r24747 by jghali - #16662: Fix 'Testing equality to None' warning reported by LGTM <luzpaz>

scribus-commit scribus-commit at lists.scribus.net
Wed Oct 20 19:29:36 UTC 2021


Author: jghali
Date: Wed Oct 20 19:29:36 2021
New Revision: 24747

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24747
Log:
#16662: Fix 'Testing equality to None' warning reported by LGTM <luzpaz>

Modified:
    trunk/Scribus/OSX-package/linktools/MachO.py
    trunk/Scribus/OSX-package/linktools/ingest.py
    trunk/Scribus/OSX-package/linktools/mkappbundle.py
    trunk/Scribus/OSX-package/linktools/mkframework.py
    trunk/Scribus/codegen/fromrelaxng/impldescription.py
    trunk/Scribus/codegen/fromrelaxng/parserng.py
    trunk/Scribus/scribus/plugins/scripter/new_api.py
    trunk/Scribus/scribus/plugins/scripter/python/sceditor/console.py
    trunk/Scribus/scribus/plugins/scripter/python/sceditor/widget.py
    trunk/Scribus/scribus/plugins/scriptplugin/scripts/CalendarWizard.py
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/scripts/CalendarWizard.py

Modified: trunk/Scribus/OSX-package/linktools/MachO.py
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24747&path=/trunk/Scribus/OSX-package/linktools/MachO.py
==============================================================================
--- trunk/Scribus/OSX-package/linktools/MachO.py	(original)
+++ trunk/Scribus/OSX-package/linktools/MachO.py	Wed Oct 20 19:29:36 2021
@@ -7,7 +7,7 @@
 	"find the framework folder for FW name"
 	if path == "" or path == "@executable_path" or path == "/":
 		return None
-	elif name == None:
+	elif name is None:
 		return findFramework(os.path.dirname(path), 
 							 os.path.basename(path))
 	elif os.path.basename(path) == name + ".framework":

Modified: trunk/Scribus/OSX-package/linktools/ingest.py
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24747&path=/trunk/Scribus/OSX-package/linktools/ingest.py
==============================================================================
--- trunk/Scribus/OSX-package/linktools/ingest.py	(original)
+++ trunk/Scribus/OSX-package/linktools/ingest.py	Wed Oct 20 19:29:36 2021
@@ -48,7 +48,7 @@
 		print "Error: unknown option: " + sys.argv[argp]
 		usage()
 		sys.exit(1)
-	elif bundle == None:
+	elif bundle is None:
 		bundle = sys.argv[argp]
 		argp = argp + 1
 	else:
@@ -56,7 +56,7 @@
 		usage()
 		sys.exit(1)
 
-if bundle == None:	
+if bundle is None:	
 	print "Error: no bundle path specified!"
 	usage()
 	sys.exit(1)

Modified: trunk/Scribus/OSX-package/linktools/mkappbundle.py
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24747&path=/trunk/Scribus/OSX-package/linktools/mkappbundle.py
==============================================================================
--- trunk/Scribus/OSX-package/linktools/mkappbundle.py	(original)
+++ trunk/Scribus/OSX-package/linktools/mkappbundle.py	Wed Oct 20 19:29:36 2021
@@ -48,7 +48,7 @@
 		print "Error: unknown option: " + sys.argv[argp]
 		usage()
 		sys.exit(1)
-	elif bundle == None:
+	elif bundle is None:
 		bundle = sys.argv[argp]
 		argp = argp + 1
 	else:
@@ -56,7 +56,7 @@
 		usage()
 		sys.exit(1)
 
-if bundle == None:	
+if bundle is None:	
 	print "Error: no bundle path specified!"
 	usage()
 	sys.exit(1)

Modified: trunk/Scribus/OSX-package/linktools/mkframework.py
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24747&path=/trunk/Scribus/OSX-package/linktools/mkframework.py
==============================================================================
--- trunk/Scribus/OSX-package/linktools/mkframework.py	(original)
+++ trunk/Scribus/OSX-package/linktools/mkframework.py	Wed Oct 20 19:29:36 2021
@@ -53,7 +53,7 @@
 		print "Error: unknown option: " + sys.argv[argp]
 		usage()
 		sys.exit(1)
-	elif bundle == None:
+	elif bundle is None:
 		bundle = sys.argv[argp]
 		argp = argp + 1
 	else:
@@ -61,7 +61,7 @@
 		usage()
 		sys.exit(1)
 
-if bundle == None:	
+if bundle is None:	
 	print "Error: no bundle path specified!"
 	usage()
 	sys.exit(1)

Modified: trunk/Scribus/codegen/fromrelaxng/impldescription.py
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24747&path=/trunk/Scribus/codegen/fromrelaxng/impldescription.py
==============================================================================
--- trunk/Scribus/codegen/fromrelaxng/impldescription.py	(original)
+++ trunk/Scribus/codegen/fromrelaxng/impldescription.py	Wed Oct 20 19:29:36 2021
@@ -54,9 +54,9 @@
     def addIncludes(self, datatypes, refnames):
         #print datatypes, refnames
         for p in self.properties:
-            if p.datatype == None and p.refname in refnames:
+            if p.datatype is None and p.refname in refnames:
                                 p.datatype = refnames[p.refname].datatype
-            if p.datatype == None:
+            if p.datatype is None:
                 print "X>>>", p.name, p.refname, refnames
             
             if p.datatype.find("<") > 0:

Modified: trunk/Scribus/codegen/fromrelaxng/parserng.py
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24747&path=/trunk/Scribus/codegen/fromrelaxng/parserng.py
==============================================================================
--- trunk/Scribus/codegen/fromrelaxng/parserng.py	(original)
+++ trunk/Scribus/codegen/fromrelaxng/parserng.py	Wed Oct 20 19:29:36 2021
@@ -27,7 +27,7 @@
                 self.currentClass = c
             elif self.currentClass != None:
                 newProp = Property(pattern, isOptional, isCollection)
-                if newProp.datatype == None:
+                if newProp.datatype is None:
                     ref = pattern.getchildren()[0]
                     if ref.tag == qn('rng:ref'):
                         newProp.refname = ref.get(an('name'))

Modified: trunk/Scribus/scribus/plugins/scripter/new_api.py
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24747&path=/trunk/Scribus/scribus/plugins/scripter/new_api.py
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/new_api.py	(original)
+++ trunk/Scribus/scribus/plugins/scripter/new_api.py	Wed Oct 20 19:29:36 2021
@@ -8,7 +8,7 @@
 
 
 def is_camelcase(s):
-    return cc_re.match(s) != None
+    return cc_re.match(s) is not None
 
 
 def to_camelcase(s):

Modified: trunk/Scribus/scribus/plugins/scripter/python/sceditor/console.py
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24747&path=/trunk/Scribus/scribus/plugins/scripter/python/sceditor/console.py
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/python/sceditor/console.py	(original)
+++ trunk/Scribus/scribus/plugins/scripter/python/sceditor/console.py	Wed Oct 20 19:29:36 2021
@@ -157,7 +157,7 @@
 
 
     def run(self, source, locals=None):
-        if locals == None:
+        if locals is None:
                 locals = self.locals
         code = compile(source, self.name, "exec")
         try:

Modified: trunk/Scribus/scribus/plugins/scripter/python/sceditor/widget.py
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24747&path=/trunk/Scribus/scribus/plugins/scripter/python/sceditor/widget.py
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/python/sceditor/widget.py	(original)
+++ trunk/Scribus/scribus/plugins/scripter/python/sceditor/widget.py	Wed Oct 20 19:29:36 2021
@@ -58,7 +58,7 @@
     def _get_block(self, line_no=None):
         cursor = self.editview.textCursor()
         row = cursor.blockNumber()
-        if line_no == None:
+        if line_no is None:
             line_no = row
         block = cursor.block()
         while row > line_no:

Modified: trunk/Scribus/scribus/plugins/scriptplugin/scripts/CalendarWizard.py
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24747&path=/trunk/Scribus/scribus/plugins/scriptplugin/scripts/CalendarWizard.py
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/scripts/CalendarWizard.py	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/scripts/CalendarWizard.py	Wed Oct 20 19:29:36 2021
@@ -649,7 +649,7 @@
             cal = ScVerticalEventCalendar(year, months, self.weekVar.get(), draw, self.sepMonthsVar.get(), self.key)
         self.master.withdraw()
         err = cal.createCalendar()
-        if err != None:
+        if err is not None:
             self.master.deiconify()
             self.statusVar.set(err)
         else:

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/scripts/CalendarWizard.py
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24747&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/scripts/CalendarWizard.py
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/scripts/CalendarWizard.py	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/scripts/CalendarWizard.py	Wed Oct 20 19:29:36 2021
@@ -649,7 +649,7 @@
             cal = ScVerticalEventCalendar(year, months, self.weekVar.get(), draw, self.sepMonthsVar.get(), self.key)
         self.master.withdraw()
         err = cal.createCalendar()
-        if err != None:
+        if err is not None:
             self.master.deiconify()
             self.statusVar.set(err)
         else:




More information about the scribus-commit mailing list