From e37b0627575f29f12eeae84538785dc472f52799 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Tue, 20 Jan 2015 13:52:08 +0000 Subject: [PATCH] python 2/3 compatibility: from functools import reduce --- src/ifcopenshell-python/ifcopenshell/__init__.py | 4 ++-- src/ifcopenshell-python/ifcopenshell/guid.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/__init__.py b/src/ifcopenshell-python/ifcopenshell/__init__.py index d06f4ad84b..42b37b661d 100644 --- a/src/ifcopenshell-python/ifcopenshell/__init__.py +++ b/src/ifcopenshell-python/ifcopenshell/__init__.py @@ -20,11 +20,11 @@ import os import functools +from functools import reduce + from . import guid from . import ifcopenshell_wrapper -if hasattr(functools, 'reduce'): reduce = functools.reduce - class entity_instance(object): def __init__(self, e): super(entity_instance, self).__setattr__('wrapped_data', e) diff --git a/src/ifcopenshell-python/ifcopenshell/guid.py b/src/ifcopenshell-python/ifcopenshell/guid.py index c8e2340fb9..ddc95694b9 100644 --- a/src/ifcopenshell-python/ifcopenshell/guid.py +++ b/src/ifcopenshell-python/ifcopenshell/guid.py @@ -19,6 +19,8 @@ import string +from functools import reduce + chars = string.digits + string.ascii_uppercase + string.ascii_lowercase + '_$' def compress(g):