aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/pytest/py3/_pytest/tmpdir.py
diff options
context:
space:
mode:
authorarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-04-24 22:11:05 +0300
committerarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-04-24 22:11:05 +0300
commit7f5e1f5ef44ca7b0cddee7ef62f932851755448b (patch)
tree3f58cd8e1121c199dab668088bbd6cd4bf41b175 /contrib/python/pytest/py3/_pytest/tmpdir.py
parentd3dcefce22da142f53fd9af30dda58955f889e48 (diff)
downloadydb-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.py5
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