瀏覽代碼

added atexit handler

digital 7 年之前
父節點
當前提交
7264b5a254
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      pin/__init__.py

+ 1 - 2
pin/__init__.py

@@ -50,8 +50,7 @@ class GPIOWrapper(object):
         lgpio.debug("setting pin numbering to broadcom")
         if self.gpio:
             self.gpio.setmode(self.gpio.BCM)
-        sig_exit = blinker.signal("global-exit")
-        sig_exit.connect(self.cleanup)
+        atexit.register(self.cleanup)
 
     def cleanup(self,*args):
         lgpio.debug("cleanup! ({})".format(args))