(s)
| 99 | base64 = binascii = None |
| 100 | |
| 101 | def _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 | |
| 110 | def _l2bytes(l): |
| 111 | # Convert a list of ints to bytes if the interpreter is Python 3 |
no outgoing calls
no test coverage detected