]> granicus.if.org Git - python/commitdiff
- Revert a change that should have been blocked: py3k has no -3 flag!
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>
Thu, 20 Mar 2008 00:35:03 +0000 (00:35 +0000)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>
Thu, 20 Mar 2008 00:35:03 +0000 (00:35 +0000)
- also remove a bogus debug print

Lib/test/regrtest.py
Lib/zipfile.py

index 100b26f7316d3811448dbdd59ff13a6ce9530105..2212af559169ebf9c132441e02c0cd2b507cc911 100755 (executable)
@@ -1157,14 +1157,6 @@ class _ExpectedSkips:
             if sys.platform != 'sunos5':
                 self.expected.add('test_nis')
 
-            # TODO: This is a hack to raise TestSkipped if -3 is not enabled.
-            # Instead of relying on callable to have a warning, we should expose
-            # the -3 flag to Python code somehow
-            with test_support.catch_warning() as w:
-                callable(int)
-                if w.message is None:
-                    self.expected.add('test_py3kwarn')
-
             self.valid = True
 
     def isvalid(self):
index 719ed445fc139f494d9cedf20993d0dc8ecbc4e0..2672d0a90ede30f0169fb9344e9980200ebb6964 100644 (file)
@@ -1067,25 +1067,14 @@ class ZipFile:
                     extract_version = zinfo.extract_version
                     create_version = zinfo.create_version
 
-                try:
-                    centdir = struct.pack(structCentralDir,
-                     stringCentralDir, create_version,
-                     zinfo.create_system, extract_version, zinfo.reserved,
-                     zinfo.flag_bits, zinfo.compress_type, dostime, dosdate,
-                     zinfo.CRC, compress_size, file_size,
-                     len(zinfo.filename), len(extra_data), len(zinfo.comment),
-                     0, zinfo.internal_attr, zinfo.external_attr,
-                     header_offset)
-                except DeprecationWarning:
-                    print >>sys.stderr, (structCentralDir,
-                     stringCentralDir, create_version,
-                     zinfo.create_system, extract_version, zinfo.reserved,
-                     zinfo.flag_bits, zinfo.compress_type, dostime, dosdate,
-                     zinfo.CRC, compress_size, file_size,
-                     len(zinfo.filename), len(extra_data), len(zinfo.comment),
-                     0, zinfo.internal_attr, zinfo.external_attr,
-                     header_offset)
-                    raise
+                centdir = struct.pack(structCentralDir,
+                 stringCentralDir, create_version,
+                 zinfo.create_system, extract_version, zinfo.reserved,
+                 zinfo.flag_bits, zinfo.compress_type, dostime, dosdate,
+                 zinfo.CRC, compress_size, file_size,
+                 len(zinfo.filename), len(extra_data), len(zinfo.comment),
+                 0, zinfo.internal_attr, zinfo.external_attr,
+                 header_offset)
                 self.fp.write(centdir)
                 self.fp.write(zinfo.filename.encode("utf-8"))
                 self.fp.write(extra_data)