~ibmcharmers/charms/xenial/ibm-cinder-storwize-svc/trunk

« back to all changes in this revision

Viewing changes to .tox/py35/lib/python3.5/site-packages/setuptools/py26compat.py

  • Committer: Ankammarao
  • Date: 2017-03-06 05:11:42 UTC
  • Revision ID: achittet@in.ibm.com-20170306051142-dpg27z4es1k56hfn
Marked tests folder executable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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__'])