[go: up one dir, main page]

File: compat.py

package info (click to toggle)
distlib 0.3.9-1
  • links: PTS
  • area: main
  • in suites: trixie
  • size: 2,228 kB
  • sloc: python: 12,347; ansic: 820; sh: 106; makefile: 3
file content (27 lines) | stat: -rw-r--r-- 739 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import sys

import unittest

_ver = sys.version_info[:2]

if _ver[0] < 3:
    import Queue as queue
    from SimpleXMLRPCServer import SimpleXMLRPCServer
    from SimpleHTTPServer import SimpleHTTPRequestHandler
    from BaseHTTPServer import HTTPServer
    text_type = unicode
    from urllib import unquote
    from urllib2 import Request
    from urlparse import urlparse
else:
    import queue
    from xmlrpc.server import SimpleXMLRPCServer
    from http.server import HTTPServer, SimpleHTTPRequestHandler
    text_type = str
    from urllib.parse import urlparse, unquote
    from urllib.request import Request