提交 48fef01e 编写于 作者: M minqiyang

Change python code style to 3.x in setup.py

上级 becc1c24
...@@ -142,7 +142,7 @@ std::string callPythonFunc(const std::string& moduleName, ...@@ -142,7 +142,7 @@ std::string callPythonFunc(const std::string& moduleName,
return std::string(str, (size_t)str_size); return std::string(str, (size_t)str_size);
#else #else
return std::string(PyString_AsString(obj.get()), PyString_Size(obj.get())); return std::string(PyString_AsString(obj.get()), PyString_Size(obj.get()));
#endif // PY_MAJOR_VERSION >= 3 #endif // PY_MAJOR_VERSION >= 3
} }
PyObjectPtr createPythonClass( PyObjectPtr createPythonClass(
......
...@@ -136,7 +136,7 @@ T castInt(PyObject* obj, bool* ok = nullptr) { ...@@ -136,7 +136,7 @@ T castInt(PyObject* obj, bool* ok = nullptr) {
return (T)0; return (T)0;
} }
} }
#endif // PY_MAJOR_VERSION >= 3 #endif // PY_MAJOR_VERSION >= 3
/** /**
* Invoke repr of python object. * Invoke repr of python object.
......
...@@ -17,7 +17,7 @@ def git_commit(): ...@@ -17,7 +17,7 @@ def git_commit():
git_commit = subprocess.Popen(cmd, stdout = subprocess.PIPE).communicate()[0].strip() git_commit = subprocess.Popen(cmd, stdout = subprocess.PIPE).communicate()[0].strip()
except: except:
git_commit = 'Unknown' git_commit = 'Unknown'
return git_commit return str(git_commit)
def _get_version_detail(idx): def _get_version_detail(idx):
assert idx < 3, "vesion info consists of %(major)d.%(minor)d.%(patch)d, \ assert idx < 3, "vesion info consists of %(major)d.%(minor)d.%(patch)d, \
...@@ -67,13 +67,13 @@ with_mkl = '%(with_mkl)s' ...@@ -67,13 +67,13 @@ with_mkl = '%(with_mkl)s'
def show(): def show():
if istaged: if istaged:
print 'full_version:', full_version print('full_version:', full_version)
print 'major:', major print('major:', major)
print 'minor:', minor print('minor:', minor)
print 'patch:', patch print('patch:', patch)
print 'rc:', rc print('rc:', rc)
else: else:
print 'commit:', commit print('commit:', commit)
def mkl(): def mkl():
return with_mkl return with_mkl
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册