提交 989e153d authored 作者: Frederic's avatar Frederic

Make sure we delete the added path if the insert succeeded.

I think the insert will always succeed, but just in case.
上级 27f62bf3
......@@ -57,10 +57,10 @@ def compile_cutils():
preargs=args)
try:
# Must be at the beginning to ensure no conflict with other project
# that would use the same module name.
sys.path.insert(0, config.compiledir)
try:
# Must be at the beginning to ensure no conflict with other project
# that would use the same module name.
sys.path.insert(0, config.compiledir)
from cutils_ext.cutils_ext import *
except ImportError:
import cmodule
......@@ -85,4 +85,5 @@ try:
# Release lock on compilation directory.
release_lock()
finally:
del sys.path[0]
if sys.path[0] == config.compiledir:
del sys.path[0]
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论