-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeLib specific 💅This affect the code from a particular libraryThis affect the code from a particular libraryNeeds investigation 🔬A bug or crash where it's not immediately obvious what is happenningA bug or crash where it's not immediately obvious what is happenning
Description
Bug description
Making any GL calls with Pyglet.gl causes unreachable code warning even though any code afterwards is most definitely reachable. The example code below yields a warning:
from pyglet.gl import glEnable, GL_CULL_FACE
def problem_code():
glEnable(GL_CULL_FACE)
print("This line is unreachable apparently!")Same function (with no branches, asserts or raises) can cause as many unreachable warnings as there are GL calls. The line of the warning is always the next line from the GL call which if another GL call, causes yet another unreachable warning. GL call with no code afterwards does not cause an unreachable warning.
For instance:
glFunctionCall...
glFunctionCall... #false positive unreachable
glFunctionCall... #false positive unreachable
print... #false positive unreachableCommand used
pylint test.pyPylint output
Module ...test
test.py:5:4: W0101: Unreachable code (unreachable)Expected behavior
The code should not yield any warnings (outside missing-docstring ones if enabled).
Pylint version
pylint 4.0.3
astroid 4.0.2
Python 3.13.9 (tags/v3.13.9:8183fa5, Oct 14 2025, 14:09:13) [MSC v.1944 64 bit (AMD64)]OS / Environment
Windows 11.
Metadata
Metadata
Assignees
Labels
False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeLib specific 💅This affect the code from a particular libraryThis affect the code from a particular libraryNeeds investigation 🔬A bug or crash where it's not immediately obvious what is happenningA bug or crash where it's not immediately obvious what is happenning