Commits

Ronald Oussoren  committed 7877995

Fix last failing tests for py 3.3

These failures were caused by assumptions in the support for
setuptools --single-versions-externally-managed namespace packages.

  • Participants
  • Parent commits 458305b

Comments (0)

Files changed (2)

File modulegraph/modulegraph.py

             except ImportError:
                 ImpImporter = pkg_resources.ImpWrapper
 
+        if sys.version_info[:2] >= (3,3):
+            import importlib.machinery
+            ImpImporter = importlib.machinery.FileFinder
+
         for entry in self.path:
             importer = pkg_resources.get_importer(entry)
 

File modulegraph_tests/test_modulegraph.py

                 srcfn = srcfn[:-1]
             self.assertEqual(m[1], srcfn)
             self.assertEqual(m[2], ('.py', 'rU', imp.PY_SOURCE))
+            m[0].close()
 
             m2 = graph.find_module('shutil', None)
             self.assertEqual(m[1:], m2[1:])
+            m2[0].close()
 
 
             record[:] = []
             self.assertEqual(record, [
                 ('sax', xml.packagepath),
             ])
+            if m[0] is not None: m[0].close()
 
         finally:
             modulegraph.find_module = saved_finder