Skip to content

Commit f522016

Browse files
committed
QA: Fix bugbears.
1 parent 6a1a76a commit f522016

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

examples/badapple.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,6 @@ def render(data:ptr8, x:int, y:int, next_tick:int): # noqa: F821
7272
# Read out the file and render
7373
while True:
7474
data = video.read(1024)
75-
if len(data) < 1024: break
75+
if len(data) < 1024:
76+
break
7677
x, y, next_tick = render(data, x, y, next_tick)

examples/balls_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def __init__(self, x, y, r, dx, dy, pen):
2323

2424
# initialise shapes
2525
balls = []
26-
for i in range(0, 170):
26+
for _ in range(0, 170):
2727
r = random.randint(0, 10) + 3
2828
balls.append(
2929
Ball(

examples/image_gallery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def fizzlefade():
126126

127127
while True:
128128

129-
for i in range(2000):
129+
for _ in range(2000):
130130
x, y = return_point()
131131
if x > -1 and y > -1:
132132
display.pixel(x, y)

examples/multi_player.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,9 @@ def check_hits(self, players):
198198
try:
199199
p.update()
200200
# Handle QwSTPads being disconnected unexpectedly
201-
except OSError:
201+
except OSError as err:
202202
print(f"P{p.index + 1}: Disconnected ... Exiting")
203-
raise SystemExit
203+
raise SystemExit from err
204204

205205
# Check if any projectiles have hit players
206206
for p in players:

examples/random_maze.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def build(self, width, height):
151151
self.maze = []
152152

153153
row = [1]
154-
for x in range(0, self.width):
154+
for _ in range(0, self.width):
155155
row.append(1)
156156
row.append(1)
157157
self.maze.append(row)

0 commit comments

Comments
 (0)