From 65abf97a35dcbb99a58c95ab19d7ca6aad68af92 Mon Sep 17 00:00:00 2001 From: Jerry Date: Tue, 12 May 2020 14:10:15 +0800 Subject: [PATCH] roa.py: skip some checks when py < 3.7 --- scripts/roa.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/roa.py b/scripts/roa.py index 454c287..0eb5b55 100755 --- a/scripts/roa.py +++ b/scripts/roa.py @@ -9,6 +9,9 @@ import re NEONET_ADDR_POOL = ('10.127.0.0/16', 'fd10:127::/32') NEONET_ADDR_POOL = [ip_network(neo) for neo in NEONET_ADDR_POOL] IS_NEONET = lambda net: bool([True for neo in NEONET_ADDR_POOL if net.version == neo.version and net.subnet_of(neo)]) +if not hasattr(IPv4Network, 'subnet_of'): + IS_NEONET = lambda x: True + print('# [!] IPv4Network has no attr subnet_of, please consider upgrading your python installation') class BashParser: def __init__(self):