File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -38,22 +38,22 @@ def run(self):
3838 # Shutdown can be initated from GPIO26
3939 poller = select .poll ()
4040 try :
41- with open ('/sys/class/gpio/export' , 'wb ' ) as f :
41+ with open ('/sys/class/gpio/export' , 'w ' ) as f :
4242 f .write ('%d' % self .gpio )
4343 except Exception :
4444 # Usually it means we ran this before
4545 pass
4646 try :
47- with open ('/sys/class/gpio/gpio%d/direction' % self .gpio , 'wb ' ) as f :
47+ with open ('/sys/class/gpio/gpio%d/direction' % self .gpio , 'w ' ) as f :
4848 f .write ('in' )
4949 except Exception :
5050 logging .warn ('Either no GPIO subsystem or no access' )
5151 return
52- with open ('/sys/class/gpio/gpio%d/edge' % self .gpio , 'wb ' ) as f :
52+ with open ('/sys/class/gpio/gpio%d/edge' % self .gpio , 'w ' ) as f :
5353 f .write ('both' )
54- with open ('/sys/class/gpio/gpio%d/active_low' % self .gpio , 'wb ' ) as f :
54+ with open ('/sys/class/gpio/gpio%d/active_low' % self .gpio , 'w ' ) as f :
5555 f .write ('1' )
56- with open ('/sys/class/gpio/gpio%d/value' % self .gpio , 'rb ' ) as f :
56+ with open ('/sys/class/gpio/gpio%d/value' % self .gpio , 'r ' ) as f :
5757 f .read ()
5858 poller .register (f , select .POLLPRI )
5959 poller .register (self .server , select .POLLHUP )
You can’t perform that action at this time.
0 commit comments