[Forensics-changes] [yara] 343/407: Update yarapython.rst
Hilko Bengen
bengen at moszumanska.debian.org
Sat Jul 1 10:28:43 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 032c39480276ee52c620b9c0c714846952922ce9
Author: R.H. <SleuthKid at mailbox.org>
Date: Wed Jan 21 13:18:10 2015 +0100
Update yarapython.rst
There is no fopen() in python. The suggested method is more pythonic.
---
docs/yarapython.rst | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/docs/yarapython.rst b/docs/yarapython.rst
index 279530e..e3075ec 100644
--- a/docs/yarapython.rst
+++ b/docs/yarapython.rst
@@ -123,9 +123,8 @@ But you can also apply the rules to a Python string:
.. code-block:: python
- f = fopen('/foo/bar/my_file', 'rb')
-
- matches = rules.match(data=f.read())
+ with open('/foo/bar/my_file', 'rb') as f:
+ matches = rules.match(data=f.read())
Or to a running process:
--
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