[Python-checkins] r57525 - sandbox/trunk/import_in_py/zipimport_/tests.py sandbox/trunk/import_in_py/zipimport_/zipimport.py
brett.cannon
python-checkins at python.org
Mon Aug 27 00:23:47 CEST 2007
Author: brett.cannon
Date: Mon Aug 27 00:23:47 2007
New Revision: 57525
Modified:
sandbox/trunk/import_in_py/zipimport_/tests.py
sandbox/trunk/import_in_py/zipimport_/zipimport.py
Log:
Remove explicit empty archive path checks. Not needed as the empty string is
never a valid path.
Modified: sandbox/trunk/import_in_py/zipimport_/tests.py
==============================================================================
--- sandbox/trunk/import_in_py/zipimport_/tests.py (original)
+++ sandbox/trunk/import_in_py/zipimport_/tests.py Mon Aug 27 00:23:47 2007
@@ -56,9 +56,6 @@
"""Test the creation of a zipimport.zipimporter instance."""
- def test_empty_archive_path(self):
- self.assertRaises(zipimport.ZipImportError, zipimport.zipimporter, '')
-
def test_nonzip(self):
# ZipImportError should be raised if a non-zip file is specified.
with open(test_support.TESTFN, 'w') as test_file:
Modified: sandbox/trunk/import_in_py/zipimport_/zipimport.py
==============================================================================
--- sandbox/trunk/import_in_py/zipimport_/zipimport.py (original)
+++ sandbox/trunk/import_in_py/zipimport_/zipimport.py Mon Aug 27 00:23:47 2007
@@ -31,8 +31,6 @@
than a zip file is passed in then ZipImportError is raised.
"""
- if len(archivepath) == 0:
- raise ZipImportError("archive path is empty")
while archivepath:
if zipfile.is_zipfile(archivepath):
break
More information about the Python-checkins
mailing list