diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2016-09-10 16:15:26 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2016-09-10 16:27:49 +0200 |
commit | 878e0360d5820fc7616eb68a87f8b88f15684c44 (patch) | |
tree | 7eecfcf67fd53705e6f5dfec6edf167e1d726071 /stdnum/numdb.py | |
parent | be24790818d1c8c32a055613c22fd98556455800 (diff) |
Avoid leaving open file descriptor in test
Diffstat (limited to 'stdnum/numdb.py')
-rw-r--r-- | stdnum/numdb.py | 3 |
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: |