compat.py 321 B

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