error.py 479 B

12345678910111213141516
  1. from __future__ import absolute_import
  2. from future.standard_library import suspend_hooks
  3. from future.utils import PY3
  4. if PY3:
  5. from urllib.error import *
  6. else:
  7. __future_module__ = True
  8. # We use this method to get at the original Py2 urllib before any renaming magic
  9. # ContentTooShortError = sys.py2_modules['urllib'].ContentTooShortError
  10. with suspend_hooks():
  11. from urllib import ContentTooShortError
  12. from urllib2 import URLError, HTTPError