MCPcopy Index your code
hub / github.com/pyload/pyload / _s2bytes

Function _s2bytes

module/lib/feedparser.py:101–108  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

99 base64 = binascii = None
100
101def _s2bytes(s):
102 # Convert a UTF-8 str to bytes if the interpreter is Python 3
103 try:
104 return bytes(s, 'utf8')
105 except (NameError, TypeError):
106 # In Python 2.5 and below, bytes doesn't exist (NameError)
107 # In Python 2.6 and above, bytes and str are the same (TypeError)
108 return s
109
110def _l2bytes(l):
111 # Convert a list of ints to bytes if the interpreter is Python 3

Callers 2

_getCharacterEncodingFunction · 0.85
_stripDoctypeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected