Skip to content

Commit 8b35304

Browse files
Fix undefined names in Python code (#2371)
Co-authored-by: Andrea Giammarchi <andrea.giammarchi@gmail.com>
1 parent 9e4cb44 commit 8b35304

File tree

5 files changed

+6
-10
lines changed

5 files changed

+6
-10
lines changed

core/tests/javascript/terminal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
classList = document.documentElement.classList
44

5-
if not __terminal__:
5+
if not __terminal__: # noqa: F821 __terminal__ is defined in core/src/plugins/donkey.js
66
classList.add("error")
77
else:
88
classList.add("ok")

core/tests/manual/game/aliens.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -318,16 +318,12 @@ async def main(winstyle=0):
318318
if not fullscreen:
319319
print("Changing to FULLSCREEN")
320320
screen_backup = screen.copy()
321-
screen = pygame.display.set_mode(
322-
SCREENRECT.size, winstyle | pygame.FULLSCREEN, bestdepth
323-
)
321+
screen = pygame.display.set_mode(SCREENRECT.size, winstyle | pygame.FULLSCREEN)
324322
screen.blit(screen_backup, (0, 0))
325323
else:
326324
print("Changing to windowed mode")
327325
screen_backup = screen.copy()
328-
screen = pygame.display.set_mode(
329-
SCREENRECT.size, winstyle, bestdepth
330-
)
326+
screen = pygame.display.set_mode(SCREENRECT.size, winstyle)
331327
screen.blit(screen_backup, (0, 0))
332328
pygame.display.flip()
333329
fullscreen = not fullscreen

core/tests/manual/issue-2302/libthree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def get_stats_gl(renderer):
140140

141141
def bg_from_v(*vertices):
142142
geometry = new(THREE.BufferGeometry)
143-
vertices_f32a = new(Float32Array, vertices)
143+
vertices_f32a = new(Float32Array, vertices) # noqa: F821 Float32Array is defined in js
144144
attr = new(THREE.Float32BufferAttribute, vertices_f32a, 3)
145145
return geometry.setAttribute('position', attr)
146146

core/tests/python/tests/test_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def test_as_bytearray():
1111
msg = b"Hello, world!"
1212
buffer = js.ArrayBuffer.new(len(msg))
1313
ui8a = js.Uint8Array.new(buffer)
14-
for b in msg:
14+
for i, b in enumerate(msg):
1515
ui8a[i] = b
1616
ba = util.as_bytearray(buffer)
1717
assert isinstance(ba, bytearray)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ skip = "*.js,*.json"
55
[tool.ruff]
66
line-length = 114
77
lint.select = ["C4", "C90", "E", "EM", "F", "PIE", "PYI", "PLC", "Q", "RET", "W"]
8-
lint.ignore = ["E402", "E722", "E731", "E741", "F401", "F704", "F821", "PLC0415"]
8+
lint.ignore = ["E402", "E722", "E731", "E741", "F401", "F704", "PLC0415"]
99
lint.mccabe.max-complexity = 27

0 commit comments

Comments
 (0)