File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# -*- coding: utf-8 -*-
2+ import warnings
23
34import six
45
56
6- def encode_if_unicode (value , encoding = 'utf-8' ):
7+ def encode_if_unicode (value , encoding = 'utf-8' ): # pragma: no cover
78 """
89 Encode and return a ``value`` using specified ``encoding``.
910
1011 Encoding is done only if ``value`` is a ``unicode`` instance
1112 (utf-8 encoding is used as default).
13+
14+ .. deprecated:: 5.0.0
15+
16+ Use :func:`laterpay.compat.stringify` instead.
1217 """
18+ warnings .warn (
19+ 'laterpay.compat.encode_if_unicode is deprecated and will be removed '
20+ 'in future versions. Use laterpay.compat.stringify instead' ,
21+ DeprecationWarning
22+ )
23+
1324 if six .PY2 and isinstance (value , six .text_type ):
1425 value = value .encode (encoding )
1526 return value
Original file line number Diff line number Diff line change @@ -6,8 +6,6 @@ show_missing = True
66
77[coverage:run]
88branch = True
9- omit =
10- laterpay/compat.py
119source = laterpay
1210
1311[flake8]
You can’t perform that action at this time.
0 commit comments