DeepSource has joined Harness. Learn more
Python logoPython/
PYL-E0602

Undefined name detectedPYL-E0602

Critical severityCritical
Bug Risk categoryBug Risk

The variable name is not defined where it is used. This will lead to an error during the runtime. Make sure there is no typo. If the name was supposed to be imported, verify that you've actually imported the name.

Bad practice

import os.path

if os.path.exits('setup.cfg'):  # misspelled `exists`
    print('Found config file')

Preferred:

import os.path

if os.path.exists('setup.cfg'):
    print('Found config file')