chia-blockchain/chia/util/setproctitle.py
Kyle Altendorf 3b084a165b
configure isort to add the future annotations import (#13327)
* 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
2022-09-30 03:40:22 -05:00

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 ""