[Python-checkins] r43403 - sandbox/trunk/setuptools/pkg_resources.py

phillip.eby python-checkins at python.org
Tue Mar 28 19:07:06 CEST 2006


Author: phillip.eby
Date: Tue Mar 28 19:07:06 2006
New Revision: 43403

Modified:
   sandbox/trunk/setuptools/pkg_resources.py
Log:
Eliminate spurious warnings due to case-insensitive file systems


Modified: sandbox/trunk/setuptools/pkg_resources.py
==============================================================================
--- sandbox/trunk/setuptools/pkg_resources.py	(original)
+++ sandbox/trunk/setuptools/pkg_resources.py	Tue Mar 28 19:07:06 2006
@@ -2053,7 +2053,7 @@
             return      # ignore the inevitable setuptools self-conflicts  :(
 
         nsp = dict.fromkeys(self._get_metadata('namespace_packages.txt'))
-
+        loc = normalize_path(self.location)
         for modname in self._get_metadata('top_level.txt'):
             if (modname not in sys.modules or modname in nsp
                 or modname in _namespace_packages
@@ -2061,7 +2061,7 @@
                 continue
 
             fn = getattr(sys.modules[modname], '__file__', None)
-            if fn and fn.startswith(self.location):
+            if fn and normalize_path(fn).startswith(loc):
                 continue
             issue_warning(
                 "Module %s was already imported from %s, but %s is being added"


More information about the Python-checkins mailing list