]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind: use sys.version_info for checking py3
authorKefu Chai <kchai@redhat.com>
Thu, 13 Apr 2017 07:25:34 +0000 (15:25 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 18 Apr 2017 03:40:14 +0000 (11:40 +0800)
it's simpler and more consistent with other part of ceph.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/cephfs/cephfs.pyx
src/pybind/rados/rados.pyx
src/test/pybind/test_rados.py

index b7b406cd95e32e2c82db3faaf52828785bc3c8c4..746b9e8da5733b12037c5b59c88417a7cd1e4cf6 100644 (file)
@@ -16,9 +16,7 @@ import os
 import sys
 
 # Are we running Python 2.x
-_python2 = sys.hexversion < 0x03000000
-
-if _python2:
+if sys.version_info[0] < 3:
     str_type = basestring
 else:
     str_type = str
index 586dc7458d2db3e8b58d8a6bf864a1b37f7a6269..47d362e972ac91ad20f0e7d7451d76c08f37eb89 100644 (file)
@@ -28,9 +28,7 @@ from functools import partial, wraps
 from itertools import chain
 
 # Are we running Python 2.x
-_python2 = sys.hexversion < 0x03000000
-
-if _python2:
+if sys.version_info[0] < 3:
     str_type = basestring
 else:
     str_type = str
index 50b09053cdd006f041f33d562d5327846de5c889..a4e1efd852ee2652e042481b77f6f6b57e1ba0bf 100644 (file)
@@ -11,7 +11,7 @@ import errno
 import sys
 
 # Are we running Python 2.x
-_python2 = sys.hexversion < 0x03000000
+_python2 = sys.version_info[0] < 3
 
 def test_rados_init_error():
     assert_raises(Error, Rados, conffile='', rados_id='admin',