mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-21 11:27:38 +03:00
eddn: Tweak replay.jsonl try/except flow
* Catch OSError instead of Exception (which is *too* general). * Put the set of self.replaylog in try/else so it only runs when there are no errors.
This commit is contained in:
parent
5e35012611
commit
99bac688af
@ -87,7 +87,7 @@ class EDDN:
|
||||
if sys.platform != 'win32': # open for writing is automatically exclusive on Windows
|
||||
lockf(self.replayfile, LOCK_EX | LOCK_NB)
|
||||
|
||||
except Exception:
|
||||
except OSError:
|
||||
logger.exception('Failed opening "replay.jsonl"')
|
||||
if self.replayfile:
|
||||
self.replayfile.close()
|
||||
@ -95,8 +95,9 @@ class EDDN:
|
||||
self.replayfile = None
|
||||
return False
|
||||
|
||||
self.replaylog = [line.strip() for line in self.replayfile]
|
||||
return True
|
||||
else:
|
||||
self.replaylog = [line.strip() for line in self.replayfile]
|
||||
return True
|
||||
|
||||
def flush(self):
|
||||
"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user