Skip to content
This repository has been archived by the owner. 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

Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
@traumschule
Copy link

@traumschule traumschule commented Oct 17, 2018

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

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:

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

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

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:

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.