Issue #4629: getopt raises an error if an argument ends with = whereas getopt
doesn't except a value (eg. --help= is rejected if getopt uses ['help='] long
options).
diff --git a/Lib/getopt.py b/Lib/getopt.py
index 13ef4d6..ac77126 100644
--- a/Lib/getopt.py
+++ b/Lib/getopt.py
@@ -156,7 +156,7 @@
if not args:
raise GetoptError('option --%s requires argument' % opt, opt)
optarg, args = args[0], args[1:]
- elif optarg:
+ elif optarg is not None:
raise GetoptError('option --%s must not have an argument' % opt, opt)
opts.append(('--' + opt, optarg or ''))
return opts, args