Mercurial > repos > bcclaywell > argo_navis
comparison venv/lib/python2.7/site-packages/setuptools/compat.py @ 0:d67268158946 draft
planemo upload commit a3f181f5f126803c654b3a66dd4e83a48f7e203b
| author | bcclaywell |
|---|---|
| date | Mon, 12 Oct 2015 17:43:33 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:d67268158946 |
|---|---|
| 1 import sys | |
| 2 import itertools | |
| 3 | |
| 4 PY3 = sys.version_info >= (3,) | |
| 5 PY2 = not PY3 | |
| 6 | |
| 7 if PY2: | |
| 8 basestring = basestring | |
| 9 import __builtin__ as builtins | |
| 10 import ConfigParser | |
| 11 from StringIO import StringIO | |
| 12 BytesIO = StringIO | |
| 13 func_code = lambda o: o.func_code | |
| 14 func_globals = lambda o: o.func_globals | |
| 15 im_func = lambda o: o.im_func | |
| 16 from htmlentitydefs import name2codepoint | |
| 17 import httplib | |
| 18 from BaseHTTPServer import HTTPServer | |
| 19 from SimpleHTTPServer import SimpleHTTPRequestHandler | |
| 20 from BaseHTTPServer import BaseHTTPRequestHandler | |
| 21 iteritems = lambda o: o.iteritems() | |
| 22 long_type = long | |
| 23 maxsize = sys.maxint | |
| 24 unichr = unichr | |
| 25 unicode = unicode | |
| 26 bytes = str | |
| 27 from urllib import url2pathname, splittag, pathname2url | |
| 28 import urllib2 | |
| 29 from urllib2 import urlopen, HTTPError, URLError, unquote, splituser | |
| 30 from urlparse import urlparse, urlunparse, urljoin, urlsplit, urlunsplit | |
| 31 filterfalse = itertools.ifilterfalse | |
| 32 | |
| 33 exec("""def reraise(tp, value, tb=None): | |
| 34 raise tp, value, tb""") | |
| 35 | |
| 36 if PY3: | |
| 37 basestring = str | |
| 38 import builtins | |
| 39 import configparser as ConfigParser | |
| 40 from io import StringIO, BytesIO | |
| 41 func_code = lambda o: o.__code__ | |
| 42 func_globals = lambda o: o.__globals__ | |
| 43 im_func = lambda o: o.__func__ | |
| 44 from html.entities import name2codepoint | |
| 45 import http.client as httplib | |
| 46 from http.server import HTTPServer, SimpleHTTPRequestHandler | |
| 47 from http.server import BaseHTTPRequestHandler | |
| 48 iteritems = lambda o: o.items() | |
| 49 long_type = int | |
| 50 maxsize = sys.maxsize | |
| 51 unichr = chr | |
| 52 unicode = str | |
| 53 bytes = bytes | |
| 54 from urllib.error import HTTPError, URLError | |
| 55 import urllib.request as urllib2 | |
| 56 from urllib.request import urlopen, url2pathname, pathname2url | |
| 57 from urllib.parse import ( | |
| 58 urlparse, urlunparse, unquote, splituser, urljoin, urlsplit, | |
| 59 urlunsplit, splittag, | |
| 60 ) | |
| 61 filterfalse = itertools.filterfalse | |
| 62 | |
| 63 def reraise(tp, value, tb=None): | |
| 64 if value.__traceback__ is not tb: | |
| 65 raise value.with_traceback(tb) | |
| 66 raise value |
