diff --git a/src/ifcopenshell-python/ifcopenshell/sql.py b/src/ifcopenshell-python/ifcopenshell/sql.py index d05af04d56..0d2e5281d0 100644 --- a/src/ifcopenshell-python/ifcopenshell/sql.py +++ b/src/ifcopenshell-python/ifcopenshell/sql.py @@ -300,8 +300,9 @@ class sqlite(file): # Override to avoid clean up data unrelated to sqlite file. pass - def wrapped_data(self) -> NoReturn: - class_name = str(type(self)) + @property + def wrapped_data(self) -> NoReturn: # pyright: ignore[reportIncompatibleVariableOverride] + class_name = type(self).__name__ raise Exception( f"No `wrapped_data` for {class_name}. `ifcopenshell.{class_name}` is probably confused with `ifcopenshell.file`." ) diff --git a/src/ifcopenshell-python/ifcopenshell/stream.py b/src/ifcopenshell-python/ifcopenshell/stream.py index 47e814e0fe..fdade150be 100644 --- a/src/ifcopenshell-python/ifcopenshell/stream.py +++ b/src/ifcopenshell-python/ifcopenshell/stream.py @@ -287,8 +287,9 @@ try: # Override to avoid clean up unrelated to stream file. pass - def wrapped_data(self) -> NoReturn: - class_name = str(type(self)) + @property + def wrapped_data(self) -> NoReturn: # pyright: ignore[reportIncompatibleVariableOverride] + class_name = type(self).__name__ raise Exception( f"No `wrapped_data` for {class_name}. `ifcopenshell.{class_name}` is probably confused with `ifcopenshell.file`." )