mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
IGN:Dont die if there is an error in a config file
This commit is contained in:
parent
2cca07250b
commit
b45437e56b
@ -6,7 +6,7 @@ __docformat__ = 'restructuredtext en'
|
|||||||
'''
|
'''
|
||||||
Manage application-wide preferences.
|
Manage application-wide preferences.
|
||||||
'''
|
'''
|
||||||
import os, re, cPickle, textwrap
|
import os, re, cPickle, textwrap, traceback
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from optparse import OptionParser as _OptionParser
|
from optparse import OptionParser as _OptionParser
|
||||||
@ -314,7 +314,12 @@ class OptionSet(object):
|
|||||||
if not isinstance(src, unicode):
|
if not isinstance(src, unicode):
|
||||||
src = src.decode('utf-8')
|
src = src.decode('utf-8')
|
||||||
if src is not None:
|
if src is not None:
|
||||||
|
try:
|
||||||
exec src in options
|
exec src in options
|
||||||
|
except:
|
||||||
|
print 'Failed to parse options string:'
|
||||||
|
print repr(src)
|
||||||
|
traceback.print_exc()
|
||||||
opts = OptionValues()
|
opts = OptionValues()
|
||||||
for pref in self.preferences:
|
for pref in self.preferences:
|
||||||
val = options.get(pref.name, pref.default)
|
val = options.get(pref.name, pref.default)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user