History

python/: fix comparisons to None

Paul Brossier committed 10 years ago

Commit dc654f81 parent 4120fbc2 files · +4 −4Browse files

Showing the changes to python (2 of 2 files). Show all

Unified · Split

2 files
  1. python/demos/demo_bpm_extract.py +1 −1
  2. python/lib/aubio/slicing.py +3 −3
python/demos/demo_bpm_extract.py+1−1
@@ -8,7 +8,7 @@ def get_file_bpm(path, params = None): · 7 unmodified lines
8 path: path to the file8 path: path to the file
9 param: dictionary of parameters9 param: dictionary of parameters
10 """10 """
11 if params == None:11 if params is None:
12 params = {}12 params = {}
13 try:13 try:
14 win_s = params['win_s']14 win_s = params['win_s']
python/lib/aubio/slicing.py+3−3
@@ -14,10 +14,10 @@ def slice_source_at_stamps(source_file, timestamps, timestamps_end=None, · 13 unmodified lines
14 14
15 if timestamps[0] != 0:15 if timestamps[0] != 0:
16 timestamps = [0] + timestamps16 timestamps = [0] + timestamps
17 if timestamps_end != None:17 if timestamps_end is not None:
18 timestamps_end = [timestamps[1] - 1] + timestamps_end18 timestamps_end = [timestamps[1] - 1] + timestamps_end
19 19
20 if timestamps_end != None:20 if timestamps_end is not None:
21 if len(timestamps_end) != len(timestamps):21 if len(timestamps_end) != len(timestamps):
22 raise ValueError("len(timestamps_end) != len(timestamps)")22 raise ValueError("len(timestamps_end) != len(timestamps)")
23 else:23 else:
@@ -27,7 +27,7 @@ def slice_source_at_stamps(source_file, timestamps, timestamps_end=None, · 3 unmodified lines
27 #print regions27 #print regions
28 28
29 source_base_name, _ = os.path.splitext(os.path.basename(source_file))29 source_base_name, _ = os.path.splitext(os.path.basename(source_file))
30 if output_dir != None:30 if output_dir is not None:
31 if not os.path.isdir(output_dir):31 if not os.path.isdir(output_dir):
32 os.makedirs(output_dir)32 os.makedirs(output_dir)
33 source_base_name = os.path.join(output_dir, source_base_name)33 source_base_name = os.path.join(output_dir, source_base_name)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t