tests/extmod/machine_pinbase: Skip if machine.PinBase is not available.
This commit is contained in:
parent
bd6622abe8
commit
c3f519adfe
@ -1,10 +1,16 @@
|
|||||||
try:
|
try:
|
||||||
from umachine import PinBase
|
import umachine as machine
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from machine import PinBase
|
import machine
|
||||||
|
try:
|
||||||
|
machine.PinBase
|
||||||
|
except AttributeError:
|
||||||
|
print("SKIP")
|
||||||
|
import sys
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
|
||||||
class MyPin(PinBase):
|
class MyPin(machine.PinBase):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
print("__init__")
|
print("__init__")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user