Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions | Variables
compatibility_helper Namespace Reference

Functions

 byte_str_decode (str_or_bytes)
 

Variables

str ENCODING = 'UTF-8'
 

Function Documentation

◆ byte_str_decode()

compatibility_helper.byte_str_decode (   str_or_bytes)
Returns a string if given either a string or bytes.

  TODO: This function should be removed when the supported python
  version is only python 3.

  Args:
      str_or_bytes (string or bytes) we want to convert or return as
      the possible value changes depending on the version of python
      used.

Definition at line 13 of file compatibility_helper.py.

13def byte_str_decode(str_or_bytes):
14 """Returns a string if given either a string or bytes.
15
16 TODO: This function should be removed when the supported python
17 version is only python 3.
18
19 Args:
20 str_or_bytes (string or bytes) we want to convert or return as
21 the possible value changes depending on the version of python
22 used.
23 """
24 return str_or_bytes if isinstance(str_or_bytes, str) else str_or_bytes.decode(ENCODING)

Variable Documentation

◆ ENCODING

str compatibility_helper.ENCODING = 'UTF-8'

Definition at line 10 of file compatibility_helper.py.