From: Stuart Prescott Date: Sun, 9 Jan 2022 16:59:43 +1100 Subject: Import old config files Old config files from the Python 2 version used StringType and IntType as the type designators; lack of these types when running under Python 3 means that an old config file will cause the program to crash on startup. This patch translates the types at read time; once rewritten, the new file is compatible with this version. --- bkchem/pref_manager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bkchem/pref_manager.py b/bkchem/pref_manager.py index 11d6ea9..b030611 100644 --- a/bkchem/pref_manager.py +++ b/bkchem/pref_manager.py @@ -80,8 +80,10 @@ class pref_manager( object): if itype in ("ListType", "TupleType", "DictType"): value = eval(dom_extensions.getAllTextFromElement(child)) else: - if itype in ("UnicodeType"): + if itype in ("UnicodeType", "StringType"): itype = unicode + elif itype in ("IntType"): + itype = int else: itype = types.__dict__[itype] try: