提交 1db1fa6b authored 作者: Ian Goodfellow's avatar Ian Goodfellow

do race-able check before making directory, to reduce # of directory creation attempts

上级 92a178d3
......@@ -30,6 +30,7 @@ try:
# compile_str()) but if another lazylinker_ext does exist then it will be
# imported and compile_str won't get called at all.
location = os.path.join(config.compiledir, 'lazylinker_ext')
if not os.path.exists(location):
try:
# Try to make the location
os.mkdir(location)
......@@ -42,8 +43,6 @@ try:
assert 'Errno 17' in str(e)
assert os.path.isdir(location)
if not os.path.exists(location):
os.mkdir(location)
if not os.path.exists(os.path.join(location, '__init__.py')):
file(os.path.join(location, '__init__.py'), 'w').close()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论