python/: fix comparisons to None
authorPaul Brossier <piem@piem.org>
Mon, 16 May 2016 01:24:09 +0000 (03:24 +0200)
committerPaul Brossier <piem@piem.org>
Mon, 16 May 2016 01:24:09 +0000 (03:24 +0200)
python/demos/demo_bpm_extract.py
python/lib/aubio/slicing.py

index 7935f42..ba7fbad 100755 (executable)
@@ -8,7 +8,7 @@ def get_file_bpm(path, params = None):
         path: path to the file
         param: dictionary of parameters
     """
-    if params == None:
+    if params is None:
         params = {}
     try:
         win_s = params['win_s']
index b274ef2..fa9d2e3 100644 (file)
@@ -14,10 +14,10 @@ def slice_source_at_stamps(source_file, timestamps, timestamps_end=None,
 
     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 @@ def slice_source_at_stamps(source_file, timestamps, timestamps_end=None,
     #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)