usb15: abort if permission denied
Don't ignore permission denied when looking for a suitable USB device. Otherwise users don't notice what the problem is, stcgal will just keep waiting on the prompt.
This commit is contained in:
parent
f90fe4152b
commit
26ef34991b
@ -21,7 +21,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import serial
|
import serial
|
||||||
import sys, os, time, struct, re
|
import sys, os, time, struct, re, errno
|
||||||
import argparse
|
import argparse
|
||||||
import collections
|
import collections
|
||||||
from stcgal.models import MCUModelDatabase
|
from stcgal.models import MCUModelDatabase
|
||||||
@ -1528,7 +1528,11 @@ class StcUsb15Protocol(Stc15Protocol):
|
|||||||
self.status_packet = None
|
self.status_packet = None
|
||||||
raise StcFramingException
|
raise StcFramingException
|
||||||
else: raise StcFramingException
|
else: raise StcFramingException
|
||||||
except (StcFramingException, usb.core.USBError): time.sleep(0.5)
|
except StcFramingException:
|
||||||
|
time.sleep(0.5)
|
||||||
|
except usb.core.USBError as err:
|
||||||
|
if err.errno == errno.EACCES:
|
||||||
|
raise IOError(err.strerror)
|
||||||
|
|
||||||
self.initialize_model()
|
self.initialize_model()
|
||||||
print("done")
|
print("done")
|
||||||
|
Loading…
Reference in New Issue
Block a user