For 2.0.0, I found dns.version.version. Great, awesome.
But for 1.x, is there a way other than catching an exception?
Newer machine:
FifthMacMini ~ % python3
Python 3.8.5 (default, Jul 21 2020, 10:48:26)
[Clang 11.0.3 (clang-1103.0.32.62)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import dns
>>> dns.version.version
'2.0.0'
Older machine:
FourthMacMini:~$ python3
Python 3.7.0 (default, Sep 18 2018, 18:47:29)
[Clang 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import dns
>>> dns.version.version
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'dns' has no attribute 'version'
Use case : Need (ok, want) to determine whether I can send in domain name into the AXFR calling code or need to use resolve to convert to IP addresses. The former accidentally worked in version 1, , the resolve is introduced in version 2.