[Pkg-bazaar-commits] ./bzr/unstable r26: fix StopIteration error on python2.3(?)
mbp at sourcefrog.net
mbp at sourcefrog.net
Fri Apr 10 07:25:30 UTC 2009
------------------------------------------------------------
revno: 26
committer: mbp at sourcefrog.net
timestamp: Sat 2005-03-12 18:34:32 +1100
message:
fix StopIteration error on python2.3(?)
modified:
bzr.py
-------------- next part --------------
=== modified file 'bzr.py'
--- a/bzr.py 2005-03-11 23:19:34 +0000
+++ b/bzr.py 2005-03-12 07:34:32 +0000
@@ -608,9 +608,8 @@
# TODO: Maybe handle '--' to end options?
- it = iter(argv[1:])
- while it:
- a = it.next()
+ while argv:
+ a = argv.pop(0)
if a[0] == '-':
optarg = None
if a[1] == '-':
@@ -634,10 +633,10 @@
optargfn = OPTIONS[optname]
if optargfn:
if optarg == None:
- if not it:
+ if not argv:
bailout('option %r needs an argument' % a)
else:
- optarg = it.next()
+ optarg = argv.pop(0)
opts[optname] = optargfn(optarg)
mutter(" option argument %r" % opts[optname])
else:
@@ -668,6 +667,7 @@
argdict = {}
# TODO: Need a way to express 'cp SRC... DEST', where it matches
# all but one.
+
for ap in argform:
argname = ap[:-1]
if ap[-1] == '?':
@@ -705,7 +705,7 @@
logging and error handling.
"""
try:
- args, opts = parse_args(argv)
+ args, opts = parse_args(argv[1:])
if 'help' in opts:
# TODO: pass down other arguments in case they asked for
# help on a command name?
More information about the Pkg-bazaar-commits
mailing list