diff --git a/HISTORY.rst b/HISTORY.rst index 0acfa7c1758714f21e667a82a25b850c0329ea4f..7f0b8229063fdfb318e2f602aa6b9cda9d72ff99 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,23 @@ History master ^^^^^^ +1.4.2 +^^^^^ + +- Fix fallback mechanism for detecting the name of the parent process + +1.4.1 +^^^^^ + +- Fix PATH registry key type on Windows + +1.4.0 +^^^^^ + +- Fix duplicating system paths on Windows +- Prevent adding paths multiple times on macOS/Linux +- Send CLI errors to stderr instead of stdout + 1.3.0 (2019-10-20) ^^^^^^^^^^^^^^^^^^ diff --git a/README.rst b/README.rst index 1193c4fb3ef6273489dbcddfb2ca6c6d16a4f105..8361a0e7d7fe34812d7373657621b020d166551f 100644 --- a/README.rst +++ b/README.rst @@ -114,6 +114,11 @@ History Important changes are emphasized. +1.4.2 +^^^^^ + +- Fix fallback mechanism for detecting the name of the parent process + 1.4.1 ^^^^^ diff --git a/userpath/__init__.py b/userpath/__init__.py index 614f617d6bf18661fac530fd55f7a2e4990c8104..0f4e48b1b58d3fc4d7c94be1b7e91c1f95456e3a 100644 --- a/userpath/__init__.py +++ b/userpath/__init__.py @@ -1,4 +1,4 @@ from .core import append, in_new_path, need_shell_restart, prepend from .utils import in_current_path -__version__ = '1.4.1' +__version__ = '1.4.2' diff --git a/userpath/utils.py b/userpath/utils.py index 3683b9f1b79def29ea8d015f05a0ba134b8ddd17..39dbbd7e15c3337a0ae40841d34d9b459b39bfec 100644 --- a/userpath/utils.py +++ b/userpath/utils.py @@ -4,7 +4,7 @@ import subprocess try: import psutil except Exception: - pass + psutil = None def normpath(location): @@ -51,7 +51,8 @@ def get_parent_process_name(): pass ppid = os.getppid() - return subprocess.check_output(['ps', '-o', 'cmd=', str(ppid)]).decode('utf-8').strip() + process_name = subprocess.check_output(['ps', '-o', 'args=', str(ppid)]).decode('utf-8') + return process_name.strip().lstrip("-") except Exception: pass