mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-30 09:26:32 +02:00
[core] add pyCompatibility module
For python 2 / 3 compatibility
This commit is contained in:
parent
1c16199ca4
commit
d83022714f
4 changed files with 28 additions and 23 deletions
15
meshroom/core/pyCompatibility.py
Normal file
15
meshroom/core/pyCompatibility.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
|
||||
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
|
Loading…
Add table
Add a link
Reference in a new issue