01-arcadia.patch 864 B

123456789101112131415161718192021
  1. --- contrib/python/hyperlink/py2/hyperlink/hypothesis.py (index)
  2. +++ contrib/python/hyperlink/py2/hyperlink/hypothesis.py (working tree)
  3. @@ -13,6 +13,8 @@ except ImportError:
  4. __all__ = () # type: Tuple[str, ...]
  5. else:
  6. + import io
  7. + import pkgutil
  8. from csv import reader as csv_reader
  9. from os.path import dirname, join
  10. from string import ascii_letters, digits
  11. @@ -76,7 +78,8 @@ else:
  12. dataFileName = join(
  13. dirname(__file__), "idna-tables-properties.csv.gz"
  14. )
  15. - with open_gzip(dataFileName) as dataFile:
  16. + data = io.BytesIO(pkgutil.get_data(__name__, "idna-tables-properties.csv.gz"))
  17. + with open_gzip(data) as dataFile:
  18. reader = csv_reader(
  19. (line.decode("utf-8") for line in dataFile),
  20. delimiter=",",