ยปCore Development>Code coverage>Lib/asyncio/compat.py

Python code coverage for Lib/asyncio/compat.py

#countcontent
1n/a"""Compatibility helpers for the different Python versions."""
2n/a
3n/aimport sys
4n/a
5n/aPY34 = sys.version_info >= (3, 4)
6n/aPY35 = sys.version_info >= (3, 5)
7n/aPY352 = sys.version_info >= (3, 5, 2)
8n/a
9n/a
10n/adef flatten_list_bytes(list_of_data):
11n/a """Concatenate a sequence of bytes-like objects."""
12n/a if not PY34:
13n/a # On Python 3.3 and older, bytes.join() doesn't handle
14n/a # memoryview.
15n/a list_of_data = (
16n/a bytes(data) if isinstance(data, memoryview) else data
17n/a for data in list_of_data)
18n/a return b''.join(list_of_data)