code: Initial micropython support.

Oliver Robson 2022-06-21 09:11:48 +10:00 zatwierdzone przez Andrew Leech
rodzic eb30d317f3
commit ae19d103b3
1 zmienionych plików z 9 dodań i 9 usunięć

Wyświetl plik

@ -201,14 +201,14 @@ class InteractiveConsole(InteractiveInterpreter):
a default message is printed. a default message is printed.
""" """
## MPY: Older versions of mpy don't support setting ps1 & ps2.
ps1 = ">>> "
ps2 = "... "
try: try:
sys.ps1 ps1 = sys.ps1
except AttributeError: ps2 = sys.ps2
sys.ps1 = ">>> " except:
try: pass
sys.ps2
except AttributeError:
sys.ps2 = "... "
cprt = 'Type "help", "copyright", "credits" or "license" for more information.' cprt = 'Type "help", "copyright", "credits" or "license" for more information.'
if banner is None: if banner is None:
self.write("Python %s on %s\n%s\n(%s)\n" % self.write("Python %s on %s\n%s\n(%s)\n" %
@ -220,9 +220,9 @@ class InteractiveConsole(InteractiveInterpreter):
while 1: while 1:
try: try:
if more: if more:
prompt = sys.ps2 prompt = ps2
else: else:
prompt = sys.ps1 prompt = ps1
try: try:
line = self.raw_input(prompt) line = self.raw_input(prompt)
except EOFError: except EOFError: