mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
More robust fix for handling of .py config files with pickled QByteArray instances
This commit is contained in:
parent
4106a4b0d1
commit
69af8a9b65
@ -193,11 +193,7 @@ class OptionSet(object):
|
||||
try:
|
||||
if not isinstance(src, unicode):
|
||||
src = src.decode('utf-8')
|
||||
src = src.replace(u'PyQt5.QtCore', u'PyQt4.QtCore')
|
||||
exec src in options
|
||||
except (SystemError, RuntimeError):
|
||||
try:
|
||||
src = src.replace('PyQt' + '4', 'PyQt5')
|
||||
src = src.replace(u'PyQt4.QtCore', u'PyQt5.QtCore')
|
||||
exec src in options
|
||||
except:
|
||||
print 'Failed to parse options string:'
|
||||
|
Loading…
x
Reference in New Issue
Block a user