From b4c631c4f0d42dbb44e388679b29b3c6ba594be8 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Thu, 11 Jul 2019 19:45:44 +0200 Subject: [PATCH] Fix builtin import in py3 (#3817) --- holoviews/core/util.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/holoviews/core/util.py b/holoviews/core/util.py index a26c01a9ea..c32c53b786 100644 --- a/holoviews/core/util.py +++ b/holoviews/core/util.py @@ -23,13 +23,10 @@ except: from collections import OrderedDict -try: - import __builtin__ as builtins # noqa (compatibility) -except: - import builtins as builtins # noqa (compatibility) - # Python3 compatibility if sys.version_info.major >= 3: + import builtins as builtins # noqa (compatibility) + basestring = str unicode = str long = int @@ -40,6 +37,8 @@ get_keywords = operator.attrgetter('varkw') LooseVersion = _LooseVersion else: + import __builtin__ as builtins # noqa (compatibility) + basestring = basestring unicode = unicode from itertools import izip