Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

Refactor for Python3 (#28091) #23

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

traumschule
Copy link

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)

Copy link

@nmathewson nmathewson left a 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:

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()

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()):

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:

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants