Skip to content

Commit 04c42f2

Browse files
authored
Update serial_scanner.py
1 parent 9dd098e commit 04c42f2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

serial_scanner.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ def ListAvailablePorts():
4040
else:
4141
print '''This method was developed only for linux and windows
4242
the current platform isn't recognised'''
43-
return AvailablePorts
43+
if len(AvailablePorts) == 0:
44+
print("NO port in use")
45+
return 0
46+
else:
47+
return AvailablePorts
4448

4549

4650
# EXAMPLE OF HOW IT WORKS

0 commit comments

Comments
 (0)