diff options
Diffstat (limited to 'logilab/common/compat.py')
-rw-r--r-- | logilab/common/compat.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/logilab/common/compat.py b/logilab/common/compat.py index eee0a61..4ca540b 100644 --- a/logilab/common/compat.py +++ b/logilab/common/compat.py @@ -33,6 +33,7 @@ import os import sys import types from warnings import warn +from typing import Union # not used here, but imported to preserve API import builtins @@ -41,7 +42,7 @@ def str_to_bytes(string): return str.encode(string) # we have to ignore the encoding in py3k to be able to write a string into a # TextIOWrapper or like object (which expect an unicode string) -def str_encode(string, encoding): +def str_encode(string: Union[int, str], encoding: str) -> str: return str(string) # See also http://bugs.python.org/issue11776 |