From 03987600713c623eba26074bd7aafa4454fee303 Mon Sep 17 00:00:00 2001 From: Nick Spaargaren Date: Sat, 6 Jan 2024 19:59:49 +0100 Subject: [PATCH] Add LifetimeTimeout exception --- .github/workflows/tests.yml | 16 ---------------- scripts/dnscheck.py | 11 ++++++----- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 36bdf396..9c5fb440 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -43,19 +43,3 @@ jobs: run: | cd scripts python3 tests.py --type regex - dns-check: - name: Checking dns response for domains - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - name: Python setup - - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - name: Install pytest - run: pip install pytest - - name: Check if list includes domains without dns response - run: | - cd scripts - python3 dnscheck.py diff --git a/scripts/dnscheck.py b/scripts/dnscheck.py index 17c8f273..5bf755c1 100644 --- a/scripts/dnscheck.py +++ b/scripts/dnscheck.py @@ -7,11 +7,12 @@ def check_domain(domain): if answer.qname: return True return False - except dns.resolver.NoAnswer: - return False - except dns.resolver.NoNameservers: - return False - except dns.resolver.NXDOMAIN: + except ( + dns.resolver.NoAnswer, + dns.resolver.NXDOMAIN, + dns.resolver.NoNameservers, + dns.resolver.LifetimeTimeout, + ): return False