File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88import contextlib
99import logging
1010import os
11+ import subprocess
1112import sys
1213from abc import ABC , abstractmethod
1314from enum import IntEnum
@@ -327,11 +328,10 @@ async def reconnect_hub():
327328 case _:
328329 return
329330
330- except SyntaxError as e :
331+ except subprocess . CalledProcessError as e :
331332 print ()
332333 print ("A syntax error occurred while parsing your program:" )
333- print (e )
334- print ()
334+ print (e .stderr .decode ())
335335
336336 except HubPowerButtonPressedError :
337337 # This means the user pressed the button on the hub to re-start the
@@ -416,11 +416,10 @@ def is_pybricks_usb(dev):
416416 if args .stay_connected :
417417 await self .stay_connected_menu (hub , args )
418418
419- except SyntaxError as e :
419+ except subprocess . CalledProcessError as e :
420420 print ()
421421 print ("A syntax error occurred while parsing your program:" )
422- print (e )
423- print ()
422+ print (e .stderr .decode ())
424423 if args .stay_connected :
425424 await self .stay_connected_menu (hub , args )
426425
You can’t perform that action at this time.
0 commit comments