We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f5ccca9 commit 286565eCopy full SHA for 286565e
osgtest/library/core.py
@@ -416,13 +416,17 @@ def version_compare(evr1, evr2):
416
as a 3-element tuple or list.
417
418
"""
419
- if isinstance(evr1, basestring):
+ if is_string(evr1):
420
epoch1, version1, release1 = stringToVersion(evr1)
421
+ elif isinstance(evr1, bytes):
422
+ epoch1, version1, release1 = stringToVersion(evr1.decode())
423
else:
424
epoch1, version1, release1 = evr1
425
- if isinstance(evr2, basestring):
426
+ if is_string(evr2):
427
epoch2, version2, release2 = stringToVersion(evr2)
428
+ elif isinstance(evr2, bytes):
429
+ epoch2, version2, release2 = stringToVersion(evr2.decode())
430
431
epoch2, version2, release2 = evr2
432
@@ -755,3 +759,12 @@ def run_fn_if_el_release_ok(*args, **kwargs):
755
759
return run_fn_if_el_release_ok
756
760
return el_release_decorator
757
761
762
+
763
+try:
764
+ unicode
765
+except NameError: # python 3
766
+ unicode = str
767
768
769
+def is_string(var):
770
+ return isinstance(var, (str, unicode))
0 commit comments