mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 14:50:25 +01:00
bug fix: read methods are in fact closing files now
This commit is contained in:
parent
10e7171d5b
commit
1ea759f1cc
1 changed files with 4 additions and 0 deletions
|
@ -224,6 +224,7 @@ def read_sfcf(path, prefix, name, quarks='.*', corr_type='bi', noffset=0, wf=0,
|
|||
read = 1
|
||||
start = k + 1
|
||||
print(str(T) + " entries found.")
|
||||
file.close()
|
||||
else:
|
||||
pattern = 'name ' + name + '\nquarks ' + quarks + '\noffset ' + str(noffset) + '\nwf ' + str(wf)
|
||||
if b2b:
|
||||
|
@ -243,8 +244,11 @@ def read_sfcf(path, prefix, name, quarks='.*', corr_type='bi', noffset=0, wf=0,
|
|||
T = content[match.start():].count('\n', 0, end_match.start()) - 4 - b2b
|
||||
assert T > 0
|
||||
print(T, 'entries, starting to read in line', start_read)
|
||||
file.close()
|
||||
else:
|
||||
file.close()
|
||||
raise Exception('Correlator with pattern\n' + pattern + '\nnot found.')
|
||||
|
||||
# we found where the correlator
|
||||
# that is to be read is in the files
|
||||
# after preparing the datastructure
|
||||
|
|
Loading…
Add table
Reference in a new issue