forked from M-Labs/artiq
master/worker_db: style
This commit is contained in:
parent
69f534cc20
commit
c97cb1d3b9
|
@ -6,7 +6,6 @@ import tempfile
|
|||
import time
|
||||
import re
|
||||
|
||||
import numpy as np
|
||||
import h5py
|
||||
|
||||
from artiq.protocols.sync_struct import Notifier
|
||||
|
@ -44,7 +43,8 @@ class RIDCounter:
|
|||
def _update_cache(self, rid):
|
||||
contents = str(rid) + "\n"
|
||||
directory = os.path.abspath(os.path.dirname(self.cache_filename))
|
||||
with tempfile.NamedTemporaryFile("w", dir=directory, delete=False) as f:
|
||||
with tempfile.NamedTemporaryFile("w", dir=directory, delete=False
|
||||
) as f:
|
||||
f.write(contents)
|
||||
tmpname = f.name
|
||||
os.replace(tmpname, self.cache_filename)
|
||||
|
|
Loading…
Reference in New Issue