summaryrefslogtreecommitdiffstats
path: root/Lib/optparse.py
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2006-07-23 16:05:51 (GMT)
committerGreg Ward <gward@python.net>2006-07-23 16:05:51 (GMT)
commit48fae7acd2c1a1d467a78688d4eeaea3315d5f98 (patch)
treee90cc7cd59454b7309ae015c7c16b4410114c1ba /Lib/optparse.py
parentafa358fabf2632c218d106550a1a4dba9b6957b0 (diff)
downloadcpython-48fae7acd2c1a1d467a78688d4eeaea3315d5f98.zip
cpython-48fae7acd2c1a1d467a78688d4eeaea3315d5f98.tar.gz
cpython-48fae7acd2c1a1d467a78688d4eeaea3315d5f98.tar.bz2
Resync optparse with Optik 1.5.3: minor tweaks for/to tests.
Diffstat (limited to 'Lib/optparse.py')
-rw-r--r--Lib/optparse.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/Lib/optparse.py b/Lib/optparse.py
index ef382aa..62d2f7e 100644
--- a/Lib/optparse.py
+++ b/Lib/optparse.py
@@ -16,7 +16,7 @@ For support, use the optik-users@lists.sourceforge.net mailing list
# Python developers: please do not make changes to this file, since
# it is automatically generated from the Optik source code.
-__version__ = "1.5.1+"
+__version__ = "1.5.3"
__all__ = ['Option',
'SUPPRESS_HELP',
@@ -75,9 +75,9 @@ def _repr(self):
# This file was generated from:
-# Id: option_parser.py 522 2006-06-11 16:22:03Z gward
+# Id: option_parser.py 527 2006-07-23 15:21:30Z greg
# Id: option.py 522 2006-06-11 16:22:03Z gward
-# Id: help.py 509 2006-04-20 00:58:24Z gward
+# Id: help.py 527 2006-07-23 15:21:30Z greg
# Id: errors.py 509 2006-04-20 00:58:24Z gward
try:
@@ -1631,7 +1631,10 @@ class OptionParser (OptionContainer):
# used by test suite
def _get_encoding(self, file):
- return getattr(file, "encoding", sys.getdefaultencoding())
+ encoding = getattr(file, "encoding", None)
+ if not encoding:
+ encoding = sys.getdefaultencoding()
+ return encoding
def print_help(self, file=None):
"""print_help(file : file = stdout)