diff options
author | Brett Cannon <bcannon@gmail.com> | 2004-07-20 02:28:28 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2004-07-20 02:28:28 (GMT) |
commit | 4d0bddfee66383e746a79d60cd64e40fc1ab1df7 (patch) | |
tree | 48d7bc7a53166b11d11f394dd49cd2a10d4b246e /Lib | |
parent | ad00913cf00ab174037e6ff675fa19f3ee27cc63 (diff) | |
download | cpython-4d0bddfee66383e746a79d60cd64e40fc1ab1df7.zip cpython-4d0bddfee66383e746a79d60cd64e40fc1ab1df7.tar.gz cpython-4d0bddfee66383e746a79d60cd64e40fc1ab1df7.tar.bz2 |
Fix bug in addsitedir() to properly handle the lack of a second argument.
Fixed to keep backwards-compatibility for the undocumented function.
Closes bug #986795.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/site.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/site.py b/Lib/site.py index 241068c..2207ec5 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -124,7 +124,7 @@ def addpackage(sitedir, name, known_paths): reset = 0 fullname = os.path.join(sitedir, name) try: - f = file(fullname, "rU") + f = open(fullname, "rU") except IOError: return try: @@ -149,7 +149,7 @@ def addsitedir(sitedir, known_paths=None): """Add 'sitedir' argument to sys.path if missing and handle .pth files in 'sitedir'""" if known_paths is None: - d = _init_pathinfo() + known_paths = _init_pathinfo() reset = 1 else: reset = 0 @@ -162,7 +162,7 @@ def addsitedir(sitedir, known_paths=None): return names.sort() for name in names: - if name[-4:] == os.extsep + "pth": + if name.endswith(os.extsep + "pth"): addpackage(sitedir, name, known_paths) if reset: known_paths = None |