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