mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix problems detected by pylint 2.8.1.
This commit is contained in:
parent
eed0bf580b
commit
4e7dc24383
@ -61,7 +61,7 @@ def get_checks(content, sol_file_path):
|
||||
constructors.append(line)
|
||||
if line.startswith("ABI_CHECK") or line.startswith("BOOST_REQUIRE"):
|
||||
checks.append(line)
|
||||
sol_file = open(sol_file_path, "r")
|
||||
with open(sol_file_path, "r") as sol_file:
|
||||
sol_constructors = []
|
||||
sol_checks = []
|
||||
inside_expectations = False
|
||||
@ -80,7 +80,7 @@ def get_checks(content, sol_file_path):
|
||||
|
||||
|
||||
def show_test(name, content, sol_file_path, current_test, test_count):
|
||||
cpp_file = tempfile.NamedTemporaryFile(delete=False)
|
||||
with tempfile.NamedTemporaryFile(delete=False) as cpp_file:
|
||||
cpp_file.write(content.encode())
|
||||
cpp_file.close()
|
||||
|
||||
@ -118,7 +118,7 @@ def get_tests(e2e_path):
|
||||
|
||||
def process_input_file(e2e_path, input_file, interactive):
|
||||
tests = get_tests(e2e_path)
|
||||
cpp_file = open(input_file, "r")
|
||||
with open(input_file, "r") as cpp_file:
|
||||
inside_test = False
|
||||
test_name = ""
|
||||
inside_extracted_test = False
|
||||
|
@ -75,7 +75,7 @@ class TraceAnalyser:
|
||||
self.ready = False
|
||||
|
||||
def analyse(self):
|
||||
trace_file = open(self.file, "r")
|
||||
with open(self.file, "r") as trace_file:
|
||||
trace = None
|
||||
test_case = None
|
||||
for line in trace_file.readlines():
|
||||
|
@ -45,7 +45,7 @@ import sys
|
||||
|
||||
def readDependencies(fname):
|
||||
with open(fname) as f:
|
||||
o = subprocess.Popen(['otool', '-L', fname], stdout=subprocess.PIPE)
|
||||
with subprocess.Popen(['otool', '-L', fname], stdout=subprocess.PIPE) as o:
|
||||
for line in o.stdout:
|
||||
if line[0] == '\t':
|
||||
library = line.split(' ', 1)[0][1:]
|
||||
|
@ -67,10 +67,10 @@ class regressor():
|
||||
if not env:
|
||||
env = os.environ.copy()
|
||||
|
||||
logfh = open(logfile, 'w')
|
||||
proc = subprocess.Popen(command, shell=True, executable='/bin/bash',
|
||||
with open(logfile, 'w') as logfh:
|
||||
with subprocess.Popen(command, shell=True, executable='/bin/bash',
|
||||
env=env, stdout=logfh,
|
||||
stderr=subprocess.STDOUT)
|
||||
stderr=subprocess.STDOUT) as proc:
|
||||
ret = proc.wait()
|
||||
logfh.close()
|
||||
return ret
|
||||
|
@ -42,7 +42,7 @@ def writeSourceToFile(lines):
|
||||
# print("filePath is", filePath)
|
||||
if filePath != False:
|
||||
os.system("mkdir -p " + filePath)
|
||||
f = open(srcName, mode='a+', encoding='utf8', newline='')
|
||||
with open(srcName, mode='a+', encoding='utf8', newline='') as f:
|
||||
createdSources.append(srcName)
|
||||
i = 0
|
||||
for idx, line in enumerate(lines[1:]):
|
||||
|
Loading…
Reference in New Issue
Block a user