Skip to content

Commit d8a5b31

Browse files
author
Snail Mail
committed
BUG: fix python3 str.translate args
1 parent 2fdbb2d commit d8a5b31

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/finance/test_slippage.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,10 @@ def template_to_num(tmpl):
928928
'.' - expected result is 'no action, pass...'
929929
"""
930930
step = 0.5
931-
tmpl = tmpl.translate(None, '+.')
931+
import six
932+
del_chars = '+.'
933+
tmpl = tmpl.translate(None, del_chars) if six.PY2 \
934+
else tmpl.translate(str.maketrans('', '', del_chars))
932935
xi = tmpl.find('x')
933936
if xi != -1:
934937
tmpl = tmpl[:xi]

0 commit comments

Comments
 (0)