コード例 #1
0
def _patch_dns():
    top = import_patched('dns')
    for pkg in ('dns', 'dns.rdtypes', 'dns.rdtypes.IN', 'dns.rdtypes.ANY'):
        mod = import_patched(pkg)
        for name in mod.__all__:
            setattr(mod, name, import_patched(pkg + '.' + name))
    return top
コード例 #2
0
ファイル: dnspython.py プロジェクト: wwqgtxx/wwqLyParse
def _patch_dns():
    top = import_patched('dns')
    for pkg in ('dns',
                'dns.rdtypes',
                'dns.rdtypes.IN',
                'dns.rdtypes.ANY'):
        mod = import_patched(pkg)
        for name in mod.__all__:
            setattr(mod, name, import_patched(pkg + '.' + name))
    return top
コード例 #3
0
def _patch_dns():
    import platform
    result = platform.architecture()
    orig_arch = platform.architecture

    def arch(*args, **kwargs):
        if not args and not kwargs:
            return result
        return orig_arch(*args, **kwargs)

    platform.architecture = arch
    try:
        top = import_patched('dns')
        for pkg in ('dns', 'dns.rdtypes', 'dns.rdtypes.IN', 'dns.rdtypes.ANY'):
            mod = import_patched(pkg)
            for name in mod.__all__:
                setattr(mod, name, import_patched(pkg + '.' + name))
    finally:
        platform.architecture = orig_arch
    return top
コード例 #4
0
ファイル: dnspython.py プロジェクト: gevent/gevent
def _patch_dns():
    import platform
    result = platform.architecture()
    orig_arch = platform.architecture
    def arch(*args, **kwargs):
        if not args and not kwargs:
            return result
        return orig_arch(*args, **kwargs)
    platform.architecture = arch
    try:
        top = import_patched('dns')
        for pkg in ('dns',
                    'dns.rdtypes',
                    'dns.rdtypes.IN',
                    'dns.rdtypes.ANY'):
            mod = import_patched(pkg)
            for name in mod.__all__:
                setattr(mod, name, import_patched(pkg + '.' + name))
    finally:
        platform.architecture = orig_arch
    return top
コード例 #5
0
ファイル: dnspython.py プロジェクト: froxor/locust_training
def _dns_import_patched(name):
    assert name.startswith('dns')
    import_patched(name)
    return dns