diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-04-24 22:11:05 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-04-24 22:11:05 +0300 |
commit | 7f5e1f5ef44ca7b0cddee7ef62f932851755448b (patch) | |
tree | 3f58cd8e1121c199dab668088bbd6cd4bf41b175 /contrib/python/pytest/py3/_pytest/tmpdir.py | |
parent | d3dcefce22da142f53fd9af30dda58955f889e48 (diff) | |
download | ydb-7f5e1f5ef44ca7b0cddee7ef62f932851755448b.tar.gz |
intermediate changes
ref:d4b5687d4c7a66b907f70930ef85d76f209837f1
Diffstat (limited to 'contrib/python/pytest/py3/_pytest/tmpdir.py')
-rw-r--r-- | contrib/python/pytest/py3/_pytest/tmpdir.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/python/pytest/py3/_pytest/tmpdir.py b/contrib/python/pytest/py3/_pytest/tmpdir.py index f901fd5727..12dc463a2a 100644 --- a/contrib/python/pytest/py3/_pytest/tmpdir.py +++ b/contrib/python/pytest/py3/_pytest/tmpdir.py @@ -158,9 +158,10 @@ class TempPathFactory: def get_user() -> Optional[str]: """Return the current user name, or None if getuser() does not work in the current environment (see #1010).""" - import getpass - try: + # In some exotic environments, getpass may not be importable. + import getpass + return getpass.getuser() except (ImportError, KeyError): return None |