1
0
Fork 0
mirror of https://github.com/NeoCloud/NeoNetwork synced 2024-11-22 18:00:41 +08:00

roa.py: skip some checks when py < 3.7

This commit is contained in:
JerryXiao 2020-05-12 14:10:15 +08:00
parent 9bd6ef8a5b
commit 65abf97a35
Signed by: Jerry
GPG key ID: 9D9CE43650FF2BAA

View file

@ -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):