Commits

Anonymous committed 9f0d6a2

Fixed the RECORD initialization. I was using absolute paths rather than paths relative to sys.prefix.

Comments (0)

Files changed (1)

src/distutils2/_backport/tests/test_pkgutil.py

             md5_hash.update(open(file).read())
             return md5_hash.hexdigest()
         def record_pieces(file):
+            path = os.path.relpath(file, sys.prefix)
             digest = get_hexdigest(file)
             size = os.path.getsize(file)
-            return [file, digest, size]
+            return [path, digest, size]
 
         self.records = {}
         for distinfo_dir in self.distinfo_dirs:
         distinfo_dir = os.path.join(self.fake_dists_path,
             distinfo_name + '.dist-info')
         true_path = [self.fake_dists_path, distinfo_name, 'grammar', 'utils.py']
-        true_path = os.path.join(*true_path)
+        true_path = os.path.relpath(os.path.join(*true_path), sys.prefix)
         false_path = [self.fake_dists_path, 'towel_stuff-0.1', 'towel_stuff',
             '__init__.py']
-        false_path = os.path.join(*false_path)
+        false_path = os.path.relpath(os.path.join(*false_path), sys.prefix)
 
         # Test if the distribution uses the file in question
         from distutils2._backport.pkgutil import Distribution
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.