Skip to content

Convert to Python3 - #144

Open
ralic wants to merge 7 commits into
benoitc:masterfrom
Python3pkg:master
Open

Convert to Python3#144
ralic wants to merge 7 commits into
benoitc:masterfrom
Python3pkg:master

Conversation

@ralic

Copy link
Copy Markdown

No description provided.

Comment threadbootstrap.py
"""

import os, shutil, sys, tempfile, urllib2
import os, shutil, sys, tempfile, urllib.request, urllib.error, urllib.parse

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thats python3 only

@ralicralicMay 21, 2017

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add following script shall make it python2/3 compatible

# Python 2 and 3: alternative 4
try:
from urllib.parse import urlparse, urlencode
from urllib.request import urlopen, Request
from urllib.error import HTTPError
except ImportError:
from urlparse import urlparse
from urllib import urlencode
from urllib2 import urlopen, Request, HTTPError

@RonnyPfannschmidt

Copy link
Copy Markdown

btw, did you communicate with the maintainer before undertaking this massive conversation?

@benoitc

benoitc commented May 28, 2017 via email

Copy link
Copy Markdown
Owner

@benoitc

Copy link
Copy Markdown
Owner

i think i'm fine with the pr, maybe some extensions can be removed?

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@ralic@RonnyPfannschmidt@benoitc