Meshroom/meshroom/core/pyCompatibility.py
Fabien Castan d83022714f [core] add pyCompatibility module
For python 2 / 3 compatibility
2018-05-21 17:12:22 +02:00

15 lines
300 B
Python

try:
unicode = unicode
except NameError:
# 'unicode' is undefined, must be Python 3
str = str
unicode = str
bytes = bytes
basestring = (str, bytes)
else:
# 'unicode' exists, must be Python 2
str = str
unicode = unicode
bytes = str
basestring = basestring