mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-29 08:56:33 +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
|
@ -1,7 +1,10 @@
|
|||
#!/usr/bin/env python
|
||||
# coding:utf-8
|
||||
from meshroom.core import pyCompatibility
|
||||
|
||||
from PySide2.QtCore import QUrl
|
||||
from PySide2.QtCore import QObject, Slot
|
||||
|
||||
import os
|
||||
|
||||
|
||||
|
@ -24,7 +27,7 @@ class FilepathHelper(QObject):
|
|||
Returns:
|
||||
str: String representation of 'path'
|
||||
"""
|
||||
if not isinstance(path, (QUrl, basestring)):
|
||||
if not isinstance(path, (QUrl, pyCompatibility.basestring)):
|
||||
raise TypeError("Unexpected data type: {}".format(path.__class__))
|
||||
if isinstance(path, QUrl):
|
||||
path = path.toLocalFile()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue