cpython: ad9a5ded5cf6 (original) (raw)
Mercurial > cpython
changeset 85754:ad9a5ded5cf6
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. [#14984]
R David Murray rdmurray@bitdance.com | |
---|---|
date | Wed, 18 Sep 2013 08:59:47 -0400 |
parents | 261910257af6(current diff)b8206cb2c4ee(diff) |
children | e839e524a7d5 |
files | Lib/netrc.py |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-)[+] [-] Lib/netrc.py 3 |
line wrap: on
line diff
--- 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[](#l1.16) try:[](#l1.17) fowner = pwd.getpwuid(prop.st_uid)[0][](#l1.18) except KeyError:[](#l1.19)