-
Notifications
You must be signed in to change notification settings - Fork 40
Refactor for Python3 (#28091) #23
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've noted a few small issues in the python3 commit on this branch.
tb_version_config.read(tb_version_path) | ||
tb_version = tb_version_config['version']['current'] | ||
|
||
except: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not do an unconditional except:
-- instead, let's catch specific exceptions.
print 'Go to the following link in your browser: ' + authorize_url | ||
code = raw_input('Enter verification code: ').strip() | ||
print('Go to the following link in your browser: ' + authorize_url) | ||
code = input('Enter verification code: ').strip() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be using getpass() instead?
@@ -279,7 +279,7 @@ def get_files_links(service, v): | |||
p3 = re.compile('.*\.dmg$') | |||
p4 = re.compile('.*\.asc$') | |||
|
|||
for file in uploaded_files.keys(): | |||
for file in list(uploaded_files.keys()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't this just become for file in uploaded_files:
?
@@ -153,7 +153,7 @@ def is_json(my_json): | |||
"""Check if json generated is valid.""" | |||
try: | |||
json_object = json.loads(my_json) | |||
except ValueError, e: | |||
except ValueError as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here (and elsewhere) it looks like you're ignoring the value of the exception -- you can just delete the as e
.
https://bugs.torproject.org/28091
(this lists all commits from https://gitweb.torproject.org/gettor.git since 2017 - reviewing should be easier pulling it in first)