mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
sb: Add support to search for a suitable version of python.
The command python has been removed from upstream python and python2 and python3 is now used. This patch wraps the commands in a shell script that locates a suitable python to run. Updates #3537
This commit is contained in:
@@ -30,10 +30,13 @@ import os
|
||||
import shutil
|
||||
import stat
|
||||
import string
|
||||
import sys
|
||||
|
||||
import error
|
||||
|
||||
windows_posix = sys.platform == 'msys'
|
||||
windows = os.name == 'nt'
|
||||
|
||||
win_maxpath = 254
|
||||
|
||||
def host(path):
|
||||
@@ -54,13 +57,15 @@ def host(path):
|
||||
return path
|
||||
|
||||
def shell(path):
|
||||
if isinstance(path, bytes):
|
||||
path = path.decode('ascii')
|
||||
if path is not None:
|
||||
if windows:
|
||||
path = path.encode('ascii', 'ignore')
|
||||
if windows or windows_posix:
|
||||
path = path.encode('ascii', 'ignore').decode('ascii')
|
||||
if path.startswith('\\\\?\\'):
|
||||
path = path[4:]
|
||||
if len(path) > 1 and path[1] == ':':
|
||||
path = '/%s%s' % (path[0], path[2:])
|
||||
path = '/%s%s' % (path[0].lower(), path[2:])
|
||||
path = path.replace('\\', '/')
|
||||
while '//' in path:
|
||||
path = path.replace('//', '/')
|
||||
|
Reference in New Issue
Block a user