Changeset 391 for python/trunk/Lib/getopt.py
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Lib/getopt.py
r2 r391 1 # -*- coding: iso-8859-1 -*-2 1 """Parser for command line options. 3 2 … … 21 20 # to class-based exceptions. 22 21 # 23 # Peter Åstrand <astrand@lysator.liu.se> added gnu_getopt().22 # Peter Astrand <astrand@lysator.liu.se> added gnu_getopt(). 24 23 # 25 24 # TODO for gnu_getopt(): … … 131 130 if args[0][:2] == '--': 132 131 opts, args = do_longs(opts, args[0][2:], longopts, args[1:]) 133 elif args[0][:1] == '-' :132 elif args[0][:1] == '-' and args[0] != '-': 134 133 opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:]) 135 134 else: … … 157 156 raise GetoptError('option --%s requires argument' % opt, opt) 158 157 optarg, args = args[0], args[1:] 159 elif optarg :158 elif optarg is not None: 160 159 raise GetoptError('option --%s must not have an argument' % opt, opt) 161 160 opts.append(('--' + opt, optarg or ''))
Note:
See TracChangeset
for help on using the changeset viewer.