#!/bin/false # You must specify a python interpreter.
-u"Tahoe-LAFS does not run under Python 3. Please use a version of Python between 2.5 and 2.7.x inclusive."
+ur"Tahoe-LAFS does not run under Python 3. Please use a version of Python between 2.5 and 2.7.x inclusive."
import sys, os, subprocess
# look for Tahoe.home .
homemarker = os.path.join(base, "Tahoe.home")
if not os.path.exists(homemarker):
- print whoami
- print '''\
+ print(whoami)
+ print('''\
I just tried to run and found that I am not living in such a directory, so I
am stopping now. To run Tahoe after it has been is installed, please execute
my brother, who gets installed into the appropriate place for executables
when you run "make install" (perhaps as "%s").
-''' % (perhaps_installed_tahoe,)
+''' % (perhaps_installed_tahoe,))
sys.exit(1)
# we've found our home. Put the tahoe support/lib etc. in our PYTHONPATH.
command = prefix + [script] + args
if not os.path.exists(script):
- print whoami
- print '''\
+ print(whoami)
+ print('''\
I could not find the support script
"%s".
To run an installed version of Tahoe-LAFS, please execute the "tahoe"
script that is installed into the appropriate place for executables
when you run "python setup.py install" (perhaps as "%s").
-''' % (script, perhaps_installed_tahoe)
+''' % (script, perhaps_installed_tahoe))
sys.exit(1)
try:
res = subprocess.call(command, env=os.environ)
-except Exception, le:
- print whoami
- print '''\
+except Exception as le:
+ print(whoami)
+ print('''\
I just tried to invoke "%s"
and got an exception.
-''' % (runner,)
+''' % (runner,))
raise
else:
sys.exit(res)
#! /usr/bin/env python
# -*- coding: utf-8 -*-
-u"Tahoe-LAFS does not run under Python 3. Please use a version of Python between 2.5 and 2.7.x inclusive."
+ur"Tahoe-LAFS does not run under Python 3. Please use a version of Python between 2.5 and 2.7.x inclusive."
# Tahoe-LAFS -- secure, distributed storage grid
#
open(APPNAMEFILE, "w").write(APPNAMEFILESTR)
else:
if curappnamefilestr.strip() != APPNAMEFILESTR:
- print "Error -- this setup.py file is configured with the 'application name' to be '%s', but there is already a file in place in '%s' which contains the contents '%s'. If the file is wrong, please remove it and setup.py will regenerate it and write '%s' into it." % (APPNAME, APPNAMEFILE, curappnamefilestr, APPNAMEFILESTR)
+ print("Error -- this setup.py file is configured with the 'application name' to be '%s', but there is already a file in place in '%s' which contains the contents '%s'. If the file is wrong, please remove it and setup.py will regenerate it and write '%s' into it." % (APPNAME, APPNAMEFILE, curappnamefilestr, APPNAMEFILESTR))
sys.exit(-1)
# setuptools/zetuptoolz looks in __main__.__requires__ for a list of
try:
# remember shell=False, so use git.cmd on windows, not just git
p = subprocess.Popen(args, stdout=subprocess.PIPE, cwd=cwd)
- except EnvironmentError, e:
+ except EnvironmentError as e:
if verbose:
- print "unable to run %s" % args[0]
- print e
+ print("unable to run %s" % args[0])
+ print(e)
return None
stdout = p.communicate()[0].strip()
if p.returncode != 0:
if verbose:
- print "unable to run %s (error)" % args[0]
+ print("unable to run %s (error)" % args[0])
return None
return stdout
return {}
if not stdout.startswith(tag_prefix):
if verbose:
- print "tag '%s' doesn't start with prefix '%s'" % (stdout, tag_prefix)
+ print("tag '%s' doesn't start with prefix '%s'" % (stdout, tag_prefix))
return {}
version = stdout[len(tag_prefix):]
pieces = version.split("-")
elif os.path.isdir(os.path.join(basedir, ".git")):
verstr = self.try_from_git(target)
else:
- print "no version-control data found, leaving _version.py alone"
+ print("no version-control data found, leaving _version.py alone")
return
if verstr:
self.distribution.metadata.version = verstr
"normalized": versions["normalized"],
"full": versions["full"] })
f.close()
- print "git-version: wrote '%s' into '%s'" % (versions["version"], fn)
+ print("git-version: wrote '%s' into '%s'" % (versions["version"], fn))
return versions.get("normalized", None)