diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-01-11 10:12:12 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-01-13 10:57:41 -0500 |
commit | fa6dd376bb24845724287d980a98ea50eb1cfab1 (patch) | |
tree | 91e536c76f4b76b8997b02f5cd5a41de29dc90ef /lib/sqlalchemy/events.py | |
parent | c703b9ce89483b6f44b97d1fbf56f8df8b14305a (diff) | |
download | sqlalchemy-fa6dd376bb24845724287d980a98ea50eb1cfab1.tar.gz |
Support python3.6
Corrects some warnings and adds tox config. Adds DeprecationWarning
to the error category. Large sweep for string literals w/ backslashes
as this is common in docstrings
Co-authored-by: Andrii Soldatenko
Fixes: #3886
Change-Id: Ia7c838dfbbe70b262622ed0803d581edc736e085
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/337
Diffstat (limited to 'lib/sqlalchemy/events.py')
-rw-r--r-- | lib/sqlalchemy/events.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/sqlalchemy/events.py b/lib/sqlalchemy/events.py index 8a6cb2689..2ed44f5dd 100644 --- a/lib/sqlalchemy/events.py +++ b/lib/sqlalchemy/events.py @@ -76,7 +76,7 @@ class DDLEvents(event.Events): _dispatch_target = SchemaEventTarget def before_create(self, target, connection, **kw): - """Called before CREATE statements are emitted. + r"""Called before CREATE statements are emitted. :param target: the :class:`.MetaData` or :class:`.Table` object which is the target of the event. @@ -92,7 +92,7 @@ class DDLEvents(event.Events): """ def after_create(self, target, connection, **kw): - """Called after CREATE statements are emitted. + r"""Called after CREATE statements are emitted. :param target: the :class:`.MetaData` or :class:`.Table` object which is the target of the event. @@ -108,7 +108,7 @@ class DDLEvents(event.Events): """ def before_drop(self, target, connection, **kw): - """Called before DROP statements are emitted. + r"""Called before DROP statements are emitted. :param target: the :class:`.MetaData` or :class:`.Table` object which is the target of the event. @@ -124,7 +124,7 @@ class DDLEvents(event.Events): """ def after_drop(self, target, connection, **kw): - """Called after DROP statements are emitted. + r"""Called after DROP statements are emitted. :param target: the :class:`.MetaData` or :class:`.Table` object which is the target of the event. @@ -717,7 +717,7 @@ class ConnectionEvents(event.Events): """ def handle_error(self, exception_context): - """Intercept all exceptions processed by the :class:`.Connection`. + r"""Intercept all exceptions processed by the :class:`.Connection`. This includes all exceptions emitted by the DBAPI as well as within SQLAlchemy's statement invocation process, including @@ -763,7 +763,7 @@ class ConnectionEvents(event.Events): @event.listens_for(Engine, "handle_error") def handle_exception(context): if isinstance(context.original_exception, - psycopg2.OperationalError) and \\ + psycopg2.OperationalError) and \ "failed" in str(context.original_exception): raise MySpecialException("failed operation") @@ -786,7 +786,7 @@ class ConnectionEvents(event.Events): @event.listens_for(Engine, "handle_error", retval=True) def handle_exception(context): - if context.chained_exception is not None and \\ + if context.chained_exception is not None and \ "special" in context.chained_exception.message: return MySpecialException("failed", cause=context.chained_exception) |