diff --git a/src/ifcopenshell-python/ifcopenshell/__init__.py b/src/ifcopenshell-python/ifcopenshell/__init__.py index 7c936f7b06..205c3c7659 100644 --- a/src/ifcopenshell-python/ifcopenshell/__init__.py +++ b/src/ifcopenshell-python/ifcopenshell/__init__.py @@ -30,10 +30,6 @@ Example: model = ifcopenshell.open("/path/to/model.ifc") """ -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function - import os import sys import zipfile diff --git a/src/ifcopenshell-python/ifcopenshell/entity_instance.py b/src/ifcopenshell-python/ifcopenshell/entity_instance.py index b94aedac41..57a2ab528f 100644 --- a/src/ifcopenshell-python/ifcopenshell/entity_instance.py +++ b/src/ifcopenshell-python/ifcopenshell/entity_instance.py @@ -17,10 +17,6 @@ # along with IfcOpenShell. If not, see . -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function - import functools import importlib import numbers diff --git a/src/ifcopenshell-python/ifcopenshell/express/mapping.py b/src/ifcopenshell-python/ifcopenshell/express/mapping.py index f32cc0fae3..ffabee4e82 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/mapping.py +++ b/src/ifcopenshell-python/ifcopenshell/express/mapping.py @@ -17,8 +17,6 @@ # along with IfcOpenShell. If not, see . -from __future__ import print_function - import sys import nodes import templates diff --git a/src/ifcopenshell-python/ifcopenshell/express/nodes.py b/src/ifcopenshell-python/ifcopenshell/express/nodes.py index a6d29650f7..34d3ef747b 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/nodes.py +++ b/src/ifcopenshell-python/ifcopenshell/express/nodes.py @@ -17,13 +17,10 @@ # along with IfcOpenShell. If not, see . -from __future__ import print_function - import io import string import operator import collections - import bootstrap class Node: diff --git a/src/ifcopenshell-python/ifcopenshell/file.py b/src/ifcopenshell-python/ifcopenshell/file.py index 40986a3735..0a9f854735 100644 --- a/src/ifcopenshell-python/ifcopenshell/file.py +++ b/src/ifcopenshell-python/ifcopenshell/file.py @@ -17,11 +17,6 @@ # along with IfcOpenShell. If not, see . -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import annotations - import os import re import numbers @@ -34,13 +29,6 @@ from typing import Optional, Any from . import ifcopenshell_wrapper from .entity_instance import entity_instance -try: - # Python 2 - basestring -except NameError: - # Python 3 or newer - basestring = (str, bytes) - class Transaction: def __init__(self, ifc_file): @@ -403,7 +391,7 @@ class file(object): def __getitem__(self, key): if isinstance(key, numbers.Integral): return entity_instance(self.wrapped_data.by_id(key), self) - elif isinstance(key, basestring): + elif isinstance(key, (str, bytes)): return entity_instance(self.wrapped_data.by_guid(str(key)), self) def by_id(self, id: int) -> ifcopenshell.entity_instance: diff --git a/src/ifcopenshell-python/ifcopenshell/geom/__init__.py b/src/ifcopenshell-python/ifcopenshell/geom/__init__.py index 7edfeaa50b..69b7c344a8 100644 --- a/src/ifcopenshell-python/ifcopenshell/geom/__init__.py +++ b/src/ifcopenshell-python/ifcopenshell/geom/__init__.py @@ -18,9 +18,6 @@ """Geometry processing and analysis""" -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function def _has_occ(): diff --git a/src/ifcopenshell-python/ifcopenshell/geom/app.py b/src/ifcopenshell-python/ifcopenshell/geom/app.py index fbba6063a1..28747a6667 100644 --- a/src/ifcopenshell-python/ifcopenshell/geom/app.py +++ b/src/ifcopenshell-python/ifcopenshell/geom/app.py @@ -16,10 +16,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with IfcOpenShell. If not, see . -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function - import os import sys import time diff --git a/src/ifcopenshell-python/ifcopenshell/geom/code_editor_pane.py b/src/ifcopenshell-python/ifcopenshell/geom/code_editor_pane.py index fd073e880d..808eb90b25 100644 --- a/src/ifcopenshell-python/ifcopenshell/geom/code_editor_pane.py +++ b/src/ifcopenshell-python/ifcopenshell/geom/code_editor_pane.py @@ -16,10 +16,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with IfcOpenShell. If not, see . -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function - import os import sys import logging diff --git a/src/ifcopenshell-python/ifcopenshell/geom/main.py b/src/ifcopenshell-python/ifcopenshell/geom/main.py index cbc7f4ce21..23eb66cda7 100644 --- a/src/ifcopenshell-python/ifcopenshell/geom/main.py +++ b/src/ifcopenshell-python/ifcopenshell/geom/main.py @@ -17,11 +17,6 @@ # along with IfcOpenShell. If not, see . -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import annotations - import os import sys import operator diff --git a/src/ifcopenshell-python/ifcopenshell/geom/occ_utils.py b/src/ifcopenshell-python/ifcopenshell/geom/occ_utils.py index 825157ab89..7d879acfc5 100644 --- a/src/ifcopenshell-python/ifcopenshell/geom/occ_utils.py +++ b/src/ifcopenshell-python/ifcopenshell/geom/occ_utils.py @@ -17,20 +17,12 @@ # along with IfcOpenShell. If not, see . -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function - import random import operator import warnings from collections import namedtuple - -try: # python 3.3+ - from collections.abc import Iterable -except ImportError: # python 2 - from collections import Iterable +from collections.abc import Iterable import OCC diff --git a/src/ifcopenshell-python/ifcopenshell/guid.py b/src/ifcopenshell-python/ifcopenshell/guid.py index a5e417e251..ac0a2ed181 100644 --- a/src/ifcopenshell-python/ifcopenshell/guid.py +++ b/src/ifcopenshell-python/ifcopenshell/guid.py @@ -18,9 +18,6 @@ """Reads and writes encoded GlobalIds""" -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function import uuid import string diff --git a/src/ifcopenshell-python/ifcopenshell/main.py b/src/ifcopenshell-python/ifcopenshell/main.py index f9d4dc94a8..632208f4d9 100644 --- a/src/ifcopenshell-python/ifcopenshell/main.py +++ b/src/ifcopenshell-python/ifcopenshell/main.py @@ -17,10 +17,6 @@ # along with IfcOpenShell. If not, see . -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function - from . import ifcopenshell_wrapper version = ifcopenshell_wrapper.version() diff --git a/src/ifcopenshell-python/ifcopenshell/template.py b/src/ifcopenshell-python/ifcopenshell/template.py index a7a77ebae6..7e506e3fd6 100644 --- a/src/ifcopenshell-python/ifcopenshell/template.py +++ b/src/ifcopenshell-python/ifcopenshell/template.py @@ -17,10 +17,6 @@ # along with IfcOpenShell. If not, see . -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function - import time import uuid diff --git a/src/ifcopenshell-python/ifcopenshell/util/data.py b/src/ifcopenshell-python/ifcopenshell/util/data.py index a66ea80252..b968879c58 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/data.py +++ b/src/ifcopenshell-python/ifcopenshell/util/data.py @@ -16,7 +16,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with IfcOpenShell. If not, see . -from __future__ import annotations import numpy as np import ifcopenshell from typing import Any, Union diff --git a/src/ifcopenshell-python/ifcopenshell/util/element.py b/src/ifcopenshell-python/ifcopenshell/util/element.py index e93a22907b..bb23d1c95a 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/element.py +++ b/src/ifcopenshell-python/ifcopenshell/util/element.py @@ -16,7 +16,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with IfcOpenShell. If not, see . -from __future__ import annotations import ifcopenshell import ifcopenshell.util.element from typing import Any, Callable, Optional, Union, Literal, overload diff --git a/src/ifcopenshell-python/ifcopenshell/util/pset.py b/src/ifcopenshell-python/ifcopenshell/util/pset.py index 4a8ce5c89d..6156af3f9c 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/pset.py +++ b/src/ifcopenshell-python/ifcopenshell/util/pset.py @@ -16,7 +16,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with IfcOpenShell. If not, see . -from __future__ import annotations import re import pathlib import ifcopenshell diff --git a/src/ifcopenshell-python/ifcopenshell/validate.py b/src/ifcopenshell-python/ifcopenshell/validate.py index 2b7b8af5ea..fa51bbde15 100644 --- a/src/ifcopenshell-python/ifcopenshell/validate.py +++ b/src/ifcopenshell-python/ifcopenshell/validate.py @@ -32,8 +32,6 @@ Available flags: - ``--fields``: Output more detailed information about failed entities (available only with ``--json``). """ -from __future__ import print_function - import os import sys import json