pyopengl icon indicating copy to clipboard operation
pyopengl copied to clipboard

fix resource warning

Open totaam opened this issue 1 year ago • 1 comments

/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 avatar Oct 27 '23 08:10 totaam

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

totaam avatar Dec 29 '23 09:12 totaam