Skip to content
Snippets Groups Projects
Commit 6ca6f471 authored by Alan De Smet's avatar Alan De Smet
Browse files

Ensure doctest test file is closed

suppresses warning when running doctests
parent 1b188328
Branches
No related tags found
No related merge requests found
......@@ -2,7 +2,6 @@ import os
import fcntl
import logging
class ExclusiveLockFile:
""" Lock a file by name or handle, returning an open file handle
......@@ -187,7 +186,9 @@ def file_matches_filename(file, filename):
>>> os.rmdir(tmpdir)
"""
try:
r = samefile(file, open(filename))
f = open(filename)
r = samefile(file, f)
f.close()
return r
except Exception as e:
return False
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment