From 5705f24f3ed0e2a688c4527f6d735e1bab985e62 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Thu, 9 Mar 2017 11:47:54 +0100 Subject: [PATCH] python: make `logging` import conditional in case `time` is not built --- src/ifcopenshell-python/ifcopenshell/entity_instance.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/entity_instance.py b/src/ifcopenshell-python/ifcopenshell/entity_instance.py index 99ca72c3f7..c717b73b49 100644 --- a/src/ifcopenshell-python/ifcopenshell/entity_instance.py +++ b/src/ifcopenshell-python/ifcopenshell/entity_instance.py @@ -19,12 +19,16 @@ import functools import numbers -import logging import itertools from . import ifcopenshell_wrapper -log = logging.getLogger(__name__) +try: + import logging + log = logging.getLogger(__name__) +except ImportError as e: + log = type('logger', (object,), {'exception': lambda s: print(s)}) + class entity_instance(object): def __init__(self, e):