Fix errors detected by Ruff (#3918)

### What problem does this PR solve?

Fix errors detected by Ruff

### Type of change

- [x] Refactoring
This commit is contained in:
Zhichang Yu
2024-12-08 14:21:12 +08:00
committed by GitHub
parent e267a026f3
commit 0d68a6cd1b
97 changed files with 2558 additions and 1976 deletions

View File

@ -41,15 +41,15 @@ def findMaxDt(fnm):
try:
with open(fnm, "r") as f:
while True:
l = f.readline()
if not l:
line = f.readline()
if not line:
break
l = l.strip("\n")
if l == 'nan':
line = line.strip("\n")
if line == 'nan':
continue
if l > m:
m = l
except Exception as e:
if line > m:
m = line
except Exception:
pass
return m
@ -59,15 +59,15 @@ def findMaxTm(fnm):
try:
with open(fnm, "r") as f:
while True:
l = f.readline()
if not l:
line = f.readline()
if not line:
break
l = l.strip("\n")
if l == 'nan':
line = line.strip("\n")
if line == 'nan':
continue
if int(l) > m:
m = int(l)
except Exception as e:
if int(line) > m:
m = int(line)
except Exception:
pass
return m