diff options
| author | Gord Thompson <gord@gordthompson.com> | 2021-04-29 12:57:06 -0600 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-04-29 16:24:14 -0400 |
| commit | 416fdb1674daf72ef215c6abfed3e08343f1e05e (patch) | |
| tree | bec9e502bd7259280a5d42c6822e9d65980fcdd0 /lib/sqlalchemy/util | |
| parent | 28493bf4bc35a4802b57b02a8b389cec7b6dcbb6 (diff) | |
| download | sqlalchemy-416fdb1674daf72ef215c6abfed3e08343f1e05e.tar.gz | |
Fix ForeignKeyConstraint.copy() error
Fixed an issue with the (deprecated in 1.4)
:meth:`_schema.ForeignKeyConstraint.copy` method that caused an error when
invoked with the ``schema`` argument.
Fixes: #6353
Change-Id: I03330d9ec254d64377f2b2e86af69a4eaff43ac6
Diffstat (limited to 'lib/sqlalchemy/util')
| -rw-r--r-- | lib/sqlalchemy/util/compat.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/sqlalchemy/util/compat.py b/lib/sqlalchemy/util/compat.py index ca92fb125..727b77f7e 100644 --- a/lib/sqlalchemy/util/compat.py +++ b/lib/sqlalchemy/util/compat.py @@ -228,6 +228,10 @@ if py3k: from abc import ABC + def _qualname(fn): + return fn.__qualname__ + + else: import base64 import ConfigParser as configparser # noqa @@ -338,6 +342,17 @@ else: TYPE_CHECKING = False + def _qualname(meth): + """return __qualname__ equivalent for a method on a class""" + + for cls in meth.im_class.__mro__: + if meth.__name__ in cls.__dict__: + break + else: + return meth.__name__ + + return "%s.%s" % (cls.__name__, meth.__name__) + if py3k: |
