server.py 606 B

1234567891011121314151617181920
  1. from __future__ import absolute_import
  2. from future.utils import PY3
  3. if PY3:
  4. from http.server import *
  5. else:
  6. __future_module__ = True
  7. from BaseHTTPServer import *
  8. from CGIHTTPServer import *
  9. from SimpleHTTPServer import *
  10. try:
  11. from CGIHTTPServer import _url_collapse_path # needed for a test
  12. except ImportError:
  13. try:
  14. # Python 2.7.0 to 2.7.3
  15. from CGIHTTPServer import (
  16. _url_collapse_path_split as _url_collapse_path)
  17. except ImportError:
  18. # Doesn't exist on Python 2.6.x. Ignore it.
  19. pass