From: R David Murray Date: Wed, 18 Sep 2013 12:59:47 +0000 (-0400) Subject: Merge #14984: only import pwd on POSIX. X-Git-Tag: v3.4.0a3~44 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6bd3e444f5444aeedcee6d6be5a2cd12a59d0154;p=python 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. --- 6bd3e444f5444aeedcee6d6be5a2cd12a59d0154 diff --cc Lib/netrc.py index 050a174689,2aa48f32cd..bbb3d23b54 --- a/Lib/netrc.py +++ b/Lib/netrc.py @@@ -2,7 -2,9 +2,7 @@@ # Module and documentation by Eric S. Raymond, 21 Dec 1998 - import io, os, shlex, stat, pwd + import os, shlex, stat -if os.name == 'posix': - import pwd __all__ = ["netrc", "NetrcParseError"] @@@ -90,6 -92,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: