Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/stdnum/numdb.py
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2016-09-10 16:15:26 +0200
committerArthur de Jong <arthur@arthurdejong.org>2016-09-10 16:27:49 +0200
commit878e0360d5820fc7616eb68a87f8b88f15684c44 (patch)
tree7eecfcf67fd53705e6f5dfec6edf167e1d726071 /stdnum/numdb.py
parentbe24790818d1c8c32a055613c22fd98556455800 (diff)
Avoid leaving open file descriptor in test
Diffstat (limited to 'stdnum/numdb.py')
-rw-r--r--stdnum/numdb.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/stdnum/numdb.py b/stdnum/numdb.py
index c8cbc3c..ea3c3b9 100644
--- a/stdnum/numdb.py
+++ b/stdnum/numdb.py
@@ -25,7 +25,8 @@ numbers, etc).
To read a database from a file:
->>> dbfile = read(open('tests/numdb-test.dat', 'r'))
+>>> with open('tests/numdb-test.dat', 'r') as f:
+... dbfile = read(f)
To split a number: