about summary refs log tree commit diff
diff options
context:
space:
mode:
authorhexcoder- <heiko@hexco.de>2020-05-14 21:13:36 +0200
committerhexcoder- <heiko@hexco.de>2020-05-14 21:13:36 +0200
commit324b44872c4f292594889305886eea0d77208479 (patch)
tree2a790620be2452fd6abd81715592710cc9171cc9
parent94a1d4d3ac423f8f7252ec6a0e52f18ff0f02d08 (diff)
downloadafl++-324b44872c4f292594889305886eea0d77208479.tar.gz
unicornafl: python/module check with faster method
-rwxr-xr-xtest/test.sh2
-rwxr-xr-xunicorn_mode/build_unicorn_support.sh3
2 files changed, 2 insertions, 3 deletions
diff --git a/test/test.sh b/test/test.sh
index bf01cb6e..88bde564 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -886,7 +886,7 @@ test -d ../unicorn_mode/unicornafl && {
       EASY_INSTALL_FOUND=0
       for PYTHON in $PYTHONS ; do
 
-        if $PYTHON -c "help('modules');" 2>/dev/null | grep -q easy_install ; then
+        if $PYTHON -c "help('easy_install');" </dev/null | grep -q module ; then
 
             EASY_INSTALL_FOUND=1
             PY=$PYTHON
diff --git a/unicorn_mode/build_unicorn_support.sh b/unicorn_mode/build_unicorn_support.sh
index a5b2b274..0833a71f 100755
--- a/unicorn_mode/build_unicorn_support.sh
+++ b/unicorn_mode/build_unicorn_support.sh
@@ -112,8 +112,7 @@ PYTHONS="`command -v python3` `command -v python` `command -v python2`"
 EASY_INSTALL_FOUND=0
 for PYTHON in $PYTHONS ; do
 
-  # slow, but should work
-  if $PYTHON -c "help('modules');" 2>/dev/null | grep -q easy_install ; then
+  if $PYTHON -c "help('$EASY_INSTALL');" </dev/null | grep -q module ; then
 
     EASY_INSTALL_FOUND=1
     PYTHONBIN=$PYTHON