Procházet zdrojové kódy

removed debug message and fixed cleanup problem, gpio.cleanup wants a list but _pins_for_cleanup is a set

digital před 7 roky
rodič
revize
51e87c4099
1 změnil soubory, kde provedl 3 přidání a 2 odebrání
  1. 3 2
      pin/__init__.py

+ 3 - 2
pin/__init__.py

@@ -55,9 +55,10 @@ class GPIOWrapper(object):
 
     def cleanup(self,*args):
         lgpio.debug("cleanup! ({})".format(args))
-        lgpio.debug("_pins_for_cleanup is:"+str(_pins_for_cleanup))
         if self.gpio:
-            self.gpio.cleanup(_pins_for_cleanup)
+            # gpio.cleanup wants a list or tuple, but _pins_for_cleanup is
+            # a set. we have to convert it first.
+            self.gpio.cleanup(list(_pins_for_cleanup))
 
     def load_rpi_gpio(self):
         try: