From f3e20ae45020f00ca70a34fa910f381782b8f180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Granskogen=20Bj=C3=B8rnstad?= Date: Wed, 1 Nov 2017 10:44:08 +0100 Subject: [PATCH] geom/app.py: ConfigParser py2/py3 fix When running the viewer app in python3, I got the following crash: Traceback (most recent call last): File "geom_app.py", line 2, in ifcopenshell.geom.app.application().start() File "/usr/lib/python3/dist-packages/ifcopenshell/geom/app.py", line 534, in __init__ self.editor = code_edit(self.canvas, configuration().options('snippets')) File "/usr/lib/python3/dist-packages/ifcopenshell/geom/app.py", line 68, in __init__ config = Cfg() TypeError: 'ConfigParser' object is not callable Unify configparser usage for py2 and py3 by making sure the py3 path also gives a callable Cfg --- src/ifcopenshell-python/ifcopenshell/geom/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/ifcopenshell/geom/app.py b/src/ifcopenshell-python/ifcopenshell/geom/app.py index a08d0ded73..8dad8c365c 100644 --- a/src/ifcopenshell-python/ifcopenshell/geom/app.py +++ b/src/ifcopenshell-python/ifcopenshell/geom/app.py @@ -51,7 +51,7 @@ class configuration(object): Cfg = ConfigParser.RawConfigParser except: import configparser - Cfg = configparser.ConfigParser(interpolation=None) + Cfg = lambda: configparser.ConfigParser(interpolation=None) conf_file = os.path.expanduser(os.path.join("~", ".ifcopenshell", "app", "snippets.conf")) if conf_file.startswith("~"):