Skip to content

Commit eba20f7

Browse files
committed
Fixed compile.py. The cefpython module name differs on Python 3.4
with Cython 0.21.2.
1 parent 1152058 commit eba20f7

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

cefpython/cef3/linux/compile.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,7 @@
104104
except OSError:
105105
pass
106106

107-
try:
108-
os.remove("./setup/cefpython_py%s.so" % PYVERSION)
109-
os.remove("./setup/cefpython_py%s_d.so" % PYVERSION)
110-
except OSError:
111-
pass
107+
os.system("rm ./setup/cefpython_py*.so")
112108

113109
pyx_files = glob.glob("./setup/*.pyx")
114110
for f in pyx_files:
@@ -152,10 +148,11 @@
152148
if ret != 0:
153149
sys.exit("ERROR")
154150

155-
if DEBUG:
156-
os.rename("./setup/cefpython_py%s_d.so" % PYVERSION, "./binaries_%s/cefpython_py%s.so" % (BITS, PYVERSION))
157-
else:
158-
os.rename("./setup/cefpython_py%s.so" % PYVERSION, "./binaries_%s/cefpython_py%s.so" % (BITS, PYVERSION))
151+
exitcode = os.system("mv ./setup/cefpython_py{0}*.so"
152+
" ./binaries_{1}/cefpython_py{0}.so"
153+
.format(PYVERSION, BITS))
154+
if exitcode:
155+
raise RuntimeError("Failed to move the cefpython module")
159156

160157
print("DONE")
161158

cefpython/cef3/mac/compile.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,7 @@
122122
except OSError:
123123
pass
124124

125-
try:
126-
os.remove("./setup/cefpython_py%s.so" % PYVERSION)
127-
os.remove("./setup/cefpython_py%s_d.so" % PYVERSION)
128-
except OSError:
129-
pass
125+
os.system("rm ./setup/cefpython_py*.so")
130126

131127
pyx_files = glob.glob("./setup/*.pyx")
132128
for f in pyx_files:
@@ -170,10 +166,11 @@
170166
if ret != 0:
171167
sys.exit("ERROR")
172168

173-
if DEBUG:
174-
os.rename("./setup/cefpython_py%s_d.so" % PYVERSION, "./binaries_%s/cefpython_py%s.so" % (BITS, PYVERSION))
175-
else:
176-
os.rename("./setup/cefpython_py%s.so" % PYVERSION, "./binaries_%s/cefpython_py%s.so" % (BITS, PYVERSION))
169+
exitcode = os.system("mv ./setup/cefpython_py{0}*.so"
170+
" ./binaries_{1}/cefpython_py{0}.so"
171+
.format(PYVERSION, BITS))
172+
if exitcode:
173+
raise RuntimeError("Failed to move the cefpython module")
177174

178175
print("DONE")
179176

0 commit comments

Comments
 (0)