Skip to content

Commit a61365c

Browse files
authored
Merge pull request #908 from Conengmo/python-2-deprecation
Warn for pending deprecation of Python 2.7
2 parents f4daaf5 + 055180f commit a61365c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

folium/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
from __future__ import (absolute_import, division, print_function)
44

5+
import sys
6+
import warnings
7+
58
from branca.colormap import (ColorMap, LinearColormap, StepColormap)
69
from branca.element import (CssLink, Div, Element, Figure, Html, IFrame,
710
JavascriptLink, Link, MacroElement)
@@ -29,6 +32,14 @@
2932
raise ImportError('branca version 0.3.0 or higher is required. '
3033
'Update branca with e.g. `pip install branca --upgrade`.')
3134

35+
if sys.version_info < (3, 0):
36+
warnings.warn(
37+
("folium will stop working with Python 2.7 starting Jan. 1, 2019."
38+
" Please transition to Python 3 before this time."
39+
" Check out https://python3statement.org/ for more info."),
40+
PendingDeprecationWarning
41+
)
42+
3243
__version__ = get_versions()['version']
3344
del get_versions
3445

0 commit comments

Comments
 (0)