mirror of
https://github.com/release-engineering/dist-git.git
synced 2025-02-23 15:02:54 +00:00
tests: override shebang to python2
This commit is contained in:
parent
982fe628f6
commit
2a79155be6
1 changed files with 6 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
from __future__ import print_function
|
||||
|
||||
import sys
|
||||
import errno
|
||||
import os
|
||||
try:
|
||||
|
@ -18,6 +19,8 @@ import random
|
|||
from configparser import ConfigParser
|
||||
from parameterized import parameterized
|
||||
|
||||
PY2 = sys.version_info.major == 2
|
||||
|
||||
# Path to the actual CGI script that should be tested
|
||||
CGI_SCRIPT = os.path.join(os.path.dirname(__file__), '../src/web/upload.cgi')
|
||||
|
||||
|
@ -257,6 +260,9 @@ def _copy_tweak(source_file, dest_file, topdir):
|
|||
with open(source_file) as source:
|
||||
with open(dest_file, 'w') as dest:
|
||||
for line in source:
|
||||
if PY2 and line == "#!/usr/bin/python3\n":
|
||||
line = line.replace("python3", "python2")
|
||||
|
||||
m = regex.match(line)
|
||||
if m:
|
||||
line = "%s = '%s%s'\n" % (m.group(1), topdir, m.group(2))
|
||||
|
|
Loading…
Add table
Reference in a new issue