diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-13 06:26:29 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-13 06:26:29 (GMT) |
commit | 2f76b5694db14b06cc20c09001732d05d4a7e1d2 (patch) | |
tree | e545ae4d9fdf700ea79f1c55c524e01d5f84cba4 /Lib/zipfile.py | |
parent | b12881e8213a40418d84ba25c00fbea877a63b4a (diff) | |
download | cpython-2f76b5694db14b06cc20c09001732d05d4a7e1d2.zip cpython-2f76b5694db14b06cc20c09001732d05d4a7e1d2.tar.gz cpython-2f76b5694db14b06cc20c09001732d05d4a7e1d2.tar.bz2 |
Issue #28102: The zipfile module CLI now prints usage to stderr.
Patch by Stephen J. Turnbull.
Diffstat (limited to 'Lib/zipfile.py')
-rw-r--r-- | Lib/zipfile.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/zipfile.py b/Lib/zipfile.py index 7ba4e59..44e653d 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -1963,19 +1963,19 @@ def main(args = None): args = sys.argv[1:] if not args or args[0] not in ('-l', '-c', '-e', '-t'): - print(USAGE) + print(USAGE, file=sys.stderr) sys.exit(1) if args[0] == '-l': if len(args) != 2: - print(USAGE) + print(USAGE, file=sys.stderr) sys.exit(1) with ZipFile(args[1], 'r') as zf: zf.printdir() elif args[0] == '-t': if len(args) != 2: - print(USAGE) + print(USAGE, file=sys.stderr) sys.exit(1) with ZipFile(args[1], 'r') as zf: badfile = zf.testzip() @@ -1985,7 +1985,7 @@ def main(args = None): elif args[0] == '-e': if len(args) != 3: - print(USAGE) + print(USAGE, file=sys.stderr) sys.exit(1) with ZipFile(args[1], 'r') as zf: @@ -1993,7 +1993,7 @@ def main(args = None): elif args[0] == '-c': if len(args) < 3: - print(USAGE) + print(USAGE, file=sys.stderr) sys.exit(1) def addToZip(zf, path, zippath): |