mcfletch / pyopengl

Repository for the PyOpenGL Project
Other
314 stars 97 forks source link

fix resource warning #106

Open totaam opened 10 months ago

totaam commented 10 months ago
/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()
totaam commented 8 months ago

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()
... 
>>>