From fdbb3ea4a84e762cbb679e7f218633080b0519ef Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 13 Oct 2020 10:25:14 +0200 Subject: [PATCH] Avoid SyntaxWarning on Python >= 3.8 Avoid [SyntaxWarnings on Python >= 3.8](https://docs.python.org/3/whatsnew/3.8.html#porting-to-python-3-8). % `python3.8` ``` >>> 0 is 0 :1: SyntaxWarning: "is" with a literal. Did you mean "=="? ``` --- python_ruby_and_bash/parsing_auth_log/logalyzer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python_ruby_and_bash/parsing_auth_log/logalyzer.py b/python_ruby_and_bash/parsing_auth_log/logalyzer.py index 115fd8c..831609c 100644 --- a/python_ruby_and_bash/parsing_auth_log/logalyzer.py +++ b/python_ruby_and_bash/parsing_auth_log/logalyzer.py @@ -12,7 +12,7 @@ import ParseLogs # callback for the user flag def user_call(option, opt_str, value, parser): - if len(parser.rargs) is not 0: + if len(parser.rargs) != 0: value = parser.rargs[0] else: value = None @@ -42,7 +42,7 @@ if __name__ == "__main__": (options, args) = parser.parse_args() # if they're trying to access /var/log/auth.log without proper privs, bail - if not os.getuid() is 0 and options.log is None: + if not os.getuid() == 0 and options.log is None: print("[-] Please run with SUDO") sys.exit(1)