summaryrefslogtreecommitdiff
path: root/Lib/netrc.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2013-09-18 08:59:47 -0400
committerR David Murray <rdmurray@bitdance.com>2013-09-18 08:59:47 -0400
commit6bd3e444f5444aeedcee6d6be5a2cd12a59d0154 (patch)
tree9281da20730174c508b10d627936e21c2fe95082 /Lib/netrc.py
parentcf6d0e77ea48e2e3f31c08782abb6e9be39012c8 (diff)
parent4b49ae61d8b67c62c8c937907789cf9df95519ec (diff)
downloadcpython-git-6bd3e444f5444aeedcee6d6be5a2cd12a59d0154.tar.gz
Merge #14984: only import pwd on POSIX.
Since we have fine grained import locks in 3.4, I moved the import to where it is actually needed.
Diffstat (limited to 'Lib/netrc.py')
-rw-r--r--Lib/netrc.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/netrc.py b/Lib/netrc.py
index 050a174689..bbb3d23b54 100644
--- a/Lib/netrc.py
+++ b/Lib/netrc.py
@@ -2,7 +2,7 @@
# Module and documentation by Eric S. Raymond, 21 Dec 1998
-import io, os, shlex, stat, pwd
+import os, shlex, stat
__all__ = ["netrc", "NetrcParseError"]
@@ -90,6 +90,7 @@ class netrc:
if os.name == 'posix' and default_netrc:
prop = os.fstat(fp.fileno())
if prop.st_uid != os.getuid():
+ import pwd
try:
fowner = pwd.getpwuid(prop.st_uid)[0]
except KeyError: