diff --git a/test/others/rpc/read.py b/test/others/rpc/read.py index ff7e5c1a0..eb9d4d70a 100755 --- a/test/others/rpc/read.py +++ b/test/others/rpc/read.py @@ -7,9 +7,8 @@ import sys -f = open(sys.argv[1]) -r = f.read(1) -f.close() +with open(sys.argv[1]) as f: + r = f.read(1) if r == '\0': sys.exit(0)