Skip to content

Commit

Permalink
small refact
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Oct 4, 2023
1 parent a395cd0 commit c90bbd4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions psutil/tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,8 +843,7 @@ def assert_stdout(exe, *args, **kwargs):
@staticmethod
def assert_syntax(exe):
exe = os.path.join(SCRIPTS_DIR, exe)
f = open(exe, encoding="utf8") if PY3 else open(exe)
with f:
with open(exe, encoding="utf8") if PY3 else open(exe) as f:
src = f.read()
ast.parse(src)

Expand Down

0 comments on commit c90bbd4

Please sign in to comment.