Skip to content

Commit

Permalink
Import pyserial only when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
guberti committed May 19, 2022
1 parent a2ab552 commit fb50053
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/microtvm/arduino/template_project/microtvm_api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
import re

from packaging import version
import serial
import serial.tools.list_ports

from tvm.micro.project_api import server

Expand Down Expand Up @@ -486,6 +484,9 @@ def flash(self, options):
subprocess.run(upload_cmd, check=True)

def open_transport(self, options):
import serial
import serial.tools.list_ports

# Zephyr example doesn't throw an error in this case
if self._serial is not None:
return
Expand Down

0 comments on commit fb50053

Please sign in to comment.