Skip to content

Commit 812b666

Browse files
committed
Do not re-raise the exception if the one that we are checking
1 parent 846c7e2 commit 812b666

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

readthedocs/core/utils/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,8 @@ def safe_makedirs(directory_name):
222222
try:
223223
os.makedirs(directory_name)
224224
except OSError as e:
225-
if e.errno == errno.EEXIST:
226-
pass
227-
raise
225+
if e.errno != errno.EEXIST: # 17, FileExistsError
226+
raise
228227

229228

230229
def safe_unlink(path):

0 commit comments

Comments
 (0)