[Forensics-changes] [yara] 389/407: yara-python/tests.py: Add missing f.close() to avoid warning

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:28:48 UTC 2017


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag v3.3.0
in repository yara.

commit 3474bd71629166d60579b67d40e920cd79837bb3
Author: Hilko Bengen <bengen at debian.org>
Date:   Fri Jan 30 21:07:44 2015 +0100

    yara-python/tests.py: Add missing f.close() to avoid warning
    
    With Python 3.4, I got:
    
        ResourceWarning: unclosed file <_io.TextIOWrapper name=4 mode='wt' encoding='UTF-8'>
---
 yara-python/tests.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/yara-python/tests.py b/yara-python/tests.py
index 2add5e2..91859b6 100644
--- a/yara-python/tests.py
+++ b/yara-python/tests.py
@@ -641,6 +641,7 @@ class TestYara(unittest.TestCase):
         f.seek(0)
 
         r = yara.compile(file=f)
+        f.close()
         self.assertTrue(r.match(data=PE32_FILE))
 
     def testCompileFiles(self):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git



More information about the forensics-changes mailing list