mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
ifcopenshell.stream - fix garbage collection errors
Mentioined in #5457 Errors such as: Exception ignored in: <function file.__del__ at 0x7f4cfcc9f920> Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/ifcopenshell/file.py", line 284, in __del__ del file_dict[self.file_pointer()] ^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/ifcopenshell/file.py", line 444, in __getattr__ return getattr(self.wrapped_data, attr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'file_pointer'
This commit is contained in:
@@ -284,6 +284,10 @@ try:
|
||||
return True
|
||||
return False
|
||||
|
||||
def __del__(self) -> None:
|
||||
# Override to avoid clean up unrelated to stream file.
|
||||
pass
|
||||
|
||||
class stream_entity(entity_instance):
|
||||
def __init__(self, id: int, ifc_class: str, file: stream = None):
|
||||
if not ifc_class:
|
||||
|
||||
Reference in New Issue
Block a user