From f12d8eeaa6cec32cdbfce9619d97e0d7b04b84b6 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Fri, 4 Aug 2017 16:31:10 +0200 Subject: [PATCH] by_guid() and unicode in py2 --- src/ifcopenshell-python/ifcopenshell/file.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/file.py b/src/ifcopenshell-python/ifcopenshell/file.py index 7c2f1339c9..7410353cb3 100644 --- a/src/ifcopenshell-python/ifcopenshell/file.py +++ b/src/ifcopenshell-python/ifcopenshell/file.py @@ -40,8 +40,8 @@ class file(object): def __getitem__(self, key): if isinstance(key, numbers.Integral): return entity_instance(self.wrapped_data.by_id(key)) - elif isinstance(key, str): - return entity_instance(self.wrapped_data.by_guid(key)) + elif isinstance(key, basestring): + return entity_instance(self.wrapped_data.by_guid(str(key))) def by_id(self, id): return self[id] def by_guid(self, guid): return self[guid] def add(self, inst):