diff options
author | R David Murray <rdmurray@bitdance.com> | 2013-09-18 12:59:47 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2013-09-18 12:59:47 (GMT) |
commit | 6bd3e444f5444aeedcee6d6be5a2cd12a59d0154 (patch) | |
tree | 9281da20730174c508b10d627936e21c2fe95082 /Lib/netrc.py | |
parent | cf6d0e77ea48e2e3f31c08782abb6e9be39012c8 (diff) | |
parent | 4b49ae61d8b67c62c8c937907789cf9df95519ec (diff) | |
download | cpython-6bd3e444f5444aeedcee6d6be5a2cd12a59d0154.zip cpython-6bd3e444f5444aeedcee6d6be5a2cd12a59d0154.tar.gz cpython-6bd3e444f5444aeedcee6d6be5a2cd12a59d0154.tar.bz2 |
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.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/netrc.py b/Lib/netrc.py index 050a174..bbb3d23 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: |