mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
prevent possible errors initializing swig wrapper's Settings #4861
This commit is contained in:
@@ -169,6 +169,12 @@ class settings_mixin:
|
||||
return super().setting_names() + ("use-python-opencascade",)
|
||||
|
||||
def __getattr__(self, k: str) -> SETTING:
|
||||
# Swig wrapper will try to access "this",
|
||||
# ensure we won't accidentally call any c-extension methods
|
||||
# like .setting_names() until wrapper is not completely initialized.
|
||||
# See #4861.
|
||||
if k == "this":
|
||||
raise AttributeError("Swig wrapper's 'this' is unset.")
|
||||
if k in map(self.rname, self.setting_names()):
|
||||
return k
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user