Commits

phillip.eby  committed 5ec1f4f

Backport some Python 2.5 compatibility work

  • Participants
  • Parent commits b1d0902
  • Branches setuptools-0.6

Comments (0)

Files changed (1)

File setuptools/tests/doctest.py

     __LINECACHE_FILENAME_RE = re.compile(r'<doctest '
                                          r'(?P<name>[\w\.]+)'
                                          r'\[(?P<examplenum>\d+)\]>$')
-    def __patched_linecache_getlines(self, filename):
+    def __patched_linecache_getlines(self, filename, module_globals=None):
         m = self.__LINECACHE_FILENAME_RE.match(filename)
         if m and m.group('name') == self.test.name:
             example = self.test.examples[int(m.group('examplenum'))]
             return example.source.splitlines(True)
+        elif self.save_linecache_getlines.func_code.co_argcount>1:
+            return self.save_linecache_getlines(filename, module_globals)
         else:
             return self.save_linecache_getlines(filename)