File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -189,16 +189,20 @@ def get_proc_dt_model():
189189def get_vcgencmd_throttled_state (command ):
190190 if __LOCAL_DEBUG :
191191 if _VCGENCMD_BROKEN :
192- output = "VCHI initialization failed"
192+ output = ""
193+ error = "VCHI initialization failed"
193194 else :
194195 output = "throttled={}" .format (
195196 next (_VCGENCMD_OUTPUT )
196197 ) # mock for local debugging
198+ error = ""
197199 else :
198- output = sarge .get_both (command , close_fds = CLOSE_FDS )
200+ output , error = sarge .get_both (command , close_fds = CLOSE_FDS )
199201
200202 if "throttled=0x" not in output :
201- raise ValueError ('Cannot parse "{}" output: {}' .format (command , output ))
203+ raise ValueError (
204+ 'Cannot parse "{}" output: {}' .format (command , error if error else output )
205+ )
202206
203207 value = output [len ("throttled=" ) :].strip (" \t \r \n \0 " )
204208 value = int (value , 0 )
You can’t perform that action at this time.
0 commit comments