Browse Source

found the bug. I overwrote the value.

digital 8 years ago
parent
commit
0e5eaba8b5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      pin/__init__.py

+ 1 - 1
pin/__init__.py

@@ -128,6 +128,7 @@ class GPIOWrapper(object):
 
     def load_rpi_gpio(self):
         try:
+            self.gpio = False
             self.gpio = __import__("RPi.GPIO")
         except ImportError as e:
             lgpio.debug("failed to import RPi.GPIO")
@@ -136,7 +137,6 @@ class GPIOWrapper(object):
             lgpio.debug("unknown error occured", exc_info=e)
             print("137")
         finally:
-            self.gpio = False
             self.OUT = getattr(self.gpio,"OUT",self.OUT)
             self.IN = getattr(self.gpio,"IN",self.IN)
             # self.BCM = getattr(self.gpio,self.BCM)