Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support python3.10 #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ stages:

jobs:
include:
- python: 3.10.0
env: DEPS="nameko==3.0.0-rc11"
- python: 3.6
env: DEPS="--pre nameko"
- python: 3.6
Expand Down
8 changes: 6 additions & 2 deletions nameko_tracer/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import collections
from importlib import import_module
import json
import logging
import sys

import six

Expand All @@ -23,6 +23,10 @@ def serialise_to_string(value):

def safe_for_serialisation(value):
no_op_types = six.string_types + six.integer_types + (float, type(None))
if sys.version_info >= (3, 3): # pragma: no cover
from collections.abc import Iterable # pylint: disable=E0611,E0401
else: # pragma: no cover
from collections import Iterable # pylint: disable=E0611,E0401
if isinstance(value, no_op_types):
return value
if isinstance(value, bytes):
Expand All @@ -31,7 +35,7 @@ def safe_for_serialisation(value):
return {
safe_for_serialisation(key): safe_for_serialisation(val)
for key, val in six.iteritems(value)}
if isinstance(value, collections.Iterable):
if isinstance(value, Iterable):
return list(map(safe_for_serialisation, value))
try:
return six.text_type(value)
Expand Down