The dns.query Python module has the send_tcp() method defined in both
dnspython 1.x and 2.x, so checking for the existence of that method to
determine the dnspython version available in the test environment does
not make any sense. Fix by checking the dns.version.MAJOR integer
instead.
if test -n "$PYTHON"
then
- if $PYTHON -c "from dns.query import send_tcp" 2> /dev/null
+ if [ "$($PYTHON -c "import dns.version; print(dns.version.MAJOR)" 2> /dev/null)" -ge 2 ]
then
:
else
if test -n "$PYTHON"
then
- if $PYTHON -c "from dns.query import send_tcp" 2> /dev/null
+ if [ "$($PYTHON -c "import dns.version; print(dns.version.MAJOR)" 2> /dev/null)" -ge 2 ]
then
:
else