]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - bin/tahoe-script.template
Merge pull request #236 from daira/2725.timezone-test.0
[tahoe-lafs/tahoe-lafs.git] / bin / tahoe-script.template
index abcdaa0129f565bce8255036961da255f1080876..b088eaf6a32f736a232be60f9c420d4628d368dc 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/false # You must specify a python interpreter.
-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; assert sys.version_info < (3,), ur"Tahoe-LAFS does not run under Python 3. Please use a version of Python between 2.6 and 2.7.x inclusive."
 
-import sys, os, subprocess
+import os, subprocess
 
 where = os.path.realpath(sys.argv[0])
 base = os.path.dirname(os.path.dirname(where))
@@ -63,7 +63,7 @@ if sys.platform == "win32":
     # Note that this doesn't escape \x7F. If it did, test_unicode_arguments_and_output
     # in test_runner.py wouldn't work.
     def mangle(s):
-        return str(re.sub(ur'[^\x20-\x7F]', lambda m: u'\x7F%x;' % (ord(m.group(0)),), s))
+        return str(re.sub(u'[^\\x20-\\x7F]', lambda m: u'\x7F%x;' % (ord(m.group(0)),), s))
 
     argv = [mangle(argv_unicode[i]) for i in xrange(0, argc.value)]
 
@@ -94,6 +94,8 @@ if len(args) >= 1 and args[0].startswith('@'):
         prefix = [sys.executable]
     else:
         prefix = []
+        if runner == "python":
+            runner = sys.executable
 
     def _subst(a):
         if a == '@tahoe': return script