(char: CharLike)
| 436 | |
| 437 | |
| 438 | def make_char(char: CharLike) -> bytes: |
| 439 | if isinstance(char, int): |
| 440 | return chr(char).encode() |
| 441 | |
| 442 | charp = make_string(char) |
| 443 | string = ( |
| 444 | charp |
| 445 | if not isinstance( |
| 446 | charp, |
| 447 | ctypes.c_char_p, |
| 448 | ) |
| 449 | else _not_null(charp.value) |
| 450 | ) |
| 451 | |
| 452 | if len(string) != 1: |
| 453 | raise InvalidBindingParameter( |
| 454 | f'"{string.decode()}" should have a length of 1', |
| 455 | ) |
| 456 | |
| 457 | return string |
| 458 | |
| 459 | |
| 460 | def isalnum(c: CharLike) -> int: |
no test coverage detected