diff options
author | Christian Heimes <christian@cheimes.de> | 2008-01-23 14:20:50 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-01-23 14:20:50 (GMT) |
commit | 082c9b0267e45cdff9bb8d30a4332f63bd14c58e (patch) | |
tree | 614e442cb1dad3aad11bb9d35031d0dac4c04b07 /Lib/optparse.py | |
parent | 964ca4274f2a1bea783b52e74c71d2dcfdb4fafc (diff) | |
download | cpython-082c9b0267e45cdff9bb8d30a4332f63bd14c58e.zip cpython-082c9b0267e45cdff9bb8d30a4332f63bd14c58e.tar.gz cpython-082c9b0267e45cdff9bb8d30a4332f63bd14c58e.tar.bz2 |
Fixed bug #1915: Python compiles with --enable-unicode=no again. However several extension methods and modules do not work without unicode support.
Diffstat (limited to 'Lib/optparse.py')
-rw-r--r-- | Lib/optparse.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/optparse.py b/Lib/optparse.py index 62d2f7e..4fbe094 100644 --- a/Lib/optparse.py +++ b/Lib/optparse.py @@ -824,7 +824,11 @@ except NameError: (True, False) = (1, 0) def isbasestring(x): - return isinstance(x, types.StringType) or isinstance(x, types.UnicodeType) + try: + return isinstance(x, basestring) + except: + return isinstance(x, types.StringType) or isinstance(x, types.UnicodeType) + class Values: |