Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
for python 3
  • Loading branch information
ideal committed Nov 19, 2014
1 parent 7d5cc5f commit 68d7380
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion create_potfiles_in.py
Expand Up @@ -28,4 +28,4 @@
fp.write(line + "\n")
fp.close()

print "Done"
print("Done")
22 changes: 11 additions & 11 deletions ez_setup.py
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand All @@ -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"""
Expand All @@ -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):]
Expand Down
6 changes: 3 additions & 3 deletions mirror/config.py
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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()
Expand Down

0 comments on commit 68d7380

Please sign in to comment.