compat.py 360 B

12345678910111213141516
  1. from .core import *
  2. from .codec import *
  3. from typing import Any, Union
  4. def ToASCII(label):
  5. # type: (str) -> bytes
  6. return encode(label)
  7. def ToUnicode(label):
  8. # type: (Union[bytes, bytearray]) -> str
  9. return decode(label)
  10. def nameprep(s):
  11. # type: (Any) -> None
  12. raise NotImplementedError('IDNA 2008 does not utilise nameprep protocol')