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

Side by Side Diff: third_party/google-endpoints/setuptools/py26compat.py

Issue 2666783008: Add google-endpoints to third_party/. (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 """
2 Compatibility Support for Python 2.6 and earlier
3 """
4
5 import sys
6
7 try:
8 from urllib.parse import splittag
9 except ImportError:
10 from urllib import splittag
11
12
13 def strip_fragment(url):
14 """
15 In `Python 8280 <http://bugs.python.org/issue8280>`_, Python 2.7 and
16 later was patched to disregard the fragment when making URL requests.
17 Do the same for Python 2.6 and earlier.
18 """
19 url, fragment = splittag(url)
20 return url
21
22
23 if sys.version_info >= (2, 7):
24 strip_fragment = lambda x: x
25
26 try:
27 from importlib import import_module
28 except ImportError:
29
30 def import_module(module_name):
31 return __import__(module_name, fromlist=['__name__'])
OLDNEW
« no previous file with comments | « third_party/google-endpoints/setuptools/package_index.py ('k') | third_party/google-endpoints/setuptools/py27compat.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698