Skip to content

Commit b0a3d2e

Browse files
committed
build: fix for python 3.7
1 parent 44ef518 commit b0a3d2e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

jinja2_humanize_extension/__init__.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
from jinja2.ext import Extension
23
from humanize import naturalsize
34

@@ -177,7 +178,13 @@ def __init__(self, environment):
177178
environment.filters["humanize_metric"] = humanize_metric
178179
environment.filters["humanize_activate"] = humanize_activate
179180
environment.filters["humanize_deactivate"] = humanize_deactivate
180-
environment.filters["humanize_thousands_separator"] = (
181-
humanize_thousands_separator
182-
)
183181
environment.filters["humanize_decimal_separator"] = humanize_decimal_separator
182+
environment.filters["humanize_thousands_separator"] = humanize_thousands_separator
183+
if (sys.version_info.minor) > 7:
184+
environment.filters["humanize_thousands_separator"] = (
185+
humanize_thousands_separator
186+
)
187+
else:
188+
environment.filters[
189+
"humanize_thousands_separator"
190+
] = humanize_thousands_separator

0 commit comments

Comments
 (0)