-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from duartexyz/master
Make updates.py compatible with Python 3
- Loading branch information
Showing
1 changed file
with
14 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env python | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
__author__ = "Mikhail Fedosov ([email protected])" | ||
__version__ = "0.1.4" | ||
|
@@ -9,12 +9,20 @@ | |
import pip | ||
import sys | ||
import socket | ||
import xmlrpclib | ||
from multiprocessing import Pool | ||
|
||
reload(sys) | ||
sys.setdefaultencoding("utf-8") | ||
|
||
if sys.version < '3': | ||
from xmlrpclib import ServerProxy | ||
else: | ||
from xmlrpc.client import ServerProxy | ||
|
||
if sys.version < '3': | ||
reload(sys) | ||
sys.setdefaultencoding("utf-8") | ||
else: | ||
# http://stackoverflow.com/questions/3828723/why-we-need-sys-setdefaultencodingutf-8-in-a-py-script | ||
pass | ||
|
||
|
||
class colors: | ||
""" Colored terminal text | ||
""" | ||
|
@@ -58,7 +66,6 @@ def simplify(cls): | |
|
||
def check_package(dist): | ||
pypi = xmlrpclib.ServerProxy("http://pypi.python.org/pypi") | ||
|
||
try: | ||
available = pypi.package_releases(dist.project_name) | ||
if not available: | ||
|