]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Use os.getenv() instead of os.environ
authorMichal Nowak <mnowak@isc.org>
Thu, 5 Dec 2024 09:37:19 +0000 (10:37 +0100)
committerMichal Nowak <mnowak@isc.org>
Thu, 5 Dec 2024 18:22:05 +0000 (18:22 +0000)
If ECDSAP256SHA256_SUPPORTED or ECDSAP384SHA384_SUPPORTED variables were
not present in the environment, os.environ would raise KeyError that is
not being handled in the decorator. Use os.getenv() instead.

bin/tests/system/ecdsa/tests_ecdsa.py

index 34b55d7ba1015550e783ca1618658629b4c9f54b..1329fa710ed7e69dec03594764e2e546d3bebcb8 100644 (file)
@@ -38,7 +38,7 @@ def check_server_soa(resolver):
 
 
 @pytest.mark.skipif(
-    not os.environ["ECDSAP256SHA256_SUPPORTED"],
+    not os.getenv("ECDSAP256SHA256_SUPPORTED"),
     reason="algorithm ECDSA256 not supported",
 )
 def test_ecdsa256():
@@ -46,7 +46,7 @@ def test_ecdsa256():
 
 
 @pytest.mark.skipif(
-    not os.environ["ECDSAP384SHA384_SUPPORTED"],
+    not os.getenv("ECDSAP384SHA384_SUPPORTED"),
     reason="algorithm ECDSA384 not supported",
 )
 def test_ecdsa384():