Closed RishabhJain2018 closed 5 years ago
Can i take this up ? @RishabhJain2018
sure @Ayukha go ahead !
As seen in last commit's build status #226
Travis CI build fails with following errors-
./notices/decorators.py:18:9: E722 do not use bare except'
./notices/decorators.py:44:9: E722 do not use bare except'
./notices/views.py:80:9: E722 do not use bare except'
./notices/views.py:146:9: E722 do not use bare except'
./notices/views.py:250:9: E722 do not use bare except'
./notices/views.py:273:9: E722 do not use bare except'
./notices/views.py:289:13: E722 do not use bare except'
./notices/views.py:297:9: E722 do not use bare except'
./notices/views.py:319:13: E722 do not use bare except'
./notices/views.py:322:9: E722 do not use bare except'
./notices/views.py:326:13: E722 do not use bare except'
./notices/views.py:330:13: E722 do not use bare except'
./notices/views.py:334:13: E722 do not use bare except'
./wifi/models.py:38:9: E722 do not use bare except'
./wifi/views.py:29:9: E722 do not use bare except'
./wifi/views.py:38:9: E722 do not use bare except'
./wifi/views.py:116:13: E722 do not use bare except'
The command "flake8 ./" exited with 1.
Solution- After reading PEP8 documentation-
A bare except: clause will catch SystemExit and KeyboardInterrupt exceptions, making it harder to interrupt a program with Control-C, and can disguise other problems. If you want to catch all exceptions that signal program errors, use except Exception: (bare except is equivalent to except BaseException:).
Hence all the bare except:
statements must be updated to except Exception:
or to retain the present state, it must be replaced with except BaseException:
Build fails again with following errors-
./apps/notices/decorators.py:21:11: W605 invalid escape sequence '\d'
./apps/notices/decorators.py:21:11: W605 invalid escape sequence '\d'
./apps/notices/decorators.py:21:11: W605 invalid escape sequence '\d'
./apps/notices/decorators.py:21:11: W605 invalid escape sequence '\d'
./apps/notices/views.py:45:45: W504 line break after binary operator
./apps/notices/views.py:46:45: W504 line break after binary operator
./apps/notices/views.py:47:45: W504 line break after binary operator
./apps/notices/views.py:48:45: W504 line break after binary operator
./apps/notices/views.py:49:45: W504 line break after binary operator
./apps/notices/views.py:50:45: W504 line break after binary operator
./apps/notices/views.py:51:45: W504 line break after binary operator
./apps/notices/views.py:417:17: W504 line break after binary operator
./apps/notices/views.py:418:17: W504 line break after binary operator
The command "flake8 ./" exited with 1.
On creating a pull reuqest the build fails. Please refer #218