aboutsummaryrefslogtreecommitdiff
path: root/google/api_core/general_helpers.py
diff options
context:
space:
mode:
authorTres Seaver <tseaver@palladion.com>2021-08-03 13:59:25 -0400
committerGitHub <noreply@github.com>2021-08-03 13:59:25 -0400
commita30f004e74f709d46e905dd819c71f43354e9ac9 (patch)
tree6e4367ce5fecd92fde24337a7b26373328e8e9df /google/api_core/general_helpers.py
parentff6ef1bd07fa68307b7c82c910416d770e7b3416 (diff)
downloadpython-api-core-a30f004e74f709d46e905dd819c71f43354e9ac9.tar.gz
fix!: drop support for Python 2.7 / 3.5 (#212)
Drop 'six' module Drop 'u"' prefixes for text Remove other Python 2.7 workarounds Drop use of 'pytz' Dxpand range to allow 'google-auth' 2.x versions Remove 'general_helpers.wraps': except for a backward-compatibility import, 'functools.wraps' does everything wee need on Python >= 3.6. Remove 'packaging' dependency Release-As: 2.0.0b1 Closes #74. Closes #215.
Diffstat (limited to 'google/api_core/general_helpers.py')
-rw-r--r--google/api_core/general_helpers.py21
1 files changed, 2 insertions, 19 deletions
diff --git a/google/api_core/general_helpers.py b/google/api_core/general_helpers.py
index d2d0c44..fba7802 100644
--- a/google/api_core/general_helpers.py
+++ b/google/api_core/general_helpers.py
@@ -12,22 +12,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-"""Helpers for general Python functionality."""
-
-import functools
-
-import six
-
-
-# functools.partial objects lack several attributes present on real function
-# objects. In Python 2 wraps fails on this so use a restricted set instead.
-_PARTIAL_VALID_ASSIGNMENTS = ("__doc__",)
-
-
-def wraps(wrapped):
- """A functools.wraps helper that handles partial objects on Python 2."""
- # https://github.com/google/pytype/issues/322
- if isinstance(wrapped, functools.partial): # pytype: disable=wrong-arg-types
- return six.wraps(wrapped, assigned=_PARTIAL_VALID_ASSIGNMENTS)
- else:
- return six.wraps(wrapped)
+# This import for backward compatibiltiy only.
+from functools import wraps # noqa: F401 pragma: NO COVER