mirror of
https://github.com/python/cpython.git
synced 2025-08-09 19:38:42 +00:00
#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.
This commit is contained in:
parent
5261b10556
commit
3caf7b9c88
2 changed files with 4 additions and 1 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue