Print a warning in case python2 is used.

pull/34/head
Raphaël Vinot 2016-10-19 18:46:47 +02:00
parent 3455567d45
commit 49433cdc3a
2 changed files with 4 additions and 0 deletions

View File

@ -8,8 +8,10 @@ import datetime
import os
import base64
import re
import warnings
try:
warnings.warn("You're using python 2, it is strongly recommended to use python >=3.3")
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
@ -29,6 +31,7 @@ from .mispevent import MISPEvent, MISPAttribute, EncodeUpdate
# Least dirty way to support python 2 and 3
try:
warnings.warn("You're using python 2, it is strongly recommended to use python >=3.3")
basestring
except NameError:
basestring = str

View File

@ -20,6 +20,7 @@ from .exceptions import PyMISPError, NewEventError, NewAttributeError
# Least dirty way to support python 2 and 3
try:
warnings.warn("You're using python 2, it is strongly recommended to use python >=3.3")
basestring
except NameError:
basestring = str