File: compat.py

package info (click to toggle)
python-graphene 2.1.9-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,024 kB
  • sloc: python: 7,295; makefile: 196; sh: 4
file content (21 lines) | stat: -rw-r--r-- 321 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from __future__ import absolute_import

import six

from graphql.pyutils.compat import Enum

try:
    from inspect import signature
except ImportError:
    from .signature import signature

if six.PY2:

    def func_name(func):
        return func.func_name


else:

    def func_name(func):
        return func.__name__