mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-19 23:21:46 +03:00
3b084a165b
* configure isort to add the future annotations import * apply the new isort setting * remove type ignores for new mypy (#13539) https://pypi.org/project/mypy/0.981/ * another
22 lines
477 B
Python
22 lines
477 B
Python
from __future__ import annotations
|
|
|
|
try:
|
|
import setproctitle as pysetproctitle
|
|
|
|
no_setproctitle = False
|
|
except Exception:
|
|
no_setproctitle = True
|
|
|
|
|
|
def setproctitle(ps_name: str) -> None:
|
|
if no_setproctitle is False:
|
|
pysetproctitle.setproctitle(ps_name)
|
|
|
|
|
|
def getproctitle() -> str:
|
|
if no_setproctitle is False:
|
|
# TODO: add type hints to setproctitle
|
|
return pysetproctitle.getproctitle() # type: ignore[no-any-return]
|
|
|
|
return ""
|