compat.py 634 B

1234567891011121314151617181920212223242526272829
  1. # -*- coding: utf-8 -*-
  2. """
  3. pythoncompat
  4. Copied from requests
  5. """
  6. import sys
  7. PY3 = sys.version_info[0] == 3
  8. builtin_str = str
  9. str = str
  10. bytes = bytes
  11. basestring = (str, bytes)
  12. numeric_types = (int, float)
  13. from zipfile import ZIP64_VERSION
  14. from zipfile import BZIP2_VERSION
  15. from zipfile import ZIP_BZIP2
  16. from zipfile import LZMA_VERSION
  17. from zipfile import ZIP_LZMA
  18. from zipfile import ZIP_MAX_COMMENT
  19. # Copy from io
  20. SEEK_SET = 0 # start of the stream (the default); offset should be zero or positive
  21. SEEK_CUR = 1 # current stream position; offset may be negative
  22. SEEK_END = 2 # end of the stream; offset is usually negative