Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Unified Diff: recipe_engine/third_party/setuptools/compat.py

Issue 1344583003: Recipe package system. (Closed) Base URL: git@github.com:luci/recipes-py.git@master
Patch Set: Recompiled proto Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: recipe_engine/third_party/setuptools/compat.py
diff --git a/recipe_engine/third_party/setuptools/compat.py b/recipe_engine/third_party/setuptools/compat.py
new file mode 100644
index 0000000000000000000000000000000000000000..73e6e4aa7e372289915df9cd27ad6e3a431c26a6
--- /dev/null
+++ b/recipe_engine/third_party/setuptools/compat.py
@@ -0,0 +1,66 @@
+import sys
+import itertools
+
+PY3 = sys.version_info >= (3,)
+PY2 = not PY3
+
+if PY2:
+ basestring = basestring
+ import __builtin__ as builtins
+ import ConfigParser
+ from StringIO import StringIO
+ BytesIO = StringIO
+ func_code = lambda o: o.func_code
+ func_globals = lambda o: o.func_globals
+ im_func = lambda o: o.im_func
+ from htmlentitydefs import name2codepoint
+ import httplib
+ from BaseHTTPServer import HTTPServer
+ from SimpleHTTPServer import SimpleHTTPRequestHandler
+ from BaseHTTPServer import BaseHTTPRequestHandler
+ iteritems = lambda o: o.iteritems()
+ long_type = long
+ maxsize = sys.maxint
+ unichr = unichr
+ unicode = unicode
+ bytes = str
+ from urllib import url2pathname, splittag, pathname2url
+ import urllib2
+ from urllib2 import urlopen, HTTPError, URLError, unquote, splituser
+ from urlparse import urlparse, urlunparse, urljoin, urlsplit, urlunsplit
+ filterfalse = itertools.ifilterfalse
+
+ exec("""def reraise(tp, value, tb=None):
+ raise tp, value, tb""")
+
+if PY3:
+ basestring = str
+ import builtins
+ import configparser as ConfigParser
+ from io import StringIO, BytesIO
+ func_code = lambda o: o.__code__
+ func_globals = lambda o: o.__globals__
+ im_func = lambda o: o.__func__
+ from html.entities import name2codepoint
+ import http.client as httplib
+ from http.server import HTTPServer, SimpleHTTPRequestHandler
+ from http.server import BaseHTTPRequestHandler
+ iteritems = lambda o: o.items()
+ long_type = int
+ maxsize = sys.maxsize
+ unichr = chr
+ unicode = str
+ bytes = bytes
+ from urllib.error import HTTPError, URLError
+ import urllib.request as urllib2
+ from urllib.request import urlopen, url2pathname, pathname2url
+ from urllib.parse import (
+ urlparse, urlunparse, unquote, splituser, urljoin, urlsplit,
+ urlunsplit, splittag,
+ )
+ filterfalse = itertools.filterfalse
+
+ def reraise(tp, value, tb=None):
+ if value.__traceback__ is not tb:
+ raise value.with_traceback(tb)
+ raise value
« no previous file with comments | « recipe_engine/third_party/setuptools/command/upload_docs.py ('k') | recipe_engine/third_party/setuptools/depends.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698