Logger.warn is deprecated in Python 3.4
authorHelmut Grohne <helmut@subdivi.de>
Sat, 7 May 2016 19:18:43 +0000 (21:18 +0200)
committerHelmut Grohne <helmut@subdivi.de>
Sat, 7 May 2016 19:18:43 +0000 (21:18 +0200)
onoff/common.py

index 4a1fe8c..df32990 100644 (file)
@@ -113,8 +113,8 @@ class ThrottledDevice(OnoffDevice):
             OnoffDevice.changestate(self, state)
         else:
             if self.desired_state == 0:
-                logger.warn("device became active but we want inactive," +
-                            "suppresing signal")
+                logger.warning("device became active but we want inactive," +
+                               "suppresing signal")
             elif self.transition is None:
                 logger.debug("scheduling report of activation in %.1fs",
                              self.ondelay)
@@ -138,8 +138,8 @@ class ThrottledDevice(OnoffDevice):
                 self.desired_state = ST_ACTIVE
                 OnoffDevice.changestate(self, ST_ACTIVE)
                 return
-            logger.warn("device should be active during delayed deactivation" +
-                        ", but is in state %d", curstate)
+            logger.warning("device should be active during delayed " +
+                           "deactivation, but is in state %d", curstate)
         self.desired_state = ST_ACTIVE
         self.device.activate()
         self.changestate(self.device.state)