Fix of issue 6271.

svn: r20969
This commit is contained in:
Peter Landgren 2013-01-03 19:20:07 +00:00
parent 042732687f
commit 812b3503bf

View File

@ -34,6 +34,7 @@ Report option handling, including saving and parsing.
#
#-------------------------------------------------------------------------
import os
import sys
import copy
from xml.sax.saxutils import escape
@ -908,17 +909,31 @@ class DocOptionHandler(_options.OptionHandler):
# First we set options_dict values based on the saved options
options = self.saved_option_list.get_options()
docgen_names = self.option_list_collection.docgen_names
for option_name, option_data in options.iteritems():
if ( option_name in self.options_dict and
isinstance(option_data, list) and
option_data and
option_data[0] in docgen_names ):
try:
converter = get_type_converter(
self.options_dict[option_name])
self.options_dict[option_name] = converter(option_data[1])
except (TypeError, ValueError):
pass
if sys.version_info[0] >= 3:
for option_name, option_data in options.items():
if ( option_name in self.options_dict and
isinstance(option_data, list) and
option_data and
option_data[0] in docgen_names ):
try:
converter = get_type_converter(
self.options_dict[option_name])
self.options_dict[option_name] = converter(option_data[1])
except (TypeError, ValueError):
pass
if sys.version_info[0] < 3:
for option_name, option_data in options.iteritems():
if ( option_name in self.options_dict and
isinstance(option_data, list) and
option_data and
option_data[0] in docgen_names ):
try:
converter = get_type_converter(
self.options_dict[option_name])
self.options_dict[option_name] = converter(option_data[1])
except (TypeError, ValueError):
pass
#------------------------------------------------------------------------
#