1
0
forked from VimPlug/jedi

Fix resource warnings

This commit is contained in:
micbou
2019-02-28 15:40:24 +01:00
committed by Dave Halter
parent 81e7dcf31e
commit 744662d096
3 changed files with 78 additions and 17 deletions

View File

@@ -357,9 +357,11 @@ def collect_dir_tests(base_dir, test_files, check_thirdparty=False):
path = os.path.join(base_dir, f_name)
if is_py3:
source = open(path, encoding='utf-8').read()
with open(path, encoding='utf-8') as f:
source = f.read()
else:
source = unicode(open(path).read(), 'UTF-8')
with open(path) as f:
source = unicode(f.read(), 'UTF-8')
for case in collect_file_tests(path, StringIO(source),
lines_to_execute):