File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,7 @@ def excl_writer(path):
227227
228228def get_cached_controller_uri (ctx = None ):
229229 try :
230- with ctx if ctx is not None else shared_reader (CONTROLLER_CACHE_PATH ) as f :
230+ with ctx if ctx else shared_reader (CONTROLLER_CACHE_PATH ) as f :
231231 return f .read ().strip ()
232232 except FileNotFoundError :
233233 pass
@@ -237,7 +237,7 @@ def get_cached_controller_uri(ctx=None):
237237
238238def delete_controller_uri_cache (ctx = None ):
239239 try :
240- with ctx if ctx is not None else excl_writer (CONTROLLER_CACHE_PATH ) as f :
240+ with ctx if ctx else excl_writer (CONTROLLER_CACHE_PATH ) as f :
241241 f .seek (0 )
242242 f .truncate ()
243243 except FileNotFoundError :
@@ -251,7 +251,7 @@ def write_controller_uri_cache(uri, ctx=None):
251251 if not os .path .exists (CONTROLLER_CACHE_DIRECTORY ):
252252 os .makedirs (CONTROLLER_CACHE_DIRECTORY )
253253 os .chmod (CONTROLLER_CACHE_DIRECTORY , 0o700 )
254- with ctx if ctx is not None else excl_writer (CONTROLLER_CACHE_PATH ) as f :
254+ with ctx if ctx else excl_writer (CONTROLLER_CACHE_PATH ) as f :
255255 f .seek (0 )
256256 f .write (uri )
257257 f .truncate ()
You can’t perform that action at this time.
0 commit comments