0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-24 03:07:54 +01:00
nodejs/tools/getsharedopensslhasquic.py
Jan Osusky af935fc9a9 tools: fix regex strings in Python tools
PR-URL: https://github.com/nodejs/node/pull/46671
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2023-02-21 11:55:22 -08:00

24 lines
420 B
Python

from __future__ import print_function
import os
import re
def get_has_quic(include_path):
if include_path:
openssl_quic_h = os.path.join(
include_path,
'openssl',
'quic.h')
try:
f = open(openssl_quic_h)
except OSError:
return False
regex = r'^#\s*define OPENSSL_INFO_QUIC'
for line in f:
if (re.match(regex, line)):
return True
return False