summaryrefslogtreecommitdiff
path: root/Lib/optparse.py
diff options
context:
space:
mode:
authorR. David Murray <rdmurray@bitdance.com>2010-07-05 16:06:05 +0000
committerR. David Murray <rdmurray@bitdance.com>2010-07-05 16:06:05 +0000
commit3caf7b9c888cafa286039379f642cbd09c7ae7cf (patch)
treee28f588d62194fdc861c9e476d86390e3f58fc37 /Lib/optparse.py
parent5261b10556d11b206d878b8382016fbfcc703927 (diff)
downloadcpython-git-3caf7b9c888cafa286039379f642cbd09c7ae7cf.tar.gz
#9161: Fix regression in acceptance of unicode strings in add_option calls.
The original change in 2.6 was made during rc1 changeover, and did not get ported to 2.7. The original change may not even have been intentional, but if so it doesn't seem to have caused any problems.
Diffstat (limited to 'Lib/optparse.py')
-rw-r--r--Lib/optparse.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/optparse.py b/Lib/optparse.py
index 8ab329104a..87d7737423 100644
--- a/Lib/optparse.py
+++ b/Lib/optparse.py
@@ -1008,7 +1008,7 @@ class OptionContainer:
"""add_option(Option)
add_option(opt_str, ..., kwarg=val, ...)
"""
- if type(args[0]) is types.StringType:
+ if type(args[0]) in types.StringTypes:
option = self.option_class(*args, **kwargs)
elif len(args) == 1 and not kwargs:
option = args[0]