Skip to content

Commit e727dc5

Browse files
authored
fix resource warning
``` /usr/lib/python3.11/site-packages/OpenGL/platform/egl.py:76: ResourceWarning: unclosed file <_io.TextIOWrapper name='/proc/cpuinfo' mode='r' encoding='UTF-8'> info = open('/proc/cpuinfo').read() ```
1 parent 29b79e8 commit e727dc5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

OpenGL/platform/egl.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ def EGL(self):
7373
# https://github.com/raspberrypi/firmware/issues/110
7474
import os
7575
if os.path.exists('/proc/cpuinfo'):
76-
info = open('/proc/cpuinfo').read()
76+
with open('/proc/cpuinfo', 'r') as f:
77+
info = f.read()
7778
if 'BCM2708' in info or 'BCM2709' in info:
7879
assert self.GLES2
7980
try:

0 commit comments

Comments
 (0)