python: Provide support to select a valid python version.

- Update imports after wrapping the code.
- Fix python3 issues.
- Fix config path issues for in repo and install runs.

Closes #3537
This commit is contained in:
Chris Johns
2018-11-07 14:55:20 +11:00
parent 087be8c67f
commit e058db0281
21 changed files with 316 additions and 123 deletions

View File

@@ -41,13 +41,13 @@ import time
from rtemstoolkit import path
from . import telnet
import telnet
#
# Not available on Windows. Not sure what this means.
#
if os.name != 'nt':
from . import stty
import stty
else:
stty = None
@@ -107,6 +107,9 @@ class tty(console):
time.sleep(0.05)
try:
data = me.tty.read()
if isinstance(data, bytes):
data = data.decode('utf-8', 'ignore')
data = [c for c in data if ord(c) < 128]
except IOError as ioe:
if ioe.errno == errno.EAGAIN:
continue