shithub: aubio

Download patch

ref: dc654f8f8ca6675edf071f77ce1f934c6ad97e6b
parent: 4120fbc9a4fe29d1d7c2e25be6212014dd790086
author: Paul Brossier <piem@piem.org>
date: Sun May 15 23:24:09 EDT 2016

python/: fix comparisons to None

--- a/python/demos/demo_bpm_extract.py
+++ b/python/demos/demo_bpm_extract.py
@@ -8,7 +8,7 @@
         path: path to the file
         param: dictionary of parameters
     """
-    if params == None:
+    if params is None:
         params = {}
     try:
         win_s = params['win_s']
--- a/python/lib/aubio/slicing.py
+++ b/python/lib/aubio/slicing.py
@@ -14,10 +14,10 @@
 
     if timestamps[0] != 0:
         timestamps = [0] + timestamps
-        if timestamps_end != None:
+        if timestamps_end is not None:
             timestamps_end = [timestamps[1] - 1] + timestamps_end
 
-    if timestamps_end != None:
+    if timestamps_end is not None:
         if len(timestamps_end) != len(timestamps):
             raise ValueError("len(timestamps_end) != len(timestamps)")
     else:
@@ -27,7 +27,7 @@
     #print regions
 
     source_base_name, _ = os.path.splitext(os.path.basename(source_file))
-    if output_dir != None:
+    if output_dir is not None:
         if not os.path.isdir(output_dir):
             os.makedirs(output_dir)
         source_base_name = os.path.join(output_dir, source_base_name)