mirror of https://github.com/MISP/PyMISP
Print a warning in case python2 is used.
parent
3455567d45
commit
49433cdc3a
|
@ -8,8 +8,10 @@ import datetime
|
||||||
import os
|
import os
|
||||||
import base64
|
import base64
|
||||||
import re
|
import re
|
||||||
|
import warnings
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
warnings.warn("You're using python 2, it is strongly recommended to use python >=3.3")
|
||||||
from urllib.parse import urljoin
|
from urllib.parse import urljoin
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from urlparse import urljoin
|
from urlparse import urljoin
|
||||||
|
@ -29,6 +31,7 @@ from .mispevent import MISPEvent, MISPAttribute, EncodeUpdate
|
||||||
|
|
||||||
# Least dirty way to support python 2 and 3
|
# Least dirty way to support python 2 and 3
|
||||||
try:
|
try:
|
||||||
|
warnings.warn("You're using python 2, it is strongly recommended to use python >=3.3")
|
||||||
basestring
|
basestring
|
||||||
except NameError:
|
except NameError:
|
||||||
basestring = str
|
basestring = str
|
||||||
|
|
|
@ -20,6 +20,7 @@ from .exceptions import PyMISPError, NewEventError, NewAttributeError
|
||||||
|
|
||||||
# Least dirty way to support python 2 and 3
|
# Least dirty way to support python 2 and 3
|
||||||
try:
|
try:
|
||||||
|
warnings.warn("You're using python 2, it is strongly recommended to use python >=3.3")
|
||||||
basestring
|
basestring
|
||||||
except NameError:
|
except NameError:
|
||||||
basestring = str
|
basestring = str
|
||||||
|
|
Loading…
Reference in New Issue