Skip to content
Permalink
Browse files

remove python version checks

  • Loading branch information
jef-n committed Mar 3, 2017
1 parent 3244634 commit 96c31a1f0e534b50029e254c203d053108f3c155
@@ -643,7 +643,7 @@ def spatialite_connect(*args, **kwargs):
def _import(name, globals={}, locals={}, fromlist=[], level=None):
""" wrapper around builtin import that keeps track of loaded plugin modules """
if level is None:
level = -1 if sys.version_info[0] < 3 else 0
level = 0
mod = _builtin_import(name, globals, locals, fromlist, level)

if mod and '__file__' in mod.__dict__:
@@ -119,8 +119,6 @@ def testPluginPath(self):
for t in ['test_plugins', 'test plugins', 'test_pluginsé€']:

# get a unicode test dir
if sys.version_info.major == 2:
t = t.encode(locale.getpreferredencoding())
testDir = os.path.join(self.TMP_DIR, t)

# copy from testdata
@@ -126,10 +126,7 @@ def __exit__(self, type, value, traceback):

def logMessage(self, msg, tag, level):
if tag == self.tag or not self.tag:
if sys.version_info.major == 2:
self.log.append(str(msg))
else:
self.log.append(str(msg))
self.log.append(str(msg))

def messages(self):
return self.log
@@ -240,10 +237,7 @@ def layerData(self, layer, request={}, offset=0):
for field in f.fields():
fields.append(str(field.name()))
fieldTypes.append(str(field.typeName()))
if sys.version_info.major == 2:
fielddata = dict((name, str(f[name])) for name in fields)
else:
fielddata = dict((name, str(f[name])) for name in fields)
fielddata = dict((name, str(f[name])) for name in fields)
g = f.geometry()
if not g.isNull():
fielddata[geomkey] = str(g.exportToWkt())
@@ -27,10 +27,7 @@


def strToUrl(s):
if sys.version_info.major == 3:
return QUrl.fromEncoded(bytes(s, "utf8"))
else:
return QUrl.fromEncoded(s)
return QUrl.fromEncoded(bytes(s, "utf8"))


class TestQgsVirtualLayerDefinition(unittest.TestCase):

0 comments on commit 96c31a1

Please sign in to comment.
You can’t perform that action at this time.