File tree 1 file changed +9
-5
lines changed 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -233,14 +233,18 @@ def _find_or_create_user_id():
233
233
):
234
234
user_id = _read_user_id (config_file )
235
235
if user_id is None :
236
- user_id = _read_user_id_locked (config_file_old )
236
+ try :
237
+ user_id = _read_user_id_locked (config_file_old )
238
+ except Timeout :
239
+ logger .debug (
240
+ "Failed to acquire %s" ,
241
+ config_file_old .with_suffix (".lock" ),
242
+ )
243
+ return None
237
244
if user_id is None :
238
245
user_id = _generate_id ()
239
246
with config_file .open (mode = "w" , encoding = "utf8" ) as fobj :
240
247
json .dump ({"user_id" : user_id }, fobj )
241
-
242
- if user_id .lower () != DO_NOT_TRACK_VALUE .lower ():
243
- return user_id
244
248
except Timeout :
245
249
logger .debug ("Failed to acquire %s" , lockfile )
246
- return None
250
+ return user_id if user_id . lower () != DO_NOT_TRACK_VALUE . lower () else None
You can’t perform that action at this time.
0 commit comments