ThoughtfulDev / EagleEye

Stalk your Friends. Find their Instagram, FB and Twitter Profiles using Image Recognition and Reverse Image Search.
Do What The F*ck You Want To Public License
4.18k stars 559 forks source link

Undefined name: driver --> self.driver #83

Closed cclauss closed 4 years ago

cclauss commented 4 years ago

driver is an undefined name in this context which will raise NameError at runtime so this PR recommends using self.driver which is already used previously on this same line of code.

flake8 testing of https://github.com/ThoughtfulDev/EagleEye on Python 3.8.0

$ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics

233./grabber/google.py:56:50: F821 undefined name 'driver'
234                    self.driver.switch_to.window(driver.window_handles[1])
235                                                 ^
2361     F821 undefined name 'driver'
2371

https://flake8.pycqa.org/en/latest/user/error-codes.html

On the flake8 test selection, this PR does not focus on "style violations" (the majority of flake8 error codes that psf/black can autocorrect). Instead these tests are focus on runtime safety and correctness: