pyopengl
pyopengl copied to clipboard
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()
FYI: the only valid warning from the CI checks is python2.7, but this PR does not change anything in that regard, and the new syntax is compatible with python2.7:
$ python2
Python 2.7.18 (default, Dec 22 2023, 00:00:00)
[GCC 13.2.1 20231205 (Red Hat 13.2.1-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> with open('/proc/cpuinfo', 'r') as f:
... info = f.read()
...
>>>