Skip to content

Commit 5c03e23

Browse files
authored
Handle conflict in namespace 'serial' (#114)
1 parent a74d48f commit 5c03e23

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

PSL/packet_handler.py

+7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
import inspect
66
import serial
77

8+
# Handle namespace conflict between packages 'pyserial' and 'serial'.
9+
try:
10+
serial.Serial
11+
except AttributeError:
12+
e = "import serial failed; PSL requires 'pyserial' but conflicting package 'serial' was found."
13+
raise ImportError(e)
14+
815
import PSL.commands_proto as CP
916

1017

0 commit comments

Comments
 (0)