[totem/gnome-3-30] dbusservice: Fix comparison to None pylint warning



commit cfe0e34aa208640afc9ccc0cbdb4af237191db17
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Nov 14 16:39:11 2018 +0100

    dbusservice: Fix comparison to None pylint warning
    
    Comparison to None should be 'expr is not None' (singleton-comparison)
    
    s/!= None/is not None/

 src/plugins/dbusservice/dbusservice.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/plugins/dbusservice/dbusservice.py b/src/plugins/dbusservice/dbusservice.py
index 61768822..2859a9c9 100644
--- a/src/plugins/dbusservice/dbusservice.py
+++ b/src/plugins/dbusservice/dbusservice.py
@@ -137,15 +137,15 @@ class Root (dbus.service.Object): # pylint: disable=R0904
 
     def __do_notify_current_mrl (self, _, prop): # pylint: disable=W0613
         self.PropertiesChanged ('org.mpris.MediaPlayer2.Player', {
-            'CanPlay': (self.totem.props.current_mrl != None),
-            'CanPause': (self.totem.props.current_mrl != None),
-            'CanSeek': (self.totem.props.current_mrl != None and
+            'CanPlay': (self.totem.props.current_mrl is not None),
+            'CanPause': (self.totem.props.current_mrl is not None),
+            'CanSeek': (self.totem.props.current_mrl is not None and
                         self.totem.props.seekable),
         }, [])
 
     def __do_notify_seekable (self, _, prop): # pylint: disable=W0613
         self.PropertiesChanged ('org.mpris.MediaPlayer2.Player', {
-            'CanSeek': (self.totem.props.current_mrl != None and
+            'CanSeek': (self.totem.props.current_mrl is not None and
                         self.totem.props.seekable),
         }, [])
 
@@ -195,9 +195,9 @@ class Root (dbus.service.Object): # pylint: disable=R0904
                 'Position': dbus.Int64(self.totem.props.current_time * 1000),
                 'CanGoNext': True, # TODO
                 'CanGoPrevious': True, # TODO
-                'CanPlay': (self.totem.props.current_mrl != None),
-                'CanPause': (self.totem.props.current_mrl != None),
-                'CanSeek': (self.totem.props.current_mrl != None and
+                'CanPlay': (self.totem.props.current_mrl is not None),
+                'CanPause': (self.totem.props.current_mrl is not None),
+                'CanSeek': (self.totem.props.current_mrl is not None and
                             self.totem.props.seekable),
                 'CanControl': True,
             }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]