Skip to content

Commit

Permalink
Merge pull request #553 from fizyk/nomorecompat
Browse files Browse the repository at this point in the history
Remove references to pyramid.compat
  • Loading branch information
leplatrem committed Mar 11, 2021
2 parents 183bec5 + 4cc7f95 commit 2554896
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cornice/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
# You can obtain one at http://mozilla.org/MPL/2.0/.
import warnings

from pyramid.compat import string_types

__all__ = ['is_string', 'to_list', 'match_accept_header',
'ContentTypePredicate', 'current_service', 'func_name']


def is_string(s):
return isinstance(s, string_types)
return isinstance(s, str)


def to_list(obj):
Expand Down Expand Up @@ -106,7 +104,7 @@ def __call__(self, context, request):

def func_name(f):
"""Return the name of a function or class method."""
if isinstance(f, string_types):
if isinstance(f, str):
return f
elif hasattr(f, '__qualname__'): # pragma: no cover
return f.__qualname__ # Python 3
Expand Down

0 comments on commit 2554896

Please sign in to comment.