mirror of
https://github.com/thearn/Python-Arduino-Command-API.git
synced 2026-04-24 03:00:20 -04:00
Fixed to run on py3.7 (str.encode major issue)
This commit is contained in:
@@ -14,12 +14,18 @@ should at least be maintained here.
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
|
||||
# Bind raw_input to input in python 2.7
|
||||
try:
|
||||
input = raw_input
|
||||
except NameError:
|
||||
pass
|
||||
|
||||
|
||||
class TestBasics(unittest.TestCase):
|
||||
|
||||
def test_find(self):
|
||||
""" Tests auto-connection/board detection. """
|
||||
raw_input(
|
||||
input(
|
||||
'Plug in Arduino board w/LED at pin 13, reset, then press enter')
|
||||
from Arduino import Arduino
|
||||
board = None
|
||||
@@ -34,11 +40,11 @@ class TestBasics(unittest.TestCase):
|
||||
""" Tests connecting to an explicit port. """
|
||||
port = None
|
||||
while not port:
|
||||
port = raw_input(
|
||||
port = input(
|
||||
'Plug in Arduino board w/LED at pin 13, reset.\n'\
|
||||
'Enter the port where the Arduino is connected, then press enter:')
|
||||
if not port:
|
||||
print 'You must enter a port.'
|
||||
print('You must enter a port.')
|
||||
from Arduino import Arduino
|
||||
board = None
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user