Teach pylint how dnspython 2.x works

pylint does not understand pylint's
globals().update(RdataType.__members__) trick.

Fixes: https://pagure.io/freeipa/issue/8419
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Christian Heimes 2020-07-18 13:12:58 +02:00
parent 28caa22a8e
commit eff65495f3

View File

@ -545,3 +545,26 @@ AstroidBuilder(MANAGER).string_build(textwrap.dedent(
api.env.webui_prod = True
"""
))
# dnspython 2.x introduces enums and creates module level globals from them
# pylint does not understand the trick
AstroidBuilder(MANAGER).string_build(textwrap.dedent(
"""
import dns.flags
import dns.rdataclass
import dns.rdatatype
dns.flags.CD = 0
dns.flags.DO = 0
dns.flags.RD = 0
dns.rdataclass.IN = 0
dns.rdatatype.NS = 0
dns.rdatatype.MX = 0
dns.rdatatype.RRSIG = 0
dns.rdatatype.SOA = 0
dns.rdatatype.SRV = 0
dns.rdatatype.TXT = 0
"""
))