Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Lib/test/test_pkgutil.py

    r2 r391  
    1616    def setUp(self):
    1717        self.dirname = tempfile.mkdtemp()
     18        self.addCleanup(shutil.rmtree, self.dirname)
    1819        sys.path.insert(0, self.dirname)
    1920
    2021    def tearDown(self):
    2122        del sys.path[0]
    22         shutil.rmtree(self.dirname)
    2323
    2424    def test_getdata_filesys(self):
     
    7979        del sys.modules[pkg]
    8080
     81    def test_unreadable_dir_on_syspath(self):
     82        # issue7367 - walk_packages failed if unreadable dir on sys.path
     83        package_name = "unreadable_package"
     84        d = os.path.join(self.dirname, package_name)
     85        # this does not appear to create an unreadable dir on Windows
     86        #   but the test should not fail anyway
     87        os.mkdir(d, 0)
     88        self.addCleanup(os.rmdir, d)
     89        for t in pkgutil.walk_packages(path=[self.dirname]):
     90            self.fail("unexpected package found")
     91
    8192class PkgutilPEP302Tests(unittest.TestCase):
    8293
Note: See TracChangeset for help on using the changeset viewer.