Path: blob/develop/build/sage_bootstrap/compat/__init__.py
4081 views
# -*- coding: utf-8 -*-1"""2Python 2/3 compatibility utils3"""456#*****************************************************************************7# Copyright (C) 2015 Volker Braun <[email protected]>8#9# This program is free software: you can redistribute it and/or modify10# it under the terms of the GNU General Public License as published by11# the Free Software Foundation, either version 2 of the License, or12# (at your option) any later version.13# https://www.gnu.org/licenses/14#*****************************************************************************151617try:18# Python 319import urllib.request as urllib20import urllib.parse as urlparse21except ImportError:22import urllib23import urlparse242526try:27from StringIO import StringIO28except ImportError:29from io import StringIO303132try:33# Use this for Python 3. This function is available for Python >= 3.334from shlex import quote35except ImportError:36# Use this for Python 2. This function is available for Python < 3.1337from pipes import quote383940