mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 06:42:38 +00:00
sql, stream - more clear error message when accessing wrapped_data
This commit is contained in:
@@ -300,8 +300,9 @@ class sqlite(file):
|
|||||||
# Override to avoid clean up data unrelated to sqlite file.
|
# Override to avoid clean up data unrelated to sqlite file.
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def wrapped_data(self) -> NoReturn:
|
@property
|
||||||
class_name = str(type(self))
|
def wrapped_data(self) -> NoReturn: # pyright: ignore[reportIncompatibleVariableOverride]
|
||||||
|
class_name = type(self).__name__
|
||||||
raise Exception(
|
raise Exception(
|
||||||
f"No `wrapped_data` for {class_name}. `ifcopenshell.{class_name}` is probably confused with `ifcopenshell.file`."
|
f"No `wrapped_data` for {class_name}. `ifcopenshell.{class_name}` is probably confused with `ifcopenshell.file`."
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -287,8 +287,9 @@ try:
|
|||||||
# Override to avoid clean up unrelated to stream file.
|
# Override to avoid clean up unrelated to stream file.
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def wrapped_data(self) -> NoReturn:
|
@property
|
||||||
class_name = str(type(self))
|
def wrapped_data(self) -> NoReturn: # pyright: ignore[reportIncompatibleVariableOverride]
|
||||||
|
class_name = type(self).__name__
|
||||||
raise Exception(
|
raise Exception(
|
||||||
f"No `wrapped_data` for {class_name}. `ifcopenshell.{class_name}` is probably confused with `ifcopenshell.file`."
|
f"No `wrapped_data` for {class_name}. `ifcopenshell.{class_name}` is probably confused with `ifcopenshell.file`."
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user