Permalink
Browse files

for python 3

  • Loading branch information...
ideal committed Nov 19, 2014
1 parent 7d5cc5f commit 68d7380cd8f0406190539713422a3f166054e7df
Showing with 15 additions and 15 deletions.
  1. +1 −1 create_potfiles_in.py
  2. +11 −11 ez_setup.py
  3. +3 −3 mirror/config.py
View
@@ -28,4 +28,4 @@
fp.write(line + "\n")
fp.close()
print "Done"
print("Done")
View
@@ -67,8 +67,8 @@ def _validate_md5(egg_name, data):
if egg_name in md5_data:
digest = md5(data).hexdigest()
if digest != md5_data[egg_name]:
print >>sys.stderr, (
"md5 validation of %s failed! (Possible download problem?)"
sys.stderr.write(
"md5 validation of %s failed! (Possible download problem?)\n"
% egg_name
)
sys.exit(2)
@@ -100,14 +100,14 @@ def do_download():
return do_download()
try:
pkg_resources.require("setuptools>="+version); return
except pkg_resources.VersionConflict, e:
except pkg_resources.VersionConflict as e:
if was_imported:
print >>sys.stderr, (
sys.stderr.write(
"The required version of setuptools (>=%s) is not available, and\n"
"can't be installed while this script is running. Please install\n"
" a more recent version first, using 'easy_install -U setuptools'."
"\n\n(Currently using %r)"
) % (version, e.args[0])
"\n\n(Currently using %r)\n"
% (version, e.args[0]))
sys.exit(2)
else:
del pkg_resources, sys.modules['pkg_resources'] # reload ok
@@ -178,9 +178,9 @@ def main(argv, version=DEFAULT_VERSION):
os.unlink(egg)
else:
if setuptools.__version__ == '0.0.1':
print >>sys.stderr, (
sys.stderr.write(
"You have an obsolete version of setuptools installed. Please\n"
"remove it from your system entirely before rerunning this script."
"remove it from your system entirely before rerunning this script.\n"
)
sys.exit(2)
@@ -200,8 +200,8 @@ def main(argv, version=DEFAULT_VERSION):
from setuptools.command.easy_install import main
main(argv)
else:
print "Setuptools version",version,"or greater has been installed."
print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)'
print("Setuptools version",version,"or greater has been installed.")
print('(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)')
def update_md5(filenames):
"""Update our built-in md5 registry"""
@@ -224,7 +224,7 @@ def update_md5(filenames):
match = re.search("\nmd5_data = {\n([^}]+)}", src)
if not match:
print >>sys.stderr, "Internal error!"
sys.stderr.write("Internal error!\n")
sys.exit(2)
src = src[:match.start(1)] + repl + src[match.end(1):]
View
@@ -167,7 +167,7 @@ def register_change_callback(self, callback):
>>> config = Config("mirror.ini", defaults={"test": 5})
>>> def callback(key, value):
... print key, value
... print(key, value)
...
>>> config.register_change_callback(callback)
@@ -182,7 +182,7 @@ def register_set_function(self, key, function, apply_now=True):
>>> config = Config("mirror.ini", defaults={"test": 5})
>>> def callback(key, value):
... print key, value
... print(key, value)
...
>>> config.register_set_function("test", callback, apply_now=True)
test 5
@@ -207,7 +207,7 @@ def apply_all(self):
>>> config = Config("mirror.ini", defaults={"test": 5})
>>> def callbck(key, value):
... print key, value
... print(key, value)
...
>>> config.register_set_function("test", callback, apply_now=False)
>>> config.apply_all()

0 comments on commit 68d7380

Please sign in to comment.