Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Lib/getopt.py

    r2 r391  
    1 # -*- coding: iso-8859-1 -*-
    21"""Parser for command line options.
    32
     
    2120# to class-based exceptions.
    2221#
    23 # Peter Åstrand <astrand@lysator.liu.se> added gnu_getopt().
     22# Peter Astrand <astrand@lysator.liu.se> added gnu_getopt().
    2423#
    2524# TODO for gnu_getopt():
     
    131130        if args[0][:2] == '--':
    132131            opts, args = do_longs(opts, args[0][2:], longopts, args[1:])
    133         elif args[0][:1] == '-':
     132        elif args[0][:1] == '-' and args[0] != '-':
    134133            opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:])
    135134        else:
     
    157156                raise GetoptError('option --%s requires argument' % opt, opt)
    158157            optarg, args = args[0], args[1:]
    159     elif optarg:
     158    elif optarg is not None:
    160159        raise GetoptError('option --%s must not have an argument' % opt, opt)
    161160    opts.append(('--' + opt, optarg or ''))
Note: See TracChangeset for help on using the changeset viewer.