History

tests/: continue python3 preparation

Paul Brossier committed 10 years ago

Commit 376d5e91 parent 6db76005 files · +17 −15Browse files

Showing the changes to python/tests/utils.py (1 of 5 files). Show all

Unified · Split

python/tests/utils.py+4−2
@@ -4,8 +4,10 @@ def array_from_text_file(filename, dtype = 'float'): · 3 unmodified lines
44 import os.path
55 from numpy import array
66 filename = os.path.join(os.path.dirname(__file__), filename)
7− return array([line.split() for line in open(filename).readlines()],
8− dtype = dtype)
7+ with open(filename) as f:
8+ lines = f.readlines()
9+ return array([line.split() for line in lines],
10+ dtype = dtype)
911
1012 def list_all_sounds(rel_dir):
1113 import os.path, glob

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