Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix resource warning #106

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix resource warning #106

wants to merge 1 commit into from

Conversation

totaam
Copy link

@totaam totaam commented Oct 27, 2023

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

```
/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
Copy link
Author

totaam commented Dec 29, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant