From a4776a6b672d4fd0f1c4b91e8ca07ddb4537faae Mon Sep 17 00:00:00 2001 From: cclauss Date: Tue, 2 Jul 2019 15:36:23 +0200 Subject: [PATCH] Use ==/!= to compare str, bytes, and int literals Identity is not the same thing as equality in Python. $ __[flake8](http://flake8.pycqa.org) . --count --select=E9,F63,F7,F82 --show-source --statistics__ ``` if resp.status_code is 200: ^ 1 F632 use ==/!= to compare str, bytes, and int literals 1 ``` --- irrelevant/generate_contributions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/irrelevant/generate_contributions.py b/irrelevant/generate_contributions.py index 136f653..f396f32 100644 --- a/irrelevant/generate_contributions.py +++ b/irrelevant/generate_contributions.py @@ -39,7 +39,7 @@ for handle, issues in contribs.items(): issue_string = ', '.join([issue_format.format(i, i) for i in issues]) resp = requests.get(github_rest_api.format(handle)) name = handle - if resp.status_code is 200: + if resp.status_code == 200: pprint.pprint(resp.json()['name']) else: print(handle, resp.content) @@ -48,4 +48,4 @@ for handle, issues in contribs.items(): handle, issue_string)) -print(table_header + "\n".join(rows_so_far)) \ No newline at end of file +print(table_header + "\n".join(rows_so_far))