From af30d2eeaabfb184ed0869135c18e0fb17bc6fce Mon Sep 17 00:00:00 2001 From: Ezio Melotti Date: Fri, 25 Sep 2009 21:35:24 +0000 Subject: fix print statement --- Lib/ctypes/test/__init__.py | 2 +- Lib/smtplib.py | 4 ++-- Lib/zipfile.py | 29 ++++++++++++++--------------- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/Lib/ctypes/test/__init__.py b/Lib/ctypes/test/__init__.py index 1e0460a..82dc9e3 100644 --- a/Lib/ctypes/test/__init__.py +++ b/Lib/ctypes/test/__init__.py @@ -58,7 +58,7 @@ def get_tests(package, mask, verbosity, exclude=()): if modname.split(".")[-1] in exclude: skipped.append(modname) if verbosity > 1: - print >> sys.stderr, "Skipped %s: excluded" % modname + print("Skipped %s: excluded" % modname, file=sys.stderr) continue try: mod = __import__(modname, globals(), locals(), ['*']) diff --git a/Lib/smtplib.py b/Lib/smtplib.py index b88adfe..a01a184 100755 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -800,13 +800,13 @@ class LMTP(SMTP): self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) self.sock.connect(host) except socket.error as msg: - if self.debuglevel > 0: print>>stderr, 'connect fail:', host + if self.debuglevel > 0: print('connect fail:', host, file=stderr) if self.sock: self.sock.close() self.sock = None raise socket.error(msg) (code, msg) = self.getreply() - if self.debuglevel > 0: print>>stderr, "connect:", msg + if self.debuglevel > 0: print('connect:', msg, file=stderr) return (code, msg) diff --git a/Lib/zipfile.py b/Lib/zipfile.py index 79ec333..79ca152 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -1191,22 +1191,21 @@ class ZipFile: try: filename, flag_bits = zinfo._encodeFilenameFlags() centdir = struct.pack(structCentralDir, - stringCentralDir, create_version, - zinfo.create_system, extract_version, zinfo.reserved, - flag_bits, zinfo.compress_type, dostime, dosdate, - zinfo.CRC, compress_size, file_size, - len(filename), len(extra_data), len(zinfo.comment), - 0, zinfo.internal_attr, zinfo.external_attr, - header_offset) + stringCentralDir, create_version, + zinfo.create_system, extract_version, zinfo.reserved, + flag_bits, zinfo.compress_type, dostime, dosdate, + zinfo.CRC, compress_size, file_size, + len(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) + print((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), file=sys.stderr) raise self.fp.write(centdir) self.fp.write(filename) -- cgit v0.12