Skip to content

Commit 9c5d052

Browse files
committed
Fixed linting
1 parent 0f1ede6 commit 9c5d052

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

examples/featherwing_tft24_simpletest.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,16 @@
1313
tft_featherwing = tft_featherwing_24.TFTFeatherWing24()
1414

1515
try:
16-
f = open( # pylint: disable=unspecified-encoding,consider-using-with
16+
with open( # pylint: disable=unspecified-encoding
1717
"/sd/tft_featherwing.txt", "w"
18-
)
19-
f.write("Blinka\nBlackberry Q10 Keyboard")
20-
f.close()
18+
) as f:
19+
f.write("Blinka\nBlackberry Q10 Keyboard")
2120

22-
f = open( # pylint: disable=unspecified-encoding,consider-using-with
21+
with open( # pylint: disable=unspecified-encoding
2322
"/sd/tft_featherwing.txt", "r"
24-
)
25-
print(f.read())
26-
f.close()
23+
) as f:
24+
print(f.read())
25+
2726
except OSError as error:
2827
print("Unable to write to SD Card.")
2928

0 commit comments

Comments
 (0)