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
88 path: path to the file
99 param: dictionary of parameters
1010 """
11− if params == None:
11+ if params is None:
1212 params = {}
1313 try:
1414 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
1414
1515 if timestamps[0] != 0:
1616 timestamps = [0] + timestamps
17− if timestamps_end != None:
17+ if timestamps_end is not None:
1818 timestamps_end = [timestamps[1] - 1] + timestamps_end
1919
20− if timestamps_end != None:
20+ if timestamps_end is not None:
2121 if len(timestamps_end) != len(timestamps):
2222 raise ValueError("len(timestamps_end) != len(timestamps)")
2323 else:
@@ -27,7 +27,7 @@ def slice_source_at_stamps(source_file, timestamps, timestamps_end=None, · 3 unmodified lines
2727 #print regions
2828
2929 source_base_name, _ = os.path.splitext(os.path.basename(source_file))
30− if output_dir != None:
30+ if output_dir is not None:
3131 if not os.path.isdir(output_dir):
3232 os.makedirs(output_dir)
3333 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