From 878e0360d5820fc7616eb68a87f8b88f15684c44 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sat, 10 Sep 2016 16:15:26 +0200 Subject: Avoid leaving open file descriptor in test --- stdnum/numdb.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'stdnum/numdb.py') 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: -- cgit v1.2.3