File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import os
21import queue
32import warnings
43from collections import OrderedDict
@@ -214,16 +213,10 @@ def model_id(self):
214213 return None
215214
216215 def read_attr (self , attribute ):
217- """read uncached attribute value from sysfs
218-
219- pyudev currently supports only cached access to attributes, so we read
220- directly from sysfs.
221- """
222- # FIXME update pyudev to support udev_device_set_sysattr_value(dev,
223- # attr, None) to clear the cache
216+ """read uncached attribute value"""
224217 if self .device is not None :
225- with open ( os . path . join ( self .device .sys_path , attribute ), 'rb' ) as f :
226- return f . read (). rstrip ( b' \n ' ) # drop trailing newlines
218+ self .device .attributes . unset ( attribute )
219+ return self . device . attributes . get ( attribute )
227220
228221 return None
229222
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ dependencies = [
4242 " pexpect>=4.8.0" ,
4343 " pyserial-labgrid>=3.4.0.1" ,
4444 " pytest>=7.0.0" ,
45- " pyudev>=0.22.0 " ,
45+ " pyudev>=0.24.4 " ,
4646 " pyusb>=1.2.1" ,
4747 " PyYAML>=6.0.1" ,
4848 " requests>=2.26.0" ,
You can’t perform that action at this time.
0 commit comments