diff --git a/src/ifcopenshell-python/ifcopenshell/file.py b/src/ifcopenshell-python/ifcopenshell/file.py index 894a4ec02c..db4ee8cebb 100644 --- a/src/ifcopenshell-python/ifcopenshell/file.py +++ b/src/ifcopenshell-python/ifcopenshell/file.py @@ -23,6 +23,13 @@ import functools from . import ifcopenshell_wrapper from .entity_instance import entity_instance +try: + # Python 2 + basestring +except NameError: + # Python 3 or newer + basestring = (str, bytes) + class file(object): def __init__(self, f=None): self.wrapped_data = f or ifcopenshell_wrapper.file()