]> granicus.if.org Git - python/commitdiff
Look for the multibyte codec map files in the parent directory too
authorNeal Norwitz <nnorwitz@gmail.com>
Sun, 6 Jun 2004 20:09:49 +0000 (20:09 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sun, 6 Jun 2004 20:09:49 +0000 (20:09 +0000)
This is similar to test_normalization, so that many source trees
can reference the same test file(s).

Lib/test/test_multibytecodec_support.py

index 77033cd422770aa620114eb661d9caaabc309861..6c503bf1777d9f45ffbee47af166750edeaccf80 100644 (file)
@@ -164,8 +164,13 @@ class TestBase_Mapping(unittest.TestCase):
     def __init__(self, *args, **kw):
         unittest.TestCase.__init__(self, *args, **kw)
         if not os.path.exists(self.mapfilename):
-            raise test_support.TestSkipped('%s not found, download from %s' %
-                    (self.mapfilename, self.mapfileurl))
+            parent = os.path.join(os.pardir, self.mapfilename)
+            if not os.path.exists(parent):
+                format = '%s not found, download from %s'
+                raise test_support.TestSkipped(format % 
+                        (self.mapfilename, self.mapfileurl))
+            else:
+                self.mapfilename = parent
 
     def test_mapping_file(self):
         unichrs = lambda s: u''.join(map(unichr, map(eval, s.split('+'))))