You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
f = Path.open('x') # SIM115 Use context handler for opening files
f.close()
Ruff nudges the user to use context managers, Ruff should do the same for:
from tempfile import NamedTemporaryFile
f = NamedTemporaryFile() # Should nudge SIM115
f.close()
and similarly for the other classes in tempfile.
The text was updated successfully, but these errors were encountered:
NeilGirdhar
changed the title
Consider suggesting using context managers with tempfile classes
Consider suggesting using tempfile classes as context managers
Sep 12, 2023
Just as in:
Ruff nudges the user to use context managers, Ruff should do the same for:
and similarly for the other classes in
tempfile
.The text was updated successfully, but these errors were encountered: