biome: 1.9.2 -> 1.9.3 (#349335)
[NixPkgs.git] / pkgs / development / python-modules / pysaml2 / hardcode-xmlsec1-path.patch
blobba932803275d17d268154c019e8afab63b3176da
1 diff --git a/src/saml2/sigver.py b/src/saml2/sigver.py
2 index 59fe2dee..0c24fbcc 100644
3 --- a/src/saml2/sigver.py
4 +++ b/src/saml2/sigver.py
5 @@ -165,33 +165,7 @@ def get_xmlsec_binary(paths=None):
6 :return: full name of the xmlsec1 binary found. If no binaries are
7 found then an exception is raised.
8 """
9 - if os.name == "posix":
10 - bin_name = ["xmlsec1"]
11 - elif os.name == "nt":
12 - bin_name = ["xmlsec.exe", "xmlsec1.exe"]
13 - else: # Default !?
14 - bin_name = ["xmlsec1"]
16 - if paths:
17 - for bname in bin_name:
18 - for path in paths:
19 - fil = os.path.join(path, bname)
20 - try:
21 - if os.lstat(fil):
22 - return fil
23 - except OSError:
24 - pass
26 - for path in os.environ["PATH"].split(os.pathsep):
27 - for bname in bin_name:
28 - fil = os.path.join(path, bname)
29 - try:
30 - if os.lstat(fil):
31 - return fil
32 - except OSError:
33 - pass
35 - raise SigverError(f"Cannot find {bin_name}")
36 + return '@xmlsec@/bin/xmlsec1'
39 def _get_xmlsec_cryptobackend(path=None, search_paths=None):