Skip to content

Commit 298dc07

Browse files
committed
fixup - PY2
1 parent de6737c commit 298dc07

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mig/shared/useradm.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
from email.utils import parseaddr
3535
import codecs
3636
import datetime
37+
import errno
3738
import fnmatch
3839
import os
3940
import re
@@ -474,7 +475,10 @@ def create_user_in_db(configuration, db_path, client_id, user, now, authorized,
474475
if do_lock:
475476
try:
476477
flock = lock_user_db(db_path)
477-
except FileNotFoundError as e:
478+
except OSError as oserr:
479+
if oserr.errno != errno.ENOENT: # FileNotFoundError
480+
raise
481+
478482
user_db_home = os.path.dirname(db_path)
479483

480484
if not os.path.exists(db_path) and not os.path.exists(user_db_home):

0 commit comments

Comments
 (0)