Support Python2 ipaddr library.
This commit is contained in:
parent
ac8d987392
commit
68be70af24
@ -14,7 +14,10 @@ from string import ascii_letters, digits
|
|||||||
from werkzeug.wrappers import Request
|
from werkzeug.wrappers import Request
|
||||||
from werkzeug.exceptions import BadRequest
|
from werkzeug.exceptions import BadRequest
|
||||||
|
|
||||||
|
try:
|
||||||
import ipaddress
|
import ipaddress
|
||||||
|
except ImportError:
|
||||||
|
import ipaddr as ipaddress
|
||||||
|
|
||||||
|
|
||||||
def anonymize(remote_addr):
|
def anonymize(remote_addr):
|
||||||
|
Loading…
Reference in New Issue
Block a user