diff options
| author | grubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2019-08-20 12:49:09 +0000 |
|---|---|---|
| committer | grubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2019-08-20 12:49:09 +0000 |
| commit | 1028c9fdf678c20fa1899da4b421d2c25c02b166 (patch) | |
| tree | a55ab454f1a7fae069cb78edc187ff2b166361fe /docutils/test | |
| parent | f6495542171cf3c0ce477235f954db9f86eef3e9 (diff) | |
| download | docutils-1028c9fdf678c20fa1899da4b421d2c25c02b166.tar.gz | |
Fix some [ 377 ] ResourceWarning: unclosed file
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8326 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test')
| -rwxr-xr-x | docutils/test/test_parsers/test_rst/test_directives/test_tables.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_tables.py b/docutils/test/test_parsers/test_rst/test_directives/test_tables.py index 0cce57809..ed11b3ab2 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_tables.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_tables.py @@ -48,7 +48,8 @@ if sys.version_info < (3,3,2): def null_bytes(): import csv - csv_data = open(utf_16_csv, 'rb').read() + with open(utf_16_csv, 'rb') as f: + csv_data = f.read() csv_data = unicode(csv_data, 'latin1').splitlines() reader = csv.reader([tables.CSVTable.encode_for_csv(line + '\n') for line in csv_data]) |
