Skip to content
This repository has been archived by the owner on May 15, 2020. It is now read-only.

Commit

Permalink
Close files properly when looking for markers.
Browse files Browse the repository at this point in the history
This one kept pypy unhappy. As I did not find a fast, reliable and
platform-independent way to look for open files, there is no regression
test for the problem. On the other hand: pypy tests fail (even more)
miserably without this fix.
  • Loading branch information
ulif committed May 19, 2015
1 parent a738afd commit 4231bc5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.rst
Expand Up @@ -22,6 +22,8 @@ Changelog for z3c.testsetup
- Fix keyword parsing of methods: accept methods that accept no
keyword parameters.

- Close files properly when looking for marker strings.


0.8.3 (2010-09-15)
==================
Expand Down
4 changes: 3 additions & 1 deletion src/z3c/testsetup/util.py
Expand Up @@ -99,7 +99,9 @@ def get_marker_from_file(marker, filepath):
:<Tag>: <Value>
"""
return get_marker_from_string(marker, open(filepath, 'r').read())
with open(filepath) as fd:
return get_marker_from_string(marker, fd.read())
return None


def warn(text):
Expand Down

0 comments on commit 4231bc5

Please sign in to comment.