diff options
| author | John Turner <jturner.usa@gmail.com> | 2025-11-17 20:02:16 +0000 |
|---|---|---|
| committer | John Turner <jturner.usa@gmail.com> | 2025-11-17 20:02:16 +0000 |
| commit | b74471706b8394d6b57bc657a9bab04e171af643 (patch) | |
| tree | 40b1e6a1a104e61b65e9eef61845f78ffcc9114b /scripts/atom.py | |
| parent | 0cc3ac8e8478ecbf829cf8dbfe7dcd5d2c40da42 (diff) | |
| download | gentoo-utils-b74471706b8394d6b57bc657a9bab04e171af643.tar.gz | |
communicate with python over a pipe to increase fuzzing performance
Diffstat (limited to 'scripts/atom.py')
| -rwxr-xr-x | scripts/atom.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/scripts/atom.py b/scripts/atom.py index a1a59bd..2e8ca7f 100755 --- a/scripts/atom.py +++ b/scripts/atom.py @@ -1,13 +1,13 @@ #!/usr/bin/env python3 import sys -import portage.dep as dep - -input = sys.stdin.read().strip() - -try: - dep.Atom(input) -except Exception as e: - sys.exit(1) - -sys.exit(0) +from portage.dep import Atom + +for line in sys.stdin.buffer: + try: + Atom(line.decode().strip()) + sys.stdout.buffer.write(b"0\n") + except: + sys.stdout.buffer.write(b"1\n") + finally: + sys.stdout.buffer.flush() |
