summaryrefslogtreecommitdiffstats
path: root/Lib/optparse.py
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2006-05-28 19:13:17 (GMT)
committerArmin Rigo <arigo@tunes.org>2006-05-28 19:13:17 (GMT)
commita3f092751ae5f29957c78a7e86381532629c7fa3 (patch)
tree27eecd5671e5bbe3654c5630a62d1deb7300e80b /Lib/optparse.py
parente9eeab5c0539ede73b52f9df9bd4da8346c91741 (diff)
downloadcpython-a3f092751ae5f29957c78a7e86381532629c7fa3.zip
cpython-a3f092751ae5f29957c78a7e86381532629c7fa3.tar.gz
cpython-a3f092751ae5f29957c78a7e86381532629c7fa3.tar.bz2
("Forward-port" of r46506)
Remove various dependencies on dictionary order in the standard library tests, and one (clearly an oversight, potentially critical) in the standard library itself - base64.py. Remaining open issues: * test_extcall is an output test, messy to make robust * tarfile.py has a potential bug here, but I'm not familiar enough with this code. Filed in as SF bug #1496501. * urllib2.HTTPPasswordMgr() returns a random result if there is more than one matching root path. I'm asking python-dev for clarification...
Diffstat (limited to 'Lib/optparse.py')
-rw-r--r--Lib/optparse.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/optparse.py b/Lib/optparse.py
index 9ac987e..6b8f5d1 100644
--- a/Lib/optparse.py
+++ b/Lib/optparse.py
@@ -611,8 +611,10 @@ class Option:
else:
setattr(self, attr, None)
if attrs:
+ attrs = attrs.keys()
+ attrs.sort()
raise OptionError(
- "invalid keyword arguments: %s" % ", ".join(attrs.keys()),
+ "invalid keyword arguments: %s" % ", ".join(attrs),
self)
@@ -1661,6 +1663,7 @@ def _match_abbrev(s, wordmap):
raise BadOptionError(s)
else:
# More than one possible completion: ambiguous prefix.
+ possibilities.sort()
raise AmbiguousOptionError(s, possibilities)