././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1729370387.5055544 asyncpg-0.30.0/0000755000175100001770000000000014705014424012644 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/.flake80000644000175100001770000000037414705014413014021 0ustar00runnerdocker[flake8] select = C90,E,F,W,Y0 ignore = E402,E731,W503,W504,E252 exclude = .git,__pycache__,build,dist,.eggs,.github,.local,.venv*,.tox per-file-ignores = *.pyi: F401,F403,F405,F811,E127,E128,E203,E266,E301,E302,E305,E501,E701,E704,E741,B303,W503,W504 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/AUTHORS0000644000175100001770000000020214705014413013704 0ustar00runnerdockerMain contributors ================= MagicStack Inc.: Elvis Pranskevichus Yury Selivanov ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/LICENSE0000644000175100001770000002631214705014413013653 0ustar00runnerdockerCopyright (C) 2016-present the asyncpg authors and contributors. Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright (C) 2016-present the asyncpg authors and contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/MANIFEST.in0000644000175100001770000000035714705014413014405 0ustar00runnerdockerrecursive-include docs *.py *.rst Makefile *.css recursive-include examples *.py recursive-include tests *.py *.pem recursive-include asyncpg *.pyx *.pxd *.pxi *.py *.pyi *.c *.h include LICENSE README.rst Makefile performance.png .flake8 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/Makefile0000644000175100001770000000167414705014413014312 0ustar00runnerdocker.PHONY: compile debug test quicktest clean all PYTHON ?= python ROOT = $(dir $(realpath $(firstword $(MAKEFILE_LIST)))) all: compile clean: rm -fr dist/ doc/_build/ rm -fr asyncpg/pgproto/*.c asyncpg/pgproto/*.html rm -fr asyncpg/pgproto/codecs/*.html rm -fr asyncpg/pgproto/*.so rm -fr asyncpg/protocol/*.c asyncpg/protocol/*.html rm -fr asyncpg/protocol/*.so build *.egg-info rm -fr asyncpg/protocol/codecs/*.html find . -name '__pycache__' | xargs rm -rf compile: env ASYNCPG_BUILD_CYTHON_ALWAYS=1 $(PYTHON) -m pip install -e . debug: env ASYNCPG_DEBUG=1 $(PYTHON) -m pip install -e . test: PYTHONASYNCIODEBUG=1 $(PYTHON) -m unittest -v tests.suite $(PYTHON) -m unittest -v tests.suite USE_UVLOOP=1 $(PYTHON) -m unittest -v tests.suite testinstalled: cd "$${HOME}" && $(PYTHON) $(ROOT)/tests/__init__.py quicktest: $(PYTHON) -m unittest -v tests.suite htmldocs: $(PYTHON) -m pip install -e .[docs] $(MAKE) -C docs html ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1729370387.5055544 asyncpg-0.30.0/PKG-INFO0000644000175100001770000001162214705014424013743 0ustar00runnerdockerMetadata-Version: 2.1 Name: asyncpg Version: 0.30.0 Summary: An asyncio PostgreSQL driver Author-email: MagicStack Inc License: Apache License, Version 2.0 Project-URL: github, https://github.com/MagicStack/asyncpg Keywords: database,postgres Classifier: Development Status :: 5 - Production/Stable Classifier: Framework :: AsyncIO Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: POSIX Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: Microsoft :: Windows Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Topic :: Database :: Front-Ends Requires-Python: >=3.8.0 Description-Content-Type: text/x-rst License-File: LICENSE License-File: AUTHORS Requires-Dist: async_timeout>=4.0.3; python_version < "3.11.0" Provides-Extra: gssauth Requires-Dist: gssapi; platform_system != "Windows" and extra == "gssauth" Requires-Dist: sspilib; platform_system == "Windows" and extra == "gssauth" Provides-Extra: test Requires-Dist: flake8~=6.1; extra == "test" Requires-Dist: flake8-pyi~=24.1.0; extra == "test" Requires-Dist: distro~=1.9.0; extra == "test" Requires-Dist: uvloop>=0.15.3; (platform_system != "Windows" and python_version < "3.14.0") and extra == "test" Requires-Dist: gssapi; platform_system == "Linux" and extra == "test" Requires-Dist: k5test; platform_system == "Linux" and extra == "test" Requires-Dist: sspilib; platform_system == "Windows" and extra == "test" Requires-Dist: mypy~=1.8.0; extra == "test" Provides-Extra: docs Requires-Dist: Sphinx~=8.1.3; extra == "docs" Requires-Dist: sphinx_rtd_theme>=1.2.2; extra == "docs" asyncpg -- A fast PostgreSQL Database Client Library for Python/asyncio ======================================================================= .. image:: https://github.com/MagicStack/asyncpg/workflows/Tests/badge.svg :target: https://github.com/MagicStack/asyncpg/actions?query=workflow%3ATests+branch%3Amaster :alt: GitHub Actions status .. image:: https://img.shields.io/pypi/v/asyncpg.svg :target: https://pypi.python.org/pypi/asyncpg **asyncpg** is a database interface library designed specifically for PostgreSQL and Python/asyncio. asyncpg is an efficient, clean implementation of PostgreSQL server binary protocol for use with Python's ``asyncio`` framework. You can read more about asyncpg in an introductory `blog post `_. asyncpg requires Python 3.8 or later and is supported for PostgreSQL versions 9.5 to 17. Other PostgreSQL versions or other databases implementing the PostgreSQL protocol *may* work, but are not being actively tested. Documentation ------------- The project documentation can be found `here `_. Performance ----------- In our testing asyncpg is, on average, **5x** faster than psycopg3. .. image:: https://raw.githubusercontent.com/MagicStack/asyncpg/master/performance.png?fddca40ab0 :target: https://gistpreview.github.io/?0ed296e93523831ea0918d42dd1258c2 The above results are a geometric mean of benchmarks obtained with PostgreSQL `client driver benchmarking toolbench `_ in June 2023 (click on the chart to see full details). Features -------- asyncpg implements PostgreSQL server protocol natively and exposes its features directly, as opposed to hiding them behind a generic facade like DB-API. This enables asyncpg to have easy-to-use support for: * **prepared statements** * **scrollable cursors** * **partial iteration** on query results * automatic encoding and decoding of composite types, arrays, and any combination of those * straightforward support for custom data types Installation ------------ asyncpg is available on PyPI. When not using GSSAPI/SSPI authentication it has no dependencies. Use pip to install:: $ pip install asyncpg If you need GSSAPI/SSPI authentication, use:: $ pip install 'asyncpg[gssauth]' For more details, please `see the documentation `_. Basic Usage ----------- .. code-block:: python import asyncio import asyncpg async def run(): conn = await asyncpg.connect(user='user', password='password', database='database', host='127.0.0.1') values = await conn.fetch( 'SELECT * FROM mytable WHERE id = $1', 10, ) await conn.close() asyncio.run(run()) License ------- asyncpg is developed and distributed under the Apache 2.0 license. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/README.rst0000644000175100001770000000565614705014413014345 0ustar00runnerdockerasyncpg -- A fast PostgreSQL Database Client Library for Python/asyncio ======================================================================= .. image:: https://github.com/MagicStack/asyncpg/workflows/Tests/badge.svg :target: https://github.com/MagicStack/asyncpg/actions?query=workflow%3ATests+branch%3Amaster :alt: GitHub Actions status .. image:: https://img.shields.io/pypi/v/asyncpg.svg :target: https://pypi.python.org/pypi/asyncpg **asyncpg** is a database interface library designed specifically for PostgreSQL and Python/asyncio. asyncpg is an efficient, clean implementation of PostgreSQL server binary protocol for use with Python's ``asyncio`` framework. You can read more about asyncpg in an introductory `blog post `_. asyncpg requires Python 3.8 or later and is supported for PostgreSQL versions 9.5 to 17. Other PostgreSQL versions or other databases implementing the PostgreSQL protocol *may* work, but are not being actively tested. Documentation ------------- The project documentation can be found `here `_. Performance ----------- In our testing asyncpg is, on average, **5x** faster than psycopg3. .. image:: https://raw.githubusercontent.com/MagicStack/asyncpg/master/performance.png?fddca40ab0 :target: https://gistpreview.github.io/?0ed296e93523831ea0918d42dd1258c2 The above results are a geometric mean of benchmarks obtained with PostgreSQL `client driver benchmarking toolbench `_ in June 2023 (click on the chart to see full details). Features -------- asyncpg implements PostgreSQL server protocol natively and exposes its features directly, as opposed to hiding them behind a generic facade like DB-API. This enables asyncpg to have easy-to-use support for: * **prepared statements** * **scrollable cursors** * **partial iteration** on query results * automatic encoding and decoding of composite types, arrays, and any combination of those * straightforward support for custom data types Installation ------------ asyncpg is available on PyPI. When not using GSSAPI/SSPI authentication it has no dependencies. Use pip to install:: $ pip install asyncpg If you need GSSAPI/SSPI authentication, use:: $ pip install 'asyncpg[gssauth]' For more details, please `see the documentation `_. Basic Usage ----------- .. code-block:: python import asyncio import asyncpg async def run(): conn = await asyncpg.connect(user='user', password='password', database='database', host='127.0.0.1') values = await conn.fetch( 'SELECT * FROM mytable WHERE id = $1', 10, ) await conn.close() asyncio.run(run()) License ------- asyncpg is developed and distributed under the Apache 2.0 license. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1729370387.4735541 asyncpg-0.30.0/asyncpg/0000755000175100001770000000000014705014423014307 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/__init__.py0000644000175100001770000000120714705014413016417 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 from __future__ import annotations from .connection import connect, Connection # NOQA from .exceptions import * # NOQA from .pool import create_pool, Pool # NOQA from .protocol import Record # NOQA from .types import * # NOQA from ._version import __version__ # NOQA from . import exceptions __all__: tuple[str, ...] = ( 'connect', 'create_pool', 'Pool', 'Record', 'Connection' ) __all__ += exceptions.__all__ # NOQA ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/_asyncio_compat.py0000644000175100001770000000475414705014413020041 0ustar00runnerdocker# Backports from Python/Lib/asyncio for older Pythons # # Copyright (c) 2001-2023 Python Software Foundation; All Rights Reserved # # SPDX-License-Identifier: PSF-2.0 from __future__ import annotations import asyncio import functools import sys import typing if typing.TYPE_CHECKING: from . import compat if sys.version_info < (3, 11): from async_timeout import timeout as timeout_ctx else: from asyncio import timeout as timeout_ctx _T = typing.TypeVar('_T') async def wait_for(fut: compat.Awaitable[_T], timeout: float | None) -> _T: """Wait for the single Future or coroutine to complete, with timeout. Coroutine will be wrapped in Task. Returns result of the Future or coroutine. When a timeout occurs, it cancels the task and raises TimeoutError. To avoid the task cancellation, wrap it in shield(). If the wait is cancelled, the task is also cancelled. If the task supresses the cancellation and returns a value instead, that value is returned. This function is a coroutine. """ # The special case for timeout <= 0 is for the following case: # # async def test_waitfor(): # func_started = False # # async def func(): # nonlocal func_started # func_started = True # # try: # await asyncio.wait_for(func(), 0) # except asyncio.TimeoutError: # assert not func_started # else: # assert False # # asyncio.run(test_waitfor()) if timeout is not None and timeout <= 0: fut = asyncio.ensure_future(fut) if fut.done(): return fut.result() await _cancel_and_wait(fut) try: return fut.result() except asyncio.CancelledError as exc: raise TimeoutError from exc async with timeout_ctx(timeout): return await fut async def _cancel_and_wait(fut: asyncio.Future[_T]) -> None: """Cancel the *fut* future or task and wait until it completes.""" loop = asyncio.get_running_loop() waiter = loop.create_future() cb = functools.partial(_release_waiter, waiter) fut.add_done_callback(cb) try: fut.cancel() # We cannot wait on *fut* directly to make # sure _cancel_and_wait itself is reliably cancellable. await waiter finally: fut.remove_done_callback(cb) def _release_waiter(waiter: asyncio.Future[typing.Any], *args: object) -> None: if not waiter.done(): waiter.set_result(None) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1729370387.4775543 asyncpg-0.30.0/asyncpg/_testbase/0000755000175100001770000000000014705014423016260 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/_testbase/__init__.py0000644000175100001770000004016314705014413020374 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncio import atexit import contextlib import functools import inspect import logging import os import re import textwrap import time import traceback import unittest import asyncpg from asyncpg import cluster as pg_cluster from asyncpg import connection as pg_connection from asyncpg import pool as pg_pool from . import fuzzer @contextlib.contextmanager def silence_asyncio_long_exec_warning(): def flt(log_record): msg = log_record.getMessage() return not msg.startswith('Executing ') logger = logging.getLogger('asyncio') logger.addFilter(flt) try: yield finally: logger.removeFilter(flt) def with_timeout(timeout): def wrap(func): func.__timeout__ = timeout return func return wrap class TestCaseMeta(type(unittest.TestCase)): TEST_TIMEOUT = None @staticmethod def _iter_methods(bases, ns): for base in bases: for methname in dir(base): if not methname.startswith('test_'): continue meth = getattr(base, methname) if not inspect.iscoroutinefunction(meth): continue yield methname, meth for methname, meth in ns.items(): if not methname.startswith('test_'): continue if not inspect.iscoroutinefunction(meth): continue yield methname, meth def __new__(mcls, name, bases, ns): for methname, meth in mcls._iter_methods(bases, ns): @functools.wraps(meth) def wrapper(self, *args, __meth__=meth, **kwargs): coro = __meth__(self, *args, **kwargs) timeout = getattr(__meth__, '__timeout__', mcls.TEST_TIMEOUT) if timeout: coro = asyncio.wait_for(coro, timeout) try: self.loop.run_until_complete(coro) except asyncio.TimeoutError: raise self.failureException( 'test timed out after {} seconds'.format( timeout)) from None else: self.loop.run_until_complete(coro) ns[methname] = wrapper return super().__new__(mcls, name, bases, ns) class TestCase(unittest.TestCase, metaclass=TestCaseMeta): @classmethod def setUpClass(cls): if os.environ.get('USE_UVLOOP'): import uvloop asyncio.set_event_loop_policy(uvloop.EventLoopPolicy()) loop = asyncio.new_event_loop() asyncio.set_event_loop(None) cls.loop = loop @classmethod def tearDownClass(cls): cls.loop.close() asyncio.set_event_loop(None) def setUp(self): self.loop.set_exception_handler(self.loop_exception_handler) self.__unhandled_exceptions = [] def tearDown(self): excs = [] for exc in self.__unhandled_exceptions: if isinstance(exc, ConnectionResetError): texc = traceback.TracebackException.from_exception( exc, lookup_lines=False) if texc.stack[-1].name == "_call_connection_lost": # On Windows calling socket.shutdown may raise # ConnectionResetError, which happens in the # finally block of _call_connection_lost. continue excs.append(exc) if excs: formatted = [] for i, context in enumerate(excs): formatted.append(self._format_loop_exception(context, i + 1)) self.fail( 'unexpected exceptions in asynchronous code:\n' + '\n'.join(formatted)) @contextlib.contextmanager def assertRunUnder(self, delta): st = time.monotonic() try: yield finally: elapsed = time.monotonic() - st if elapsed > delta: raise AssertionError( 'running block took {:0.3f}s which is longer ' 'than the expected maximum of {:0.3f}s'.format( elapsed, delta)) @contextlib.contextmanager def assertLoopErrorHandlerCalled(self, msg_re: str): contexts = [] def handler(loop, ctx): contexts.append(ctx) old_handler = self.loop.get_exception_handler() self.loop.set_exception_handler(handler) try: yield for ctx in contexts: msg = ctx.get('message') if msg and re.search(msg_re, msg): return raise AssertionError( 'no message matching {!r} was logged with ' 'loop.call_exception_handler()'.format(msg_re)) finally: self.loop.set_exception_handler(old_handler) def loop_exception_handler(self, loop, context): self.__unhandled_exceptions.append(context) loop.default_exception_handler(context) def _format_loop_exception(self, context, n): message = context.get('message', 'Unhandled exception in event loop') exception = context.get('exception') if exception is not None: exc_info = (type(exception), exception, exception.__traceback__) else: exc_info = None lines = [] for key in sorted(context): if key in {'message', 'exception'}: continue value = context[key] if key == 'source_traceback': tb = ''.join(traceback.format_list(value)) value = 'Object created at (most recent call last):\n' value += tb.rstrip() else: try: value = repr(value) except Exception as ex: value = ('Exception in __repr__ {!r}; ' 'value type: {!r}'.format(ex, type(value))) lines.append('[{}]: {}\n\n'.format(key, value)) if exc_info is not None: lines.append('[exception]:\n') formatted_exc = textwrap.indent( ''.join(traceback.format_exception(*exc_info)), ' ') lines.append(formatted_exc) details = textwrap.indent(''.join(lines), ' ') return '{:02d}. {}:\n{}\n'.format(n, message, details) _default_cluster = None def _init_cluster(ClusterCls, cluster_kwargs, initdb_options=None): cluster = ClusterCls(**cluster_kwargs) cluster.init(**(initdb_options or {})) cluster.trust_local_connections() atexit.register(_shutdown_cluster, cluster) return cluster def _get_initdb_options(initdb_options=None): if not initdb_options: initdb_options = {} else: initdb_options = dict(initdb_options) # Make the default superuser name stable. if 'username' not in initdb_options: initdb_options['username'] = 'postgres' return initdb_options def _init_default_cluster(initdb_options=None): global _default_cluster if _default_cluster is None: pg_host = os.environ.get('PGHOST') if pg_host: # Using existing cluster, assuming it is initialized and running _default_cluster = pg_cluster.RunningCluster() else: _default_cluster = _init_cluster( pg_cluster.TempCluster, cluster_kwargs={ "data_dir_suffix": ".apgtest", }, initdb_options=_get_initdb_options(initdb_options), ) return _default_cluster def _shutdown_cluster(cluster): if cluster.get_status() == 'running': cluster.stop() if cluster.get_status() != 'not-initialized': cluster.destroy() def create_pool(dsn=None, *, min_size=10, max_size=10, max_queries=50000, max_inactive_connection_lifetime=60.0, connect=None, setup=None, init=None, loop=None, pool_class=pg_pool.Pool, connection_class=pg_connection.Connection, record_class=asyncpg.Record, **connect_kwargs): return pool_class( dsn, min_size=min_size, max_size=max_size, max_queries=max_queries, loop=loop, connect=connect, setup=setup, init=init, max_inactive_connection_lifetime=max_inactive_connection_lifetime, connection_class=connection_class, record_class=record_class, **connect_kwargs, ) class ClusterTestCase(TestCase): @classmethod def get_server_settings(cls): settings = { 'log_connections': 'on' } if cls.cluster.get_pg_version() >= (11, 0): # JITting messes up timing tests, and # is not essential for testing. settings['jit'] = 'off' return settings @classmethod def new_cluster(cls, ClusterCls, *, cluster_kwargs={}, initdb_options={}): cluster = _init_cluster(ClusterCls, cluster_kwargs, _get_initdb_options(initdb_options)) cls._clusters.append(cluster) return cluster @classmethod def start_cluster(cls, cluster, *, server_settings={}): cluster.start(port='dynamic', server_settings=server_settings) @classmethod def setup_cluster(cls): cls.cluster = _init_default_cluster() if cls.cluster.get_status() != 'running': cls.cluster.start( port='dynamic', server_settings=cls.get_server_settings()) @classmethod def setUpClass(cls): super().setUpClass() cls._clusters = [] cls.setup_cluster() @classmethod def tearDownClass(cls): super().tearDownClass() for cluster in cls._clusters: if cluster is not _default_cluster: cluster.stop() cluster.destroy() cls._clusters = [] @classmethod def get_connection_spec(cls, kwargs={}): conn_spec = cls.cluster.get_connection_spec() if kwargs.get('dsn'): conn_spec.pop('host') conn_spec.update(kwargs) if not os.environ.get('PGHOST') and not kwargs.get('dsn'): if 'database' not in conn_spec: conn_spec['database'] = 'postgres' if 'user' not in conn_spec: conn_spec['user'] = 'postgres' return conn_spec @classmethod def connect(cls, **kwargs): conn_spec = cls.get_connection_spec(kwargs) return pg_connection.connect(**conn_spec, loop=cls.loop) def setUp(self): super().setUp() self._pools = [] def tearDown(self): super().tearDown() for pool in self._pools: pool.terminate() self._pools = [] def create_pool(self, pool_class=pg_pool.Pool, connection_class=pg_connection.Connection, **kwargs): conn_spec = self.get_connection_spec(kwargs) pool = create_pool(loop=self.loop, pool_class=pool_class, connection_class=connection_class, **conn_spec) self._pools.append(pool) return pool class ProxiedClusterTestCase(ClusterTestCase): @classmethod def get_server_settings(cls): settings = dict(super().get_server_settings()) settings['listen_addresses'] = '127.0.0.1' return settings @classmethod def get_proxy_settings(cls): return {'fuzzing-mode': None} @classmethod def setUpClass(cls): super().setUpClass() conn_spec = cls.cluster.get_connection_spec() host = conn_spec.get('host') if not host: host = '127.0.0.1' elif host.startswith('/'): host = '127.0.0.1' cls.proxy = fuzzer.TCPFuzzingProxy( backend_host=host, backend_port=conn_spec['port'], ) cls.proxy.start() @classmethod def tearDownClass(cls): cls.proxy.stop() super().tearDownClass() @classmethod def get_connection_spec(cls, kwargs): conn_spec = super().get_connection_spec(kwargs) conn_spec['host'] = cls.proxy.listening_addr conn_spec['port'] = cls.proxy.listening_port return conn_spec def tearDown(self): self.proxy.reset() super().tearDown() def with_connection_options(**options): if not options: raise ValueError('no connection options were specified') def wrap(func): func.__connect_options__ = options return func return wrap class ConnectedTestCase(ClusterTestCase): def setUp(self): super().setUp() # Extract options set up with `with_connection_options`. test_func = getattr(self, self._testMethodName).__func__ opts = getattr(test_func, '__connect_options__', {}) self.con = self.loop.run_until_complete(self.connect(**opts)) self.server_version = self.con.get_server_version() def tearDown(self): try: self.loop.run_until_complete(self.con.close()) self.con = None finally: super().tearDown() class HotStandbyTestCase(ClusterTestCase): @classmethod def setup_cluster(cls): cls.master_cluster = cls.new_cluster(pg_cluster.TempCluster) cls.start_cluster( cls.master_cluster, server_settings={ 'max_wal_senders': 10, 'wal_level': 'hot_standby' } ) con = None try: con = cls.loop.run_until_complete( cls.master_cluster.connect( database='postgres', user='postgres', loop=cls.loop)) cls.loop.run_until_complete( con.execute(''' CREATE ROLE replication WITH LOGIN REPLICATION ''')) cls.master_cluster.trust_local_replication_by('replication') conn_spec = cls.master_cluster.get_connection_spec() cls.standby_cluster = cls.new_cluster( pg_cluster.HotStandbyCluster, cluster_kwargs={ 'master': conn_spec, 'replication_user': 'replication' } ) cls.start_cluster( cls.standby_cluster, server_settings={ 'hot_standby': True } ) finally: if con is not None: cls.loop.run_until_complete(con.close()) @classmethod def get_cluster_connection_spec(cls, cluster, kwargs={}): conn_spec = cluster.get_connection_spec() if kwargs.get('dsn'): conn_spec.pop('host') conn_spec.update(kwargs) if not os.environ.get('PGHOST') and not kwargs.get('dsn'): if 'database' not in conn_spec: conn_spec['database'] = 'postgres' if 'user' not in conn_spec: conn_spec['user'] = 'postgres' return conn_spec @classmethod def get_connection_spec(cls, kwargs={}): primary_spec = cls.get_cluster_connection_spec( cls.master_cluster, kwargs ) standby_spec = cls.get_cluster_connection_spec( cls.standby_cluster, kwargs ) return { 'host': [primary_spec['host'], standby_spec['host']], 'port': [primary_spec['port'], standby_spec['port']], 'database': primary_spec['database'], 'user': primary_spec['user'], **kwargs } @classmethod def connect_primary(cls, **kwargs): conn_spec = cls.get_cluster_connection_spec(cls.master_cluster, kwargs) return pg_connection.connect(**conn_spec, loop=cls.loop) @classmethod def connect_standby(cls, **kwargs): conn_spec = cls.get_cluster_connection_spec( cls.standby_cluster, kwargs ) return pg_connection.connect(**conn_spec, loop=cls.loop) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/_testbase/fuzzer.py0000644000175100001770000002311414705014413020157 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncio import socket import threading import typing from asyncpg import cluster class StopServer(Exception): pass class TCPFuzzingProxy: def __init__(self, *, listening_addr: str='127.0.0.1', listening_port: typing.Optional[int]=None, backend_host: str, backend_port: int, settings: typing.Optional[dict]=None) -> None: self.listening_addr = listening_addr self.listening_port = listening_port self.backend_host = backend_host self.backend_port = backend_port self.settings = settings or {} self.loop = None self.connectivity = None self.connectivity_loss = None self.stop_event = None self.connections = {} self.sock = None self.listen_task = None async def _wait(self, work): work_task = asyncio.ensure_future(work) stop_event_task = asyncio.ensure_future(self.stop_event.wait()) try: await asyncio.wait( [work_task, stop_event_task], return_when=asyncio.FIRST_COMPLETED) if self.stop_event.is_set(): raise StopServer() else: return work_task.result() finally: if not work_task.done(): work_task.cancel() if not stop_event_task.done(): stop_event_task.cancel() def start(self): started = threading.Event() self.thread = threading.Thread( target=self._start_thread, args=(started,)) self.thread.start() if not started.wait(timeout=2): raise RuntimeError('fuzzer proxy failed to start') def stop(self): self.loop.call_soon_threadsafe(self._stop) self.thread.join() def _stop(self): self.stop_event.set() def _start_thread(self, started_event): self.loop = asyncio.new_event_loop() asyncio.set_event_loop(self.loop) self.connectivity = asyncio.Event() self.connectivity.set() self.connectivity_loss = asyncio.Event() self.stop_event = asyncio.Event() if self.listening_port is None: self.listening_port = cluster.find_available_port() self.sock = socket.socket() self.sock.bind((self.listening_addr, self.listening_port)) self.sock.listen(50) self.sock.setblocking(False) try: self.loop.run_until_complete(self._main(started_event)) finally: self.loop.close() async def _main(self, started_event): self.listen_task = asyncio.ensure_future(self.listen()) # Notify the main thread that we are ready to go. started_event.set() try: await self.listen_task finally: for c in list(self.connections): c.close() await asyncio.sleep(0.01) if hasattr(self.loop, 'remove_reader'): self.loop.remove_reader(self.sock.fileno()) self.sock.close() async def listen(self): while True: try: client_sock, _ = await self._wait( self.loop.sock_accept(self.sock)) backend_sock = socket.socket() backend_sock.setblocking(False) await self._wait(self.loop.sock_connect( backend_sock, (self.backend_host, self.backend_port))) except StopServer: break conn = Connection(client_sock, backend_sock, self) conn_task = self.loop.create_task(conn.handle()) self.connections[conn] = conn_task def trigger_connectivity_loss(self): self.loop.call_soon_threadsafe(self._trigger_connectivity_loss) def _trigger_connectivity_loss(self): self.connectivity.clear() self.connectivity_loss.set() def restore_connectivity(self): self.loop.call_soon_threadsafe(self._restore_connectivity) def _restore_connectivity(self): self.connectivity.set() self.connectivity_loss.clear() def reset(self): self.restore_connectivity() def _close_connection(self, connection): conn_task = self.connections.pop(connection, None) if conn_task is not None: conn_task.cancel() def close_all_connections(self): for conn in list(self.connections): self.loop.call_soon_threadsafe(self._close_connection, conn) class Connection: def __init__(self, client_sock, backend_sock, proxy): self.client_sock = client_sock self.backend_sock = backend_sock self.proxy = proxy self.loop = proxy.loop self.connectivity = proxy.connectivity self.connectivity_loss = proxy.connectivity_loss self.proxy_to_backend_task = None self.proxy_from_backend_task = None self.is_closed = False def close(self): if self.is_closed: return self.is_closed = True if self.proxy_to_backend_task is not None: self.proxy_to_backend_task.cancel() self.proxy_to_backend_task = None if self.proxy_from_backend_task is not None: self.proxy_from_backend_task.cancel() self.proxy_from_backend_task = None self.proxy._close_connection(self) async def handle(self): self.proxy_to_backend_task = asyncio.ensure_future( self.proxy_to_backend()) self.proxy_from_backend_task = asyncio.ensure_future( self.proxy_from_backend()) try: await asyncio.wait( [self.proxy_to_backend_task, self.proxy_from_backend_task], return_when=asyncio.FIRST_COMPLETED) finally: if self.proxy_to_backend_task is not None: self.proxy_to_backend_task.cancel() if self.proxy_from_backend_task is not None: self.proxy_from_backend_task.cancel() # Asyncio fails to properly remove the readers and writers # when the task doing recv() or send() is cancelled, so # we must remove the readers and writers manually before # closing the sockets. self.loop.remove_reader(self.client_sock.fileno()) self.loop.remove_writer(self.client_sock.fileno()) self.loop.remove_reader(self.backend_sock.fileno()) self.loop.remove_writer(self.backend_sock.fileno()) self.client_sock.close() self.backend_sock.close() async def _read(self, sock, n): read_task = asyncio.ensure_future( self.loop.sock_recv(sock, n)) conn_event_task = asyncio.ensure_future( self.connectivity_loss.wait()) try: await asyncio.wait( [read_task, conn_event_task], return_when=asyncio.FIRST_COMPLETED) if self.connectivity_loss.is_set(): return None else: return read_task.result() finally: if not self.loop.is_closed(): if not read_task.done(): read_task.cancel() if not conn_event_task.done(): conn_event_task.cancel() async def _write(self, sock, data): write_task = asyncio.ensure_future( self.loop.sock_sendall(sock, data)) conn_event_task = asyncio.ensure_future( self.connectivity_loss.wait()) try: await asyncio.wait( [write_task, conn_event_task], return_when=asyncio.FIRST_COMPLETED) if self.connectivity_loss.is_set(): return None else: return write_task.result() finally: if not self.loop.is_closed(): if not write_task.done(): write_task.cancel() if not conn_event_task.done(): conn_event_task.cancel() async def proxy_to_backend(self): buf = None try: while True: await self.connectivity.wait() if buf is not None: data = buf buf = None else: data = await self._read(self.client_sock, 4096) if data == b'': break if self.connectivity_loss.is_set(): if data: buf = data continue await self._write(self.backend_sock, data) except ConnectionError: pass finally: if not self.loop.is_closed(): self.loop.call_soon(self.close) async def proxy_from_backend(self): buf = None try: while True: await self.connectivity.wait() if buf is not None: data = buf buf = None else: data = await self._read(self.backend_sock, 4096) if data == b'': break if self.connectivity_loss.is_set(): if data: buf = data continue await self._write(self.client_sock, data) except ConnectionError: pass finally: if not self.loop.is_closed(): self.loop.call_soon(self.close) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1729370387.5055544 asyncpg-0.30.0/asyncpg/_version.py0000644000175100001770000000120114705014424016500 0ustar00runnerdocker# This file MUST NOT contain anything but the __version__ assignment. # # When making a release, change the value of __version__ # to an appropriate value, and open a pull request against # the correct branch (master if making a new feature release). # The commit message MUST contain a properly formatted release # log, and the commit must be signed. # # The release automation will: build and test the packages for the # supported platforms, publish the packages on PyPI, merge the PR # to the target branch, create a Git tag pointing to the commit. from __future__ import annotations import typing __version__: typing.Final = '0.30.0' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/cluster.py0000644000175100001770000005763414705014413016360 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncio import os import os.path import platform import random import re import shutil import socket import string import subprocess import sys import tempfile import textwrap import time import asyncpg from asyncpg import serverversion _system = platform.uname().system if _system == 'Windows': def platform_exe(name): if name.endswith('.exe'): return name return name + '.exe' else: def platform_exe(name): return name def find_available_port(): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: sock.bind(('127.0.0.1', 0)) return sock.getsockname()[1] except Exception: return None finally: sock.close() def _world_readable_mkdtemp(suffix=None, prefix=None, dir=None): name = "".join(random.choices(string.ascii_lowercase, k=8)) if dir is None: dir = tempfile.gettempdir() if prefix is None: prefix = tempfile.gettempprefix() if suffix is None: suffix = "" fn = os.path.join(dir, prefix + name + suffix) os.mkdir(fn, 0o755) return fn def _mkdtemp(suffix=None, prefix=None, dir=None): if _system == 'Windows' and os.environ.get("GITHUB_ACTIONS"): # Due to mitigations introduced in python/cpython#118486 # when Python runs in a session created via an SSH connection # tempfile.mkdtemp creates directories that are not accessible. return _world_readable_mkdtemp(suffix, prefix, dir) else: return tempfile.mkdtemp(suffix, prefix, dir) class ClusterError(Exception): pass class Cluster: def __init__(self, data_dir, *, pg_config_path=None): self._data_dir = data_dir self._pg_config_path = pg_config_path self._pg_bin_dir = ( os.environ.get('PGINSTALLATION') or os.environ.get('PGBIN') ) self._pg_ctl = None self._daemon_pid = None self._daemon_process = None self._connection_addr = None self._connection_spec_override = None def get_pg_version(self): return self._pg_version def is_managed(self): return True def get_data_dir(self): return self._data_dir def get_status(self): if self._pg_ctl is None: self._init_env() process = subprocess.run( [self._pg_ctl, 'status', '-D', self._data_dir], stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = process.stdout, process.stderr if (process.returncode == 4 or not os.path.exists(self._data_dir) or not os.listdir(self._data_dir)): return 'not-initialized' elif process.returncode == 3: return 'stopped' elif process.returncode == 0: r = re.match(r'.*PID\s?:\s+(\d+).*', stdout.decode()) if not r: raise ClusterError( 'could not parse pg_ctl status output: {}'.format( stdout.decode())) self._daemon_pid = int(r.group(1)) return self._test_connection(timeout=0) else: raise ClusterError( 'pg_ctl status exited with status {:d}: {}'.format( process.returncode, stderr)) async def connect(self, loop=None, **kwargs): conn_info = self.get_connection_spec() conn_info.update(kwargs) return await asyncpg.connect(loop=loop, **conn_info) def init(self, **settings): """Initialize cluster.""" if self.get_status() != 'not-initialized': raise ClusterError( 'cluster in {!r} has already been initialized'.format( self._data_dir)) settings = dict(settings) if 'encoding' not in settings: settings['encoding'] = 'UTF-8' if settings: settings_args = ['--{}={}'.format(k, v) for k, v in settings.items()] extra_args = ['-o'] + [' '.join(settings_args)] else: extra_args = [] os.makedirs(self._data_dir, exist_ok=True) process = subprocess.run( [self._pg_ctl, 'init', '-D', self._data_dir] + extra_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=self._data_dir, ) output = process.stdout if process.returncode != 0: raise ClusterError( 'pg_ctl init exited with status {:d}:\n{}'.format( process.returncode, output.decode())) return output.decode() def start(self, wait=60, *, server_settings={}, **opts): """Start the cluster.""" status = self.get_status() if status == 'running': return elif status == 'not-initialized': raise ClusterError( 'cluster in {!r} has not been initialized'.format( self._data_dir)) port = opts.pop('port', None) if port == 'dynamic': port = find_available_port() extra_args = ['--{}={}'.format(k, v) for k, v in opts.items()] extra_args.append('--port={}'.format(port)) sockdir = server_settings.get('unix_socket_directories') if sockdir is None: sockdir = server_settings.get('unix_socket_directory') if sockdir is None and _system != 'Windows': sockdir = tempfile.gettempdir() ssl_key = server_settings.get('ssl_key_file') if ssl_key: # Make sure server certificate key file has correct permissions. keyfile = os.path.join(self._data_dir, 'srvkey.pem') shutil.copy(ssl_key, keyfile) os.chmod(keyfile, 0o600) server_settings = server_settings.copy() server_settings['ssl_key_file'] = keyfile if sockdir is not None: if self._pg_version < (9, 3): sockdir_opt = 'unix_socket_directory' else: sockdir_opt = 'unix_socket_directories' server_settings[sockdir_opt] = sockdir for k, v in server_settings.items(): extra_args.extend(['-c', '{}={}'.format(k, v)]) if _system == 'Windows': # On Windows we have to use pg_ctl as direct execution # of postgres daemon under an Administrative account # is not permitted and there is no easy way to drop # privileges. if os.getenv('ASYNCPG_DEBUG_SERVER'): stdout = sys.stdout print( 'asyncpg.cluster: Running', ' '.join([ self._pg_ctl, 'start', '-D', self._data_dir, '-o', ' '.join(extra_args) ]), file=sys.stderr, ) else: stdout = subprocess.DEVNULL process = subprocess.run( [self._pg_ctl, 'start', '-D', self._data_dir, '-o', ' '.join(extra_args)], stdout=stdout, stderr=subprocess.STDOUT, cwd=self._data_dir, ) if process.returncode != 0: if process.stderr: stderr = ':\n{}'.format(process.stderr.decode()) else: stderr = '' raise ClusterError( 'pg_ctl start exited with status {:d}{}'.format( process.returncode, stderr)) else: if os.getenv('ASYNCPG_DEBUG_SERVER'): stdout = sys.stdout else: stdout = subprocess.DEVNULL self._daemon_process = \ subprocess.Popen( [self._postgres, '-D', self._data_dir, *extra_args], stdout=stdout, stderr=subprocess.STDOUT, cwd=self._data_dir, ) self._daemon_pid = self._daemon_process.pid self._test_connection(timeout=wait) def reload(self): """Reload server configuration.""" status = self.get_status() if status != 'running': raise ClusterError('cannot reload: cluster is not running') process = subprocess.run( [self._pg_ctl, 'reload', '-D', self._data_dir], stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=self._data_dir, ) stderr = process.stderr if process.returncode != 0: raise ClusterError( 'pg_ctl stop exited with status {:d}: {}'.format( process.returncode, stderr.decode())) def stop(self, wait=60): process = subprocess.run( [self._pg_ctl, 'stop', '-D', self._data_dir, '-t', str(wait), '-m', 'fast'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=self._data_dir, ) stderr = process.stderr if process.returncode != 0: raise ClusterError( 'pg_ctl stop exited with status {:d}: {}'.format( process.returncode, stderr.decode())) if (self._daemon_process is not None and self._daemon_process.returncode is None): self._daemon_process.kill() def destroy(self): status = self.get_status() if status == 'stopped' or status == 'not-initialized': shutil.rmtree(self._data_dir) else: raise ClusterError('cannot destroy {} cluster'.format(status)) def _get_connection_spec(self): if self._connection_addr is None: self._connection_addr = self._connection_addr_from_pidfile() if self._connection_addr is not None: if self._connection_spec_override: args = self._connection_addr.copy() args.update(self._connection_spec_override) return args else: return self._connection_addr def get_connection_spec(self): status = self.get_status() if status != 'running': raise ClusterError('cluster is not running') return self._get_connection_spec() def override_connection_spec(self, **kwargs): self._connection_spec_override = kwargs def reset_wal(self, *, oid=None, xid=None): status = self.get_status() if status == 'not-initialized': raise ClusterError( 'cannot modify WAL status: cluster is not initialized') if status == 'running': raise ClusterError( 'cannot modify WAL status: cluster is running') opts = [] if oid is not None: opts.extend(['-o', str(oid)]) if xid is not None: opts.extend(['-x', str(xid)]) if not opts: return opts.append(self._data_dir) try: reset_wal = self._find_pg_binary('pg_resetwal') except ClusterError: reset_wal = self._find_pg_binary('pg_resetxlog') process = subprocess.run( [reset_wal] + opts, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stderr = process.stderr if process.returncode != 0: raise ClusterError( 'pg_resetwal exited with status {:d}: {}'.format( process.returncode, stderr.decode())) def reset_hba(self): """Remove all records from pg_hba.conf.""" status = self.get_status() if status == 'not-initialized': raise ClusterError( 'cannot modify HBA records: cluster is not initialized') pg_hba = os.path.join(self._data_dir, 'pg_hba.conf') try: with open(pg_hba, 'w'): pass except IOError as e: raise ClusterError( 'cannot modify HBA records: {}'.format(e)) from e def add_hba_entry(self, *, type='host', database, user, address=None, auth_method, auth_options=None): """Add a record to pg_hba.conf.""" status = self.get_status() if status == 'not-initialized': raise ClusterError( 'cannot modify HBA records: cluster is not initialized') if type not in {'local', 'host', 'hostssl', 'hostnossl'}: raise ValueError('invalid HBA record type: {!r}'.format(type)) pg_hba = os.path.join(self._data_dir, 'pg_hba.conf') record = '{} {} {}'.format(type, database, user) if type != 'local': if address is None: raise ValueError( '{!r} entry requires a valid address'.format(type)) else: record += ' {}'.format(address) record += ' {}'.format(auth_method) if auth_options is not None: record += ' ' + ' '.join( '{}={}'.format(k, v) for k, v in auth_options) try: with open(pg_hba, 'a') as f: print(record, file=f) except IOError as e: raise ClusterError( 'cannot modify HBA records: {}'.format(e)) from e def trust_local_connections(self): self.reset_hba() if _system != 'Windows': self.add_hba_entry(type='local', database='all', user='all', auth_method='trust') self.add_hba_entry(type='host', address='127.0.0.1/32', database='all', user='all', auth_method='trust') self.add_hba_entry(type='host', address='::1/128', database='all', user='all', auth_method='trust') status = self.get_status() if status == 'running': self.reload() def trust_local_replication_by(self, user): if _system != 'Windows': self.add_hba_entry(type='local', database='replication', user=user, auth_method='trust') self.add_hba_entry(type='host', address='127.0.0.1/32', database='replication', user=user, auth_method='trust') self.add_hba_entry(type='host', address='::1/128', database='replication', user=user, auth_method='trust') status = self.get_status() if status == 'running': self.reload() def _init_env(self): if not self._pg_bin_dir: pg_config = self._find_pg_config(self._pg_config_path) pg_config_data = self._run_pg_config(pg_config) self._pg_bin_dir = pg_config_data.get('bindir') if not self._pg_bin_dir: raise ClusterError( 'pg_config output did not provide the BINDIR value') self._pg_ctl = self._find_pg_binary('pg_ctl') self._postgres = self._find_pg_binary('postgres') self._pg_version = self._get_pg_version() def _connection_addr_from_pidfile(self): pidfile = os.path.join(self._data_dir, 'postmaster.pid') try: with open(pidfile, 'rt') as f: piddata = f.read() except FileNotFoundError: return None lines = piddata.splitlines() if len(lines) < 6: # A complete postgres pidfile is at least 6 lines return None pmpid = int(lines[0]) if self._daemon_pid and pmpid != self._daemon_pid: # This might be an old pidfile left from previous postgres # daemon run. return None portnum = lines[3] sockdir = lines[4] hostaddr = lines[5] if sockdir: if sockdir[0] != '/': # Relative sockdir sockdir = os.path.normpath( os.path.join(self._data_dir, sockdir)) host_str = sockdir else: host_str = hostaddr if host_str == '*': host_str = 'localhost' elif host_str == '0.0.0.0': host_str = '127.0.0.1' elif host_str == '::': host_str = '::1' return { 'host': host_str, 'port': portnum } def _test_connection(self, timeout=60): self._connection_addr = None loop = asyncio.new_event_loop() try: for i in range(timeout): if self._connection_addr is None: conn_spec = self._get_connection_spec() if conn_spec is None: time.sleep(1) continue try: con = loop.run_until_complete( asyncpg.connect(database='postgres', user='postgres', timeout=5, loop=loop, **self._connection_addr)) except (OSError, asyncio.TimeoutError, asyncpg.CannotConnectNowError, asyncpg.PostgresConnectionError): time.sleep(1) continue except asyncpg.PostgresError: # Any other error other than ServerNotReadyError or # ConnectionError is interpreted to indicate the server is # up. break else: loop.run_until_complete(con.close()) break finally: loop.close() return 'running' def _run_pg_config(self, pg_config_path): process = subprocess.run( pg_config_path, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = process.stdout, process.stderr if process.returncode != 0: raise ClusterError('pg_config exited with status {:d}: {}'.format( process.returncode, stderr)) else: config = {} for line in stdout.splitlines(): k, eq, v = line.decode('utf-8').partition('=') if eq: config[k.strip().lower()] = v.strip() return config def _find_pg_config(self, pg_config_path): if pg_config_path is None: pg_install = ( os.environ.get('PGINSTALLATION') or os.environ.get('PGBIN') ) if pg_install: pg_config_path = platform_exe( os.path.join(pg_install, 'pg_config')) else: pathenv = os.environ.get('PATH').split(os.pathsep) for path in pathenv: pg_config_path = platform_exe( os.path.join(path, 'pg_config')) if os.path.exists(pg_config_path): break else: pg_config_path = None if not pg_config_path: raise ClusterError('could not find pg_config executable') if not os.path.isfile(pg_config_path): raise ClusterError('{!r} is not an executable'.format( pg_config_path)) return pg_config_path def _find_pg_binary(self, binary): bpath = platform_exe(os.path.join(self._pg_bin_dir, binary)) if not os.path.isfile(bpath): raise ClusterError( 'could not find {} executable: '.format(binary) + '{!r} does not exist or is not a file'.format(bpath)) return bpath def _get_pg_version(self): process = subprocess.run( [self._postgres, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = process.stdout, process.stderr if process.returncode != 0: raise ClusterError( 'postgres --version exited with status {:d}: {}'.format( process.returncode, stderr)) version_string = stdout.decode('utf-8').strip(' \n') prefix = 'postgres (PostgreSQL) ' if not version_string.startswith(prefix): raise ClusterError( 'could not determine server version from {!r}'.format( version_string)) version_string = version_string[len(prefix):] return serverversion.split_server_version_string(version_string) class TempCluster(Cluster): def __init__(self, *, data_dir_suffix=None, data_dir_prefix=None, data_dir_parent=None, pg_config_path=None): self._data_dir = _mkdtemp(suffix=data_dir_suffix, prefix=data_dir_prefix, dir=data_dir_parent) super().__init__(self._data_dir, pg_config_path=pg_config_path) class HotStandbyCluster(TempCluster): def __init__(self, *, master, replication_user, data_dir_suffix=None, data_dir_prefix=None, data_dir_parent=None, pg_config_path=None): self._master = master self._repl_user = replication_user super().__init__( data_dir_suffix=data_dir_suffix, data_dir_prefix=data_dir_prefix, data_dir_parent=data_dir_parent, pg_config_path=pg_config_path) def _init_env(self): super()._init_env() self._pg_basebackup = self._find_pg_binary('pg_basebackup') def init(self, **settings): """Initialize cluster.""" if self.get_status() != 'not-initialized': raise ClusterError( 'cluster in {!r} has already been initialized'.format( self._data_dir)) process = subprocess.run( [self._pg_basebackup, '-h', self._master['host'], '-p', self._master['port'], '-D', self._data_dir, '-U', self._repl_user], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) output = process.stdout if process.returncode != 0: raise ClusterError( 'pg_basebackup init exited with status {:d}:\n{}'.format( process.returncode, output.decode())) if self._pg_version < (12, 0): with open(os.path.join(self._data_dir, 'recovery.conf'), 'w') as f: f.write(textwrap.dedent("""\ standby_mode = 'on' primary_conninfo = 'host={host} port={port} user={user}' """.format( host=self._master['host'], port=self._master['port'], user=self._repl_user))) else: f = open(os.path.join(self._data_dir, 'standby.signal'), 'w') f.close() return output.decode() def start(self, wait=60, *, server_settings={}, **opts): if self._pg_version >= (12, 0): server_settings = server_settings.copy() server_settings['primary_conninfo'] = ( '"host={host} port={port} user={user}"'.format( host=self._master['host'], port=self._master['port'], user=self._repl_user, ) ) super().start(wait=wait, server_settings=server_settings, **opts) class RunningCluster(Cluster): def __init__(self, **kwargs): self.conn_spec = kwargs def is_managed(self): return False def get_connection_spec(self): return dict(self.conn_spec) def get_status(self): return 'running' def init(self, **settings): pass def start(self, wait=60, **settings): pass def stop(self, wait=60): pass def destroy(self): pass def reset_hba(self): raise ClusterError('cannot modify HBA records of unmanaged cluster') def add_hba_entry(self, *, type='host', database, user, address=None, auth_method, auth_options=None): raise ClusterError('cannot modify HBA records of unmanaged cluster') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/compat.py0000644000175100001770000000463314705014413016151 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 from __future__ import annotations import enum import pathlib import platform import typing import sys if typing.TYPE_CHECKING: import asyncio SYSTEM: typing.Final = platform.uname().system if sys.platform == 'win32': import ctypes.wintypes CSIDL_APPDATA: typing.Final = 0x001a def get_pg_home_directory() -> pathlib.Path | None: # We cannot simply use expanduser() as that returns the user's # home directory, whereas Postgres stores its config in # %AppData% on Windows. buf = ctypes.create_unicode_buffer(ctypes.wintypes.MAX_PATH) r = ctypes.windll.shell32.SHGetFolderPathW(0, CSIDL_APPDATA, 0, 0, buf) if r: return None else: return pathlib.Path(buf.value) / 'postgresql' else: def get_pg_home_directory() -> pathlib.Path | None: try: return pathlib.Path.home() except (RuntimeError, KeyError): return None async def wait_closed(stream: asyncio.StreamWriter) -> None: # Not all asyncio versions have StreamWriter.wait_closed(). if hasattr(stream, 'wait_closed'): try: await stream.wait_closed() except ConnectionResetError: # On Windows wait_closed() sometimes propagates # ConnectionResetError which is totally unnecessary. pass if sys.version_info < (3, 12): def markcoroutinefunction(c): # type: ignore pass else: from inspect import markcoroutinefunction # noqa: F401 if sys.version_info < (3, 12): from ._asyncio_compat import wait_for as wait_for # noqa: F401 else: from asyncio import wait_for as wait_for # noqa: F401 if sys.version_info < (3, 11): from ._asyncio_compat import timeout_ctx as timeout # noqa: F401 else: from asyncio import timeout as timeout # noqa: F401 if sys.version_info < (3, 9): from typing import ( # noqa: F401 Awaitable as Awaitable, ) else: from collections.abc import ( # noqa: F401 Awaitable as Awaitable, ) if sys.version_info < (3, 11): class StrEnum(str, enum.Enum): __str__ = str.__str__ __repr__ = enum.Enum.__repr__ else: from enum import StrEnum as StrEnum # noqa: F401 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/connect_utils.py0000644000175100001770000011007314705014413017533 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncio import collections import enum import functools import getpass import os import pathlib import platform import random import re import socket import ssl as ssl_module import stat import struct import sys import typing import urllib.parse import warnings import inspect from . import compat from . import exceptions from . import protocol class SSLMode(enum.IntEnum): disable = 0 allow = 1 prefer = 2 require = 3 verify_ca = 4 verify_full = 5 @classmethod def parse(cls, sslmode): if isinstance(sslmode, cls): return sslmode return getattr(cls, sslmode.replace('-', '_')) class SSLNegotiation(compat.StrEnum): postgres = "postgres" direct = "direct" _ConnectionParameters = collections.namedtuple( 'ConnectionParameters', [ 'user', 'password', 'database', 'ssl', 'sslmode', 'ssl_negotiation', 'server_settings', 'target_session_attrs', 'krbsrvname', 'gsslib', ]) _ClientConfiguration = collections.namedtuple( 'ConnectionConfiguration', [ 'command_timeout', 'statement_cache_size', 'max_cached_statement_lifetime', 'max_cacheable_statement_size', ]) _system = platform.uname().system if _system == 'Windows': PGPASSFILE = 'pgpass.conf' else: PGPASSFILE = '.pgpass' def _read_password_file(passfile: pathlib.Path) \ -> typing.List[typing.Tuple[str, ...]]: passtab = [] try: if not passfile.exists(): return [] if not passfile.is_file(): warnings.warn( 'password file {!r} is not a plain file'.format(passfile)) return [] if _system != 'Windows': if passfile.stat().st_mode & (stat.S_IRWXG | stat.S_IRWXO): warnings.warn( 'password file {!r} has group or world access; ' 'permissions should be u=rw (0600) or less'.format( passfile)) return [] with passfile.open('rt') as f: for line in f: line = line.strip() if not line or line.startswith('#'): # Skip empty lines and comments. continue # Backslash escapes both itself and the colon, # which is a record separator. line = line.replace(R'\\', '\n') passtab.append(tuple( p.replace('\n', R'\\') for p in re.split(r'(? typing.Optional[pathlib.Path]: try: homedir = pathlib.Path.home() except (RuntimeError, KeyError): return None return (homedir / '.postgresql' / filename).resolve() def _parse_connect_dsn_and_args(*, dsn, host, port, user, password, passfile, database, ssl, direct_tls, server_settings, target_session_attrs, krbsrvname, gsslib): # `auth_hosts` is the version of host information for the purposes # of reading the pgpass file. auth_hosts = None sslcert = sslkey = sslrootcert = sslcrl = sslpassword = None ssl_min_protocol_version = ssl_max_protocol_version = None sslnegotiation = None if dsn: parsed = urllib.parse.urlparse(dsn) if parsed.scheme not in {'postgresql', 'postgres'}: raise exceptions.ClientConfigurationError( 'invalid DSN: scheme is expected to be either ' '"postgresql" or "postgres", got {!r}'.format(parsed.scheme)) if parsed.netloc: if '@' in parsed.netloc: dsn_auth, _, dsn_hostspec = parsed.netloc.partition('@') else: dsn_hostspec = parsed.netloc dsn_auth = '' else: dsn_auth = dsn_hostspec = '' if dsn_auth: dsn_user, _, dsn_password = dsn_auth.partition(':') else: dsn_user = dsn_password = '' if not host and dsn_hostspec: host, port = _parse_hostlist(dsn_hostspec, port, unquote=True) if parsed.path and database is None: dsn_database = parsed.path if dsn_database.startswith('/'): dsn_database = dsn_database[1:] database = urllib.parse.unquote(dsn_database) if user is None and dsn_user: user = urllib.parse.unquote(dsn_user) if password is None and dsn_password: password = urllib.parse.unquote(dsn_password) if parsed.query: query = urllib.parse.parse_qs(parsed.query, strict_parsing=True) for key, val in query.items(): if isinstance(val, list): query[key] = val[-1] if 'port' in query: val = query.pop('port') if not port and val: port = [int(p) for p in val.split(',')] if 'host' in query: val = query.pop('host') if not host and val: host, port = _parse_hostlist(val, port) if 'dbname' in query: val = query.pop('dbname') if database is None: database = val if 'database' in query: val = query.pop('database') if database is None: database = val if 'user' in query: val = query.pop('user') if user is None: user = val if 'password' in query: val = query.pop('password') if password is None: password = val if 'passfile' in query: val = query.pop('passfile') if passfile is None: passfile = val if 'sslmode' in query: val = query.pop('sslmode') if ssl is None: ssl = val if 'sslcert' in query: sslcert = query.pop('sslcert') if 'sslkey' in query: sslkey = query.pop('sslkey') if 'sslrootcert' in query: sslrootcert = query.pop('sslrootcert') if 'sslnegotiation' in query: sslnegotiation = query.pop('sslnegotiation') if 'sslcrl' in query: sslcrl = query.pop('sslcrl') if 'sslpassword' in query: sslpassword = query.pop('sslpassword') if 'ssl_min_protocol_version' in query: ssl_min_protocol_version = query.pop( 'ssl_min_protocol_version' ) if 'ssl_max_protocol_version' in query: ssl_max_protocol_version = query.pop( 'ssl_max_protocol_version' ) if 'target_session_attrs' in query: dsn_target_session_attrs = query.pop( 'target_session_attrs' ) if target_session_attrs is None: target_session_attrs = dsn_target_session_attrs if 'krbsrvname' in query: val = query.pop('krbsrvname') if krbsrvname is None: krbsrvname = val if 'gsslib' in query: val = query.pop('gsslib') if gsslib is None: gsslib = val if query: if server_settings is None: server_settings = query else: server_settings = {**query, **server_settings} if not host: hostspec = os.environ.get('PGHOST') if hostspec: host, port = _parse_hostlist(hostspec, port) if not host: auth_hosts = ['localhost'] if _system == 'Windows': host = ['localhost'] else: host = ['/run/postgresql', '/var/run/postgresql', '/tmp', '/private/tmp', 'localhost'] if not isinstance(host, (list, tuple)): host = [host] if auth_hosts is None: auth_hosts = host if not port: portspec = os.environ.get('PGPORT') if portspec: if ',' in portspec: port = [int(p) for p in portspec.split(',')] else: port = int(portspec) else: port = 5432 elif isinstance(port, (list, tuple)): port = [int(p) for p in port] else: port = int(port) port = _validate_port_spec(host, port) if user is None: user = os.getenv('PGUSER') if not user: user = getpass.getuser() if password is None: password = os.getenv('PGPASSWORD') if database is None: database = os.getenv('PGDATABASE') if database is None: database = user if user is None: raise exceptions.ClientConfigurationError( 'could not determine user name to connect with') if database is None: raise exceptions.ClientConfigurationError( 'could not determine database name to connect to') if password is None: if passfile is None: passfile = os.getenv('PGPASSFILE') if passfile is None: homedir = compat.get_pg_home_directory() if homedir: passfile = homedir / PGPASSFILE else: passfile = None else: passfile = pathlib.Path(passfile) if passfile is not None: password = _read_password_from_pgpass( hosts=auth_hosts, ports=port, database=database, user=user, passfile=passfile) addrs = [] have_tcp_addrs = False for h, p in zip(host, port): if h.startswith('/'): # UNIX socket name if '.s.PGSQL.' not in h: h = os.path.join(h, '.s.PGSQL.{}'.format(p)) addrs.append(h) else: # TCP host/port addrs.append((h, p)) have_tcp_addrs = True if not addrs: raise exceptions.InternalClientError( 'could not determine the database address to connect to') if ssl is None: ssl = os.getenv('PGSSLMODE') if ssl is None and have_tcp_addrs: ssl = 'prefer' if direct_tls is not None: sslneg = ( SSLNegotiation.direct if direct_tls else SSLNegotiation.postgres ) else: if sslnegotiation is None: sslnegotiation = os.environ.get("PGSSLNEGOTIATION") if sslnegotiation is not None: try: sslneg = SSLNegotiation(sslnegotiation) except ValueError: modes = ', '.join( m.name.replace('_', '-') for m in SSLNegotiation ) raise exceptions.ClientConfigurationError( f'`sslnegotiation` parameter must be one of: {modes}' ) from None else: sslneg = SSLNegotiation.postgres if isinstance(ssl, (str, SSLMode)): try: sslmode = SSLMode.parse(ssl) except AttributeError: modes = ', '.join(m.name.replace('_', '-') for m in SSLMode) raise exceptions.ClientConfigurationError( '`sslmode` parameter must be one of: {}'.format(modes) ) from None # docs at https://www.postgresql.org/docs/10/static/libpq-connect.html if sslmode < SSLMode.allow: ssl = False else: ssl = ssl_module.SSLContext(ssl_module.PROTOCOL_TLS_CLIENT) ssl.check_hostname = sslmode >= SSLMode.verify_full if sslmode < SSLMode.require: ssl.verify_mode = ssl_module.CERT_NONE else: if sslrootcert is None: sslrootcert = os.getenv('PGSSLROOTCERT') if sslrootcert: ssl.load_verify_locations(cafile=sslrootcert) ssl.verify_mode = ssl_module.CERT_REQUIRED else: try: sslrootcert = _dot_postgresql_path('root.crt') if sslrootcert is not None: ssl.load_verify_locations(cafile=sslrootcert) else: raise exceptions.ClientConfigurationError( 'cannot determine location of user ' 'PostgreSQL configuration directory' ) except ( exceptions.ClientConfigurationError, FileNotFoundError, NotADirectoryError, ): if sslmode > SSLMode.require: if sslrootcert is None: sslrootcert = '~/.postgresql/root.crt' detail = ( 'Could not determine location of user ' 'home directory (HOME is either unset, ' 'inaccessible, or does not point to a ' 'valid directory)' ) else: detail = None raise exceptions.ClientConfigurationError( f'root certificate file "{sslrootcert}" does ' f'not exist or cannot be accessed', hint='Provide the certificate file directly ' f'or make sure "{sslrootcert}" ' 'exists and is readable.', detail=detail, ) elif sslmode == SSLMode.require: ssl.verify_mode = ssl_module.CERT_NONE else: assert False, 'unreachable' else: ssl.verify_mode = ssl_module.CERT_REQUIRED if sslcrl is None: sslcrl = os.getenv('PGSSLCRL') if sslcrl: ssl.load_verify_locations(cafile=sslcrl) ssl.verify_flags |= ssl_module.VERIFY_CRL_CHECK_CHAIN else: sslcrl = _dot_postgresql_path('root.crl') if sslcrl is not None: try: ssl.load_verify_locations(cafile=sslcrl) except ( FileNotFoundError, NotADirectoryError, ): pass else: ssl.verify_flags |= \ ssl_module.VERIFY_CRL_CHECK_CHAIN if sslkey is None: sslkey = os.getenv('PGSSLKEY') if not sslkey: sslkey = _dot_postgresql_path('postgresql.key') if sslkey is not None and not sslkey.exists(): sslkey = None if not sslpassword: sslpassword = '' if sslcert is None: sslcert = os.getenv('PGSSLCERT') if sslcert: ssl.load_cert_chain( sslcert, keyfile=sslkey, password=lambda: sslpassword ) else: sslcert = _dot_postgresql_path('postgresql.crt') if sslcert is not None: try: ssl.load_cert_chain( sslcert, keyfile=sslkey, password=lambda: sslpassword ) except (FileNotFoundError, NotADirectoryError): pass # OpenSSL 1.1.1 keylog file, copied from create_default_context() if hasattr(ssl, 'keylog_filename'): keylogfile = os.environ.get('SSLKEYLOGFILE') if keylogfile and not sys.flags.ignore_environment: ssl.keylog_filename = keylogfile if ssl_min_protocol_version is None: ssl_min_protocol_version = os.getenv('PGSSLMINPROTOCOLVERSION') if ssl_min_protocol_version: ssl.minimum_version = _parse_tls_version( ssl_min_protocol_version ) else: ssl.minimum_version = _parse_tls_version('TLSv1.2') if ssl_max_protocol_version is None: ssl_max_protocol_version = os.getenv('PGSSLMAXPROTOCOLVERSION') if ssl_max_protocol_version: ssl.maximum_version = _parse_tls_version( ssl_max_protocol_version ) elif ssl is True: ssl = ssl_module.create_default_context() sslmode = SSLMode.verify_full else: sslmode = SSLMode.disable if server_settings is not None and ( not isinstance(server_settings, dict) or not all(isinstance(k, str) for k in server_settings) or not all(isinstance(v, str) for v in server_settings.values())): raise exceptions.ClientConfigurationError( 'server_settings is expected to be None or ' 'a Dict[str, str]') if target_session_attrs is None: target_session_attrs = os.getenv( "PGTARGETSESSIONATTRS", SessionAttribute.any ) try: target_session_attrs = SessionAttribute(target_session_attrs) except ValueError: raise exceptions.ClientConfigurationError( "target_session_attrs is expected to be one of " "{!r}" ", got {!r}".format( SessionAttribute.__members__.values, target_session_attrs ) ) from None if krbsrvname is None: krbsrvname = os.getenv('PGKRBSRVNAME') if gsslib is None: gsslib = os.getenv('PGGSSLIB') if gsslib is None: gsslib = 'sspi' if _system == 'Windows' else 'gssapi' if gsslib not in {'gssapi', 'sspi'}: raise exceptions.ClientConfigurationError( "gsslib parameter must be either 'gssapi' or 'sspi'" ", got {!r}".format(gsslib)) params = _ConnectionParameters( user=user, password=password, database=database, ssl=ssl, sslmode=sslmode, ssl_negotiation=sslneg, server_settings=server_settings, target_session_attrs=target_session_attrs, krbsrvname=krbsrvname, gsslib=gsslib) return addrs, params def _parse_connect_arguments(*, dsn, host, port, user, password, passfile, database, command_timeout, statement_cache_size, max_cached_statement_lifetime, max_cacheable_statement_size, ssl, direct_tls, server_settings, target_session_attrs, krbsrvname, gsslib): local_vars = locals() for var_name in {'max_cacheable_statement_size', 'max_cached_statement_lifetime', 'statement_cache_size'}: var_val = local_vars[var_name] if var_val is None or isinstance(var_val, bool) or var_val < 0: raise ValueError( '{} is expected to be greater ' 'or equal to 0, got {!r}'.format(var_name, var_val)) if command_timeout is not None: try: if isinstance(command_timeout, bool): raise ValueError command_timeout = float(command_timeout) if command_timeout <= 0: raise ValueError except ValueError: raise ValueError( 'invalid command_timeout value: ' 'expected greater than 0 float (got {!r})'.format( command_timeout)) from None addrs, params = _parse_connect_dsn_and_args( dsn=dsn, host=host, port=port, user=user, password=password, passfile=passfile, ssl=ssl, direct_tls=direct_tls, database=database, server_settings=server_settings, target_session_attrs=target_session_attrs, krbsrvname=krbsrvname, gsslib=gsslib) config = _ClientConfiguration( command_timeout=command_timeout, statement_cache_size=statement_cache_size, max_cached_statement_lifetime=max_cached_statement_lifetime, max_cacheable_statement_size=max_cacheable_statement_size,) return addrs, params, config class TLSUpgradeProto(asyncio.Protocol): def __init__(self, loop, host, port, ssl_context, ssl_is_advisory): self.on_data = _create_future(loop) self.host = host self.port = port self.ssl_context = ssl_context self.ssl_is_advisory = ssl_is_advisory def data_received(self, data): if data == b'S': self.on_data.set_result(True) elif (self.ssl_is_advisory and self.ssl_context.verify_mode == ssl_module.CERT_NONE and data == b'N'): # ssl_is_advisory will imply that ssl.verify_mode == CERT_NONE, # since the only way to get ssl_is_advisory is from # sslmode=prefer. But be extra sure to disallow insecure # connections when the ssl context asks for real security. self.on_data.set_result(False) else: self.on_data.set_exception( ConnectionError( 'PostgreSQL server at "{host}:{port}" ' 'rejected SSL upgrade'.format( host=self.host, port=self.port))) def connection_lost(self, exc): if not self.on_data.done(): if exc is None: exc = ConnectionError('unexpected connection_lost() call') self.on_data.set_exception(exc) async def _create_ssl_connection(protocol_factory, host, port, *, loop, ssl_context, ssl_is_advisory=False): tr, pr = await loop.create_connection( lambda: TLSUpgradeProto(loop, host, port, ssl_context, ssl_is_advisory), host, port) tr.write(struct.pack('!ll', 8, 80877103)) # SSLRequest message. try: do_ssl_upgrade = await pr.on_data except (Exception, asyncio.CancelledError): tr.close() raise if hasattr(loop, 'start_tls'): if do_ssl_upgrade: try: new_tr = await loop.start_tls( tr, pr, ssl_context, server_hostname=host) except (Exception, asyncio.CancelledError): tr.close() raise else: new_tr = tr pg_proto = protocol_factory() pg_proto.is_ssl = do_ssl_upgrade pg_proto.connection_made(new_tr) new_tr.set_protocol(pg_proto) return new_tr, pg_proto else: conn_factory = functools.partial( loop.create_connection, protocol_factory) if do_ssl_upgrade: conn_factory = functools.partial( conn_factory, ssl=ssl_context, server_hostname=host) sock = _get_socket(tr) sock = sock.dup() _set_nodelay(sock) tr.close() try: new_tr, pg_proto = await conn_factory(sock=sock) pg_proto.is_ssl = do_ssl_upgrade return new_tr, pg_proto except (Exception, asyncio.CancelledError): sock.close() raise async def _connect_addr( *, addr, loop, params, config, connection_class, record_class ): assert loop is not None params_input = params if callable(params.password): password = params.password() if inspect.isawaitable(password): password = await password params = params._replace(password=password) args = (addr, loop, config, connection_class, record_class, params_input) # prepare the params (which attempt has ssl) for the 2 attempts if params.sslmode == SSLMode.allow: params_retry = params params = params._replace(ssl=None) elif params.sslmode == SSLMode.prefer: params_retry = params._replace(ssl=None) else: # skip retry if we don't have to return await __connect_addr(params, False, *args) # first attempt try: return await __connect_addr(params, True, *args) except _RetryConnectSignal: pass # second attempt return await __connect_addr(params_retry, False, *args) class _RetryConnectSignal(Exception): pass async def __connect_addr( params, retry, addr, loop, config, connection_class, record_class, params_input, ): connected = _create_future(loop) proto_factory = lambda: protocol.Protocol( addr, connected, params, record_class, loop) if isinstance(addr, str): # UNIX socket connector = loop.create_unix_connection(proto_factory, addr) elif params.ssl and params.ssl_negotiation is SSLNegotiation.direct: # if ssl and ssl_negotiation is `direct`, skip STARTTLS and perform # direct SSL connection connector = loop.create_connection( proto_factory, *addr, ssl=params.ssl ) elif params.ssl: connector = _create_ssl_connection( proto_factory, *addr, loop=loop, ssl_context=params.ssl, ssl_is_advisory=params.sslmode == SSLMode.prefer) else: connector = loop.create_connection(proto_factory, *addr) tr, pr = await connector try: await connected except ( exceptions.InvalidAuthorizationSpecificationError, exceptions.ConnectionDoesNotExistError, # seen on Windows ): tr.close() # retry=True here is a redundant check because we don't want to # accidentally raise the internal _RetryConnectSignal to the user if retry and ( params.sslmode == SSLMode.allow and not pr.is_ssl or params.sslmode == SSLMode.prefer and pr.is_ssl ): # Trigger retry when: # 1. First attempt with sslmode=allow, ssl=None failed # 2. First attempt with sslmode=prefer, ssl=ctx failed while the # server claimed to support SSL (returning "S" for SSLRequest) # (likely because pg_hba.conf rejected the connection) raise _RetryConnectSignal() else: # but will NOT retry if: # 1. First attempt with sslmode=prefer failed but the server # doesn't support SSL (returning 'N' for SSLRequest), because # we already tried to connect without SSL thru ssl_is_advisory # 2. Second attempt with sslmode=prefer, ssl=None failed # 3. Second attempt with sslmode=allow, ssl=ctx failed # 4. Any other sslmode raise except (Exception, asyncio.CancelledError): tr.close() raise con = connection_class(pr, tr, loop, addr, config, params_input) pr.set_connection(con) return con class SessionAttribute(str, enum.Enum): any = 'any' primary = 'primary' standby = 'standby' prefer_standby = 'prefer-standby' read_write = "read-write" read_only = "read-only" def _accept_in_hot_standby(should_be_in_hot_standby: bool): """ If the server didn't report "in_hot_standby" at startup, we must determine the state by checking "SELECT pg_catalog.pg_is_in_recovery()". If the server allows a connection and states it is in recovery it must be a replica/standby server. """ async def can_be_used(connection): settings = connection.get_settings() hot_standby_status = getattr(settings, 'in_hot_standby', None) if hot_standby_status is not None: is_in_hot_standby = hot_standby_status == 'on' else: is_in_hot_standby = await connection.fetchval( "SELECT pg_catalog.pg_is_in_recovery()" ) return is_in_hot_standby == should_be_in_hot_standby return can_be_used def _accept_read_only(should_be_read_only: bool): """ Verify the server has not set default_transaction_read_only=True """ async def can_be_used(connection): settings = connection.get_settings() is_readonly = getattr(settings, 'default_transaction_read_only', 'off') if is_readonly == "on": return should_be_read_only return await _accept_in_hot_standby(should_be_read_only)(connection) return can_be_used async def _accept_any(_): return True target_attrs_check = { SessionAttribute.any: _accept_any, SessionAttribute.primary: _accept_in_hot_standby(False), SessionAttribute.standby: _accept_in_hot_standby(True), SessionAttribute.prefer_standby: _accept_in_hot_standby(True), SessionAttribute.read_write: _accept_read_only(False), SessionAttribute.read_only: _accept_read_only(True), } async def _can_use_connection(connection, attr: SessionAttribute): can_use = target_attrs_check[attr] return await can_use(connection) async def _connect(*, loop, connection_class, record_class, **kwargs): if loop is None: loop = asyncio.get_event_loop() addrs, params, config = _parse_connect_arguments(**kwargs) target_attr = params.target_session_attrs candidates = [] chosen_connection = None last_error = None for addr in addrs: try: conn = await _connect_addr( addr=addr, loop=loop, params=params, config=config, connection_class=connection_class, record_class=record_class, ) candidates.append(conn) if await _can_use_connection(conn, target_attr): chosen_connection = conn break except OSError as ex: last_error = ex else: if target_attr == SessionAttribute.prefer_standby and candidates: chosen_connection = random.choice(candidates) await asyncio.gather( *(c.close() for c in candidates if c is not chosen_connection), return_exceptions=True ) if chosen_connection: return chosen_connection raise last_error or exceptions.TargetServerAttributeNotMatched( 'None of the hosts match the target attribute requirement ' '{!r}'.format(target_attr) ) async def _cancel(*, loop, addr, params: _ConnectionParameters, backend_pid, backend_secret): class CancelProto(asyncio.Protocol): def __init__(self): self.on_disconnect = _create_future(loop) self.is_ssl = False def connection_lost(self, exc): if not self.on_disconnect.done(): self.on_disconnect.set_result(True) if isinstance(addr, str): tr, pr = await loop.create_unix_connection(CancelProto, addr) else: if params.ssl and params.sslmode != SSLMode.allow: tr, pr = await _create_ssl_connection( CancelProto, *addr, loop=loop, ssl_context=params.ssl, ssl_is_advisory=params.sslmode == SSLMode.prefer) else: tr, pr = await loop.create_connection( CancelProto, *addr) _set_nodelay(_get_socket(tr)) # Pack a CancelRequest message msg = struct.pack('!llll', 16, 80877102, backend_pid, backend_secret) try: tr.write(msg) await pr.on_disconnect finally: tr.close() def _get_socket(transport): sock = transport.get_extra_info('socket') if sock is None: # Shouldn't happen with any asyncio-complaint event loop. raise ConnectionError( 'could not get the socket for transport {!r}'.format(transport)) return sock def _set_nodelay(sock): if not hasattr(socket, 'AF_UNIX') or sock.family != socket.AF_UNIX: sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) def _create_future(loop): try: create_future = loop.create_future except AttributeError: return asyncio.Future(loop=loop) else: return create_future() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/connection.py0000644000175100001770000030036114705014413017022 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncio import asyncpg import collections import collections.abc import contextlib import functools import itertools import inspect import os import sys import time import traceback import typing import warnings import weakref from . import compat from . import connect_utils from . import cursor from . import exceptions from . import introspection from . import prepared_stmt from . import protocol from . import serverversion from . import transaction from . import utils class ConnectionMeta(type): def __instancecheck__(cls, instance): mro = type(instance).__mro__ return Connection in mro or _ConnectionProxy in mro class Connection(metaclass=ConnectionMeta): """A representation of a database session. Connections are created by calling :func:`~asyncpg.connection.connect`. """ __slots__ = ('_protocol', '_transport', '_loop', '_top_xact', '_aborted', '_pool_release_ctr', '_stmt_cache', '_stmts_to_close', '_stmt_cache_enabled', '_listeners', '_server_version', '_server_caps', '_intro_query', '_reset_query', '_proxy', '_stmt_exclusive_section', '_config', '_params', '_addr', '_log_listeners', '_termination_listeners', '_cancellations', '_source_traceback', '_query_loggers', '__weakref__') def __init__(self, protocol, transport, loop, addr, config: connect_utils._ClientConfiguration, params: connect_utils._ConnectionParameters): self._protocol = protocol self._transport = transport self._loop = loop self._top_xact = None self._aborted = False # Incremented every time the connection is released back to a pool. # Used to catch invalid references to connection-related resources # post-release (e.g. explicit prepared statements). self._pool_release_ctr = 0 self._addr = addr self._config = config self._params = params self._stmt_cache = _StatementCache( loop=loop, max_size=config.statement_cache_size, on_remove=functools.partial( _weak_maybe_gc_stmt, weakref.ref(self)), max_lifetime=config.max_cached_statement_lifetime) self._stmts_to_close = set() self._stmt_cache_enabled = config.statement_cache_size > 0 self._listeners = {} self._log_listeners = set() self._cancellations = set() self._termination_listeners = set() self._query_loggers = set() settings = self._protocol.get_settings() ver_string = settings.server_version self._server_version = \ serverversion.split_server_version_string(ver_string) self._server_caps = _detect_server_capabilities( self._server_version, settings) if self._server_version < (14, 0): self._intro_query = introspection.INTRO_LOOKUP_TYPES_13 else: self._intro_query = introspection.INTRO_LOOKUP_TYPES self._reset_query = None self._proxy = None # Used to serialize operations that might involve anonymous # statements. Specifically, we want to make the following # operation atomic: # ("prepare an anonymous statement", "use the statement") # # Used for `con.fetchval()`, `con.fetch()`, `con.fetchrow()`, # `con.execute()`, and `con.executemany()`. self._stmt_exclusive_section = _Atomic() if loop.get_debug(): self._source_traceback = _extract_stack() else: self._source_traceback = None def __del__(self): if not self.is_closed() and self._protocol is not None: if self._source_traceback: msg = "unclosed connection {!r}; created at:\n {}".format( self, self._source_traceback) else: msg = ( "unclosed connection {!r}; run in asyncio debug " "mode to show the traceback of connection " "origin".format(self) ) warnings.warn(msg, ResourceWarning) if not self._loop.is_closed(): self.terminate() async def add_listener(self, channel, callback): """Add a listener for Postgres notifications. :param str channel: Channel to listen on. :param callable callback: A callable or a coroutine function receiving the following arguments: **connection**: a Connection the callback is registered with; **pid**: PID of the Postgres server that sent the notification; **channel**: name of the channel the notification was sent to; **payload**: the payload. .. versionchanged:: 0.24.0 The ``callback`` argument may be a coroutine function. """ self._check_open() if channel not in self._listeners: await self.fetch('LISTEN {}'.format(utils._quote_ident(channel))) self._listeners[channel] = set() self._listeners[channel].add(_Callback.from_callable(callback)) async def remove_listener(self, channel, callback): """Remove a listening callback on the specified channel.""" if self.is_closed(): return if channel not in self._listeners: return cb = _Callback.from_callable(callback) if cb not in self._listeners[channel]: return self._listeners[channel].remove(cb) if not self._listeners[channel]: del self._listeners[channel] await self.fetch('UNLISTEN {}'.format(utils._quote_ident(channel))) def add_log_listener(self, callback): """Add a listener for Postgres log messages. It will be called when asyncronous NoticeResponse is received from the connection. Possible message types are: WARNING, NOTICE, DEBUG, INFO, or LOG. :param callable callback: A callable or a coroutine function receiving the following arguments: **connection**: a Connection the callback is registered with; **message**: the `exceptions.PostgresLogMessage` message. .. versionadded:: 0.12.0 .. versionchanged:: 0.24.0 The ``callback`` argument may be a coroutine function. """ if self.is_closed(): raise exceptions.InterfaceError('connection is closed') self._log_listeners.add(_Callback.from_callable(callback)) def remove_log_listener(self, callback): """Remove a listening callback for log messages. .. versionadded:: 0.12.0 """ self._log_listeners.discard(_Callback.from_callable(callback)) def add_termination_listener(self, callback): """Add a listener that will be called when the connection is closed. :param callable callback: A callable or a coroutine function receiving one argument: **connection**: a Connection the callback is registered with. .. versionadded:: 0.21.0 .. versionchanged:: 0.24.0 The ``callback`` argument may be a coroutine function. """ self._termination_listeners.add(_Callback.from_callable(callback)) def remove_termination_listener(self, callback): """Remove a listening callback for connection termination. :param callable callback: The callable or coroutine function that was passed to :meth:`Connection.add_termination_listener`. .. versionadded:: 0.21.0 """ self._termination_listeners.discard(_Callback.from_callable(callback)) def add_query_logger(self, callback): """Add a logger that will be called when queries are executed. :param callable callback: A callable or a coroutine function receiving one argument: **record**, a LoggedQuery containing `query`, `args`, `timeout`, `elapsed`, `exception`, `conn_addr`, and `conn_params`. .. versionadded:: 0.29.0 """ self._query_loggers.add(_Callback.from_callable(callback)) def remove_query_logger(self, callback): """Remove a query logger callback. :param callable callback: The callable or coroutine function that was passed to :meth:`Connection.add_query_logger`. .. versionadded:: 0.29.0 """ self._query_loggers.discard(_Callback.from_callable(callback)) def get_server_pid(self): """Return the PID of the Postgres server the connection is bound to.""" return self._protocol.get_server_pid() def get_server_version(self): """Return the version of the connected PostgreSQL server. The returned value is a named tuple similar to that in ``sys.version_info``: .. code-block:: pycon >>> con.get_server_version() ServerVersion(major=9, minor=6, micro=1, releaselevel='final', serial=0) .. versionadded:: 0.8.0 """ return self._server_version def get_settings(self): """Return connection settings. :return: :class:`~asyncpg.ConnectionSettings`. """ return self._protocol.get_settings() def transaction(self, *, isolation=None, readonly=False, deferrable=False): """Create a :class:`~transaction.Transaction` object. Refer to `PostgreSQL documentation`_ on the meaning of transaction parameters. :param isolation: Transaction isolation mode, can be one of: `'serializable'`, `'repeatable_read'`, `'read_uncommitted'`, `'read_committed'`. If not specified, the behavior is up to the server and session, which is usually ``read_committed``. :param readonly: Specifies whether or not this transaction is read-only. :param deferrable: Specifies whether or not this transaction is deferrable. .. _`PostgreSQL documentation`: https://www.postgresql.org/docs/ current/static/sql-set-transaction.html """ self._check_open() return transaction.Transaction(self, isolation, readonly, deferrable) def is_in_transaction(self): """Return True if Connection is currently inside a transaction. :return bool: True if inside transaction, False otherwise. .. versionadded:: 0.16.0 """ return self._protocol.is_in_transaction() async def execute(self, query: str, *args, timeout: float=None) -> str: """Execute an SQL command (or commands). This method can execute many SQL commands at once, when no arguments are provided. Example: .. code-block:: pycon >>> await con.execute(''' ... CREATE TABLE mytab (a int); ... INSERT INTO mytab (a) VALUES (100), (200), (300); ... ''') INSERT 0 3 >>> await con.execute(''' ... INSERT INTO mytab (a) VALUES ($1), ($2) ... ''', 10, 20) INSERT 0 2 :param args: Query arguments. :param float timeout: Optional timeout value in seconds. :return str: Status of the last SQL command. .. versionchanged:: 0.5.4 Made it possible to pass query arguments. """ self._check_open() if not args: if self._query_loggers: with self._time_and_log(query, args, timeout): result = await self._protocol.query(query, timeout) else: result = await self._protocol.query(query, timeout) return result _, status, _ = await self._execute( query, args, 0, timeout, return_status=True, ) return status.decode() async def executemany(self, command: str, args, *, timeout: float=None): """Execute an SQL *command* for each sequence of arguments in *args*. Example: .. code-block:: pycon >>> await con.executemany(''' ... INSERT INTO mytab (a) VALUES ($1, $2, $3); ... ''', [(1, 2, 3), (4, 5, 6)]) :param command: Command to execute. :param args: An iterable containing sequences of arguments. :param float timeout: Optional timeout value in seconds. :return None: This method discards the results of the operations. .. versionadded:: 0.7.0 .. versionchanged:: 0.11.0 `timeout` became a keyword-only parameter. .. versionchanged:: 0.22.0 ``executemany()`` is now an atomic operation, which means that either all executions succeed, or none at all. This is in contrast to prior versions, where the effect of already-processed iterations would remain in place when an error has occurred, unless ``executemany()`` was called in a transaction. """ self._check_open() return await self._executemany(command, args, timeout) async def _get_statement( self, query, timeout, *, named=False, use_cache=True, ignore_custom_codec=False, record_class=None ): if record_class is None: record_class = self._protocol.get_record_class() else: _check_record_class(record_class) if use_cache: statement = self._stmt_cache.get( (query, record_class, ignore_custom_codec) ) if statement is not None: return statement # Only use the cache when: # * `statement_cache_size` is greater than 0; # * query size is less than `max_cacheable_statement_size`. use_cache = ( self._stmt_cache_enabled and ( not self._config.max_cacheable_statement_size or len(query) <= self._config.max_cacheable_statement_size ) ) if isinstance(named, str): stmt_name = named elif use_cache or named: stmt_name = self._get_unique_id('stmt') else: stmt_name = '' statement = await self._protocol.prepare( stmt_name, query, timeout, record_class=record_class, ignore_custom_codec=ignore_custom_codec, ) need_reprepare = False types_with_missing_codecs = statement._init_types() tries = 0 while types_with_missing_codecs: settings = self._protocol.get_settings() # Introspect newly seen types and populate the # codec cache. types, intro_stmt = await self._introspect_types( types_with_missing_codecs, timeout) settings.register_data_types(types) # The introspection query has used an anonymous statement, # which has blown away the anonymous statement we've prepared # for the query, so we need to re-prepare it. need_reprepare = not intro_stmt.name and not statement.name types_with_missing_codecs = statement._init_types() tries += 1 if tries > 5: # In the vast majority of cases there will be only # one iteration. In rare cases, there might be a race # with reload_schema_state(), which would cause a # second try. More than five is clearly a bug. raise exceptions.InternalClientError( 'could not resolve query result and/or argument types ' 'in {} attempts'.format(tries) ) # Now that types have been resolved, populate the codec pipeline # for the statement. statement._init_codecs() if ( need_reprepare or (not statement.name and not self._stmt_cache_enabled) ): # Mark this anonymous prepared statement as "unprepared", # causing it to get re-Parsed in next bind_execute. # We always do this when stmt_cache_size is set to 0 assuming # people are running PgBouncer which is mishandling implicit # transactions. statement.mark_unprepared() if use_cache: self._stmt_cache.put( (query, record_class, ignore_custom_codec), statement) # If we've just created a new statement object, check if there # are any statements for GC. if self._stmts_to_close: await self._cleanup_stmts() return statement async def _introspect_types(self, typeoids, timeout): if self._server_caps.jit: try: cfgrow, _ = await self.__execute( """ SELECT current_setting('jit') AS cur, set_config('jit', 'off', false) AS new """, (), 0, timeout, ignore_custom_codec=True, ) jit_state = cfgrow[0]['cur'] except exceptions.UndefinedObjectError: jit_state = 'off' else: jit_state = 'off' result = await self.__execute( self._intro_query, (list(typeoids),), 0, timeout, ignore_custom_codec=True, ) if jit_state != 'off': await self.__execute( """ SELECT set_config('jit', $1, false) """, (jit_state,), 0, timeout, ignore_custom_codec=True, ) return result async def _introspect_type(self, typename, schema): if ( schema == 'pg_catalog' and typename.lower() in protocol.BUILTIN_TYPE_NAME_MAP ): typeoid = protocol.BUILTIN_TYPE_NAME_MAP[typename.lower()] rows = await self._execute( introspection.TYPE_BY_OID, [typeoid], limit=0, timeout=None, ignore_custom_codec=True, ) else: rows = await self._execute( introspection.TYPE_BY_NAME, [typename, schema], limit=1, timeout=None, ignore_custom_codec=True, ) if not rows: raise ValueError( 'unknown type: {}.{}'.format(schema, typename)) return rows[0] def cursor( self, query, *args, prefetch=None, timeout=None, record_class=None ): """Return a *cursor factory* for the specified query. :param args: Query arguments. :param int prefetch: The number of rows the *cursor iterator* will prefetch (defaults to ``50``.) :param float timeout: Optional timeout in seconds. :param type record_class: If specified, the class to use for records returned by this cursor. Must be a subclass of :class:`~asyncpg.Record`. If not specified, a per-connection *record_class* is used. :return: A :class:`~cursor.CursorFactory` object. .. versionchanged:: 0.22.0 Added the *record_class* parameter. """ self._check_open() return cursor.CursorFactory( self, query, None, args, prefetch, timeout, record_class, ) async def prepare( self, query, *, name=None, timeout=None, record_class=None, ): """Create a *prepared statement* for the specified query. :param str query: Text of the query to create a prepared statement for. :param str name: Optional name of the returned prepared statement. If not specified, the name is auto-generated. :param float timeout: Optional timeout value in seconds. :param type record_class: If specified, the class to use for records returned by the prepared statement. Must be a subclass of :class:`~asyncpg.Record`. If not specified, a per-connection *record_class* is used. :return: A :class:`~prepared_stmt.PreparedStatement` instance. .. versionchanged:: 0.22.0 Added the *record_class* parameter. .. versionchanged:: 0.25.0 Added the *name* parameter. """ return await self._prepare( query, name=name, timeout=timeout, use_cache=False, record_class=record_class, ) async def _prepare( self, query, *, name=None, timeout=None, use_cache: bool=False, record_class=None ): self._check_open() stmt = await self._get_statement( query, timeout, named=True if name is None else name, use_cache=use_cache, record_class=record_class, ) return prepared_stmt.PreparedStatement(self, query, stmt) async def fetch( self, query, *args, timeout=None, record_class=None ) -> list: """Run a query and return the results as a list of :class:`Record`. :param str query: Query text. :param args: Query arguments. :param float timeout: Optional timeout value in seconds. :param type record_class: If specified, the class to use for records returned by this method. Must be a subclass of :class:`~asyncpg.Record`. If not specified, a per-connection *record_class* is used. :return list: A list of :class:`~asyncpg.Record` instances. If specified, the actual type of list elements would be *record_class*. .. versionchanged:: 0.22.0 Added the *record_class* parameter. """ self._check_open() return await self._execute( query, args, 0, timeout, record_class=record_class, ) async def fetchval(self, query, *args, column=0, timeout=None): """Run a query and return a value in the first row. :param str query: Query text. :param args: Query arguments. :param int column: Numeric index within the record of the value to return (defaults to 0). :param float timeout: Optional timeout value in seconds. If not specified, defaults to the value of ``command_timeout`` argument to the ``Connection`` instance constructor. :return: The value of the specified column of the first record, or None if no records were returned by the query. """ self._check_open() data = await self._execute(query, args, 1, timeout) if not data: return None return data[0][column] async def fetchrow( self, query, *args, timeout=None, record_class=None ): """Run a query and return the first row. :param str query: Query text :param args: Query arguments :param float timeout: Optional timeout value in seconds. :param type record_class: If specified, the class to use for the value returned by this method. Must be a subclass of :class:`~asyncpg.Record`. If not specified, a per-connection *record_class* is used. :return: The first row as a :class:`~asyncpg.Record` instance, or None if no records were returned by the query. If specified, *record_class* is used as the type for the result value. .. versionchanged:: 0.22.0 Added the *record_class* parameter. """ self._check_open() data = await self._execute( query, args, 1, timeout, record_class=record_class, ) if not data: return None return data[0] async def fetchmany( self, query, args, *, timeout: float=None, record_class=None ): """Run a query for each sequence of arguments in *args* and return the results as a list of :class:`Record`. :param query: Query to execute. :param args: An iterable containing sequences of arguments for the query. :param float timeout: Optional timeout value in seconds. :param type record_class: If specified, the class to use for records returned by this method. Must be a subclass of :class:`~asyncpg.Record`. If not specified, a per-connection *record_class* is used. :return list: A list of :class:`~asyncpg.Record` instances. If specified, the actual type of list elements would be *record_class*. Example: .. code-block:: pycon >>> rows = await con.fetchmany(''' ... INSERT INTO mytab (a, b) VALUES ($1, $2) RETURNING a; ... ''', [('x', 1), ('y', 2), ('z', 3)]) >>> rows [, , ] .. versionadded:: 0.30.0 """ self._check_open() return await self._executemany( query, args, timeout, return_rows=True, record_class=record_class ) async def copy_from_table(self, table_name, *, output, columns=None, schema_name=None, timeout=None, format=None, oids=None, delimiter=None, null=None, header=None, quote=None, escape=None, force_quote=None, encoding=None): """Copy table contents to a file or file-like object. :param str table_name: The name of the table to copy data from. :param output: A :term:`path-like object `, or a :term:`file-like object `, or a :term:`coroutine function ` that takes a ``bytes`` instance as a sole argument. :param list columns: An optional list of column names to copy. :param str schema_name: An optional schema name to qualify the table. :param float timeout: Optional timeout value in seconds. The remaining keyword arguments are ``COPY`` statement options, see `COPY statement documentation`_ for details. :return: The status string of the COPY command. Example: .. code-block:: pycon >>> import asyncpg >>> import asyncio >>> async def run(): ... con = await asyncpg.connect(user='postgres') ... result = await con.copy_from_table( ... 'mytable', columns=('foo', 'bar'), ... output='file.csv', format='csv') ... print(result) ... >>> asyncio.run(run()) 'COPY 100' .. _`COPY statement documentation`: https://www.postgresql.org/docs/current/static/sql-copy.html .. versionadded:: 0.11.0 """ tabname = utils._quote_ident(table_name) if schema_name: tabname = utils._quote_ident(schema_name) + '.' + tabname if columns: cols = '({})'.format( ', '.join(utils._quote_ident(c) for c in columns)) else: cols = '' opts = self._format_copy_opts( format=format, oids=oids, delimiter=delimiter, null=null, header=header, quote=quote, escape=escape, force_quote=force_quote, encoding=encoding ) copy_stmt = 'COPY {tab}{cols} TO STDOUT {opts}'.format( tab=tabname, cols=cols, opts=opts) return await self._copy_out(copy_stmt, output, timeout) async def copy_from_query(self, query, *args, output, timeout=None, format=None, oids=None, delimiter=None, null=None, header=None, quote=None, escape=None, force_quote=None, encoding=None): """Copy the results of a query to a file or file-like object. :param str query: The query to copy the results of. :param args: Query arguments. :param output: A :term:`path-like object `, or a :term:`file-like object `, or a :term:`coroutine function ` that takes a ``bytes`` instance as a sole argument. :param float timeout: Optional timeout value in seconds. The remaining keyword arguments are ``COPY`` statement options, see `COPY statement documentation`_ for details. :return: The status string of the COPY command. Example: .. code-block:: pycon >>> import asyncpg >>> import asyncio >>> async def run(): ... con = await asyncpg.connect(user='postgres') ... result = await con.copy_from_query( ... 'SELECT foo, bar FROM mytable WHERE foo > $1', 10, ... output='file.csv', format='csv') ... print(result) ... >>> asyncio.run(run()) 'COPY 10' .. _`COPY statement documentation`: https://www.postgresql.org/docs/current/static/sql-copy.html .. versionadded:: 0.11.0 """ opts = self._format_copy_opts( format=format, oids=oids, delimiter=delimiter, null=null, header=header, quote=quote, escape=escape, force_quote=force_quote, encoding=encoding ) if args: query = await utils._mogrify(self, query, args) copy_stmt = 'COPY ({query}) TO STDOUT {opts}'.format( query=query, opts=opts) return await self._copy_out(copy_stmt, output, timeout) async def copy_to_table(self, table_name, *, source, columns=None, schema_name=None, timeout=None, format=None, oids=None, freeze=None, delimiter=None, null=None, header=None, quote=None, escape=None, force_quote=None, force_not_null=None, force_null=None, encoding=None, where=None): """Copy data to the specified table. :param str table_name: The name of the table to copy data to. :param source: A :term:`path-like object `, or a :term:`file-like object `, or an :term:`asynchronous iterable ` that returns ``bytes``, or an object supporting the :ref:`buffer protocol `. :param list columns: An optional list of column names to copy. :param str schema_name: An optional schema name to qualify the table. :param str where: An optional SQL expression used to filter rows when copying. .. note:: Usage of this parameter requires support for the ``COPY FROM ... WHERE`` syntax, introduced in PostgreSQL version 12. :param float timeout: Optional timeout value in seconds. The remaining keyword arguments are ``COPY`` statement options, see `COPY statement documentation`_ for details. :return: The status string of the COPY command. Example: .. code-block:: pycon >>> import asyncpg >>> import asyncio >>> async def run(): ... con = await asyncpg.connect(user='postgres') ... result = await con.copy_to_table( ... 'mytable', source='datafile.tbl') ... print(result) ... >>> asyncio.run(run()) 'COPY 140000' .. _`COPY statement documentation`: https://www.postgresql.org/docs/current/static/sql-copy.html .. versionadded:: 0.11.0 .. versionadded:: 0.29.0 Added the *where* parameter. """ tabname = utils._quote_ident(table_name) if schema_name: tabname = utils._quote_ident(schema_name) + '.' + tabname if columns: cols = '({})'.format( ', '.join(utils._quote_ident(c) for c in columns)) else: cols = '' cond = self._format_copy_where(where) opts = self._format_copy_opts( format=format, oids=oids, freeze=freeze, delimiter=delimiter, null=null, header=header, quote=quote, escape=escape, force_not_null=force_not_null, force_null=force_null, encoding=encoding ) copy_stmt = 'COPY {tab}{cols} FROM STDIN {opts} {cond}'.format( tab=tabname, cols=cols, opts=opts, cond=cond) return await self._copy_in(copy_stmt, source, timeout) async def copy_records_to_table(self, table_name, *, records, columns=None, schema_name=None, timeout=None, where=None): """Copy a list of records to the specified table using binary COPY. :param str table_name: The name of the table to copy data to. :param records: An iterable returning row tuples to copy into the table. :term:`Asynchronous iterables ` are also supported. :param list columns: An optional list of column names to copy. :param str schema_name: An optional schema name to qualify the table. :param str where: An optional SQL expression used to filter rows when copying. .. note:: Usage of this parameter requires support for the ``COPY FROM ... WHERE`` syntax, introduced in PostgreSQL version 12. :param float timeout: Optional timeout value in seconds. :return: The status string of the COPY command. Example: .. code-block:: pycon >>> import asyncpg >>> import asyncio >>> async def run(): ... con = await asyncpg.connect(user='postgres') ... result = await con.copy_records_to_table( ... 'mytable', records=[ ... (1, 'foo', 'bar'), ... (2, 'ham', 'spam')]) ... print(result) ... >>> asyncio.run(run()) 'COPY 2' Asynchronous record iterables are also supported: .. code-block:: pycon >>> import asyncpg >>> import asyncio >>> async def run(): ... con = await asyncpg.connect(user='postgres') ... async def record_gen(size): ... for i in range(size): ... yield (i,) ... result = await con.copy_records_to_table( ... 'mytable', records=record_gen(100)) ... print(result) ... >>> asyncio.run(run()) 'COPY 100' .. versionadded:: 0.11.0 .. versionchanged:: 0.24.0 The ``records`` argument may be an asynchronous iterable. .. versionadded:: 0.29.0 Added the *where* parameter. """ tabname = utils._quote_ident(table_name) if schema_name: tabname = utils._quote_ident(schema_name) + '.' + tabname if columns: col_list = ', '.join(utils._quote_ident(c) for c in columns) cols = '({})'.format(col_list) else: col_list = '*' cols = '' intro_query = 'SELECT {cols} FROM {tab} LIMIT 1'.format( tab=tabname, cols=col_list) intro_ps = await self._prepare(intro_query, use_cache=True) cond = self._format_copy_where(where) opts = '(FORMAT binary)' copy_stmt = 'COPY {tab}{cols} FROM STDIN {opts} {cond}'.format( tab=tabname, cols=cols, opts=opts, cond=cond) return await self._protocol.copy_in( copy_stmt, None, None, records, intro_ps._state, timeout) def _format_copy_where(self, where): if where and not self._server_caps.sql_copy_from_where: raise exceptions.UnsupportedServerFeatureError( 'the `where` parameter requires PostgreSQL 12 or later') if where: where_clause = 'WHERE ' + where else: where_clause = '' return where_clause def _format_copy_opts(self, *, format=None, oids=None, freeze=None, delimiter=None, null=None, header=None, quote=None, escape=None, force_quote=None, force_not_null=None, force_null=None, encoding=None): kwargs = dict(locals()) kwargs.pop('self') opts = [] if force_quote is not None and isinstance(force_quote, bool): kwargs.pop('force_quote') if force_quote: opts.append('FORCE_QUOTE *') for k, v in kwargs.items(): if v is not None: if k in ('force_not_null', 'force_null', 'force_quote'): v = '(' + ', '.join(utils._quote_ident(c) for c in v) + ')' elif k in ('oids', 'freeze', 'header'): v = str(v) else: v = utils._quote_literal(v) opts.append('{} {}'.format(k.upper(), v)) if opts: return '(' + ', '.join(opts) + ')' else: return '' async def _copy_out(self, copy_stmt, output, timeout): try: path = os.fspath(output) except TypeError: # output is not a path-like object path = None writer = None opened_by_us = False run_in_executor = self._loop.run_in_executor if path is not None: # a path f = await run_in_executor(None, open, path, 'wb') opened_by_us = True elif hasattr(output, 'write'): # file-like f = output elif callable(output): # assuming calling output returns an awaitable. writer = output else: raise TypeError( 'output is expected to be a file-like object, ' 'a path-like object or a coroutine function, ' 'not {}'.format(type(output).__name__) ) if writer is None: async def _writer(data): await run_in_executor(None, f.write, data) writer = _writer try: return await self._protocol.copy_out(copy_stmt, writer, timeout) finally: if opened_by_us: f.close() async def _copy_in(self, copy_stmt, source, timeout): try: path = os.fspath(source) except TypeError: # source is not a path-like object path = None f = None reader = None data = None opened_by_us = False run_in_executor = self._loop.run_in_executor if path is not None: # a path f = await run_in_executor(None, open, path, 'rb') opened_by_us = True elif hasattr(source, 'read'): # file-like f = source elif isinstance(source, collections.abc.AsyncIterable): # assuming calling output returns an awaitable. # copy_in() is designed to handle very large amounts of data, and # the source async iterable is allowed to return an arbitrary # amount of data on every iteration. reader = source else: # assuming source is an instance supporting the buffer protocol. data = source if f is not None: # Copying from a file-like object. class _Reader: def __aiter__(self): return self async def __anext__(self): data = await run_in_executor(None, f.read, 524288) if len(data) == 0: raise StopAsyncIteration else: return data reader = _Reader() try: return await self._protocol.copy_in( copy_stmt, reader, data, None, None, timeout) finally: if opened_by_us: await run_in_executor(None, f.close) async def set_type_codec(self, typename, *, schema='public', encoder, decoder, format='text'): """Set an encoder/decoder pair for the specified data type. :param typename: Name of the data type the codec is for. :param schema: Schema name of the data type the codec is for (defaults to ``'public'``) :param format: The type of the argument received by the *decoder* callback, and the type of the *encoder* callback return value. If *format* is ``'text'`` (the default), the exchange datum is a ``str`` instance containing valid text representation of the data type. If *format* is ``'binary'``, the exchange datum is a ``bytes`` instance containing valid _binary_ representation of the data type. If *format* is ``'tuple'``, the exchange datum is a type-specific ``tuple`` of values. The table below lists supported data types and their format for this mode. +-----------------+---------------------------------------------+ | Type | Tuple layout | +=================+=============================================+ | ``interval`` | (``months``, ``days``, ``microseconds``) | +-----------------+---------------------------------------------+ | ``date`` | (``date ordinal relative to Jan 1 2000``,) | | | ``-2^31`` for negative infinity timestamp | | | ``2^31-1`` for positive infinity timestamp. | +-----------------+---------------------------------------------+ | ``timestamp`` | (``microseconds relative to Jan 1 2000``,) | | | ``-2^63`` for negative infinity timestamp | | | ``2^63-1`` for positive infinity timestamp. | +-----------------+---------------------------------------------+ | ``timestamp | (``microseconds relative to Jan 1 2000 | | with time zone``| UTC``,) | | | ``-2^63`` for negative infinity timestamp | | | ``2^63-1`` for positive infinity timestamp. | +-----------------+---------------------------------------------+ | ``time`` | (``microseconds``,) | +-----------------+---------------------------------------------+ | ``time with | (``microseconds``, | | time zone`` | ``time zone offset in seconds``) | +-----------------+---------------------------------------------+ | any composite | Composite value elements | | type | | +-----------------+---------------------------------------------+ :param encoder: Callable accepting a Python object as a single argument and returning a value encoded according to *format*. :param decoder: Callable accepting a single argument encoded according to *format* and returning a decoded Python object. Example: .. code-block:: pycon >>> import asyncpg >>> import asyncio >>> import datetime >>> from dateutil.relativedelta import relativedelta >>> async def run(): ... con = await asyncpg.connect(user='postgres') ... def encoder(delta): ... ndelta = delta.normalized() ... return (ndelta.years * 12 + ndelta.months, ... ndelta.days, ... ((ndelta.hours * 3600 + ... ndelta.minutes * 60 + ... ndelta.seconds) * 1000000 + ... ndelta.microseconds)) ... def decoder(tup): ... return relativedelta(months=tup[0], days=tup[1], ... microseconds=tup[2]) ... await con.set_type_codec( ... 'interval', schema='pg_catalog', encoder=encoder, ... decoder=decoder, format='tuple') ... result = await con.fetchval( ... "SELECT '2 years 3 mons 1 day'::interval") ... print(result) ... print(datetime.datetime(2002, 1, 1) + result) ... >>> asyncio.run(run()) relativedelta(years=+2, months=+3, days=+1) 2004-04-02 00:00:00 .. versionadded:: 0.12.0 Added the ``format`` keyword argument and support for 'tuple' format. .. versionchanged:: 0.12.0 The ``binary`` keyword argument is deprecated in favor of ``format``. .. versionchanged:: 0.13.0 The ``binary`` keyword argument was removed in favor of ``format``. .. versionchanged:: 0.29.0 Custom codecs for composite types are now supported with ``format='tuple'``. .. note:: It is recommended to use the ``'binary'`` or ``'tuple'`` *format* whenever possible and if the underlying type supports it. Asyncpg currently does not support text I/O for composite and range types, and some other functionality, such as :meth:`Connection.copy_to_table`, does not support types with text codecs. """ self._check_open() settings = self._protocol.get_settings() typeinfo = await self._introspect_type(typename, schema) full_typeinfos = [] if introspection.is_scalar_type(typeinfo): kind = 'scalar' elif introspection.is_composite_type(typeinfo): if format != 'tuple': raise exceptions.UnsupportedClientFeatureError( 'only tuple-format codecs can be used on composite types', hint="Use `set_type_codec(..., format='tuple')` and " "pass/interpret data as a Python tuple. See an " "example at https://magicstack.github.io/asyncpg/" "current/usage.html#example-decoding-complex-types", ) kind = 'composite' full_typeinfos, _ = await self._introspect_types( (typeinfo['oid'],), 10) else: raise exceptions.InterfaceError( f'cannot use custom codec on type {schema}.{typename}: ' f'it is neither a scalar type nor a composite type' ) if introspection.is_domain_type(typeinfo): raise exceptions.UnsupportedClientFeatureError( 'custom codecs on domain types are not supported', hint='Set the codec on the base type.', detail=( 'PostgreSQL does not distinguish domains from ' 'their base types in query results at the protocol level.' ) ) oid = typeinfo['oid'] settings.add_python_codec( oid, typename, schema, full_typeinfos, kind, encoder, decoder, format) # Statement cache is no longer valid due to codec changes. self._drop_local_statement_cache() async def reset_type_codec(self, typename, *, schema='public'): """Reset *typename* codec to the default implementation. :param typename: Name of the data type the codec is for. :param schema: Schema name of the data type the codec is for (defaults to ``'public'``) .. versionadded:: 0.12.0 """ typeinfo = await self._introspect_type(typename, schema) self._protocol.get_settings().remove_python_codec( typeinfo['oid'], typename, schema) # Statement cache is no longer valid due to codec changes. self._drop_local_statement_cache() async def set_builtin_type_codec(self, typename, *, schema='public', codec_name, format=None): """Set a builtin codec for the specified scalar data type. This method has two uses. The first is to register a builtin codec for an extension type without a stable OID, such as 'hstore'. The second use is to declare that an extension type or a user-defined type is wire-compatible with a certain builtin data type and should be exchanged as such. :param typename: Name of the data type the codec is for. :param schema: Schema name of the data type the codec is for (defaults to ``'public'``). :param codec_name: The name of the builtin codec to use for the type. This should be either the name of a known core type (such as ``"int"``), or the name of a supported extension type. Currently, the only supported extension type is ``"pg_contrib.hstore"``. :param format: If *format* is ``None`` (the default), all formats supported by the target codec are declared to be supported for *typename*. If *format* is ``'text'`` or ``'binary'``, then only the specified format is declared to be supported for *typename*. .. versionchanged:: 0.18.0 The *codec_name* argument can be the name of any known core data type. Added the *format* keyword argument. """ self._check_open() typeinfo = await self._introspect_type(typename, schema) if not introspection.is_scalar_type(typeinfo): raise exceptions.InterfaceError( 'cannot alias non-scalar type {}.{}'.format( schema, typename)) oid = typeinfo['oid'] self._protocol.get_settings().set_builtin_type_codec( oid, typename, schema, 'scalar', codec_name, format) # Statement cache is no longer valid due to codec changes. self._drop_local_statement_cache() def is_closed(self): """Return ``True`` if the connection is closed, ``False`` otherwise. :return bool: ``True`` if the connection is closed, ``False`` otherwise. """ return self._aborted or not self._protocol.is_connected() async def close(self, *, timeout=None): """Close the connection gracefully. :param float timeout: Optional timeout value in seconds. .. versionchanged:: 0.14.0 Added the *timeout* parameter. """ try: if not self.is_closed(): await self._protocol.close(timeout) except (Exception, asyncio.CancelledError): # If we fail to close gracefully, abort the connection. self._abort() raise finally: self._cleanup() def terminate(self): """Terminate the connection without waiting for pending data.""" if not self.is_closed(): self._abort() self._cleanup() async def _reset(self): self._check_open() self._listeners.clear() self._log_listeners.clear() if self._protocol.is_in_transaction() or self._top_xact is not None: if self._top_xact is None or not self._top_xact._managed: # Managed transactions are guaranteed to __aexit__ # correctly. self._loop.call_exception_handler({ 'message': 'Resetting connection with an ' 'active transaction {!r}'.format(self) }) self._top_xact = None await self.execute("ROLLBACK") async def reset(self, *, timeout=None): """Reset the connection state. Calling this will reset the connection session state to a state resembling that of a newly obtained connection. Namely, an open transaction (if any) is rolled back, open cursors are closed, all `LISTEN `_ registrations are removed, all session configuration variables are reset to their default values, and all advisory locks are released. Note that the above describes the default query returned by :meth:`Connection.get_reset_query`. If one overloads the method by subclassing ``Connection``, then this method will do whatever the overloaded method returns, except open transactions are always terminated and any callbacks registered by :meth:`Connection.add_listener` or :meth:`Connection.add_log_listener` are removed. :param float timeout: A timeout for resetting the connection. If not specified, defaults to no timeout. """ async with compat.timeout(timeout): await self._reset() reset_query = self.get_reset_query() if reset_query: await self.execute(reset_query) def _abort(self): # Put the connection into the aborted state. self._aborted = True self._protocol.abort() self._protocol = None def _cleanup(self): self._call_termination_listeners() # Free the resources associated with this connection. # This must be called when a connection is terminated. if self._proxy is not None: # Connection is a member of a pool, so let the pool # know that this connection is dead. self._proxy._holder._release_on_close() self._mark_stmts_as_closed() self._listeners.clear() self._log_listeners.clear() self._query_loggers.clear() self._clean_tasks() def _clean_tasks(self): # Wrap-up any remaining tasks associated with this connection. if self._cancellations: for fut in self._cancellations: if not fut.done(): fut.cancel() self._cancellations.clear() def _check_open(self): if self.is_closed(): raise exceptions.InterfaceError('connection is closed') def _get_unique_id(self, prefix): global _uid _uid += 1 return '__asyncpg_{}_{:x}__'.format(prefix, _uid) def _mark_stmts_as_closed(self): for stmt in self._stmt_cache.iter_statements(): stmt.mark_closed() for stmt in self._stmts_to_close: stmt.mark_closed() self._stmt_cache.clear() self._stmts_to_close.clear() def _maybe_gc_stmt(self, stmt): if ( stmt.refs == 0 and stmt.name and not self._stmt_cache.has( (stmt.query, stmt.record_class, stmt.ignore_custom_codec) ) ): # If low-level `stmt` isn't referenced from any high-level # `PreparedStatement` object and is not in the `_stmt_cache`: # # * mark it as closed, which will make it non-usable # for any `PreparedStatement` or for methods like # `Connection.fetch()`. # # * schedule it to be formally closed on the server. stmt.mark_closed() self._stmts_to_close.add(stmt) async def _cleanup_stmts(self): # Called whenever we create a new prepared statement in # `Connection._get_statement()` and `_stmts_to_close` is # not empty. to_close = self._stmts_to_close self._stmts_to_close = set() for stmt in to_close: # It is imperative that statements are cleaned properly, # so we ignore the timeout. await self._protocol.close_statement(stmt, protocol.NO_TIMEOUT) async def _cancel(self, waiter): try: # Open new connection to the server await connect_utils._cancel( loop=self._loop, addr=self._addr, params=self._params, backend_pid=self._protocol.backend_pid, backend_secret=self._protocol.backend_secret) except ConnectionResetError as ex: # On some systems Postgres will reset the connection # after processing the cancellation command. if not waiter.done(): waiter.set_exception(ex) except asyncio.CancelledError: # There are two scenarios in which the cancellation # itself will be cancelled: 1) the connection is being closed, # 2) the event loop is being shut down. # In either case we do not care about the propagation of # the CancelledError, and don't want the loop to warn about # an unretrieved exception. pass except (Exception, asyncio.CancelledError) as ex: if not waiter.done(): waiter.set_exception(ex) finally: self._cancellations.discard( asyncio.current_task(self._loop)) if not waiter.done(): waiter.set_result(None) def _cancel_current_command(self, waiter): self._cancellations.add(self._loop.create_task(self._cancel(waiter))) def _process_log_message(self, fields, last_query): if not self._log_listeners: return message = exceptions.PostgresLogMessage.new(fields, query=last_query) con_ref = self._unwrap() for cb in self._log_listeners: if cb.is_async: self._loop.create_task(cb.cb(con_ref, message)) else: self._loop.call_soon(cb.cb, con_ref, message) def _call_termination_listeners(self): if not self._termination_listeners: return con_ref = self._unwrap() for cb in self._termination_listeners: if cb.is_async: self._loop.create_task(cb.cb(con_ref)) else: self._loop.call_soon(cb.cb, con_ref) self._termination_listeners.clear() def _process_notification(self, pid, channel, payload): if channel not in self._listeners: return con_ref = self._unwrap() for cb in self._listeners[channel]: if cb.is_async: self._loop.create_task(cb.cb(con_ref, pid, channel, payload)) else: self._loop.call_soon(cb.cb, con_ref, pid, channel, payload) def _unwrap(self): if self._proxy is None: con_ref = self else: # `_proxy` is not None when the connection is a member # of a connection pool. Which means that the user is working # with a `PoolConnectionProxy` instance, and expects to see it # (and not the actual Connection) in their event callbacks. con_ref = self._proxy return con_ref def get_reset_query(self): """Return the query sent to server on connection release. The query returned by this method is used by :meth:`Connection.reset`, which is, in turn, used by :class:`~asyncpg.pool.Pool` before making the connection available to another acquirer. .. versionadded:: 0.30.0 """ if self._reset_query is not None: return self._reset_query caps = self._server_caps _reset_query = [] if caps.advisory_locks: _reset_query.append('SELECT pg_advisory_unlock_all();') if caps.sql_close_all: _reset_query.append('CLOSE ALL;') if caps.notifications and caps.plpgsql: _reset_query.append('UNLISTEN *;') if caps.sql_reset: _reset_query.append('RESET ALL;') _reset_query = '\n'.join(_reset_query) self._reset_query = _reset_query return _reset_query def _set_proxy(self, proxy): if self._proxy is not None and proxy is not None: # Should not happen unless there is a bug in `Pool`. raise exceptions.InterfaceError( 'internal asyncpg error: connection is already proxied') self._proxy = proxy def _check_listeners(self, listeners, listener_type): if listeners: count = len(listeners) w = exceptions.InterfaceWarning( '{conn!r} is being released to the pool but has {c} active ' '{type} listener{s}'.format( conn=self, c=count, type=listener_type, s='s' if count > 1 else '')) warnings.warn(w) def _on_release(self, stacklevel=1): # Invalidate external references to the connection. self._pool_release_ctr += 1 # Called when the connection is about to be released to the pool. # Let's check that the user has not left any listeners on it. self._check_listeners( list(itertools.chain.from_iterable(self._listeners.values())), 'notification') self._check_listeners( self._log_listeners, 'log') def _drop_local_statement_cache(self): self._stmt_cache.clear() def _drop_global_statement_cache(self): if self._proxy is not None: # This connection is a member of a pool, so we delegate # the cache drop to the pool. pool = self._proxy._holder._pool pool._drop_statement_cache() else: self._drop_local_statement_cache() def _drop_local_type_cache(self): self._protocol.get_settings().clear_type_cache() def _drop_global_type_cache(self): if self._proxy is not None: # This connection is a member of a pool, so we delegate # the cache drop to the pool. pool = self._proxy._holder._pool pool._drop_type_cache() else: self._drop_local_type_cache() async def reload_schema_state(self): """Indicate that the database schema information must be reloaded. For performance reasons, asyncpg caches certain aspects of the database schema, such as the layout of composite types. Consequently, when the database schema changes, and asyncpg is not able to gracefully recover from an error caused by outdated schema assumptions, an :exc:`~asyncpg.exceptions.OutdatedSchemaCacheError` is raised. To prevent the exception, this method may be used to inform asyncpg that the database schema has changed. Example: .. code-block:: pycon >>> import asyncpg >>> import asyncio >>> async def change_type(con): ... result = await con.fetch('SELECT id, info FROM tbl') ... # Change composite's attribute type "int"=>"text" ... await con.execute('ALTER TYPE custom DROP ATTRIBUTE y') ... await con.execute('ALTER TYPE custom ADD ATTRIBUTE y text') ... await con.reload_schema_state() ... for id_, info in result: ... new = (info['x'], str(info['y'])) ... await con.execute( ... 'UPDATE tbl SET info=$2 WHERE id=$1', id_, new) ... >>> async def run(): ... # Initial schema: ... # CREATE TYPE custom AS (x int, y int); ... # CREATE TABLE tbl(id int, info custom); ... con = await asyncpg.connect(user='postgres') ... async with con.transaction(): ... # Prevent concurrent changes in the table ... await con.execute('LOCK TABLE tbl') ... await change_type(con) ... >>> asyncio.run(run()) .. versionadded:: 0.14.0 """ self._drop_global_type_cache() self._drop_global_statement_cache() async def _execute( self, query, args, limit, timeout, *, return_status=False, ignore_custom_codec=False, record_class=None ): with self._stmt_exclusive_section: result, _ = await self.__execute( query, args, limit, timeout, return_status=return_status, record_class=record_class, ignore_custom_codec=ignore_custom_codec, ) return result @contextlib.contextmanager def query_logger(self, callback): """Context manager that adds `callback` to the list of query loggers, and removes it upon exit. :param callable callback: A callable or a coroutine function receiving one argument: **record**, a LoggedQuery containing `query`, `args`, `timeout`, `elapsed`, `exception`, `conn_addr`, and `conn_params`. Example: .. code-block:: pycon >>> class QuerySaver: def __init__(self): self.queries = [] def __call__(self, record): self.queries.append(record.query) >>> with con.query_logger(QuerySaver()): >>> await con.execute("SELECT 1") >>> print(log.queries) ['SELECT 1'] .. versionadded:: 0.29.0 """ self.add_query_logger(callback) yield self.remove_query_logger(callback) @contextlib.contextmanager def _time_and_log(self, query, args, timeout): start = time.monotonic() exception = None try: yield except BaseException as ex: exception = ex raise finally: elapsed = time.monotonic() - start record = LoggedQuery( query=query, args=args, timeout=timeout, elapsed=elapsed, exception=exception, conn_addr=self._addr, conn_params=self._params, ) for cb in self._query_loggers: if cb.is_async: self._loop.create_task(cb.cb(record)) else: self._loop.call_soon(cb.cb, record) async def __execute( self, query, args, limit, timeout, *, return_status=False, ignore_custom_codec=False, record_class=None ): executor = lambda stmt, timeout: self._protocol.bind_execute( state=stmt, args=args, portal_name='', limit=limit, return_extra=return_status, timeout=timeout, ) timeout = self._protocol._get_timeout(timeout) if self._query_loggers: with self._time_and_log(query, args, timeout): result, stmt = await self._do_execute( query, executor, timeout, record_class=record_class, ignore_custom_codec=ignore_custom_codec, ) else: result, stmt = await self._do_execute( query, executor, timeout, record_class=record_class, ignore_custom_codec=ignore_custom_codec, ) return result, stmt async def _executemany( self, query, args, timeout, return_rows=False, record_class=None, ): executor = lambda stmt, timeout: self._protocol.bind_execute_many( state=stmt, args=args, portal_name='', timeout=timeout, return_rows=return_rows, ) timeout = self._protocol._get_timeout(timeout) with self._stmt_exclusive_section: with self._time_and_log(query, args, timeout): result, _ = await self._do_execute( query, executor, timeout, record_class=record_class ) return result async def _do_execute( self, query, executor, timeout, retry=True, *, ignore_custom_codec=False, record_class=None ): if timeout is None: stmt = await self._get_statement( query, None, record_class=record_class, ignore_custom_codec=ignore_custom_codec, ) else: before = time.monotonic() stmt = await self._get_statement( query, timeout, record_class=record_class, ignore_custom_codec=ignore_custom_codec, ) after = time.monotonic() timeout -= after - before before = after try: if timeout is None: result = await executor(stmt, None) else: try: result = await executor(stmt, timeout) finally: after = time.monotonic() timeout -= after - before except exceptions.OutdatedSchemaCacheError: # This exception is raised when we detect a difference between # cached type's info and incoming tuple from the DB (when a type is # changed by the ALTER TYPE). # It is not possible to recover (the statement is already done at # the server's side), the only way is to drop our caches and # reraise the exception to the caller. await self.reload_schema_state() raise except exceptions.InvalidCachedStatementError: # PostgreSQL will raise an exception when it detects # that the result type of the query has changed from # when the statement was prepared. This may happen, # for example, after an ALTER TABLE or SET search_path. # # When this happens, and there is no transaction running, # we can simply re-prepare the statement and try once # again. We deliberately retry only once as this is # supposed to be a rare occurrence. # # If the transaction _is_ running, this error will put it # into an error state, and we have no choice but to # re-raise the exception. # # In either case we clear the statement cache for this # connection and all other connections of the pool this # connection belongs to (if any). # # See https://github.com/MagicStack/asyncpg/issues/72 # and https://github.com/MagicStack/asyncpg/issues/76 # for discussion. # self._drop_global_statement_cache() if self._protocol.is_in_transaction() or not retry: raise else: return await self._do_execute( query, executor, timeout, retry=False) return result, stmt async def connect(dsn=None, *, host=None, port=None, user=None, password=None, passfile=None, database=None, loop=None, timeout=60, statement_cache_size=100, max_cached_statement_lifetime=300, max_cacheable_statement_size=1024 * 15, command_timeout=None, ssl=None, direct_tls=None, connection_class=Connection, record_class=protocol.Record, server_settings=None, target_session_attrs=None, krbsrvname=None, gsslib=None): r"""A coroutine to establish a connection to a PostgreSQL server. The connection parameters may be specified either as a connection URI in *dsn*, or as specific keyword arguments, or both. If both *dsn* and keyword arguments are specified, the latter override the corresponding values parsed from the connection URI. The default values for the majority of arguments can be specified using `environment variables `_. Returns a new :class:`~asyncpg.connection.Connection` object. :param dsn: Connection arguments specified using as a single string in the `libpq connection URI format`_: ``postgres://user:password@host:port/database?option=value``. The following options are recognized by asyncpg: ``host``, ``port``, ``user``, ``database`` (or ``dbname``), ``password``, ``passfile``, ``sslmode``, ``sslcert``, ``sslkey``, ``sslrootcert``, and ``sslcrl``. Unlike libpq, asyncpg will treat unrecognized options as `server settings`_ to be used for the connection. .. note:: The URI must be *valid*, which means that all components must be properly quoted with :py:func:`urllib.parse.quote_plus`, and any literal IPv6 addresses must be enclosed in square brackets. For example: .. code-block:: text postgres://dbuser@[fe80::1ff:fe23:4567:890a%25eth0]/dbname :param host: Database host address as one of the following: - an IP address or a domain name; - an absolute path to the directory containing the database server Unix-domain socket (not supported on Windows); - a sequence of any of the above, in which case the addresses will be tried in order, and the first successful connection will be returned. If not specified, asyncpg will try the following, in order: - host address(es) parsed from the *dsn* argument, - the value of the ``PGHOST`` environment variable, - on Unix, common directories used for PostgreSQL Unix-domain sockets: ``"/run/postgresql"``, ``"/var/run/postgresl"``, ``"/var/pgsql_socket"``, ``"/private/tmp"``, and ``"/tmp"``, - ``"localhost"``. :param port: Port number to connect to at the server host (or Unix-domain socket file extension). If multiple host addresses were specified, this parameter may specify a sequence of port numbers of the same length as the host sequence, or it may specify a single port number to be used for all host addresses. If not specified, the value parsed from the *dsn* argument is used, or the value of the ``PGPORT`` environment variable, or ``5432`` if neither is specified. :param user: The name of the database role used for authentication. If not specified, the value parsed from the *dsn* argument is used, or the value of the ``PGUSER`` environment variable, or the operating system name of the user running the application. :param database: The name of the database to connect to. If not specified, the value parsed from the *dsn* argument is used, or the value of the ``PGDATABASE`` environment variable, or the computed value of the *user* argument. :param password: Password to be used for authentication, if the server requires one. If not specified, the value parsed from the *dsn* argument is used, or the value of the ``PGPASSWORD`` environment variable. Note that the use of the environment variable is discouraged as other users and applications may be able to read it without needing specific privileges. It is recommended to use *passfile* instead. Password may be either a string, or a callable that returns a string. If a callable is provided, it will be called each time a new connection is established. :param passfile: The name of the file used to store passwords (defaults to ``~/.pgpass``, or ``%APPDATA%\postgresql\pgpass.conf`` on Windows). :param loop: An asyncio event loop instance. If ``None``, the default event loop will be used. :param float timeout: Connection timeout in seconds. :param int statement_cache_size: The size of prepared statement LRU cache. Pass ``0`` to disable the cache. :param int max_cached_statement_lifetime: The maximum time in seconds a prepared statement will stay in the cache. Pass ``0`` to allow statements be cached indefinitely. :param int max_cacheable_statement_size: The maximum size of a statement that can be cached (15KiB by default). Pass ``0`` to allow all statements to be cached regardless of their size. :param float command_timeout: The default timeout for operations on this connection (the default is ``None``: no timeout). :param ssl: Pass ``True`` or an `ssl.SSLContext `_ instance to require an SSL connection. If ``True``, a default SSL context returned by `ssl.create_default_context() `_ will be used. The value can also be one of the following strings: - ``'disable'`` - SSL is disabled (equivalent to ``False``) - ``'prefer'`` - try SSL first, fallback to non-SSL connection if SSL connection fails - ``'allow'`` - try without SSL first, then retry with SSL if the first attempt fails. - ``'require'`` - only try an SSL connection. Certificate verification errors are ignored - ``'verify-ca'`` - only try an SSL connection, and verify that the server certificate is issued by a trusted certificate authority (CA) - ``'verify-full'`` - only try an SSL connection, verify that the server certificate is issued by a trusted CA and that the requested server host name matches that in the certificate. The default is ``'prefer'``: try an SSL connection and fallback to non-SSL connection if that fails. .. note:: *ssl* is ignored for Unix domain socket communication. Example of programmatic SSL context configuration that is equivalent to ``sslmode=verify-full&sslcert=..&sslkey=..&sslrootcert=..``: .. code-block:: pycon >>> import asyncpg >>> import asyncio >>> import ssl >>> async def main(): ... # Load CA bundle for server certificate verification, ... # equivalent to sslrootcert= in DSN. ... sslctx = ssl.create_default_context( ... ssl.Purpose.SERVER_AUTH, ... cafile="path/to/ca_bundle.pem") ... # If True, equivalent to sslmode=verify-full, if False: ... # sslmode=verify-ca. ... sslctx.check_hostname = True ... # Load client certificate and private key for client ... # authentication, equivalent to sslcert= and sslkey= in ... # DSN. ... sslctx.load_cert_chain( ... "path/to/client.cert", ... keyfile="path/to/client.key", ... ) ... con = await asyncpg.connect(user='postgres', ssl=sslctx) ... await con.close() >>> asyncio.run(main()) Example of programmatic SSL context configuration that is equivalent to ``sslmode=require`` (no server certificate or host verification): .. code-block:: pycon >>> import asyncpg >>> import asyncio >>> import ssl >>> async def main(): ... sslctx = ssl.create_default_context( ... ssl.Purpose.SERVER_AUTH) ... sslctx.check_hostname = False ... sslctx.verify_mode = ssl.CERT_NONE ... con = await asyncpg.connect(user='postgres', ssl=sslctx) ... await con.close() >>> asyncio.run(main()) :param bool direct_tls: Pass ``True`` to skip PostgreSQL STARTTLS mode and perform a direct SSL connection. Must be used alongside ``ssl`` param. :param dict server_settings: An optional dict of server runtime parameters. Refer to PostgreSQL documentation for a `list of supported options `_. :param type connection_class: Class of the returned connection object. Must be a subclass of :class:`~asyncpg.connection.Connection`. :param type record_class: If specified, the class to use for records returned by queries on this connection object. Must be a subclass of :class:`~asyncpg.Record`. :param SessionAttribute target_session_attrs: If specified, check that the host has the correct attribute. Can be one of: - ``"any"`` - the first successfully connected host - ``"primary"`` - the host must NOT be in hot standby mode - ``"standby"`` - the host must be in hot standby mode - ``"read-write"`` - the host must allow writes - ``"read-only"`` - the host most NOT allow writes - ``"prefer-standby"`` - first try to find a standby host, but if none of the listed hosts is a standby server, return any of them. If not specified, the value parsed from the *dsn* argument is used, or the value of the ``PGTARGETSESSIONATTRS`` environment variable, or ``"any"`` if neither is specified. :param str krbsrvname: Kerberos service name to use when authenticating with GSSAPI. This must match the server configuration. Defaults to 'postgres'. :param str gsslib: GSS library to use for GSSAPI/SSPI authentication. Can be 'gssapi' or 'sspi'. Defaults to 'sspi' on Windows and 'gssapi' otherwise. :return: A :class:`~asyncpg.connection.Connection` instance. Example: .. code-block:: pycon >>> import asyncpg >>> import asyncio >>> async def run(): ... con = await asyncpg.connect(user='postgres') ... types = await con.fetch('SELECT * FROM pg_type') ... print(types) ... >>> asyncio.run(run()) [= 0 self._max_size = new_size self._maybe_cleanup() def get_max_lifetime(self): return self._max_lifetime def set_max_lifetime(self, new_lifetime): assert new_lifetime >= 0 self._max_lifetime = new_lifetime for entry in self._entries.values(): # For every entry cancel the existing callback # and setup a new one if necessary. self._set_entry_timeout(entry) def get(self, query, *, promote=True): if not self._max_size: # The cache is disabled. return entry = self._entries.get(query) # type: _StatementCacheEntry if entry is None: return if entry._statement.closed: # Happens in unittests when we call `stmt._state.mark_closed()` # manually or when a prepared statement closes itself on type # cache error. self._entries.pop(query) self._clear_entry_callback(entry) return if promote: # `promote` is `False` when `get()` is called by `has()`. self._entries.move_to_end(query, last=True) return entry._statement def has(self, query): return self.get(query, promote=False) is not None def put(self, query, statement): if not self._max_size: # The cache is disabled. return self._entries[query] = self._new_entry(query, statement) # Check if the cache is bigger than max_size and trim it # if necessary. self._maybe_cleanup() def iter_statements(self): return (e._statement for e in self._entries.values()) def clear(self): # Store entries for later. entries = tuple(self._entries.values()) # Clear the entries dict. self._entries.clear() # Make sure that we cancel all scheduled callbacks # and call on_remove callback for each entry. for entry in entries: self._clear_entry_callback(entry) self._on_remove(entry._statement) def _set_entry_timeout(self, entry): # Clear the existing timeout. self._clear_entry_callback(entry) # Set the new timeout if it's not 0. if self._max_lifetime: entry._cleanup_cb = self._loop.call_later( self._max_lifetime, self._on_entry_expired, entry) def _new_entry(self, query, statement): entry = _StatementCacheEntry(self, query, statement) self._set_entry_timeout(entry) return entry def _on_entry_expired(self, entry): # `call_later` callback, called when an entry stayed longer # than `self._max_lifetime`. if self._entries.get(entry._query) is entry: self._entries.pop(entry._query) self._on_remove(entry._statement) def _clear_entry_callback(self, entry): if entry._cleanup_cb is not None: entry._cleanup_cb.cancel() def _maybe_cleanup(self): # Delete cache entries until the size of the cache is `max_size`. while len(self._entries) > self._max_size: old_query, old_entry = self._entries.popitem(last=False) self._clear_entry_callback(old_entry) # Let the connection know that the statement was removed # from the cache. self._on_remove(old_entry._statement) class _Callback(typing.NamedTuple): cb: typing.Callable[..., None] is_async: bool @classmethod def from_callable(cls, cb: typing.Callable[..., None]) -> '_Callback': if inspect.iscoroutinefunction(cb): is_async = True elif callable(cb): is_async = False else: raise exceptions.InterfaceError( 'expected a callable or an `async def` function,' 'got {!r}'.format(cb) ) return cls(cb, is_async) class _Atomic: __slots__ = ('_acquired',) def __init__(self): self._acquired = 0 def __enter__(self): if self._acquired: raise exceptions.InterfaceError( 'cannot perform operation: another operation is in progress') self._acquired = 1 def __exit__(self, t, e, tb): self._acquired = 0 class _ConnectionProxy: # Base class to enable `isinstance(Connection)` check. __slots__ = () LoggedQuery = collections.namedtuple( 'LoggedQuery', ['query', 'args', 'timeout', 'elapsed', 'exception', 'conn_addr', 'conn_params']) LoggedQuery.__doc__ = 'Log record of an executed query.' ServerCapabilities = collections.namedtuple( 'ServerCapabilities', ['advisory_locks', 'notifications', 'plpgsql', 'sql_reset', 'sql_close_all', 'sql_copy_from_where', 'jit']) ServerCapabilities.__doc__ = 'PostgreSQL server capabilities.' def _detect_server_capabilities(server_version, connection_settings): if hasattr(connection_settings, 'padb_revision'): # Amazon Redshift detected. advisory_locks = False notifications = False plpgsql = False sql_reset = True sql_close_all = False jit = False sql_copy_from_where = False elif hasattr(connection_settings, 'crdb_version'): # CockroachDB detected. advisory_locks = False notifications = False plpgsql = False sql_reset = False sql_close_all = False jit = False sql_copy_from_where = False elif hasattr(connection_settings, 'crate_version'): # CrateDB detected. advisory_locks = False notifications = False plpgsql = False sql_reset = False sql_close_all = False jit = False sql_copy_from_where = False else: # Standard PostgreSQL server assumed. advisory_locks = True notifications = True plpgsql = True sql_reset = True sql_close_all = True jit = server_version >= (11, 0) sql_copy_from_where = server_version.major >= 12 return ServerCapabilities( advisory_locks=advisory_locks, notifications=notifications, plpgsql=plpgsql, sql_reset=sql_reset, sql_close_all=sql_close_all, sql_copy_from_where=sql_copy_from_where, jit=jit, ) def _extract_stack(limit=10): """Replacement for traceback.extract_stack() that only does the necessary work for asyncio debug mode. """ frame = sys._getframe().f_back try: stack = traceback.StackSummary.extract( traceback.walk_stack(frame), lookup_lines=False) finally: del frame apg_path = asyncpg.__path__[0] i = 0 while i < len(stack) and stack[i][0].startswith(apg_path): i += 1 stack = stack[i:i + limit] stack.reverse() return ''.join(traceback.format_list(stack)) def _check_record_class(record_class): if record_class is protocol.Record: pass elif ( isinstance(record_class, type) and issubclass(record_class, protocol.Record) ): if ( record_class.__new__ is not object.__new__ or record_class.__init__ is not object.__init__ ): raise exceptions.InterfaceError( 'record_class must not redefine __new__ or __init__' ) else: raise exceptions.InterfaceError( 'record_class is expected to be a subclass of ' 'asyncpg.Record, got {!r}'.format(record_class) ) def _weak_maybe_gc_stmt(weak_ref, stmt): self = weak_ref() if self is not None: self._maybe_gc_stmt(stmt) _uid = 0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/connresource.py0000644000175100001770000000255014705014413017367 0ustar00runnerdocker # Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import functools from . import exceptions def guarded(meth): """A decorator to add a sanity check to ConnectionResource methods.""" @functools.wraps(meth) def _check(self, *args, **kwargs): self._check_conn_validity(meth.__name__) return meth(self, *args, **kwargs) return _check class ConnectionResource: __slots__ = ('_connection', '_con_release_ctr') def __init__(self, connection): self._connection = connection self._con_release_ctr = connection._pool_release_ctr def _check_conn_validity(self, meth_name): con_release_ctr = self._connection._pool_release_ctr if con_release_ctr != self._con_release_ctr: raise exceptions.InterfaceError( 'cannot call {}.{}(): ' 'the underlying connection has been released back ' 'to the pool'.format(self.__class__.__name__, meth_name)) if self._connection.is_closed(): raise exceptions.InterfaceError( 'cannot call {}.{}(): ' 'the underlying connection is closed'.format( self.__class__.__name__, meth_name)) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/cursor.py0000644000175100001770000002171014705014413016176 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import collections from . import connresource from . import exceptions class CursorFactory(connresource.ConnectionResource): """A cursor interface for the results of a query. A cursor interface can be used to initiate efficient traversal of the results of a large query. """ __slots__ = ( '_state', '_args', '_prefetch', '_query', '_timeout', '_record_class', ) def __init__( self, connection, query, state, args, prefetch, timeout, record_class ): super().__init__(connection) self._args = args self._prefetch = prefetch self._query = query self._timeout = timeout self._state = state self._record_class = record_class if state is not None: state.attach() @connresource.guarded def __aiter__(self): prefetch = 50 if self._prefetch is None else self._prefetch return CursorIterator( self._connection, self._query, self._state, self._args, self._record_class, prefetch, self._timeout, ) @connresource.guarded def __await__(self): if self._prefetch is not None: raise exceptions.InterfaceError( 'prefetch argument can only be specified for iterable cursor') cursor = Cursor( self._connection, self._query, self._state, self._args, self._record_class, ) return cursor._init(self._timeout).__await__() def __del__(self): if self._state is not None: self._state.detach() self._connection._maybe_gc_stmt(self._state) class BaseCursor(connresource.ConnectionResource): __slots__ = ( '_state', '_args', '_portal_name', '_exhausted', '_query', '_record_class', ) def __init__(self, connection, query, state, args, record_class): super().__init__(connection) self._args = args self._state = state if state is not None: state.attach() self._portal_name = None self._exhausted = False self._query = query self._record_class = record_class def _check_ready(self): if self._state is None: raise exceptions.InterfaceError( 'cursor: no associated prepared statement') if self._state.closed: raise exceptions.InterfaceError( 'cursor: the prepared statement is closed') if not self._connection._top_xact: raise exceptions.NoActiveSQLTransactionError( 'cursor cannot be created outside of a transaction') async def _bind_exec(self, n, timeout): self._check_ready() if self._portal_name: raise exceptions.InterfaceError( 'cursor already has an open portal') con = self._connection protocol = con._protocol self._portal_name = con._get_unique_id('portal') buffer, _, self._exhausted = await protocol.bind_execute( self._state, self._args, self._portal_name, n, True, timeout) return buffer async def _bind(self, timeout): self._check_ready() if self._portal_name: raise exceptions.InterfaceError( 'cursor already has an open portal') con = self._connection protocol = con._protocol self._portal_name = con._get_unique_id('portal') buffer = await protocol.bind(self._state, self._args, self._portal_name, timeout) return buffer async def _exec(self, n, timeout): self._check_ready() if not self._portal_name: raise exceptions.InterfaceError( 'cursor does not have an open portal') protocol = self._connection._protocol buffer, _, self._exhausted = await protocol.execute( self._state, self._portal_name, n, True, timeout) return buffer async def _close_portal(self, timeout): self._check_ready() if not self._portal_name: raise exceptions.InterfaceError( 'cursor does not have an open portal') protocol = self._connection._protocol await protocol.close_portal(self._portal_name, timeout) self._portal_name = None def __repr__(self): attrs = [] if self._exhausted: attrs.append('exhausted') attrs.append('') # to separate from id if self.__class__.__module__.startswith('asyncpg.'): mod = 'asyncpg' else: mod = self.__class__.__module__ return '<{}.{} "{!s:.30}" {}{:#x}>'.format( mod, self.__class__.__name__, self._state.query, ' '.join(attrs), id(self)) def __del__(self): if self._state is not None: self._state.detach() self._connection._maybe_gc_stmt(self._state) class CursorIterator(BaseCursor): __slots__ = ('_buffer', '_prefetch', '_timeout') def __init__( self, connection, query, state, args, record_class, prefetch, timeout ): super().__init__(connection, query, state, args, record_class) if prefetch <= 0: raise exceptions.InterfaceError( 'prefetch argument must be greater than zero') self._buffer = collections.deque() self._prefetch = prefetch self._timeout = timeout @connresource.guarded def __aiter__(self): return self @connresource.guarded async def __anext__(self): if self._state is None: self._state = await self._connection._get_statement( self._query, self._timeout, named=True, record_class=self._record_class, ) self._state.attach() if not self._portal_name and not self._exhausted: buffer = await self._bind_exec(self._prefetch, self._timeout) self._buffer.extend(buffer) if not self._buffer and not self._exhausted: buffer = await self._exec(self._prefetch, self._timeout) self._buffer.extend(buffer) if self._portal_name and self._exhausted: await self._close_portal(self._timeout) if self._buffer: return self._buffer.popleft() raise StopAsyncIteration class Cursor(BaseCursor): """An open *portal* into the results of a query.""" __slots__ = () async def _init(self, timeout): if self._state is None: self._state = await self._connection._get_statement( self._query, timeout, named=True, record_class=self._record_class, ) self._state.attach() self._check_ready() await self._bind(timeout) return self @connresource.guarded async def fetch(self, n, *, timeout=None): r"""Return the next *n* rows as a list of :class:`Record` objects. :param float timeout: Optional timeout value in seconds. :return: A list of :class:`Record` instances. """ self._check_ready() if n <= 0: raise exceptions.InterfaceError('n must be greater than zero') if self._exhausted: return [] recs = await self._exec(n, timeout) if len(recs) < n: self._exhausted = True return recs @connresource.guarded async def fetchrow(self, *, timeout=None): r"""Return the next row. :param float timeout: Optional timeout value in seconds. :return: A :class:`Record` instance. """ self._check_ready() if self._exhausted: return None recs = await self._exec(1, timeout) if len(recs) < 1: self._exhausted = True return None return recs[0] @connresource.guarded async def forward(self, n, *, timeout=None) -> int: r"""Skip over the next *n* rows. :param float timeout: Optional timeout value in seconds. :return: A number of rows actually skipped over (<= *n*). """ self._check_ready() if n <= 0: raise exceptions.InterfaceError('n must be greater than zero') protocol = self._connection._protocol status = await protocol.query('MOVE FORWARD {:d} {}'.format( n, self._portal_name), timeout) advanced = int(status.split()[1]) if advanced < n: self._exhausted = True return advanced ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1729370387.4775543 asyncpg-0.30.0/asyncpg/exceptions/0000755000175100001770000000000014705014423016470 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/exceptions/__init__.py0000644000175100001770000007074514705014413020615 0ustar00runnerdocker# GENERATED FROM postgresql/src/backend/utils/errcodes.txt # DO NOT MODIFY, use tools/generate_exceptions.py to update from ._base import * # NOQA from . import _base class PostgresWarning(_base.PostgresLogMessage, Warning): sqlstate = '01000' class DynamicResultSetsReturned(PostgresWarning): sqlstate = '0100C' class ImplicitZeroBitPadding(PostgresWarning): sqlstate = '01008' class NullValueEliminatedInSetFunction(PostgresWarning): sqlstate = '01003' class PrivilegeNotGranted(PostgresWarning): sqlstate = '01007' class PrivilegeNotRevoked(PostgresWarning): sqlstate = '01006' class StringDataRightTruncation(PostgresWarning): sqlstate = '01004' class DeprecatedFeature(PostgresWarning): sqlstate = '01P01' class NoData(PostgresWarning): sqlstate = '02000' class NoAdditionalDynamicResultSetsReturned(NoData): sqlstate = '02001' class SQLStatementNotYetCompleteError(_base.PostgresError): sqlstate = '03000' class PostgresConnectionError(_base.PostgresError): sqlstate = '08000' class ConnectionDoesNotExistError(PostgresConnectionError): sqlstate = '08003' class ConnectionFailureError(PostgresConnectionError): sqlstate = '08006' class ClientCannotConnectError(PostgresConnectionError): sqlstate = '08001' class ConnectionRejectionError(PostgresConnectionError): sqlstate = '08004' class TransactionResolutionUnknownError(PostgresConnectionError): sqlstate = '08007' class ProtocolViolationError(PostgresConnectionError): sqlstate = '08P01' class TriggeredActionError(_base.PostgresError): sqlstate = '09000' class FeatureNotSupportedError(_base.PostgresError): sqlstate = '0A000' class InvalidCachedStatementError(FeatureNotSupportedError): pass class InvalidTransactionInitiationError(_base.PostgresError): sqlstate = '0B000' class LocatorError(_base.PostgresError): sqlstate = '0F000' class InvalidLocatorSpecificationError(LocatorError): sqlstate = '0F001' class InvalidGrantorError(_base.PostgresError): sqlstate = '0L000' class InvalidGrantOperationError(InvalidGrantorError): sqlstate = '0LP01' class InvalidRoleSpecificationError(_base.PostgresError): sqlstate = '0P000' class DiagnosticsError(_base.PostgresError): sqlstate = '0Z000' class StackedDiagnosticsAccessedWithoutActiveHandlerError(DiagnosticsError): sqlstate = '0Z002' class InvalidArgumentForXqueryError(_base.PostgresError): sqlstate = '10608' class CaseNotFoundError(_base.PostgresError): sqlstate = '20000' class CardinalityViolationError(_base.PostgresError): sqlstate = '21000' class DataError(_base.PostgresError): sqlstate = '22000' class ArraySubscriptError(DataError): sqlstate = '2202E' class CharacterNotInRepertoireError(DataError): sqlstate = '22021' class DatetimeFieldOverflowError(DataError): sqlstate = '22008' class DivisionByZeroError(DataError): sqlstate = '22012' class ErrorInAssignmentError(DataError): sqlstate = '22005' class EscapeCharacterConflictError(DataError): sqlstate = '2200B' class IndicatorOverflowError(DataError): sqlstate = '22022' class IntervalFieldOverflowError(DataError): sqlstate = '22015' class InvalidArgumentForLogarithmError(DataError): sqlstate = '2201E' class InvalidArgumentForNtileFunctionError(DataError): sqlstate = '22014' class InvalidArgumentForNthValueFunctionError(DataError): sqlstate = '22016' class InvalidArgumentForPowerFunctionError(DataError): sqlstate = '2201F' class InvalidArgumentForWidthBucketFunctionError(DataError): sqlstate = '2201G' class InvalidCharacterValueForCastError(DataError): sqlstate = '22018' class InvalidDatetimeFormatError(DataError): sqlstate = '22007' class InvalidEscapeCharacterError(DataError): sqlstate = '22019' class InvalidEscapeOctetError(DataError): sqlstate = '2200D' class InvalidEscapeSequenceError(DataError): sqlstate = '22025' class NonstandardUseOfEscapeCharacterError(DataError): sqlstate = '22P06' class InvalidIndicatorParameterValueError(DataError): sqlstate = '22010' class InvalidParameterValueError(DataError): sqlstate = '22023' class InvalidPrecedingOrFollowingSizeError(DataError): sqlstate = '22013' class InvalidRegularExpressionError(DataError): sqlstate = '2201B' class InvalidRowCountInLimitClauseError(DataError): sqlstate = '2201W' class InvalidRowCountInResultOffsetClauseError(DataError): sqlstate = '2201X' class InvalidTablesampleArgumentError(DataError): sqlstate = '2202H' class InvalidTablesampleRepeatError(DataError): sqlstate = '2202G' class InvalidTimeZoneDisplacementValueError(DataError): sqlstate = '22009' class InvalidUseOfEscapeCharacterError(DataError): sqlstate = '2200C' class MostSpecificTypeMismatchError(DataError): sqlstate = '2200G' class NullValueNotAllowedError(DataError): sqlstate = '22004' class NullValueNoIndicatorParameterError(DataError): sqlstate = '22002' class NumericValueOutOfRangeError(DataError): sqlstate = '22003' class SequenceGeneratorLimitExceededError(DataError): sqlstate = '2200H' class StringDataLengthMismatchError(DataError): sqlstate = '22026' class StringDataRightTruncationError(DataError): sqlstate = '22001' class SubstringError(DataError): sqlstate = '22011' class TrimError(DataError): sqlstate = '22027' class UnterminatedCStringError(DataError): sqlstate = '22024' class ZeroLengthCharacterStringError(DataError): sqlstate = '2200F' class PostgresFloatingPointError(DataError): sqlstate = '22P01' class InvalidTextRepresentationError(DataError): sqlstate = '22P02' class InvalidBinaryRepresentationError(DataError): sqlstate = '22P03' class BadCopyFileFormatError(DataError): sqlstate = '22P04' class UntranslatableCharacterError(DataError): sqlstate = '22P05' class NotAnXmlDocumentError(DataError): sqlstate = '2200L' class InvalidXmlDocumentError(DataError): sqlstate = '2200M' class InvalidXmlContentError(DataError): sqlstate = '2200N' class InvalidXmlCommentError(DataError): sqlstate = '2200S' class InvalidXmlProcessingInstructionError(DataError): sqlstate = '2200T' class DuplicateJsonObjectKeyValueError(DataError): sqlstate = '22030' class InvalidArgumentForSQLJsonDatetimeFunctionError(DataError): sqlstate = '22031' class InvalidJsonTextError(DataError): sqlstate = '22032' class InvalidSQLJsonSubscriptError(DataError): sqlstate = '22033' class MoreThanOneSQLJsonItemError(DataError): sqlstate = '22034' class NoSQLJsonItemError(DataError): sqlstate = '22035' class NonNumericSQLJsonItemError(DataError): sqlstate = '22036' class NonUniqueKeysInAJsonObjectError(DataError): sqlstate = '22037' class SingletonSQLJsonItemRequiredError(DataError): sqlstate = '22038' class SQLJsonArrayNotFoundError(DataError): sqlstate = '22039' class SQLJsonMemberNotFoundError(DataError): sqlstate = '2203A' class SQLJsonNumberNotFoundError(DataError): sqlstate = '2203B' class SQLJsonObjectNotFoundError(DataError): sqlstate = '2203C' class TooManyJsonArrayElementsError(DataError): sqlstate = '2203D' class TooManyJsonObjectMembersError(DataError): sqlstate = '2203E' class SQLJsonScalarRequiredError(DataError): sqlstate = '2203F' class SQLJsonItemCannotBeCastToTargetTypeError(DataError): sqlstate = '2203G' class IntegrityConstraintViolationError(_base.PostgresError): sqlstate = '23000' class RestrictViolationError(IntegrityConstraintViolationError): sqlstate = '23001' class NotNullViolationError(IntegrityConstraintViolationError): sqlstate = '23502' class ForeignKeyViolationError(IntegrityConstraintViolationError): sqlstate = '23503' class UniqueViolationError(IntegrityConstraintViolationError): sqlstate = '23505' class CheckViolationError(IntegrityConstraintViolationError): sqlstate = '23514' class ExclusionViolationError(IntegrityConstraintViolationError): sqlstate = '23P01' class InvalidCursorStateError(_base.PostgresError): sqlstate = '24000' class InvalidTransactionStateError(_base.PostgresError): sqlstate = '25000' class ActiveSQLTransactionError(InvalidTransactionStateError): sqlstate = '25001' class BranchTransactionAlreadyActiveError(InvalidTransactionStateError): sqlstate = '25002' class HeldCursorRequiresSameIsolationLevelError(InvalidTransactionStateError): sqlstate = '25008' class InappropriateAccessModeForBranchTransactionError( InvalidTransactionStateError): sqlstate = '25003' class InappropriateIsolationLevelForBranchTransactionError( InvalidTransactionStateError): sqlstate = '25004' class NoActiveSQLTransactionForBranchTransactionError( InvalidTransactionStateError): sqlstate = '25005' class ReadOnlySQLTransactionError(InvalidTransactionStateError): sqlstate = '25006' class SchemaAndDataStatementMixingNotSupportedError( InvalidTransactionStateError): sqlstate = '25007' class NoActiveSQLTransactionError(InvalidTransactionStateError): sqlstate = '25P01' class InFailedSQLTransactionError(InvalidTransactionStateError): sqlstate = '25P02' class IdleInTransactionSessionTimeoutError(InvalidTransactionStateError): sqlstate = '25P03' class TransactionTimeoutError(InvalidTransactionStateError): sqlstate = '25P04' class InvalidSQLStatementNameError(_base.PostgresError): sqlstate = '26000' class TriggeredDataChangeViolationError(_base.PostgresError): sqlstate = '27000' class InvalidAuthorizationSpecificationError(_base.PostgresError): sqlstate = '28000' class InvalidPasswordError(InvalidAuthorizationSpecificationError): sqlstate = '28P01' class DependentPrivilegeDescriptorsStillExistError(_base.PostgresError): sqlstate = '2B000' class DependentObjectsStillExistError( DependentPrivilegeDescriptorsStillExistError): sqlstate = '2BP01' class InvalidTransactionTerminationError(_base.PostgresError): sqlstate = '2D000' class SQLRoutineError(_base.PostgresError): sqlstate = '2F000' class FunctionExecutedNoReturnStatementError(SQLRoutineError): sqlstate = '2F005' class ModifyingSQLDataNotPermittedError(SQLRoutineError): sqlstate = '2F002' class ProhibitedSQLStatementAttemptedError(SQLRoutineError): sqlstate = '2F003' class ReadingSQLDataNotPermittedError(SQLRoutineError): sqlstate = '2F004' class InvalidCursorNameError(_base.PostgresError): sqlstate = '34000' class ExternalRoutineError(_base.PostgresError): sqlstate = '38000' class ContainingSQLNotPermittedError(ExternalRoutineError): sqlstate = '38001' class ModifyingExternalRoutineSQLDataNotPermittedError(ExternalRoutineError): sqlstate = '38002' class ProhibitedExternalRoutineSQLStatementAttemptedError( ExternalRoutineError): sqlstate = '38003' class ReadingExternalRoutineSQLDataNotPermittedError(ExternalRoutineError): sqlstate = '38004' class ExternalRoutineInvocationError(_base.PostgresError): sqlstate = '39000' class InvalidSqlstateReturnedError(ExternalRoutineInvocationError): sqlstate = '39001' class NullValueInExternalRoutineNotAllowedError( ExternalRoutineInvocationError): sqlstate = '39004' class TriggerProtocolViolatedError(ExternalRoutineInvocationError): sqlstate = '39P01' class SrfProtocolViolatedError(ExternalRoutineInvocationError): sqlstate = '39P02' class EventTriggerProtocolViolatedError(ExternalRoutineInvocationError): sqlstate = '39P03' class SavepointError(_base.PostgresError): sqlstate = '3B000' class InvalidSavepointSpecificationError(SavepointError): sqlstate = '3B001' class InvalidCatalogNameError(_base.PostgresError): sqlstate = '3D000' class InvalidSchemaNameError(_base.PostgresError): sqlstate = '3F000' class TransactionRollbackError(_base.PostgresError): sqlstate = '40000' class TransactionIntegrityConstraintViolationError(TransactionRollbackError): sqlstate = '40002' class SerializationError(TransactionRollbackError): sqlstate = '40001' class StatementCompletionUnknownError(TransactionRollbackError): sqlstate = '40003' class DeadlockDetectedError(TransactionRollbackError): sqlstate = '40P01' class SyntaxOrAccessError(_base.PostgresError): sqlstate = '42000' class PostgresSyntaxError(SyntaxOrAccessError): sqlstate = '42601' class InsufficientPrivilegeError(SyntaxOrAccessError): sqlstate = '42501' class CannotCoerceError(SyntaxOrAccessError): sqlstate = '42846' class GroupingError(SyntaxOrAccessError): sqlstate = '42803' class WindowingError(SyntaxOrAccessError): sqlstate = '42P20' class InvalidRecursionError(SyntaxOrAccessError): sqlstate = '42P19' class InvalidForeignKeyError(SyntaxOrAccessError): sqlstate = '42830' class InvalidNameError(SyntaxOrAccessError): sqlstate = '42602' class NameTooLongError(SyntaxOrAccessError): sqlstate = '42622' class ReservedNameError(SyntaxOrAccessError): sqlstate = '42939' class DatatypeMismatchError(SyntaxOrAccessError): sqlstate = '42804' class IndeterminateDatatypeError(SyntaxOrAccessError): sqlstate = '42P18' class CollationMismatchError(SyntaxOrAccessError): sqlstate = '42P21' class IndeterminateCollationError(SyntaxOrAccessError): sqlstate = '42P22' class WrongObjectTypeError(SyntaxOrAccessError): sqlstate = '42809' class GeneratedAlwaysError(SyntaxOrAccessError): sqlstate = '428C9' class UndefinedColumnError(SyntaxOrAccessError): sqlstate = '42703' class UndefinedFunctionError(SyntaxOrAccessError): sqlstate = '42883' class UndefinedTableError(SyntaxOrAccessError): sqlstate = '42P01' class UndefinedParameterError(SyntaxOrAccessError): sqlstate = '42P02' class UndefinedObjectError(SyntaxOrAccessError): sqlstate = '42704' class DuplicateColumnError(SyntaxOrAccessError): sqlstate = '42701' class DuplicateCursorError(SyntaxOrAccessError): sqlstate = '42P03' class DuplicateDatabaseError(SyntaxOrAccessError): sqlstate = '42P04' class DuplicateFunctionError(SyntaxOrAccessError): sqlstate = '42723' class DuplicatePreparedStatementError(SyntaxOrAccessError): sqlstate = '42P05' class DuplicateSchemaError(SyntaxOrAccessError): sqlstate = '42P06' class DuplicateTableError(SyntaxOrAccessError): sqlstate = '42P07' class DuplicateAliasError(SyntaxOrAccessError): sqlstate = '42712' class DuplicateObjectError(SyntaxOrAccessError): sqlstate = '42710' class AmbiguousColumnError(SyntaxOrAccessError): sqlstate = '42702' class AmbiguousFunctionError(SyntaxOrAccessError): sqlstate = '42725' class AmbiguousParameterError(SyntaxOrAccessError): sqlstate = '42P08' class AmbiguousAliasError(SyntaxOrAccessError): sqlstate = '42P09' class InvalidColumnReferenceError(SyntaxOrAccessError): sqlstate = '42P10' class InvalidColumnDefinitionError(SyntaxOrAccessError): sqlstate = '42611' class InvalidCursorDefinitionError(SyntaxOrAccessError): sqlstate = '42P11' class InvalidDatabaseDefinitionError(SyntaxOrAccessError): sqlstate = '42P12' class InvalidFunctionDefinitionError(SyntaxOrAccessError): sqlstate = '42P13' class InvalidPreparedStatementDefinitionError(SyntaxOrAccessError): sqlstate = '42P14' class InvalidSchemaDefinitionError(SyntaxOrAccessError): sqlstate = '42P15' class InvalidTableDefinitionError(SyntaxOrAccessError): sqlstate = '42P16' class InvalidObjectDefinitionError(SyntaxOrAccessError): sqlstate = '42P17' class WithCheckOptionViolationError(_base.PostgresError): sqlstate = '44000' class InsufficientResourcesError(_base.PostgresError): sqlstate = '53000' class DiskFullError(InsufficientResourcesError): sqlstate = '53100' class OutOfMemoryError(InsufficientResourcesError): sqlstate = '53200' class TooManyConnectionsError(InsufficientResourcesError): sqlstate = '53300' class ConfigurationLimitExceededError(InsufficientResourcesError): sqlstate = '53400' class ProgramLimitExceededError(_base.PostgresError): sqlstate = '54000' class StatementTooComplexError(ProgramLimitExceededError): sqlstate = '54001' class TooManyColumnsError(ProgramLimitExceededError): sqlstate = '54011' class TooManyArgumentsError(ProgramLimitExceededError): sqlstate = '54023' class ObjectNotInPrerequisiteStateError(_base.PostgresError): sqlstate = '55000' class ObjectInUseError(ObjectNotInPrerequisiteStateError): sqlstate = '55006' class CantChangeRuntimeParamError(ObjectNotInPrerequisiteStateError): sqlstate = '55P02' class LockNotAvailableError(ObjectNotInPrerequisiteStateError): sqlstate = '55P03' class UnsafeNewEnumValueUsageError(ObjectNotInPrerequisiteStateError): sqlstate = '55P04' class OperatorInterventionError(_base.PostgresError): sqlstate = '57000' class QueryCanceledError(OperatorInterventionError): sqlstate = '57014' class AdminShutdownError(OperatorInterventionError): sqlstate = '57P01' class CrashShutdownError(OperatorInterventionError): sqlstate = '57P02' class CannotConnectNowError(OperatorInterventionError): sqlstate = '57P03' class DatabaseDroppedError(OperatorInterventionError): sqlstate = '57P04' class IdleSessionTimeoutError(OperatorInterventionError): sqlstate = '57P05' class PostgresSystemError(_base.PostgresError): sqlstate = '58000' class PostgresIOError(PostgresSystemError): sqlstate = '58030' class UndefinedFileError(PostgresSystemError): sqlstate = '58P01' class DuplicateFileError(PostgresSystemError): sqlstate = '58P02' class FileNameTooLongError(PostgresSystemError): sqlstate = '58P03' class SnapshotTooOldError(_base.PostgresError): sqlstate = '72000' class ConfigFileError(_base.PostgresError): sqlstate = 'F0000' class LockFileExistsError(ConfigFileError): sqlstate = 'F0001' class FDWError(_base.PostgresError): sqlstate = 'HV000' class FDWColumnNameNotFoundError(FDWError): sqlstate = 'HV005' class FDWDynamicParameterValueNeededError(FDWError): sqlstate = 'HV002' class FDWFunctionSequenceError(FDWError): sqlstate = 'HV010' class FDWInconsistentDescriptorInformationError(FDWError): sqlstate = 'HV021' class FDWInvalidAttributeValueError(FDWError): sqlstate = 'HV024' class FDWInvalidColumnNameError(FDWError): sqlstate = 'HV007' class FDWInvalidColumnNumberError(FDWError): sqlstate = 'HV008' class FDWInvalidDataTypeError(FDWError): sqlstate = 'HV004' class FDWInvalidDataTypeDescriptorsError(FDWError): sqlstate = 'HV006' class FDWInvalidDescriptorFieldIdentifierError(FDWError): sqlstate = 'HV091' class FDWInvalidHandleError(FDWError): sqlstate = 'HV00B' class FDWInvalidOptionIndexError(FDWError): sqlstate = 'HV00C' class FDWInvalidOptionNameError(FDWError): sqlstate = 'HV00D' class FDWInvalidStringLengthOrBufferLengthError(FDWError): sqlstate = 'HV090' class FDWInvalidStringFormatError(FDWError): sqlstate = 'HV00A' class FDWInvalidUseOfNullPointerError(FDWError): sqlstate = 'HV009' class FDWTooManyHandlesError(FDWError): sqlstate = 'HV014' class FDWOutOfMemoryError(FDWError): sqlstate = 'HV001' class FDWNoSchemasError(FDWError): sqlstate = 'HV00P' class FDWOptionNameNotFoundError(FDWError): sqlstate = 'HV00J' class FDWReplyHandleError(FDWError): sqlstate = 'HV00K' class FDWSchemaNotFoundError(FDWError): sqlstate = 'HV00Q' class FDWTableNotFoundError(FDWError): sqlstate = 'HV00R' class FDWUnableToCreateExecutionError(FDWError): sqlstate = 'HV00L' class FDWUnableToCreateReplyError(FDWError): sqlstate = 'HV00M' class FDWUnableToEstablishConnectionError(FDWError): sqlstate = 'HV00N' class PLPGSQLError(_base.PostgresError): sqlstate = 'P0000' class RaiseError(PLPGSQLError): sqlstate = 'P0001' class NoDataFoundError(PLPGSQLError): sqlstate = 'P0002' class TooManyRowsError(PLPGSQLError): sqlstate = 'P0003' class AssertError(PLPGSQLError): sqlstate = 'P0004' class InternalServerError(_base.PostgresError): sqlstate = 'XX000' class DataCorruptedError(InternalServerError): sqlstate = 'XX001' class IndexCorruptedError(InternalServerError): sqlstate = 'XX002' __all__ = ( 'ActiveSQLTransactionError', 'AdminShutdownError', 'AmbiguousAliasError', 'AmbiguousColumnError', 'AmbiguousFunctionError', 'AmbiguousParameterError', 'ArraySubscriptError', 'AssertError', 'BadCopyFileFormatError', 'BranchTransactionAlreadyActiveError', 'CannotCoerceError', 'CannotConnectNowError', 'CantChangeRuntimeParamError', 'CardinalityViolationError', 'CaseNotFoundError', 'CharacterNotInRepertoireError', 'CheckViolationError', 'ClientCannotConnectError', 'CollationMismatchError', 'ConfigFileError', 'ConfigurationLimitExceededError', 'ConnectionDoesNotExistError', 'ConnectionFailureError', 'ConnectionRejectionError', 'ContainingSQLNotPermittedError', 'CrashShutdownError', 'DataCorruptedError', 'DataError', 'DatabaseDroppedError', 'DatatypeMismatchError', 'DatetimeFieldOverflowError', 'DeadlockDetectedError', 'DependentObjectsStillExistError', 'DependentPrivilegeDescriptorsStillExistError', 'DeprecatedFeature', 'DiagnosticsError', 'DiskFullError', 'DivisionByZeroError', 'DuplicateAliasError', 'DuplicateColumnError', 'DuplicateCursorError', 'DuplicateDatabaseError', 'DuplicateFileError', 'DuplicateFunctionError', 'DuplicateJsonObjectKeyValueError', 'DuplicateObjectError', 'DuplicatePreparedStatementError', 'DuplicateSchemaError', 'DuplicateTableError', 'DynamicResultSetsReturned', 'ErrorInAssignmentError', 'EscapeCharacterConflictError', 'EventTriggerProtocolViolatedError', 'ExclusionViolationError', 'ExternalRoutineError', 'ExternalRoutineInvocationError', 'FDWColumnNameNotFoundError', 'FDWDynamicParameterValueNeededError', 'FDWError', 'FDWFunctionSequenceError', 'FDWInconsistentDescriptorInformationError', 'FDWInvalidAttributeValueError', 'FDWInvalidColumnNameError', 'FDWInvalidColumnNumberError', 'FDWInvalidDataTypeDescriptorsError', 'FDWInvalidDataTypeError', 'FDWInvalidDescriptorFieldIdentifierError', 'FDWInvalidHandleError', 'FDWInvalidOptionIndexError', 'FDWInvalidOptionNameError', 'FDWInvalidStringFormatError', 'FDWInvalidStringLengthOrBufferLengthError', 'FDWInvalidUseOfNullPointerError', 'FDWNoSchemasError', 'FDWOptionNameNotFoundError', 'FDWOutOfMemoryError', 'FDWReplyHandleError', 'FDWSchemaNotFoundError', 'FDWTableNotFoundError', 'FDWTooManyHandlesError', 'FDWUnableToCreateExecutionError', 'FDWUnableToCreateReplyError', 'FDWUnableToEstablishConnectionError', 'FeatureNotSupportedError', 'FileNameTooLongError', 'ForeignKeyViolationError', 'FunctionExecutedNoReturnStatementError', 'GeneratedAlwaysError', 'GroupingError', 'HeldCursorRequiresSameIsolationLevelError', 'IdleInTransactionSessionTimeoutError', 'IdleSessionTimeoutError', 'ImplicitZeroBitPadding', 'InFailedSQLTransactionError', 'InappropriateAccessModeForBranchTransactionError', 'InappropriateIsolationLevelForBranchTransactionError', 'IndeterminateCollationError', 'IndeterminateDatatypeError', 'IndexCorruptedError', 'IndicatorOverflowError', 'InsufficientPrivilegeError', 'InsufficientResourcesError', 'IntegrityConstraintViolationError', 'InternalServerError', 'IntervalFieldOverflowError', 'InvalidArgumentForLogarithmError', 'InvalidArgumentForNthValueFunctionError', 'InvalidArgumentForNtileFunctionError', 'InvalidArgumentForPowerFunctionError', 'InvalidArgumentForSQLJsonDatetimeFunctionError', 'InvalidArgumentForWidthBucketFunctionError', 'InvalidArgumentForXqueryError', 'InvalidAuthorizationSpecificationError', 'InvalidBinaryRepresentationError', 'InvalidCachedStatementError', 'InvalidCatalogNameError', 'InvalidCharacterValueForCastError', 'InvalidColumnDefinitionError', 'InvalidColumnReferenceError', 'InvalidCursorDefinitionError', 'InvalidCursorNameError', 'InvalidCursorStateError', 'InvalidDatabaseDefinitionError', 'InvalidDatetimeFormatError', 'InvalidEscapeCharacterError', 'InvalidEscapeOctetError', 'InvalidEscapeSequenceError', 'InvalidForeignKeyError', 'InvalidFunctionDefinitionError', 'InvalidGrantOperationError', 'InvalidGrantorError', 'InvalidIndicatorParameterValueError', 'InvalidJsonTextError', 'InvalidLocatorSpecificationError', 'InvalidNameError', 'InvalidObjectDefinitionError', 'InvalidParameterValueError', 'InvalidPasswordError', 'InvalidPrecedingOrFollowingSizeError', 'InvalidPreparedStatementDefinitionError', 'InvalidRecursionError', 'InvalidRegularExpressionError', 'InvalidRoleSpecificationError', 'InvalidRowCountInLimitClauseError', 'InvalidRowCountInResultOffsetClauseError', 'InvalidSQLJsonSubscriptError', 'InvalidSQLStatementNameError', 'InvalidSavepointSpecificationError', 'InvalidSchemaDefinitionError', 'InvalidSchemaNameError', 'InvalidSqlstateReturnedError', 'InvalidTableDefinitionError', 'InvalidTablesampleArgumentError', 'InvalidTablesampleRepeatError', 'InvalidTextRepresentationError', 'InvalidTimeZoneDisplacementValueError', 'InvalidTransactionInitiationError', 'InvalidTransactionStateError', 'InvalidTransactionTerminationError', 'InvalidUseOfEscapeCharacterError', 'InvalidXmlCommentError', 'InvalidXmlContentError', 'InvalidXmlDocumentError', 'InvalidXmlProcessingInstructionError', 'LocatorError', 'LockFileExistsError', 'LockNotAvailableError', 'ModifyingExternalRoutineSQLDataNotPermittedError', 'ModifyingSQLDataNotPermittedError', 'MoreThanOneSQLJsonItemError', 'MostSpecificTypeMismatchError', 'NameTooLongError', 'NoActiveSQLTransactionError', 'NoActiveSQLTransactionForBranchTransactionError', 'NoAdditionalDynamicResultSetsReturned', 'NoData', 'NoDataFoundError', 'NoSQLJsonItemError', 'NonNumericSQLJsonItemError', 'NonUniqueKeysInAJsonObjectError', 'NonstandardUseOfEscapeCharacterError', 'NotAnXmlDocumentError', 'NotNullViolationError', 'NullValueEliminatedInSetFunction', 'NullValueInExternalRoutineNotAllowedError', 'NullValueNoIndicatorParameterError', 'NullValueNotAllowedError', 'NumericValueOutOfRangeError', 'ObjectInUseError', 'ObjectNotInPrerequisiteStateError', 'OperatorInterventionError', 'OutOfMemoryError', 'PLPGSQLError', 'PostgresConnectionError', 'PostgresFloatingPointError', 'PostgresIOError', 'PostgresSyntaxError', 'PostgresSystemError', 'PostgresWarning', 'PrivilegeNotGranted', 'PrivilegeNotRevoked', 'ProgramLimitExceededError', 'ProhibitedExternalRoutineSQLStatementAttemptedError', 'ProhibitedSQLStatementAttemptedError', 'ProtocolViolationError', 'QueryCanceledError', 'RaiseError', 'ReadOnlySQLTransactionError', 'ReadingExternalRoutineSQLDataNotPermittedError', 'ReadingSQLDataNotPermittedError', 'ReservedNameError', 'RestrictViolationError', 'SQLJsonArrayNotFoundError', 'SQLJsonItemCannotBeCastToTargetTypeError', 'SQLJsonMemberNotFoundError', 'SQLJsonNumberNotFoundError', 'SQLJsonObjectNotFoundError', 'SQLJsonScalarRequiredError', 'SQLRoutineError', 'SQLStatementNotYetCompleteError', 'SavepointError', 'SchemaAndDataStatementMixingNotSupportedError', 'SequenceGeneratorLimitExceededError', 'SerializationError', 'SingletonSQLJsonItemRequiredError', 'SnapshotTooOldError', 'SrfProtocolViolatedError', 'StackedDiagnosticsAccessedWithoutActiveHandlerError', 'StatementCompletionUnknownError', 'StatementTooComplexError', 'StringDataLengthMismatchError', 'StringDataRightTruncation', 'StringDataRightTruncationError', 'SubstringError', 'SyntaxOrAccessError', 'TooManyArgumentsError', 'TooManyColumnsError', 'TooManyConnectionsError', 'TooManyJsonArrayElementsError', 'TooManyJsonObjectMembersError', 'TooManyRowsError', 'TransactionIntegrityConstraintViolationError', 'TransactionResolutionUnknownError', 'TransactionRollbackError', 'TransactionTimeoutError', 'TriggerProtocolViolatedError', 'TriggeredActionError', 'TriggeredDataChangeViolationError', 'TrimError', 'UndefinedColumnError', 'UndefinedFileError', 'UndefinedFunctionError', 'UndefinedObjectError', 'UndefinedParameterError', 'UndefinedTableError', 'UniqueViolationError', 'UnsafeNewEnumValueUsageError', 'UnterminatedCStringError', 'UntranslatableCharacterError', 'WindowingError', 'WithCheckOptionViolationError', 'WrongObjectTypeError', 'ZeroLengthCharacterStringError' ) __all__ += _base.__all__ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/exceptions/_base.py0000644000175100001770000002205414705014413020115 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncpg import sys import textwrap __all__ = ('PostgresError', 'FatalPostgresError', 'UnknownPostgresError', 'InterfaceError', 'InterfaceWarning', 'PostgresLogMessage', 'ClientConfigurationError', 'InternalClientError', 'OutdatedSchemaCacheError', 'ProtocolError', 'UnsupportedClientFeatureError', 'TargetServerAttributeNotMatched', 'UnsupportedServerFeatureError') def _is_asyncpg_class(cls): modname = cls.__module__ return modname == 'asyncpg' or modname.startswith('asyncpg.') class PostgresMessageMeta(type): _message_map = {} _field_map = { 'S': 'severity', 'V': 'severity_en', 'C': 'sqlstate', 'M': 'message', 'D': 'detail', 'H': 'hint', 'P': 'position', 'p': 'internal_position', 'q': 'internal_query', 'W': 'context', 's': 'schema_name', 't': 'table_name', 'c': 'column_name', 'd': 'data_type_name', 'n': 'constraint_name', 'F': 'server_source_filename', 'L': 'server_source_line', 'R': 'server_source_function' } def __new__(mcls, name, bases, dct): cls = super().__new__(mcls, name, bases, dct) if cls.__module__ == mcls.__module__ and name == 'PostgresMessage': for f in mcls._field_map.values(): setattr(cls, f, None) if _is_asyncpg_class(cls): mod = sys.modules[cls.__module__] if hasattr(mod, name): raise RuntimeError('exception class redefinition: {}'.format( name)) code = dct.get('sqlstate') if code is not None: existing = mcls._message_map.get(code) if existing is not None: raise TypeError('{} has duplicate SQLSTATE code, which is' 'already defined by {}'.format( name, existing.__name__)) mcls._message_map[code] = cls return cls @classmethod def get_message_class_for_sqlstate(mcls, code): return mcls._message_map.get(code, UnknownPostgresError) class PostgresMessage(metaclass=PostgresMessageMeta): @classmethod def _get_error_class(cls, fields): sqlstate = fields.get('C') return type(cls).get_message_class_for_sqlstate(sqlstate) @classmethod def _get_error_dict(cls, fields, query): dct = { 'query': query } field_map = type(cls)._field_map for k, v in fields.items(): field = field_map.get(k) if field: dct[field] = v return dct @classmethod def _make_constructor(cls, fields, query=None): dct = cls._get_error_dict(fields, query) exccls = cls._get_error_class(fields) message = dct.get('message', '') # PostgreSQL will raise an exception when it detects # that the result type of the query has changed from # when the statement was prepared. # # The original error is somewhat cryptic and unspecific, # so we raise a custom subclass that is easier to handle # and identify. # # Note that we specifically do not rely on the error # message, as it is localizable. is_icse = ( exccls.__name__ == 'FeatureNotSupportedError' and _is_asyncpg_class(exccls) and dct.get('server_source_function') == 'RevalidateCachedQuery' ) if is_icse: exceptions = sys.modules[exccls.__module__] exccls = exceptions.InvalidCachedStatementError message = ('cached statement plan is invalid due to a database ' 'schema or configuration change') is_prepared_stmt_error = ( exccls.__name__ in ('DuplicatePreparedStatementError', 'InvalidSQLStatementNameError') and _is_asyncpg_class(exccls) ) if is_prepared_stmt_error: hint = dct.get('hint', '') hint += textwrap.dedent("""\ NOTE: pgbouncer with pool_mode set to "transaction" or "statement" does not support prepared statements properly. You have two options: * if you are using pgbouncer for connection pooling to a single server, switch to the connection pool functionality provided by asyncpg, it is a much better option for this purpose; * if you have no option of avoiding the use of pgbouncer, then you can set statement_cache_size to 0 when creating the asyncpg connection object. """) dct['hint'] = hint return exccls, message, dct def as_dict(self): dct = {} for f in type(self)._field_map.values(): val = getattr(self, f) if val is not None: dct[f] = val return dct class PostgresError(PostgresMessage, Exception): """Base class for all Postgres errors.""" def __str__(self): msg = self.args[0] if self.detail: msg += '\nDETAIL: {}'.format(self.detail) if self.hint: msg += '\nHINT: {}'.format(self.hint) return msg @classmethod def new(cls, fields, query=None): exccls, message, dct = cls._make_constructor(fields, query) ex = exccls(message) ex.__dict__.update(dct) return ex class FatalPostgresError(PostgresError): """A fatal error that should result in server disconnection.""" class UnknownPostgresError(FatalPostgresError): """An error with an unknown SQLSTATE code.""" class InterfaceMessage: def __init__(self, *, detail=None, hint=None): self.detail = detail self.hint = hint def __str__(self): msg = self.args[0] if self.detail: msg += '\nDETAIL: {}'.format(self.detail) if self.hint: msg += '\nHINT: {}'.format(self.hint) return msg class InterfaceError(InterfaceMessage, Exception): """An error caused by improper use of asyncpg API.""" def __init__(self, msg, *, detail=None, hint=None): InterfaceMessage.__init__(self, detail=detail, hint=hint) Exception.__init__(self, msg) def with_msg(self, msg): return type(self)( msg, detail=self.detail, hint=self.hint, ).with_traceback( self.__traceback__ ) class ClientConfigurationError(InterfaceError, ValueError): """An error caused by improper client configuration.""" class DataError(InterfaceError, ValueError): """An error caused by invalid query input.""" class UnsupportedClientFeatureError(InterfaceError): """Requested feature is unsupported by asyncpg.""" class UnsupportedServerFeatureError(InterfaceError): """Requested feature is unsupported by PostgreSQL server.""" class InterfaceWarning(InterfaceMessage, UserWarning): """A warning caused by an improper use of asyncpg API.""" def __init__(self, msg, *, detail=None, hint=None): InterfaceMessage.__init__(self, detail=detail, hint=hint) UserWarning.__init__(self, msg) class InternalClientError(Exception): """All unexpected errors not classified otherwise.""" class ProtocolError(InternalClientError): """Unexpected condition in the handling of PostgreSQL protocol input.""" class TargetServerAttributeNotMatched(InternalClientError): """Could not find a host that satisfies the target attribute requirement""" class OutdatedSchemaCacheError(InternalClientError): """A value decoding error caused by a schema change before row fetching.""" def __init__(self, msg, *, schema=None, data_type=None, position=None): super().__init__(msg) self.schema_name = schema self.data_type_name = data_type self.position = position class PostgresLogMessage(PostgresMessage): """A base class for non-error server messages.""" def __str__(self): return '{}: {}'.format(type(self).__name__, self.message) def __setattr__(self, name, val): raise TypeError('instances of {} are immutable'.format( type(self).__name__)) @classmethod def new(cls, fields, query=None): exccls, message_text, dct = cls._make_constructor(fields, query) if exccls is UnknownPostgresError: exccls = PostgresLogMessage if exccls is PostgresLogMessage: severity = dct.get('severity_en') or dct.get('severity') if severity and severity.upper() == 'WARNING': exccls = asyncpg.PostgresWarning if issubclass(exccls, (BaseException, Warning)): msg = exccls(message_text) else: msg = exccls() msg.__dict__.update(dct) return msg ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/introspection.py0000644000175100001770000002177714705014413017576 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 from __future__ import annotations import typing if typing.TYPE_CHECKING: from . import protocol _TYPEINFO_13: typing.Final = '''\ ( SELECT t.oid AS oid, ns.nspname AS ns, t.typname AS name, t.typtype AS kind, (CASE WHEN t.typtype = 'd' THEN (WITH RECURSIVE typebases(oid, depth) AS ( SELECT t2.typbasetype AS oid, 0 AS depth FROM pg_type t2 WHERE t2.oid = t.oid UNION ALL SELECT t2.typbasetype AS oid, tb.depth + 1 AS depth FROM pg_type t2, typebases tb WHERE tb.oid = t2.oid AND t2.typbasetype != 0 ) SELECT oid FROM typebases ORDER BY depth DESC LIMIT 1) ELSE NULL END) AS basetype, t.typelem AS elemtype, elem_t.typdelim AS elemdelim, range_t.rngsubtype AS range_subtype, (CASE WHEN t.typtype = 'c' THEN (SELECT array_agg(ia.atttypid ORDER BY ia.attnum) FROM pg_attribute ia INNER JOIN pg_class c ON (ia.attrelid = c.oid) WHERE ia.attnum > 0 AND NOT ia.attisdropped AND c.reltype = t.oid) ELSE NULL END) AS attrtypoids, (CASE WHEN t.typtype = 'c' THEN (SELECT array_agg(ia.attname::text ORDER BY ia.attnum) FROM pg_attribute ia INNER JOIN pg_class c ON (ia.attrelid = c.oid) WHERE ia.attnum > 0 AND NOT ia.attisdropped AND c.reltype = t.oid) ELSE NULL END) AS attrnames FROM pg_catalog.pg_type AS t INNER JOIN pg_catalog.pg_namespace ns ON ( ns.oid = t.typnamespace) LEFT JOIN pg_type elem_t ON ( t.typlen = -1 AND t.typelem != 0 AND t.typelem = elem_t.oid ) LEFT JOIN pg_range range_t ON ( t.oid = range_t.rngtypid ) ) ''' INTRO_LOOKUP_TYPES_13 = '''\ WITH RECURSIVE typeinfo_tree( oid, ns, name, kind, basetype, elemtype, elemdelim, range_subtype, attrtypoids, attrnames, depth) AS ( SELECT ti.oid, ti.ns, ti.name, ti.kind, ti.basetype, ti.elemtype, ti.elemdelim, ti.range_subtype, ti.attrtypoids, ti.attrnames, 0 FROM {typeinfo} AS ti WHERE ti.oid = any($1::oid[]) UNION ALL SELECT ti.oid, ti.ns, ti.name, ti.kind, ti.basetype, ti.elemtype, ti.elemdelim, ti.range_subtype, ti.attrtypoids, ti.attrnames, tt.depth + 1 FROM {typeinfo} ti, typeinfo_tree tt WHERE (tt.elemtype IS NOT NULL AND ti.oid = tt.elemtype) OR (tt.attrtypoids IS NOT NULL AND ti.oid = any(tt.attrtypoids)) OR (tt.range_subtype IS NOT NULL AND ti.oid = tt.range_subtype) OR (tt.basetype IS NOT NULL AND ti.oid = tt.basetype) ) SELECT DISTINCT *, basetype::regtype::text AS basetype_name, elemtype::regtype::text AS elemtype_name, range_subtype::regtype::text AS range_subtype_name FROM typeinfo_tree ORDER BY depth DESC '''.format(typeinfo=_TYPEINFO_13) _TYPEINFO: typing.Final = '''\ ( SELECT t.oid AS oid, ns.nspname AS ns, t.typname AS name, t.typtype AS kind, (CASE WHEN t.typtype = 'd' THEN (WITH RECURSIVE typebases(oid, depth) AS ( SELECT t2.typbasetype AS oid, 0 AS depth FROM pg_type t2 WHERE t2.oid = t.oid UNION ALL SELECT t2.typbasetype AS oid, tb.depth + 1 AS depth FROM pg_type t2, typebases tb WHERE tb.oid = t2.oid AND t2.typbasetype != 0 ) SELECT oid FROM typebases ORDER BY depth DESC LIMIT 1) ELSE NULL END) AS basetype, t.typelem AS elemtype, elem_t.typdelim AS elemdelim, COALESCE( range_t.rngsubtype, multirange_t.rngsubtype) AS range_subtype, (CASE WHEN t.typtype = 'c' THEN (SELECT array_agg(ia.atttypid ORDER BY ia.attnum) FROM pg_attribute ia INNER JOIN pg_class c ON (ia.attrelid = c.oid) WHERE ia.attnum > 0 AND NOT ia.attisdropped AND c.reltype = t.oid) ELSE NULL END) AS attrtypoids, (CASE WHEN t.typtype = 'c' THEN (SELECT array_agg(ia.attname::text ORDER BY ia.attnum) FROM pg_attribute ia INNER JOIN pg_class c ON (ia.attrelid = c.oid) WHERE ia.attnum > 0 AND NOT ia.attisdropped AND c.reltype = t.oid) ELSE NULL END) AS attrnames FROM pg_catalog.pg_type AS t INNER JOIN pg_catalog.pg_namespace ns ON ( ns.oid = t.typnamespace) LEFT JOIN pg_type elem_t ON ( t.typlen = -1 AND t.typelem != 0 AND t.typelem = elem_t.oid ) LEFT JOIN pg_range range_t ON ( t.oid = range_t.rngtypid ) LEFT JOIN pg_range multirange_t ON ( t.oid = multirange_t.rngmultitypid ) ) ''' INTRO_LOOKUP_TYPES = '''\ WITH RECURSIVE typeinfo_tree( oid, ns, name, kind, basetype, elemtype, elemdelim, range_subtype, attrtypoids, attrnames, depth) AS ( SELECT ti.oid, ti.ns, ti.name, ti.kind, ti.basetype, ti.elemtype, ti.elemdelim, ti.range_subtype, ti.attrtypoids, ti.attrnames, 0 FROM {typeinfo} AS ti WHERE ti.oid = any($1::oid[]) UNION ALL SELECT ti.oid, ti.ns, ti.name, ti.kind, ti.basetype, ti.elemtype, ti.elemdelim, ti.range_subtype, ti.attrtypoids, ti.attrnames, tt.depth + 1 FROM {typeinfo} ti, typeinfo_tree tt WHERE (tt.elemtype IS NOT NULL AND ti.oid = tt.elemtype) OR (tt.attrtypoids IS NOT NULL AND ti.oid = any(tt.attrtypoids)) OR (tt.range_subtype IS NOT NULL AND ti.oid = tt.range_subtype) OR (tt.basetype IS NOT NULL AND ti.oid = tt.basetype) ) SELECT DISTINCT *, basetype::regtype::text AS basetype_name, elemtype::regtype::text AS elemtype_name, range_subtype::regtype::text AS range_subtype_name FROM typeinfo_tree ORDER BY depth DESC '''.format(typeinfo=_TYPEINFO) TYPE_BY_NAME: typing.Final = '''\ SELECT t.oid, t.typelem AS elemtype, t.typtype AS kind FROM pg_catalog.pg_type AS t INNER JOIN pg_catalog.pg_namespace ns ON (ns.oid = t.typnamespace) WHERE t.typname = $1 AND ns.nspname = $2 ''' TYPE_BY_OID = '''\ SELECT t.oid, t.typelem AS elemtype, t.typtype AS kind FROM pg_catalog.pg_type AS t WHERE t.oid = $1 ''' # 'b' for a base type, 'd' for a domain, 'e' for enum. SCALAR_TYPE_KINDS = (b'b', b'd', b'e') def is_scalar_type(typeinfo: protocol.Record) -> bool: return ( typeinfo['kind'] in SCALAR_TYPE_KINDS and not typeinfo['elemtype'] ) def is_domain_type(typeinfo: protocol.Record) -> bool: return typeinfo['kind'] == b'd' # type: ignore[no-any-return] def is_composite_type(typeinfo: protocol.Record) -> bool: return typeinfo['kind'] == b'c' # type: ignore[no-any-return] ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1729370387.4815543 asyncpg-0.30.0/asyncpg/pgproto/0000755000175100001770000000000014705014423016001 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/__init__.pxd0000644000175100001770000000032514705014413020254 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/__init__.py0000644000175100001770000000032514705014413020111 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/buffer.pxd0000644000175100001770000001043614705014413017772 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef class WriteBuffer: cdef: # Preallocated small buffer bint _smallbuf_inuse char _smallbuf[_BUFFER_INITIAL_SIZE] char *_buf # Allocated size ssize_t _size # Length of data in the buffer ssize_t _length # Number of memoryviews attached to the buffer int _view_count # True is start_message was used bint _message_mode cdef inline len(self): return self._length cdef inline write_len_prefixed_utf8(self, str s): return self.write_len_prefixed_bytes(s.encode('utf-8')) cdef inline _check_readonly(self) cdef inline _ensure_alloced(self, ssize_t extra_length) cdef _reallocate(self, ssize_t new_size) cdef inline reset(self) cdef inline start_message(self, char type) cdef inline end_message(self) cdef write_buffer(self, WriteBuffer buf) cdef write_byte(self, char b) cdef write_bytes(self, bytes data) cdef write_len_prefixed_buffer(self, WriteBuffer buf) cdef write_len_prefixed_bytes(self, bytes data) cdef write_bytestring(self, bytes string) cdef write_str(self, str string, str encoding) cdef write_frbuf(self, FRBuffer *buf) cdef write_cstr(self, const char *data, ssize_t len) cdef write_int16(self, int16_t i) cdef write_int32(self, int32_t i) cdef write_int64(self, int64_t i) cdef write_float(self, float f) cdef write_double(self, double d) @staticmethod cdef WriteBuffer new_message(char type) @staticmethod cdef WriteBuffer new() ctypedef const char * (*try_consume_message_method)(object, ssize_t*) ctypedef int32_t (*take_message_type_method)(object, char) except -1 ctypedef int32_t (*take_message_method)(object) except -1 ctypedef char (*get_message_type_method)(object) cdef class ReadBuffer: cdef: # A deque of buffers (bytes objects) object _bufs object _bufs_append object _bufs_popleft # A pointer to the first buffer in `_bufs` bytes _buf0 # A pointer to the previous first buffer # (used to prolong the life of _buf0 when using # methods like _try_read_bytes) bytes _buf0_prev # Number of buffers in `_bufs` int32_t _bufs_len # A read position in the first buffer in `_bufs` ssize_t _pos0 # Length of the first buffer in `_bufs` ssize_t _len0 # A total number of buffered bytes in ReadBuffer ssize_t _length char _current_message_type int32_t _current_message_len ssize_t _current_message_len_unread bint _current_message_ready cdef inline len(self): return self._length cdef inline char get_message_type(self): return self._current_message_type cdef inline int32_t get_message_length(self): return self._current_message_len cdef feed_data(self, data) cdef inline _ensure_first_buf(self) cdef _switch_to_next_buf(self) cdef inline char read_byte(self) except? -1 cdef inline const char* _try_read_bytes(self, ssize_t nbytes) cdef inline _read_into(self, char *buf, ssize_t nbytes) cdef inline _read_and_discard(self, ssize_t nbytes) cdef bytes read_bytes(self, ssize_t nbytes) cdef bytes read_len_prefixed_bytes(self) cdef str read_len_prefixed_utf8(self) cdef read_uuid(self) cdef inline int64_t read_int64(self) except? -1 cdef inline int32_t read_int32(self) except? -1 cdef inline int16_t read_int16(self) except? -1 cdef inline read_null_str(self) cdef int32_t take_message(self) except -1 cdef inline int32_t take_message_type(self, char mtype) except -1 cdef int32_t put_message(self) except -1 cdef inline const char* try_consume_message(self, ssize_t* len) cdef bytes consume_message(self) cdef discard_message(self) cdef redirect_messages(self, WriteBuffer buf, char mtype, int stop_at=?) cdef bytearray consume_messages(self, char mtype) cdef finish_message(self) cdef inline _finish_message(self) @staticmethod cdef ReadBuffer new_message_parser(object data) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/buffer.pyx0000644000175100001770000006133614705014413020024 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 from libc.string cimport memcpy import collections class BufferError(Exception): pass @cython.no_gc_clear @cython.final @cython.freelist(_BUFFER_FREELIST_SIZE) cdef class WriteBuffer: def __cinit__(self): self._smallbuf_inuse = True self._buf = self._smallbuf self._size = _BUFFER_INITIAL_SIZE self._length = 0 self._message_mode = 0 def __dealloc__(self): if self._buf is not NULL and not self._smallbuf_inuse: cpython.PyMem_Free(self._buf) self._buf = NULL self._size = 0 if self._view_count: raise BufferError( 'Deallocating buffer with attached memoryviews') def __getbuffer__(self, Py_buffer *buffer, int flags): self._view_count += 1 cpython.PyBuffer_FillInfo( buffer, self, self._buf, self._length, 1, # read-only flags) def __releasebuffer__(self, Py_buffer *buffer): self._view_count -= 1 cdef inline _check_readonly(self): if self._view_count: raise BufferError('the buffer is in read-only mode') cdef inline _ensure_alloced(self, ssize_t extra_length): cdef ssize_t new_size = extra_length + self._length if new_size > self._size: self._reallocate(new_size) cdef _reallocate(self, ssize_t new_size): cdef char *new_buf if new_size < _BUFFER_MAX_GROW: new_size = _BUFFER_MAX_GROW else: # Add a little extra new_size += _BUFFER_INITIAL_SIZE if self._smallbuf_inuse: new_buf = cpython.PyMem_Malloc( sizeof(char) * new_size) if new_buf is NULL: self._buf = NULL self._size = 0 self._length = 0 raise MemoryError memcpy(new_buf, self._buf, self._size) self._size = new_size self._buf = new_buf self._smallbuf_inuse = False else: new_buf = cpython.PyMem_Realloc( self._buf, new_size) if new_buf is NULL: cpython.PyMem_Free(self._buf) self._buf = NULL self._size = 0 self._length = 0 raise MemoryError self._buf = new_buf self._size = new_size cdef inline start_message(self, char type): if self._length != 0: raise BufferError( 'cannot start_message for a non-empty buffer') self._ensure_alloced(5) self._message_mode = 1 self._buf[0] = type self._length = 5 cdef inline end_message(self): # "length-1" to exclude the message type byte cdef ssize_t mlen = self._length - 1 self._check_readonly() if not self._message_mode: raise BufferError( 'end_message can only be called with start_message') if self._length < 5: raise BufferError('end_message: buffer is too small') if mlen > _MAXINT32: raise BufferError('end_message: message is too large') hton.pack_int32(&self._buf[1], mlen) return self cdef inline reset(self): self._length = 0 self._message_mode = 0 cdef write_buffer(self, WriteBuffer buf): self._check_readonly() if not buf._length: return self._ensure_alloced(buf._length) memcpy(self._buf + self._length, buf._buf, buf._length) self._length += buf._length cdef write_byte(self, char b): self._check_readonly() self._ensure_alloced(1) self._buf[self._length] = b self._length += 1 cdef write_bytes(self, bytes data): cdef char* buf cdef ssize_t len cpython.PyBytes_AsStringAndSize(data, &buf, &len) self.write_cstr(buf, len) cdef write_bytestring(self, bytes string): cdef char* buf cdef ssize_t len cpython.PyBytes_AsStringAndSize(string, &buf, &len) # PyBytes_AsStringAndSize returns a null-terminated buffer, # but the null byte is not counted in len. hence the + 1 self.write_cstr(buf, len + 1) cdef write_str(self, str string, str encoding): self.write_bytestring(string.encode(encoding)) cdef write_len_prefixed_buffer(self, WriteBuffer buf): # Write a length-prefixed (not NULL-terminated) bytes sequence. self.write_int32(buf.len()) self.write_buffer(buf) cdef write_len_prefixed_bytes(self, bytes data): # Write a length-prefixed (not NULL-terminated) bytes sequence. cdef: char *buf ssize_t size cpython.PyBytes_AsStringAndSize(data, &buf, &size) if size > _MAXINT32: raise BufferError('string is too large') # `size` does not account for the NULL at the end. self.write_int32(size) self.write_cstr(buf, size) cdef write_frbuf(self, FRBuffer *buf): cdef: ssize_t buf_len = buf.len if buf_len > 0: self.write_cstr(frb_read_all(buf), buf_len) cdef write_cstr(self, const char *data, ssize_t len): self._check_readonly() self._ensure_alloced(len) memcpy(self._buf + self._length, data, len) self._length += len cdef write_int16(self, int16_t i): self._check_readonly() self._ensure_alloced(2) hton.pack_int16(&self._buf[self._length], i) self._length += 2 cdef write_int32(self, int32_t i): self._check_readonly() self._ensure_alloced(4) hton.pack_int32(&self._buf[self._length], i) self._length += 4 cdef write_int64(self, int64_t i): self._check_readonly() self._ensure_alloced(8) hton.pack_int64(&self._buf[self._length], i) self._length += 8 cdef write_float(self, float f): self._check_readonly() self._ensure_alloced(4) hton.pack_float(&self._buf[self._length], f) self._length += 4 cdef write_double(self, double d): self._check_readonly() self._ensure_alloced(8) hton.pack_double(&self._buf[self._length], d) self._length += 8 @staticmethod cdef WriteBuffer new_message(char type): cdef WriteBuffer buf buf = WriteBuffer.__new__(WriteBuffer) buf.start_message(type) return buf @staticmethod cdef WriteBuffer new(): cdef WriteBuffer buf buf = WriteBuffer.__new__(WriteBuffer) return buf @cython.no_gc_clear @cython.final @cython.freelist(_BUFFER_FREELIST_SIZE) cdef class ReadBuffer: def __cinit__(self): self._bufs = collections.deque() self._bufs_append = self._bufs.append self._bufs_popleft = self._bufs.popleft self._bufs_len = 0 self._buf0 = None self._buf0_prev = None self._pos0 = 0 self._len0 = 0 self._length = 0 self._current_message_type = 0 self._current_message_len = 0 self._current_message_len_unread = 0 self._current_message_ready = 0 cdef feed_data(self, data): cdef: ssize_t dlen bytes data_bytes if not cpython.PyBytes_CheckExact(data): if cpythonx.PyByteArray_CheckExact(data): # ProactorEventLoop in Python 3.10+ seems to be sending # bytearray objects instead of bytes. Handle this here # to avoid duplicating this check in every data_received(). data = bytes(data) else: raise BufferError( 'feed_data: a bytes or bytearray object expected') # Uncomment the below code to test code paths that # read single int/str/bytes sequences are split over # multiple received buffers. # # ll = 107 # if len(data) > ll: # self.feed_data(data[:ll]) # self.feed_data(data[ll:]) # return data_bytes = data dlen = cpython.Py_SIZE(data_bytes) if dlen == 0: # EOF? return self._bufs_append(data_bytes) self._length += dlen if self._bufs_len == 0: # First buffer self._len0 = dlen self._buf0 = data_bytes self._bufs_len += 1 cdef inline _ensure_first_buf(self): if PG_DEBUG: if self._len0 == 0: raise BufferError('empty first buffer') if self._length == 0: raise BufferError('empty buffer') if self._pos0 == self._len0: self._switch_to_next_buf() cdef _switch_to_next_buf(self): # The first buffer is fully read, discard it self._bufs_popleft() self._bufs_len -= 1 # Shouldn't fail, since we've checked that `_length >= 1` # in _ensure_first_buf() self._buf0_prev = self._buf0 self._buf0 = self._bufs[0] self._pos0 = 0 self._len0 = len(self._buf0) if PG_DEBUG: if self._len0 < 1: raise BufferError( 'debug: second buffer of ReadBuffer is empty') cdef inline const char* _try_read_bytes(self, ssize_t nbytes): # Try to read *nbytes* from the first buffer. # # Returns pointer to data if there is at least *nbytes* # in the buffer, NULL otherwise. # # Important: caller must call _ensure_first_buf() prior # to calling try_read_bytes, and must not overread cdef: const char *result if PG_DEBUG: if nbytes > self._length: return NULL if self._current_message_ready: if self._current_message_len_unread < nbytes: return NULL if self._pos0 + nbytes <= self._len0: result = cpython.PyBytes_AS_STRING(self._buf0) result += self._pos0 self._pos0 += nbytes self._length -= nbytes if self._current_message_ready: self._current_message_len_unread -= nbytes return result else: return NULL cdef inline _read_into(self, char *buf, ssize_t nbytes): cdef: ssize_t nread char *buf0 while True: buf0 = cpython.PyBytes_AS_STRING(self._buf0) if self._pos0 + nbytes > self._len0: nread = self._len0 - self._pos0 memcpy(buf, buf0 + self._pos0, nread) self._pos0 = self._len0 self._length -= nread nbytes -= nread buf += nread self._ensure_first_buf() else: memcpy(buf, buf0 + self._pos0, nbytes) self._pos0 += nbytes self._length -= nbytes break cdef inline _read_and_discard(self, ssize_t nbytes): cdef: ssize_t nread self._ensure_first_buf() while True: if self._pos0 + nbytes > self._len0: nread = self._len0 - self._pos0 self._pos0 = self._len0 self._length -= nread nbytes -= nread self._ensure_first_buf() else: self._pos0 += nbytes self._length -= nbytes break cdef bytes read_bytes(self, ssize_t nbytes): cdef: bytes result ssize_t nread const char *cbuf char *buf self._ensure_first_buf() cbuf = self._try_read_bytes(nbytes) if cbuf != NULL: return cpython.PyBytes_FromStringAndSize(cbuf, nbytes) if nbytes > self._length: raise BufferError( 'not enough data to read {} bytes'.format(nbytes)) if self._current_message_ready: self._current_message_len_unread -= nbytes if self._current_message_len_unread < 0: raise BufferError('buffer overread') result = cpython.PyBytes_FromStringAndSize(NULL, nbytes) buf = cpython.PyBytes_AS_STRING(result) self._read_into(buf, nbytes) return result cdef bytes read_len_prefixed_bytes(self): cdef int32_t size = self.read_int32() if size < 0: raise BufferError( 'negative length for a len-prefixed bytes value') if size == 0: return b'' return self.read_bytes(size) cdef str read_len_prefixed_utf8(self): cdef: int32_t size const char *cbuf size = self.read_int32() if size < 0: raise BufferError( 'negative length for a len-prefixed bytes value') if size == 0: return '' self._ensure_first_buf() cbuf = self._try_read_bytes(size) if cbuf != NULL: return cpython.PyUnicode_DecodeUTF8(cbuf, size, NULL) else: return self.read_bytes(size).decode('utf-8') cdef read_uuid(self): cdef: bytes mem const char *cbuf self._ensure_first_buf() cbuf = self._try_read_bytes(16) if cbuf != NULL: return pg_uuid_from_buf(cbuf) else: return pg_UUID(self.read_bytes(16)) cdef inline char read_byte(self) except? -1: cdef const char *first_byte if PG_DEBUG: if not self._buf0: raise BufferError( 'debug: first buffer of ReadBuffer is empty') self._ensure_first_buf() first_byte = self._try_read_bytes(1) if first_byte is NULL: raise BufferError('not enough data to read one byte') return first_byte[0] cdef inline int64_t read_int64(self) except? -1: cdef: bytes mem const char *cbuf self._ensure_first_buf() cbuf = self._try_read_bytes(8) if cbuf != NULL: return hton.unpack_int64(cbuf) else: mem = self.read_bytes(8) return hton.unpack_int64(cpython.PyBytes_AS_STRING(mem)) cdef inline int32_t read_int32(self) except? -1: cdef: bytes mem const char *cbuf self._ensure_first_buf() cbuf = self._try_read_bytes(4) if cbuf != NULL: return hton.unpack_int32(cbuf) else: mem = self.read_bytes(4) return hton.unpack_int32(cpython.PyBytes_AS_STRING(mem)) cdef inline int16_t read_int16(self) except? -1: cdef: bytes mem const char *cbuf self._ensure_first_buf() cbuf = self._try_read_bytes(2) if cbuf != NULL: return hton.unpack_int16(cbuf) else: mem = self.read_bytes(2) return hton.unpack_int16(cpython.PyBytes_AS_STRING(mem)) cdef inline read_null_str(self): if not self._current_message_ready: raise BufferError( 'read_null_str only works when the message guaranteed ' 'to be in the buffer') cdef: ssize_t pos ssize_t nread bytes result const char *buf const char *buf_start self._ensure_first_buf() buf_start = cpython.PyBytes_AS_STRING(self._buf0) buf = buf_start + self._pos0 while buf - buf_start < self._len0: if buf[0] == 0: pos = buf - buf_start nread = pos - self._pos0 buf = self._try_read_bytes(nread + 1) if buf != NULL: return cpython.PyBytes_FromStringAndSize(buf, nread) else: break else: buf += 1 result = b'' while True: pos = self._buf0.find(b'\x00', self._pos0) if pos >= 0: result += self._buf0[self._pos0 : pos] nread = pos - self._pos0 + 1 self._pos0 = pos + 1 self._length -= nread self._current_message_len_unread -= nread if self._current_message_len_unread < 0: raise BufferError( 'read_null_str: buffer overread') return result else: result += self._buf0[self._pos0:] nread = self._len0 - self._pos0 self._pos0 = self._len0 self._length -= nread self._current_message_len_unread -= nread if self._current_message_len_unread < 0: raise BufferError( 'read_null_str: buffer overread') self._ensure_first_buf() cdef int32_t take_message(self) except -1: cdef: const char *cbuf if self._current_message_ready: return 1 if self._current_message_type == 0: if self._length < 1: return 0 self._ensure_first_buf() cbuf = self._try_read_bytes(1) if cbuf == NULL: raise BufferError( 'failed to read one byte on a non-empty buffer') self._current_message_type = cbuf[0] if self._current_message_len == 0: if self._length < 4: return 0 self._ensure_first_buf() cbuf = self._try_read_bytes(4) if cbuf != NULL: self._current_message_len = hton.unpack_int32(cbuf) else: self._current_message_len = self.read_int32() self._current_message_len_unread = self._current_message_len - 4 if self._length < self._current_message_len_unread: return 0 self._current_message_ready = 1 return 1 cdef inline int32_t take_message_type(self, char mtype) except -1: cdef const char *buf0 if self._current_message_ready: return self._current_message_type == mtype elif self._length >= 1: self._ensure_first_buf() buf0 = cpython.PyBytes_AS_STRING(self._buf0) return buf0[self._pos0] == mtype and self.take_message() else: return 0 cdef int32_t put_message(self) except -1: if not self._current_message_ready: raise BufferError( 'cannot put message: no message taken') self._current_message_ready = False return 0 cdef inline const char* try_consume_message(self, ssize_t* len): cdef: ssize_t buf_len const char *buf if not self._current_message_ready: return NULL self._ensure_first_buf() buf_len = self._current_message_len_unread buf = self._try_read_bytes(buf_len) if buf != NULL: len[0] = buf_len self._finish_message() return buf cdef discard_message(self): if not self._current_message_ready: raise BufferError('no message to discard') if self._current_message_len_unread > 0: self._read_and_discard(self._current_message_len_unread) self._current_message_len_unread = 0 self._finish_message() cdef bytes consume_message(self): if not self._current_message_ready: raise BufferError('no message to consume') if self._current_message_len_unread > 0: mem = self.read_bytes(self._current_message_len_unread) else: mem = b'' self._finish_message() return mem cdef redirect_messages(self, WriteBuffer buf, char mtype, int stop_at=0): if not self._current_message_ready: raise BufferError( 'consume_full_messages called on a buffer without a ' 'complete first message') if mtype != self._current_message_type: raise BufferError( 'consume_full_messages called with a wrong mtype') if self._current_message_len_unread != self._current_message_len - 4: raise BufferError( 'consume_full_messages called on a partially read message') cdef: const char* cbuf ssize_t cbuf_len int32_t msg_len ssize_t new_pos0 ssize_t pos_delta int32_t done while True: buf.write_byte(mtype) buf.write_int32(self._current_message_len) cbuf = self.try_consume_message(&cbuf_len) if cbuf != NULL: buf.write_cstr(cbuf, cbuf_len) else: buf.write_bytes(self.consume_message()) if self._length > 0: self._ensure_first_buf() else: return if stop_at and buf._length >= stop_at: return # Fast path: exhaust buf0 as efficiently as possible. if self._pos0 + 5 <= self._len0: cbuf = cpython.PyBytes_AS_STRING(self._buf0) new_pos0 = self._pos0 cbuf_len = self._len0 done = 0 # Scan the first buffer and find the position of the # end of the last "mtype" message. while new_pos0 + 5 <= cbuf_len: if (cbuf + new_pos0)[0] != mtype: done = 1 break if (stop_at and (buf._length + new_pos0 - self._pos0) > stop_at): done = 1 break msg_len = hton.unpack_int32(cbuf + new_pos0 + 1) + 1 if new_pos0 + msg_len > cbuf_len: break new_pos0 += msg_len if new_pos0 != self._pos0: assert self._pos0 < new_pos0 <= self._len0 pos_delta = new_pos0 - self._pos0 buf.write_cstr( cbuf + self._pos0, pos_delta) self._pos0 = new_pos0 self._length -= pos_delta assert self._length >= 0 if done: # The next message is of a different type. return # Back to slow path. if not self.take_message_type(mtype): return cdef bytearray consume_messages(self, char mtype): """Consume consecutive messages of the same type.""" cdef: char *buf ssize_t nbytes ssize_t total_bytes = 0 bytearray result if not self.take_message_type(mtype): return None # consume_messages is a volume-oriented method, so # we assume that the remainder of the buffer will contain # messages of the requested type. result = cpythonx.PyByteArray_FromStringAndSize(NULL, self._length) buf = cpythonx.PyByteArray_AsString(result) while self.take_message_type(mtype): self._ensure_first_buf() nbytes = self._current_message_len_unread self._read_into(buf, nbytes) buf += nbytes total_bytes += nbytes self._finish_message() # Clamp the result to an actual size read. cpythonx.PyByteArray_Resize(result, total_bytes) return result cdef finish_message(self): if self._current_message_type == 0 or not self._current_message_ready: # The message has already been finished (e.g by consume_message()), # or has been put back by put_message(). return if self._current_message_len_unread: if PG_DEBUG: mtype = chr(self._current_message_type) discarded = self.consume_message() if PG_DEBUG: print('!!! discarding message {!r} unread data: {!r}'.format( mtype, discarded)) self._finish_message() cdef inline _finish_message(self): self._current_message_type = 0 self._current_message_len = 0 self._current_message_ready = 0 self._current_message_len_unread = 0 @staticmethod cdef ReadBuffer new_message_parser(object data): cdef ReadBuffer buf buf = ReadBuffer.__new__(ReadBuffer) buf.feed_data(data) buf._current_message_ready = 1 buf._current_message_len_unread = buf._len0 return buf ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1729370387.4855542 asyncpg-0.30.0/asyncpg/pgproto/codecs/0000755000175100001770000000000014705014423017241 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/codecs/__init__.pxd0000644000175100001770000001357514705014413021527 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef class CodecContext: cpdef get_text_codec(self) cdef is_encoding_utf8(self) cpdef get_json_decoder(self) cdef is_decoding_json(self) cpdef get_json_encoder(self) cdef is_encoding_json(self) ctypedef object (*encode_func)(CodecContext settings, WriteBuffer buf, object obj) ctypedef object (*decode_func)(CodecContext settings, FRBuffer *buf) # Datetime cdef date_encode(CodecContext settings, WriteBuffer buf, obj) cdef date_decode(CodecContext settings, FRBuffer * buf) cdef date_encode_tuple(CodecContext settings, WriteBuffer buf, obj) cdef date_decode_tuple(CodecContext settings, FRBuffer * buf) cdef timestamp_encode(CodecContext settings, WriteBuffer buf, obj) cdef timestamp_decode(CodecContext settings, FRBuffer * buf) cdef timestamp_encode_tuple(CodecContext settings, WriteBuffer buf, obj) cdef timestamp_decode_tuple(CodecContext settings, FRBuffer * buf) cdef timestamptz_encode(CodecContext settings, WriteBuffer buf, obj) cdef timestamptz_decode(CodecContext settings, FRBuffer * buf) cdef time_encode(CodecContext settings, WriteBuffer buf, obj) cdef time_decode(CodecContext settings, FRBuffer * buf) cdef time_encode_tuple(CodecContext settings, WriteBuffer buf, obj) cdef time_decode_tuple(CodecContext settings, FRBuffer * buf) cdef timetz_encode(CodecContext settings, WriteBuffer buf, obj) cdef timetz_decode(CodecContext settings, FRBuffer * buf) cdef timetz_encode_tuple(CodecContext settings, WriteBuffer buf, obj) cdef timetz_decode_tuple(CodecContext settings, FRBuffer * buf) cdef interval_encode(CodecContext settings, WriteBuffer buf, obj) cdef interval_decode(CodecContext settings, FRBuffer * buf) cdef interval_encode_tuple(CodecContext settings, WriteBuffer buf, tuple obj) cdef interval_decode_tuple(CodecContext settings, FRBuffer * buf) # Bits cdef bits_encode(CodecContext settings, WriteBuffer wbuf, obj) cdef bits_decode(CodecContext settings, FRBuffer * buf) # Bools cdef bool_encode(CodecContext settings, WriteBuffer buf, obj) cdef bool_decode(CodecContext settings, FRBuffer * buf) # Geometry cdef box_encode(CodecContext settings, WriteBuffer wbuf, obj) cdef box_decode(CodecContext settings, FRBuffer * buf) cdef line_encode(CodecContext settings, WriteBuffer wbuf, obj) cdef line_decode(CodecContext settings, FRBuffer * buf) cdef lseg_encode(CodecContext settings, WriteBuffer wbuf, obj) cdef lseg_decode(CodecContext settings, FRBuffer * buf) cdef point_encode(CodecContext settings, WriteBuffer wbuf, obj) cdef point_decode(CodecContext settings, FRBuffer * buf) cdef path_encode(CodecContext settings, WriteBuffer wbuf, obj) cdef path_decode(CodecContext settings, FRBuffer * buf) cdef poly_encode(CodecContext settings, WriteBuffer wbuf, obj) cdef poly_decode(CodecContext settings, FRBuffer * buf) cdef circle_encode(CodecContext settings, WriteBuffer wbuf, obj) cdef circle_decode(CodecContext settings, FRBuffer * buf) # Hstore cdef hstore_encode(CodecContext settings, WriteBuffer buf, obj) cdef hstore_decode(CodecContext settings, FRBuffer * buf) # Ints cdef int2_encode(CodecContext settings, WriteBuffer buf, obj) cdef int2_decode(CodecContext settings, FRBuffer * buf) cdef int4_encode(CodecContext settings, WriteBuffer buf, obj) cdef int4_decode(CodecContext settings, FRBuffer * buf) cdef uint4_encode(CodecContext settings, WriteBuffer buf, obj) cdef uint4_decode(CodecContext settings, FRBuffer * buf) cdef int8_encode(CodecContext settings, WriteBuffer buf, obj) cdef int8_decode(CodecContext settings, FRBuffer * buf) cdef uint8_encode(CodecContext settings, WriteBuffer buf, obj) cdef uint8_decode(CodecContext settings, FRBuffer * buf) # Floats cdef float4_encode(CodecContext settings, WriteBuffer buf, obj) cdef float4_decode(CodecContext settings, FRBuffer * buf) cdef float8_encode(CodecContext settings, WriteBuffer buf, obj) cdef float8_decode(CodecContext settings, FRBuffer * buf) # JSON cdef jsonb_encode(CodecContext settings, WriteBuffer buf, obj) cdef jsonb_decode(CodecContext settings, FRBuffer * buf) # JSON path cdef jsonpath_encode(CodecContext settings, WriteBuffer buf, obj) cdef jsonpath_decode(CodecContext settings, FRBuffer * buf) # Text cdef as_pg_string_and_size( CodecContext settings, obj, char **cstr, ssize_t *size) cdef text_encode(CodecContext settings, WriteBuffer buf, obj) cdef text_decode(CodecContext settings, FRBuffer * buf) # Bytea cdef bytea_encode(CodecContext settings, WriteBuffer wbuf, obj) cdef bytea_decode(CodecContext settings, FRBuffer * buf) # UUID cdef uuid_encode(CodecContext settings, WriteBuffer wbuf, obj) cdef uuid_decode(CodecContext settings, FRBuffer * buf) # Numeric cdef numeric_encode_text(CodecContext settings, WriteBuffer buf, obj) cdef numeric_decode_text(CodecContext settings, FRBuffer * buf) cdef numeric_encode_binary(CodecContext settings, WriteBuffer buf, obj) cdef numeric_decode_binary(CodecContext settings, FRBuffer * buf) cdef numeric_decode_binary_ex(CodecContext settings, FRBuffer * buf, bint trail_fract_zero) # Void cdef void_encode(CodecContext settings, WriteBuffer buf, obj) cdef void_decode(CodecContext settings, FRBuffer * buf) # tid cdef tid_encode(CodecContext settings, WriteBuffer buf, obj) cdef tid_decode(CodecContext settings, FRBuffer * buf) # Network cdef cidr_encode(CodecContext settings, WriteBuffer buf, obj) cdef cidr_decode(CodecContext settings, FRBuffer * buf) cdef inet_encode(CodecContext settings, WriteBuffer buf, obj) cdef inet_decode(CodecContext settings, FRBuffer * buf) # pg_snapshot cdef pg_snapshot_encode(CodecContext settings, WriteBuffer buf, obj) cdef pg_snapshot_decode(CodecContext settings, FRBuffer * buf) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/codecs/bits.pyx0000644000175100001770000000270314705014413020745 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef bits_encode(CodecContext settings, WriteBuffer wbuf, obj): cdef: Py_buffer pybuf bint pybuf_used = False char *buf ssize_t len ssize_t bitlen if cpython.PyBytes_CheckExact(obj): buf = cpython.PyBytes_AS_STRING(obj) len = cpython.Py_SIZE(obj) bitlen = len * 8 elif isinstance(obj, pgproto_types.BitString): cpython.PyBytes_AsStringAndSize(obj.bytes, &buf, &len) bitlen = obj.__len__() else: cpython.PyObject_GetBuffer(obj, &pybuf, cpython.PyBUF_SIMPLE) pybuf_used = True buf = pybuf.buf len = pybuf.len bitlen = len * 8 try: if bitlen > _MAXINT32: raise ValueError('bit value too long') wbuf.write_int32(4 + len) wbuf.write_int32(bitlen) wbuf.write_cstr(buf, len) finally: if pybuf_used: cpython.PyBuffer_Release(&pybuf) cdef bits_decode(CodecContext settings, FRBuffer *buf): cdef: int32_t bitlen = hton.unpack_int32(frb_read(buf, 4)) ssize_t buf_len = buf.len bytes_ = cpython.PyBytes_FromStringAndSize(frb_read_all(buf), buf_len) return pgproto_types.BitString.frombytes(bytes_, bitlen) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/codecs/bytea.pyx0000644000175100001770000000174514705014413021115 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef bytea_encode(CodecContext settings, WriteBuffer wbuf, obj): cdef: Py_buffer pybuf bint pybuf_used = False char *buf ssize_t len if cpython.PyBytes_CheckExact(obj): buf = cpython.PyBytes_AS_STRING(obj) len = cpython.Py_SIZE(obj) else: cpython.PyObject_GetBuffer(obj, &pybuf, cpython.PyBUF_SIMPLE) pybuf_used = True buf = pybuf.buf len = pybuf.len try: wbuf.write_int32(len) wbuf.write_cstr(buf, len) finally: if pybuf_used: cpython.PyBuffer_Release(&pybuf) cdef bytea_decode(CodecContext settings, FRBuffer *buf): cdef ssize_t buf_len = buf.len return cpython.PyBytes_FromStringAndSize(frb_read_all(buf), buf_len) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/codecs/context.pyx0000644000175100001770000000115714705014413021472 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef class CodecContext: cpdef get_text_codec(self): raise NotImplementedError cdef is_encoding_utf8(self): raise NotImplementedError cpdef get_json_decoder(self): raise NotImplementedError cdef is_decoding_json(self): return False cpdef get_json_encoder(self): raise NotImplementedError cdef is_encoding_json(self): return False ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/codecs/datetime.pyx0000644000175100001770000003103714705014413021602 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cimport cpython.datetime import datetime cpython.datetime.import_datetime() utc = datetime.timezone.utc date_from_ordinal = datetime.date.fromordinal timedelta = datetime.timedelta pg_epoch_datetime = datetime.datetime(2000, 1, 1) cdef int32_t pg_epoch_datetime_ts = \ cpython.PyLong_AsLong(int(pg_epoch_datetime.timestamp())) pg_epoch_datetime_utc = datetime.datetime(2000, 1, 1, tzinfo=utc) cdef int32_t pg_epoch_datetime_utc_ts = \ cpython.PyLong_AsLong(int(pg_epoch_datetime_utc.timestamp())) pg_epoch_date = datetime.date(2000, 1, 1) cdef int32_t pg_date_offset_ord = \ cpython.PyLong_AsLong(pg_epoch_date.toordinal()) # Binary representations of infinity for datetimes. cdef int64_t pg_time64_infinity = 0x7fffffffffffffff cdef int64_t pg_time64_negative_infinity = 0x8000000000000000 cdef int32_t pg_date_infinity = 0x7fffffff cdef int32_t pg_date_negative_infinity = 0x80000000 infinity_datetime = datetime.datetime( datetime.MAXYEAR, 12, 31, 23, 59, 59, 999999) cdef int32_t infinity_datetime_ord = cpython.PyLong_AsLong( infinity_datetime.toordinal()) cdef int64_t infinity_datetime_ts = 252455615999999999 negative_infinity_datetime = datetime.datetime( datetime.MINYEAR, 1, 1, 0, 0, 0, 0) cdef int32_t negative_infinity_datetime_ord = cpython.PyLong_AsLong( negative_infinity_datetime.toordinal()) cdef int64_t negative_infinity_datetime_ts = -63082281600000000 infinity_date = datetime.date(datetime.MAXYEAR, 12, 31) cdef int32_t infinity_date_ord = cpython.PyLong_AsLong( infinity_date.toordinal()) negative_infinity_date = datetime.date(datetime.MINYEAR, 1, 1) cdef int32_t negative_infinity_date_ord = cpython.PyLong_AsLong( negative_infinity_date.toordinal()) cdef inline _local_timezone(): d = datetime.datetime.now(datetime.timezone.utc).astimezone() return datetime.timezone(d.utcoffset()) cdef inline _encode_time(WriteBuffer buf, int64_t seconds, int32_t microseconds): # XXX: add support for double timestamps # int64 timestamps, cdef int64_t ts = seconds * 1000000 + microseconds if ts == infinity_datetime_ts: buf.write_int64(pg_time64_infinity) elif ts == negative_infinity_datetime_ts: buf.write_int64(pg_time64_negative_infinity) else: buf.write_int64(ts) cdef inline int32_t _decode_time(FRBuffer *buf, int64_t *seconds, int32_t *microseconds): cdef int64_t ts = hton.unpack_int64(frb_read(buf, 8)) if ts == pg_time64_infinity: return 1 elif ts == pg_time64_negative_infinity: return -1 else: seconds[0] = ts // 1000000 microseconds[0] = (ts % 1000000) return 0 cdef date_encode(CodecContext settings, WriteBuffer buf, obj): cdef: int32_t ordinal = cpython.PyLong_AsLong(obj.toordinal()) int32_t pg_ordinal if ordinal == infinity_date_ord: pg_ordinal = pg_date_infinity elif ordinal == negative_infinity_date_ord: pg_ordinal = pg_date_negative_infinity else: pg_ordinal = ordinal - pg_date_offset_ord buf.write_int32(4) buf.write_int32(pg_ordinal) cdef date_encode_tuple(CodecContext settings, WriteBuffer buf, obj): cdef: int32_t pg_ordinal if len(obj) != 1: raise ValueError( 'date tuple encoder: expecting 1 element ' 'in tuple, got {}'.format(len(obj))) pg_ordinal = obj[0] buf.write_int32(4) buf.write_int32(pg_ordinal) cdef date_decode(CodecContext settings, FRBuffer *buf): cdef int32_t pg_ordinal = hton.unpack_int32(frb_read(buf, 4)) if pg_ordinal == pg_date_infinity: return infinity_date elif pg_ordinal == pg_date_negative_infinity: return negative_infinity_date else: return date_from_ordinal(pg_ordinal + pg_date_offset_ord) cdef date_decode_tuple(CodecContext settings, FRBuffer *buf): cdef int32_t pg_ordinal = hton.unpack_int32(frb_read(buf, 4)) return (pg_ordinal,) cdef timestamp_encode(CodecContext settings, WriteBuffer buf, obj): if not cpython.datetime.PyDateTime_Check(obj): if cpython.datetime.PyDate_Check(obj): obj = datetime.datetime(obj.year, obj.month, obj.day) else: raise TypeError( 'expected a datetime.date or datetime.datetime instance, ' 'got {!r}'.format(type(obj).__name__) ) delta = obj - pg_epoch_datetime cdef: int64_t seconds = cpython.PyLong_AsLongLong(delta.days) * 86400 + \ cpython.PyLong_AsLong(delta.seconds) int32_t microseconds = cpython.PyLong_AsLong( delta.microseconds) buf.write_int32(8) _encode_time(buf, seconds, microseconds) cdef timestamp_encode_tuple(CodecContext settings, WriteBuffer buf, obj): cdef: int64_t microseconds if len(obj) != 1: raise ValueError( 'timestamp tuple encoder: expecting 1 element ' 'in tuple, got {}'.format(len(obj))) microseconds = obj[0] buf.write_int32(8) buf.write_int64(microseconds) cdef timestamp_decode(CodecContext settings, FRBuffer *buf): cdef: int64_t seconds = 0 int32_t microseconds = 0 int32_t inf = _decode_time(buf, &seconds, µseconds) if inf > 0: # positive infinity return infinity_datetime elif inf < 0: # negative infinity return negative_infinity_datetime else: return pg_epoch_datetime.__add__( timedelta(0, seconds, microseconds)) cdef timestamp_decode_tuple(CodecContext settings, FRBuffer *buf): cdef: int64_t ts = hton.unpack_int64(frb_read(buf, 8)) return (ts,) cdef timestamptz_encode(CodecContext settings, WriteBuffer buf, obj): if not cpython.datetime.PyDateTime_Check(obj): if cpython.datetime.PyDate_Check(obj): obj = datetime.datetime(obj.year, obj.month, obj.day, tzinfo=_local_timezone()) else: raise TypeError( 'expected a datetime.date or datetime.datetime instance, ' 'got {!r}'.format(type(obj).__name__) ) buf.write_int32(8) if obj == infinity_datetime: buf.write_int64(pg_time64_infinity) return elif obj == negative_infinity_datetime: buf.write_int64(pg_time64_negative_infinity) return utc_dt = obj.astimezone(utc) delta = utc_dt - pg_epoch_datetime_utc cdef: int64_t seconds = cpython.PyLong_AsLongLong(delta.days) * 86400 + \ cpython.PyLong_AsLong(delta.seconds) int32_t microseconds = cpython.PyLong_AsLong( delta.microseconds) _encode_time(buf, seconds, microseconds) cdef timestamptz_decode(CodecContext settings, FRBuffer *buf): cdef: int64_t seconds = 0 int32_t microseconds = 0 int32_t inf = _decode_time(buf, &seconds, µseconds) if inf > 0: # positive infinity return infinity_datetime elif inf < 0: # negative infinity return negative_infinity_datetime else: return pg_epoch_datetime_utc.__add__( timedelta(0, seconds, microseconds)) cdef time_encode(CodecContext settings, WriteBuffer buf, obj): cdef: int64_t seconds = cpython.PyLong_AsLong(obj.hour) * 3600 + \ cpython.PyLong_AsLong(obj.minute) * 60 + \ cpython.PyLong_AsLong(obj.second) int32_t microseconds = cpython.PyLong_AsLong(obj.microsecond) buf.write_int32(8) _encode_time(buf, seconds, microseconds) cdef time_encode_tuple(CodecContext settings, WriteBuffer buf, obj): cdef: int64_t microseconds if len(obj) != 1: raise ValueError( 'time tuple encoder: expecting 1 element ' 'in tuple, got {}'.format(len(obj))) microseconds = obj[0] buf.write_int32(8) buf.write_int64(microseconds) cdef time_decode(CodecContext settings, FRBuffer *buf): cdef: int64_t seconds = 0 int32_t microseconds = 0 _decode_time(buf, &seconds, µseconds) cdef: int64_t minutes = (seconds / 60) int64_t sec = seconds % 60 int64_t hours = (minutes / 60) int64_t min = minutes % 60 return datetime.time(hours, min, sec, microseconds) cdef time_decode_tuple(CodecContext settings, FRBuffer *buf): cdef: int64_t ts = hton.unpack_int64(frb_read(buf, 8)) return (ts,) cdef timetz_encode(CodecContext settings, WriteBuffer buf, obj): offset = obj.tzinfo.utcoffset(None) cdef: int32_t offset_sec = \ cpython.PyLong_AsLong(offset.days) * 24 * 60 * 60 + \ cpython.PyLong_AsLong(offset.seconds) int64_t seconds = cpython.PyLong_AsLong(obj.hour) * 3600 + \ cpython.PyLong_AsLong(obj.minute) * 60 + \ cpython.PyLong_AsLong(obj.second) int32_t microseconds = cpython.PyLong_AsLong(obj.microsecond) buf.write_int32(12) _encode_time(buf, seconds, microseconds) # In Python utcoffset() is the difference between the local time # and the UTC, whereas in PostgreSQL it's the opposite, # so we need to flip the sign. buf.write_int32(-offset_sec) cdef timetz_encode_tuple(CodecContext settings, WriteBuffer buf, obj): cdef: int64_t microseconds int32_t offset_sec if len(obj) != 2: raise ValueError( 'time tuple encoder: expecting 2 elements2 ' 'in tuple, got {}'.format(len(obj))) microseconds = obj[0] offset_sec = obj[1] buf.write_int32(12) buf.write_int64(microseconds) buf.write_int32(offset_sec) cdef timetz_decode(CodecContext settings, FRBuffer *buf): time = time_decode(settings, buf) cdef int32_t offset = (hton.unpack_int32(frb_read(buf, 4)) / 60) # See the comment in the `timetz_encode` method. return time.replace(tzinfo=datetime.timezone(timedelta(minutes=-offset))) cdef timetz_decode_tuple(CodecContext settings, FRBuffer *buf): cdef: int64_t microseconds = hton.unpack_int64(frb_read(buf, 8)) int32_t offset_sec = hton.unpack_int32(frb_read(buf, 4)) return (microseconds, offset_sec) cdef interval_encode(CodecContext settings, WriteBuffer buf, obj): cdef: int32_t days = cpython.PyLong_AsLong(obj.days) int64_t seconds = cpython.PyLong_AsLongLong(obj.seconds) int32_t microseconds = cpython.PyLong_AsLong(obj.microseconds) buf.write_int32(16) _encode_time(buf, seconds, microseconds) buf.write_int32(days) buf.write_int32(0) # Months cdef interval_encode_tuple(CodecContext settings, WriteBuffer buf, tuple obj): cdef: int32_t months int32_t days int64_t microseconds if len(obj) != 3: raise ValueError( 'interval tuple encoder: expecting 3 elements ' 'in tuple, got {}'.format(len(obj))) months = obj[0] days = obj[1] microseconds = obj[2] buf.write_int32(16) buf.write_int64(microseconds) buf.write_int32(days) buf.write_int32(months) cdef interval_decode(CodecContext settings, FRBuffer *buf): cdef: int32_t days int32_t months int32_t years int64_t seconds = 0 int32_t microseconds = 0 _decode_time(buf, &seconds, µseconds) days = hton.unpack_int32(frb_read(buf, 4)) months = hton.unpack_int32(frb_read(buf, 4)) if months < 0: years = -(-months // 12) months = -(-months % 12) else: years = (months // 12) months = (months % 12) return datetime.timedelta(days=days + months * 30 + years * 365, seconds=seconds, microseconds=microseconds) cdef interval_decode_tuple(CodecContext settings, FRBuffer *buf): cdef: int32_t days int32_t months int64_t microseconds microseconds = hton.unpack_int64(frb_read(buf, 8)) days = hton.unpack_int32(frb_read(buf, 4)) months = hton.unpack_int32(frb_read(buf, 4)) return (months, days, microseconds) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/codecs/float.pyx0000644000175100001770000000200714705014413021106 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 from libc cimport math cdef float4_encode(CodecContext settings, WriteBuffer buf, obj): cdef double dval = cpython.PyFloat_AsDouble(obj) cdef float fval = dval if math.isinf(fval) and not math.isinf(dval): raise ValueError('value out of float32 range') buf.write_int32(4) buf.write_float(fval) cdef float4_decode(CodecContext settings, FRBuffer *buf): cdef float f = hton.unpack_float(frb_read(buf, 4)) return cpython.PyFloat_FromDouble(f) cdef float8_encode(CodecContext settings, WriteBuffer buf, obj): cdef double dval = cpython.PyFloat_AsDouble(obj) buf.write_int32(8) buf.write_double(dval) cdef float8_decode(CodecContext settings, FRBuffer *buf): cdef double f = hton.unpack_double(frb_read(buf, 8)) return cpython.PyFloat_FromDouble(f) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/codecs/geometry.pyx0000644000175100001770000001107114705014413021635 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef inline _encode_points(WriteBuffer wbuf, object points): cdef object point for point in points: wbuf.write_double(point[0]) wbuf.write_double(point[1]) cdef inline _decode_points(FRBuffer *buf): cdef: int32_t npts = hton.unpack_int32(frb_read(buf, 4)) pts = cpython.PyTuple_New(npts) int32_t i object point double x double y for i in range(npts): x = hton.unpack_double(frb_read(buf, 8)) y = hton.unpack_double(frb_read(buf, 8)) point = pgproto_types.Point(x, y) cpython.Py_INCREF(point) cpython.PyTuple_SET_ITEM(pts, i, point) return pts cdef box_encode(CodecContext settings, WriteBuffer wbuf, obj): wbuf.write_int32(32) _encode_points(wbuf, (obj[0], obj[1])) cdef box_decode(CodecContext settings, FRBuffer *buf): cdef: double high_x = hton.unpack_double(frb_read(buf, 8)) double high_y = hton.unpack_double(frb_read(buf, 8)) double low_x = hton.unpack_double(frb_read(buf, 8)) double low_y = hton.unpack_double(frb_read(buf, 8)) return pgproto_types.Box( pgproto_types.Point(high_x, high_y), pgproto_types.Point(low_x, low_y)) cdef line_encode(CodecContext settings, WriteBuffer wbuf, obj): wbuf.write_int32(24) wbuf.write_double(obj[0]) wbuf.write_double(obj[1]) wbuf.write_double(obj[2]) cdef line_decode(CodecContext settings, FRBuffer *buf): cdef: double A = hton.unpack_double(frb_read(buf, 8)) double B = hton.unpack_double(frb_read(buf, 8)) double C = hton.unpack_double(frb_read(buf, 8)) return pgproto_types.Line(A, B, C) cdef lseg_encode(CodecContext settings, WriteBuffer wbuf, obj): wbuf.write_int32(32) _encode_points(wbuf, (obj[0], obj[1])) cdef lseg_decode(CodecContext settings, FRBuffer *buf): cdef: double p1_x = hton.unpack_double(frb_read(buf, 8)) double p1_y = hton.unpack_double(frb_read(buf, 8)) double p2_x = hton.unpack_double(frb_read(buf, 8)) double p2_y = hton.unpack_double(frb_read(buf, 8)) return pgproto_types.LineSegment((p1_x, p1_y), (p2_x, p2_y)) cdef point_encode(CodecContext settings, WriteBuffer wbuf, obj): wbuf.write_int32(16) wbuf.write_double(obj[0]) wbuf.write_double(obj[1]) cdef point_decode(CodecContext settings, FRBuffer *buf): cdef: double x = hton.unpack_double(frb_read(buf, 8)) double y = hton.unpack_double(frb_read(buf, 8)) return pgproto_types.Point(x, y) cdef path_encode(CodecContext settings, WriteBuffer wbuf, obj): cdef: int8_t is_closed = 0 ssize_t npts ssize_t encoded_len int32_t i if cpython.PyTuple_Check(obj): is_closed = 1 elif cpython.PyList_Check(obj): is_closed = 0 elif isinstance(obj, pgproto_types.Path): is_closed = obj.is_closed npts = len(obj) encoded_len = 1 + 4 + 16 * npts if encoded_len > _MAXINT32: raise ValueError('path value too long') wbuf.write_int32(encoded_len) wbuf.write_byte(is_closed) wbuf.write_int32(npts) _encode_points(wbuf, obj) cdef path_decode(CodecContext settings, FRBuffer *buf): cdef: int8_t is_closed = (frb_read(buf, 1)[0]) return pgproto_types.Path(*_decode_points(buf), is_closed=is_closed == 1) cdef poly_encode(CodecContext settings, WriteBuffer wbuf, obj): cdef: bint is_closed ssize_t npts ssize_t encoded_len int32_t i npts = len(obj) encoded_len = 4 + 16 * npts if encoded_len > _MAXINT32: raise ValueError('polygon value too long') wbuf.write_int32(encoded_len) wbuf.write_int32(npts) _encode_points(wbuf, obj) cdef poly_decode(CodecContext settings, FRBuffer *buf): return pgproto_types.Polygon(*_decode_points(buf)) cdef circle_encode(CodecContext settings, WriteBuffer wbuf, obj): wbuf.write_int32(24) wbuf.write_double(obj[0][0]) wbuf.write_double(obj[0][1]) wbuf.write_double(obj[1]) cdef circle_decode(CodecContext settings, FRBuffer *buf): cdef: double center_x = hton.unpack_double(frb_read(buf, 8)) double center_y = hton.unpack_double(frb_read(buf, 8)) double radius = hton.unpack_double(frb_read(buf, 8)) return pgproto_types.Circle((center_x, center_y), radius) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/codecs/hstore.pyx0000644000175100001770000000374214705014413021314 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef hstore_encode(CodecContext settings, WriteBuffer buf, obj): cdef: char *str ssize_t size ssize_t count object items WriteBuffer item_buf = WriteBuffer.new() count = len(obj) if count > _MAXINT32: raise ValueError('hstore value is too large') item_buf.write_int32(count) if hasattr(obj, 'items'): items = obj.items() else: items = obj for k, v in items: if k is None: raise ValueError('null value not allowed in hstore key') as_pg_string_and_size(settings, k, &str, &size) item_buf.write_int32(size) item_buf.write_cstr(str, size) if v is None: item_buf.write_int32(-1) else: as_pg_string_and_size(settings, v, &str, &size) item_buf.write_int32(size) item_buf.write_cstr(str, size) buf.write_int32(item_buf.len()) buf.write_buffer(item_buf) cdef hstore_decode(CodecContext settings, FRBuffer *buf): cdef: dict result uint32_t elem_count int32_t elem_len uint32_t i str k str v result = {} elem_count = hton.unpack_int32(frb_read(buf, 4)) if elem_count == 0: return result for i in range(elem_count): elem_len = hton.unpack_int32(frb_read(buf, 4)) if elem_len < 0: raise ValueError('null value not allowed in hstore key') k = decode_pg_string(settings, frb_read(buf, elem_len), elem_len) elem_len = hton.unpack_int32(frb_read(buf, 4)) if elem_len < 0: v = None else: v = decode_pg_string(settings, frb_read(buf, elem_len), elem_len) result[k] = v return result ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/codecs/int.pyx0000644000175100001770000001065714705014413020605 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef bool_encode(CodecContext settings, WriteBuffer buf, obj): if not cpython.PyBool_Check(obj): raise TypeError('a boolean is required (got type {})'.format( type(obj).__name__)) buf.write_int32(1) buf.write_byte(b'\x01' if obj is True else b'\x00') cdef bool_decode(CodecContext settings, FRBuffer *buf): return frb_read(buf, 1)[0] is b'\x01' cdef int2_encode(CodecContext settings, WriteBuffer buf, obj): cdef int overflow = 0 cdef long val try: if type(obj) is not int and hasattr(type(obj), '__int__'): # Silence a Python warning about implicit __int__ # conversion. obj = int(obj) val = cpython.PyLong_AsLong(obj) except OverflowError: overflow = 1 if overflow or val < INT16_MIN or val > INT16_MAX: raise OverflowError('value out of int16 range') buf.write_int32(2) buf.write_int16(val) cdef int2_decode(CodecContext settings, FRBuffer *buf): return cpython.PyLong_FromLong(hton.unpack_int16(frb_read(buf, 2))) cdef int4_encode(CodecContext settings, WriteBuffer buf, obj): cdef int overflow = 0 cdef long val = 0 try: if type(obj) is not int and hasattr(type(obj), '__int__'): # Silence a Python warning about implicit __int__ # conversion. obj = int(obj) val = cpython.PyLong_AsLong(obj) except OverflowError: overflow = 1 # "long" and "long long" have the same size for x86_64, need an extra check if overflow or (sizeof(val) > 4 and (val < INT32_MIN or val > INT32_MAX)): raise OverflowError('value out of int32 range') buf.write_int32(4) buf.write_int32(val) cdef int4_decode(CodecContext settings, FRBuffer *buf): return cpython.PyLong_FromLong(hton.unpack_int32(frb_read(buf, 4))) cdef uint4_encode(CodecContext settings, WriteBuffer buf, obj): cdef int overflow = 0 cdef unsigned long val = 0 try: if type(obj) is not int and hasattr(type(obj), '__int__'): # Silence a Python warning about implicit __int__ # conversion. obj = int(obj) val = cpython.PyLong_AsUnsignedLong(obj) except OverflowError: overflow = 1 # "long" and "long long" have the same size for x86_64, need an extra check if overflow or (sizeof(val) > 4 and val > UINT32_MAX): raise OverflowError('value out of uint32 range') buf.write_int32(4) buf.write_int32(val) cdef uint4_decode(CodecContext settings, FRBuffer *buf): return cpython.PyLong_FromUnsignedLong( hton.unpack_int32(frb_read(buf, 4))) cdef int8_encode(CodecContext settings, WriteBuffer buf, obj): cdef int overflow = 0 cdef long long val try: if type(obj) is not int and hasattr(type(obj), '__int__'): # Silence a Python warning about implicit __int__ # conversion. obj = int(obj) val = cpython.PyLong_AsLongLong(obj) except OverflowError: overflow = 1 # Just in case for systems with "long long" bigger than 8 bytes if overflow or (sizeof(val) > 8 and (val < INT64_MIN or val > INT64_MAX)): raise OverflowError('value out of int64 range') buf.write_int32(8) buf.write_int64(val) cdef int8_decode(CodecContext settings, FRBuffer *buf): return cpython.PyLong_FromLongLong(hton.unpack_int64(frb_read(buf, 8))) cdef uint8_encode(CodecContext settings, WriteBuffer buf, obj): cdef int overflow = 0 cdef unsigned long long val = 0 try: if type(obj) is not int and hasattr(type(obj), '__int__'): # Silence a Python warning about implicit __int__ # conversion. obj = int(obj) val = cpython.PyLong_AsUnsignedLongLong(obj) except OverflowError: overflow = 1 # Just in case for systems with "long long" bigger than 8 bytes if overflow or (sizeof(val) > 8 and val > UINT64_MAX): raise OverflowError('value out of uint64 range') buf.write_int32(8) buf.write_int64(val) cdef uint8_decode(CodecContext settings, FRBuffer *buf): return cpython.PyLong_FromUnsignedLongLong( hton.unpack_int64(frb_read(buf, 8)))././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/codecs/json.pyx0000644000175100001770000000265614705014413020764 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef jsonb_encode(CodecContext settings, WriteBuffer buf, obj): cdef: char *str ssize_t size if settings.is_encoding_json(): obj = settings.get_json_encoder().encode(obj) as_pg_string_and_size(settings, obj, &str, &size) if size > 0x7fffffff - 1: raise ValueError('string too long') buf.write_int32(size + 1) buf.write_byte(1) # JSONB format version buf.write_cstr(str, size) cdef jsonb_decode(CodecContext settings, FRBuffer *buf): cdef uint8_t format = (frb_read(buf, 1)[0]) if format != 1: raise ValueError('unexpected JSONB format: {}'.format(format)) rv = text_decode(settings, buf) if settings.is_decoding_json(): rv = settings.get_json_decoder().decode(rv) return rv cdef json_encode(CodecContext settings, WriteBuffer buf, obj): cdef: char *str ssize_t size if settings.is_encoding_json(): obj = settings.get_json_encoder().encode(obj) text_encode(settings, buf, obj) cdef json_decode(CodecContext settings, FRBuffer *buf): rv = text_decode(settings, buf) if settings.is_decoding_json(): rv = settings.get_json_decoder().decode(rv) return rv ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/codecs/jsonpath.pyx0000644000175100001770000000150114705014413021625 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef jsonpath_encode(CodecContext settings, WriteBuffer buf, obj): cdef: char *str ssize_t size as_pg_string_and_size(settings, obj, &str, &size) if size > 0x7fffffff - 1: raise ValueError('string too long') buf.write_int32(size + 1) buf.write_byte(1) # jsonpath format version buf.write_cstr(str, size) cdef jsonpath_decode(CodecContext settings, FRBuffer *buf): cdef uint8_t format = (frb_read(buf, 1)[0]) if format != 1: raise ValueError('unexpected jsonpath format: {}'.format(format)) return text_decode(settings, buf) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/codecs/misc.pyx0000644000175100001770000000074414705014413020742 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef void_encode(CodecContext settings, WriteBuffer buf, obj): # Void is zero bytes buf.write_int32(0) cdef void_decode(CodecContext settings, FRBuffer *buf): # Do nothing; void will be passed as NULL so this function # will never be called. pass ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/codecs/network.pyx0000644000175100001770000000751514705014413021503 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import ipaddress # defined in postgresql/src/include/inet.h # DEF PGSQL_AF_INET = 2 # AF_INET DEF PGSQL_AF_INET6 = 3 # AF_INET + 1 _ipaddr = ipaddress.ip_address _ipiface = ipaddress.ip_interface _ipnet = ipaddress.ip_network cdef inline uint8_t _ip_max_prefix_len(int32_t family): # Maximum number of bits in the network prefix of the specified # IP protocol version. if family == PGSQL_AF_INET: return 32 else: return 128 cdef inline int32_t _ip_addr_len(int32_t family): # Length of address in bytes for the specified IP protocol version. if family == PGSQL_AF_INET: return 4 else: return 16 cdef inline int8_t _ver_to_family(int32_t version): if version == 4: return PGSQL_AF_INET else: return PGSQL_AF_INET6 cdef inline _net_encode(WriteBuffer buf, int8_t family, uint32_t bits, int8_t is_cidr, bytes addr): cdef: char *addrbytes ssize_t addrlen cpython.PyBytes_AsStringAndSize(addr, &addrbytes, &addrlen) buf.write_int32(4 + addrlen) buf.write_byte(family) buf.write_byte(bits) buf.write_byte(is_cidr) buf.write_byte(addrlen) buf.write_cstr(addrbytes, addrlen) cdef net_decode(CodecContext settings, FRBuffer *buf, bint as_cidr): cdef: int32_t family = frb_read(buf, 1)[0] uint8_t bits = frb_read(buf, 1)[0] int prefix_len int32_t is_cidr = frb_read(buf, 1)[0] int32_t addrlen = frb_read(buf, 1)[0] bytes addr uint8_t max_prefix_len = _ip_max_prefix_len(family) if is_cidr != as_cidr: raise ValueError('unexpected CIDR flag set in non-cidr value') if family != PGSQL_AF_INET and family != PGSQL_AF_INET6: raise ValueError('invalid address family in "{}" value'.format( 'cidr' if is_cidr else 'inet' )) max_prefix_len = _ip_max_prefix_len(family) if bits > max_prefix_len: raise ValueError('invalid network prefix length in "{}" value'.format( 'cidr' if is_cidr else 'inet' )) if addrlen != _ip_addr_len(family): raise ValueError('invalid address length in "{}" value'.format( 'cidr' if is_cidr else 'inet' )) addr = cpython.PyBytes_FromStringAndSize(frb_read(buf, addrlen), addrlen) if as_cidr or bits != max_prefix_len: prefix_len = cpython.PyLong_FromLong(bits) if as_cidr: return _ipnet((addr, prefix_len)) else: return _ipiface((addr, prefix_len)) else: return _ipaddr(addr) cdef cidr_encode(CodecContext settings, WriteBuffer buf, obj): cdef: object ipnet int8_t family ipnet = _ipnet(obj) family = _ver_to_family(ipnet.version) _net_encode(buf, family, ipnet.prefixlen, 1, ipnet.network_address.packed) cdef cidr_decode(CodecContext settings, FRBuffer *buf): return net_decode(settings, buf, True) cdef inet_encode(CodecContext settings, WriteBuffer buf, obj): cdef: object ipaddr int8_t family try: ipaddr = _ipaddr(obj) except ValueError: # PostgreSQL accepts *both* CIDR and host values # for the host datatype. ipaddr = _ipiface(obj) family = _ver_to_family(ipaddr.version) _net_encode(buf, family, ipaddr.network.prefixlen, 1, ipaddr.packed) else: family = _ver_to_family(ipaddr.version) _net_encode(buf, family, _ip_max_prefix_len(family), 0, ipaddr.packed) cdef inet_decode(CodecContext settings, FRBuffer *buf): return net_decode(settings, buf, False) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/codecs/numeric.pyx0000644000175100001770000002420514705014413021447 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 from libc.math cimport abs, log10 from libc.stdio cimport snprintf import decimal # defined in postgresql/src/backend/utils/adt/numeric.c DEF DEC_DIGITS = 4 DEF MAX_DSCALE = 0x3FFF DEF NUMERIC_POS = 0x0000 DEF NUMERIC_NEG = 0x4000 DEF NUMERIC_NAN = 0xC000 DEF NUMERIC_PINF = 0xD000 DEF NUMERIC_NINF = 0xF000 _Dec = decimal.Decimal cdef numeric_encode_text(CodecContext settings, WriteBuffer buf, obj): text_encode(settings, buf, str(obj)) cdef numeric_decode_text(CodecContext settings, FRBuffer *buf): return _Dec(text_decode(settings, buf)) cdef numeric_encode_binary(CodecContext settings, WriteBuffer buf, obj): cdef: object dec object dt int64_t exponent int64_t i int64_t j tuple pydigits int64_t num_pydigits int16_t pgdigit int64_t num_pgdigits int16_t dscale int64_t dweight int64_t weight uint16_t sign int64_t padding_size = 0 if isinstance(obj, _Dec): dec = obj else: dec = _Dec(obj) dt = dec.as_tuple() if dt.exponent == 'n' or dt.exponent == 'N': # NaN sign = NUMERIC_NAN num_pgdigits = 0 weight = 0 dscale = 0 elif dt.exponent == 'F': # Infinity if dt.sign: sign = NUMERIC_NINF else: sign = NUMERIC_PINF num_pgdigits = 0 weight = 0 dscale = 0 else: exponent = dt.exponent if exponent < 0 and -exponent > MAX_DSCALE: raise ValueError( 'cannot encode Decimal value into numeric: ' 'exponent is too small') if dt.sign: sign = NUMERIC_NEG else: sign = NUMERIC_POS pydigits = dt.digits num_pydigits = len(pydigits) dweight = num_pydigits + exponent - 1 if dweight >= 0: weight = (dweight + DEC_DIGITS) // DEC_DIGITS - 1 else: weight = -((-dweight - 1) // DEC_DIGITS + 1) if weight > 2 ** 16 - 1: raise ValueError( 'cannot encode Decimal value into numeric: ' 'exponent is too large') padding_size = \ (weight + 1) * DEC_DIGITS - (dweight + 1) num_pgdigits = \ (num_pydigits + padding_size + DEC_DIGITS - 1) // DEC_DIGITS if num_pgdigits > 2 ** 16 - 1: raise ValueError( 'cannot encode Decimal value into numeric: ' 'number of digits is too large') # Pad decimal digits to provide room for correct Postgres # digit alignment in the digit computation loop. pydigits = (0,) * DEC_DIGITS + pydigits + (0,) * DEC_DIGITS if exponent < 0: if -exponent > MAX_DSCALE: raise ValueError( 'cannot encode Decimal value into numeric: ' 'exponent is too small') dscale = -exponent else: dscale = 0 buf.write_int32(2 + 2 + 2 + 2 + 2 * num_pgdigits) buf.write_int16(num_pgdigits) buf.write_int16(weight) buf.write_int16(sign) buf.write_int16(dscale) j = DEC_DIGITS - padding_size for i in range(num_pgdigits): pgdigit = (pydigits[j] * 1000 + pydigits[j + 1] * 100 + pydigits[j + 2] * 10 + pydigits[j + 3]) j += DEC_DIGITS buf.write_int16(pgdigit) # The decoding strategy here is to form a string representation of # the numeric var, as it is faster than passing an iterable of digits. # For this reason the below code is pure overhead and is ~25% slower # than the simple text decoder above. That said, we need the binary # decoder to support binary COPY with numeric values. cdef numeric_decode_binary_ex( CodecContext settings, FRBuffer *buf, bint trail_fract_zero, ): cdef: uint16_t num_pgdigits = hton.unpack_int16(frb_read(buf, 2)) int16_t weight = hton.unpack_int16(frb_read(buf, 2)) uint16_t sign = hton.unpack_int16(frb_read(buf, 2)) uint16_t dscale = hton.unpack_int16(frb_read(buf, 2)) int16_t pgdigit0 ssize_t i int16_t pgdigit object pydigits ssize_t num_pydigits ssize_t actual_num_pydigits ssize_t buf_size int64_t exponent int64_t abs_exponent ssize_t exponent_chars ssize_t front_padding = 0 ssize_t num_fract_digits ssize_t trailing_fract_zeros_adj char smallbuf[_NUMERIC_DECODER_SMALLBUF_SIZE] char *charbuf char *bufptr bint buf_allocated = False if sign == NUMERIC_NAN: # Not-a-number return _Dec('NaN') elif sign == NUMERIC_PINF: # +Infinity return _Dec('Infinity') elif sign == NUMERIC_NINF: # -Infinity return _Dec('-Infinity') if num_pgdigits == 0: # Zero return _Dec('0e-' + str(dscale)) pgdigit0 = hton.unpack_int16(frb_read(buf, 2)) if weight >= 0: if pgdigit0 < 10: front_padding = 3 elif pgdigit0 < 100: front_padding = 2 elif pgdigit0 < 1000: front_padding = 1 # The number of fractional decimal digits actually encoded in # base-DEC_DEIGITS digits sent by Postgres. num_fract_digits = (num_pgdigits - weight - 1) * DEC_DIGITS # The trailing zero adjustment necessary to obtain exactly # dscale number of fractional digits in output. May be negative, # which indicates that trailing zeros in the last input digit # should be discarded. trailing_fract_zeros_adj = dscale - num_fract_digits # Maximum possible number of decimal digits in base 10. # The actual number might be up to 3 digits smaller due to # leading zeros in first input digit. num_pydigits = num_pgdigits * DEC_DIGITS if trailing_fract_zeros_adj > 0: num_pydigits += trailing_fract_zeros_adj # Exponent. exponent = (weight + 1) * DEC_DIGITS - front_padding abs_exponent = abs(exponent) if abs_exponent != 0: # Number of characters required to render absolute exponent value # in decimal. exponent_chars = log10(abs_exponent) + 1 else: exponent_chars = 0 # Output buffer size. buf_size = ( 1 + # sign 1 + # leading zero 1 + # decimal dot num_pydigits + # digits 1 + # possible trailing zero padding 2 + # exponent indicator (E-,E+) exponent_chars + # exponent 1 # null terminator char ) if buf_size > _NUMERIC_DECODER_SMALLBUF_SIZE: charbuf = cpython.PyMem_Malloc(buf_size) buf_allocated = True else: charbuf = smallbuf try: bufptr = charbuf if sign == NUMERIC_NEG: bufptr[0] = b'-' bufptr += 1 bufptr[0] = b'0' bufptr[1] = b'.' bufptr += 2 if weight >= 0: bufptr = _unpack_digit_stripping_lzeros(bufptr, pgdigit0) else: bufptr = _unpack_digit(bufptr, pgdigit0) for i in range(1, num_pgdigits): pgdigit = hton.unpack_int16(frb_read(buf, 2)) bufptr = _unpack_digit(bufptr, pgdigit) if dscale: if trailing_fract_zeros_adj > 0: for i in range(trailing_fract_zeros_adj): bufptr[i] = b'0' # If display scale is _less_ than the number of rendered digits, # trailing_fract_zeros_adj will be negative and this will strip # the excess trailing zeros. bufptr += trailing_fract_zeros_adj if trail_fract_zero: # Check if the number of rendered digits matches the exponent, # and if so, add another trailing zero, so the result always # appears with a decimal point. actual_num_pydigits = bufptr - charbuf - 2 if sign == NUMERIC_NEG: actual_num_pydigits -= 1 if actual_num_pydigits == abs_exponent: bufptr[0] = b'0' bufptr += 1 if exponent != 0: bufptr[0] = b'E' if exponent < 0: bufptr[1] = b'-' else: bufptr[1] = b'+' bufptr += 2 snprintf(bufptr, exponent_chars + 1, '%d', abs_exponent) bufptr += exponent_chars bufptr[0] = 0 pydigits = cpythonx.PyUnicode_FromString(charbuf) return _Dec(pydigits) finally: if buf_allocated: cpython.PyMem_Free(charbuf) cdef numeric_decode_binary(CodecContext settings, FRBuffer *buf): return numeric_decode_binary_ex(settings, buf, False) cdef inline char *_unpack_digit_stripping_lzeros(char *buf, int64_t pgdigit): cdef: int64_t d bint significant d = pgdigit // 1000 significant = (d > 0) if significant: pgdigit -= d * 1000 buf[0] = (d + b'0') buf += 1 d = pgdigit // 100 significant |= (d > 0) if significant: pgdigit -= d * 100 buf[0] = (d + b'0') buf += 1 d = pgdigit // 10 significant |= (d > 0) if significant: pgdigit -= d * 10 buf[0] = (d + b'0') buf += 1 buf[0] = (pgdigit + b'0') buf += 1 return buf cdef inline char *_unpack_digit(char *buf, int64_t pgdigit): cdef: int64_t d d = pgdigit // 1000 pgdigit -= d * 1000 buf[0] = (d + b'0') d = pgdigit // 100 pgdigit -= d * 100 buf[1] = (d + b'0') d = pgdigit // 10 pgdigit -= d * 10 buf[2] = (d + b'0') buf[3] = (pgdigit + b'0') buf += 4 return buf ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/codecs/pg_snapshot.pyx0000644000175100001770000000342614705014413022334 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef pg_snapshot_encode(CodecContext settings, WriteBuffer buf, obj): cdef: ssize_t nxip uint64_t xmin uint64_t xmax int i WriteBuffer xip_buf = WriteBuffer.new() if not (cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj)): raise TypeError( 'list or tuple expected (got type {})'.format(type(obj))) if len(obj) != 3: raise ValueError( 'invalid number of elements in txid_snapshot tuple, expecting 4') nxip = len(obj[2]) if nxip > _MAXINT32: raise ValueError('txid_snapshot value is too long') xmin = obj[0] xmax = obj[1] for i in range(nxip): xip_buf.write_int64( cpython.PyLong_AsUnsignedLongLong(obj[2][i])) buf.write_int32(20 + xip_buf.len()) buf.write_int32(nxip) buf.write_int64(xmin) buf.write_int64(xmax) buf.write_buffer(xip_buf) cdef pg_snapshot_decode(CodecContext settings, FRBuffer *buf): cdef: int32_t nxip uint64_t xmin uint64_t xmax tuple xip_tup int32_t i object xip nxip = hton.unpack_int32(frb_read(buf, 4)) xmin = hton.unpack_int64(frb_read(buf, 8)) xmax = hton.unpack_int64(frb_read(buf, 8)) xip_tup = cpython.PyTuple_New(nxip) for i in range(nxip): xip = cpython.PyLong_FromUnsignedLongLong( hton.unpack_int64(frb_read(buf, 8))) cpython.Py_INCREF(xip) cpython.PyTuple_SET_ITEM(xip_tup, i, xip) return (xmin, xmax, xip_tup) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/codecs/text.pyx0000644000175100001770000000275414705014413020776 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef inline as_pg_string_and_size( CodecContext settings, obj, char **cstr, ssize_t *size): if not cpython.PyUnicode_Check(obj): raise TypeError('expected str, got {}'.format(type(obj).__name__)) if settings.is_encoding_utf8(): cstr[0] = cpythonx.PyUnicode_AsUTF8AndSize(obj, size) else: encoded = settings.get_text_codec().encode(obj)[0] cpython.PyBytes_AsStringAndSize(encoded, cstr, size) if size[0] > 0x7fffffff: raise ValueError('string too long') cdef text_encode(CodecContext settings, WriteBuffer buf, obj): cdef: char *str ssize_t size as_pg_string_and_size(settings, obj, &str, &size) buf.write_int32(size) buf.write_cstr(str, size) cdef inline decode_pg_string(CodecContext settings, const char* data, ssize_t len): if settings.is_encoding_utf8(): # decode UTF-8 in strict mode return cpython.PyUnicode_DecodeUTF8(data, len, NULL) else: bytes = cpython.PyBytes_FromStringAndSize(data, len) return settings.get_text_codec().decode(bytes)[0] cdef text_decode(CodecContext settings, FRBuffer *buf): cdef ssize_t buf_len = buf.len return decode_pg_string(settings, frb_read_all(buf), buf_len) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/codecs/tid.pyx0000644000175100001770000000301514705014413020561 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef tid_encode(CodecContext settings, WriteBuffer buf, obj): cdef int overflow = 0 cdef unsigned long block, offset if not (cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj)): raise TypeError( 'list or tuple expected (got type {})'.format(type(obj))) if len(obj) != 2: raise ValueError( 'invalid number of elements in tid tuple, expecting 2') try: block = cpython.PyLong_AsUnsignedLong(obj[0]) except OverflowError: overflow = 1 # "long" and "long long" have the same size for x86_64, need an extra check if overflow or (sizeof(block) > 4 and block > UINT32_MAX): raise OverflowError('tuple id block value out of uint32 range') try: offset = cpython.PyLong_AsUnsignedLong(obj[1]) overflow = 0 except OverflowError: overflow = 1 if overflow or offset > 65535: raise OverflowError('tuple id offset value out of uint16 range') buf.write_int32(6) buf.write_int32(block) buf.write_int16(offset) cdef tid_decode(CodecContext settings, FRBuffer *buf): cdef: uint32_t block uint16_t offset block = hton.unpack_int32(frb_read(buf, 4)) offset = hton.unpack_int16(frb_read(buf, 2)) return (block, offset) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/codecs/uuid.pyx0000644000175100001770000000152714705014413020755 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef uuid_encode(CodecContext settings, WriteBuffer wbuf, obj): cdef: char buf[16] if type(obj) is pg_UUID: wbuf.write_int32(16) wbuf.write_cstr((obj)._data, 16) elif cpython.PyUnicode_Check(obj): pg_uuid_bytes_from_str(obj, buf) wbuf.write_int32(16) wbuf.write_cstr(buf, 16) else: bytea_encode(settings, wbuf, obj.bytes) cdef uuid_decode(CodecContext settings, FRBuffer *buf): if buf.len != 16: raise TypeError( f'cannot decode UUID, expected 16 bytes, got {buf.len}') return pg_uuid_from_buf(frb_read_all(buf)) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/consts.pxi0000644000175100001770000000056714705014413020043 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 DEF _BUFFER_INITIAL_SIZE = 1024 DEF _BUFFER_MAX_GROW = 65536 DEF _BUFFER_FREELIST_SIZE = 256 DEF _MAXINT32 = 2**31 - 1 DEF _NUMERIC_DECODER_SMALLBUF_SIZE = 256 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/cpythonx.pxd0000644000175100001770000000134014705014413020367 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 from cpython cimport Py_buffer cdef extern from "Python.h": int PyUnicode_1BYTE_KIND int PyByteArray_CheckExact(object) int PyByteArray_Resize(object, ssize_t) except -1 object PyByteArray_FromStringAndSize(const char *, ssize_t) char* PyByteArray_AsString(object) object PyUnicode_FromString(const char *u) const char* PyUnicode_AsUTF8AndSize( object unicode, ssize_t *size) except NULL object PyUnicode_FromKindAndData( int kind, const void *buffer, Py_ssize_t size) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/debug.h0000644000175100001770000000005314705014413017235 0ustar00runnerdocker#ifndef PG_DEBUG #define PG_DEBUG 0 #endif ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/debug.pxd0000644000175100001770000000040714705014413017604 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef extern from "debug.h": cdef int PG_DEBUG ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/frb.pxd0000644000175100001770000000227414705014413017273 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef: struct FRBuffer: const char* buf ssize_t len inline ssize_t frb_get_len(FRBuffer *frb): return frb.len inline void frb_set_len(FRBuffer *frb, ssize_t new_len): frb.len = new_len inline void frb_init(FRBuffer *frb, const char *buf, ssize_t len): frb.buf = buf frb.len = len inline const char* frb_read(FRBuffer *frb, ssize_t n) except NULL: cdef const char *result frb_check(frb, n) result = frb.buf frb.buf += n frb.len -= n return result inline const char* frb_read_all(FRBuffer *frb): cdef const char *result result = frb.buf frb.buf += frb.len frb.len = 0 return result inline FRBuffer *frb_slice_from(FRBuffer *frb, FRBuffer* source, ssize_t len): frb.buf = frb_read(source, len) frb.len = len return frb object frb_check(FRBuffer *frb, ssize_t n) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/frb.pyx0000644000175100001770000000063114705014413017313 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef object frb_check(FRBuffer *frb, ssize_t n): if n > frb.len: raise AssertionError( f'insufficient data in buffer: requested {n} ' f'remaining {frb.len}') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/hton.h0000644000175100001770000001140014705014413017115 0ustar00runnerdocker#include #if defined(__linux__) || defined(__CYGWIN__) || defined(__sun) #include #elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) \ || defined(__DragonFly__) #include #elif defined(__APPLE__) #include #elif defined(_WIN32) || defined(_WIN64) || defined(__WINDOWS__) /* Assume Windows is always LE. There seems to be no reliable way to detect endianness there */ #define __LITTLE_ENDIAN 1234 #define __BIG_ENDIAN 4321 #define __BYTE_ORDER __LITTLE_ENDIAN #endif #if defined(_BYTE_ORDER) && !defined(__BYTE_ORDER) #define __BYTE_ORDER _BYTE_ORDER #endif #if defined(BYTE_ORDER) && !defined(__BYTE_ORDER) #define __BYTE_ORDER BYTE_ORDER #endif #if defined(_LITTLE_ENDIAN) && !defined(__LITTLE_ENDIAN) #define __LITTLE_ENDIAN _LITTLE_ENDIAN #endif #if defined(LITTLE_ENDIAN) && !defined(__LITTLE_ENDIAN) #define __LITTLE_ENDIAN LITTLE_ENDIAN #endif #if defined(_BIG_ENDIAN) && !defined(__BIG_ENDIAN) #define __BIG_ENDIAN _BIG_ENDIAN #endif #if defined(BIG_ENDIAN) && !defined(__BIG_ENDIAN) #define __BIG_ENDIAN BIG_ENDIAN #endif #if !defined(__BYTE_ORDER) || !defined(__LITTLE_ENDIAN) \ || !defined(__BIG_ENDIAN) #error Cannot determine platform byte order. #endif #if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) #define apg_bswap16(x) __builtin_bswap16(x) #define apg_bswap32(x) __builtin_bswap32(x) #define apg_bswap64(x) __builtin_bswap64(x) #elif defined(_MSC_VER) #define apg_bswap16(x) _byteswap_ushort(x) #define apg_bswap32(x) _byteswap_ulong(x) #define apg_bswap64(x) _byteswap_uint64(x) #else static inline uint16_t apg_bswap16(uint16_t) { return ((x << 8) & 0xff00) | (x >> 8) & 0x00ff)); } static inline uint32_t apg_bswap32(uint32_t x) { return ( ((x << 24) & 0xff000000) | ((x << 8) & 0x00ff0000) | ((x >> 8) & 0x0000ff00) | ((x >> 24) & 0x000000ff) ); } static inline uint64_t apg_bswap64(uint64_t x) { return ( ((x << 56) & 0xff00000000000000ULL) | ((x << 40) & 0x00ff000000000000ULL) | ((x << 24) & 0x0000ff0000000000ULL) | ((x << 8) & 0x000000ff00000000ULL) | ((x >> 8) & 0x00000000ff000000ULL) | ((x >> 24) & 0x0000000000ff0000ULL) | ((x >> 40) & 0x000000000000ff00ULL) | ((x >> 56) & 0x00000000000000ffULL); ); } #endif #if __BYTE_ORDER == __BIG_ENDIAN #define apg_hton16(x) (x) #define apg_hton32(x) (x) #define apg_hton64(x) (x) #define apg_ntoh16(x) (x) #define apg_ntoh32(x) (x) #define apg_ntoh64(x) (x) #elif __BYTE_ORDER == __LITTLE_ENDIAN #define apg_hton16(x) apg_bswap16(x) #define apg_hton32(x) apg_bswap32(x) #define apg_hton64(x) apg_bswap64(x) #define apg_ntoh16(x) apg_bswap16(x) #define apg_ntoh32(x) apg_bswap32(x) #define apg_ntoh64(x) apg_bswap64(x) #else #error Unsupported byte order. #endif static inline void pack_int16(char *buf, int16_t x) { uint16_t nx = apg_hton16((uint16_t)x); /* NOTE: the memcpy below is _important_ to support systems which disallow unaligned access. On systems, which do allow unaligned access it will be optimized away by the compiler */ memcpy(buf, &nx, sizeof(uint16_t)); } static inline void pack_int32(char *buf, int64_t x) { uint32_t nx = apg_hton32((uint32_t)x); memcpy(buf, &nx, sizeof(uint32_t)); } static inline void pack_int64(char *buf, int64_t x) { uint64_t nx = apg_hton64((uint64_t)x); memcpy(buf, &nx, sizeof(uint64_t)); } static inline uint16_t unpack_uint16(const char *buf) { uint16_t nx; memcpy((char *)&nx, buf, sizeof(uint16_t)); return apg_ntoh16(nx); } static inline int16_t unpack_int16(const char *buf) { return (int16_t)unpack_uint16(buf); } static inline uint32_t unpack_uint32(const char *buf) { uint32_t nx; memcpy((char *)&nx, buf, sizeof(uint32_t)); return apg_ntoh32(nx); } static inline int32_t unpack_int32(const char *buf) { return (int32_t)unpack_uint32(buf); } static inline uint64_t unpack_uint64(const char *buf) { uint64_t nx; memcpy((char *)&nx, buf, sizeof(uint64_t)); return apg_ntoh64(nx); } static inline int64_t unpack_int64(const char *buf) { return (int64_t)unpack_uint64(buf); } union _apg_floatconv { uint32_t i; float f; }; union _apg_doubleconv { uint64_t i; double f; }; static inline void pack_float(char *buf, float f) { union _apg_floatconv v; v.f = f; pack_int32(buf, (int32_t)v.i); } static inline void pack_double(char *buf, double f) { union _apg_doubleconv v; v.f = f; pack_int64(buf, (int64_t)v.i); } static inline float unpack_float(const char *buf) { union _apg_floatconv v; v.i = (uint32_t)unpack_int32(buf); return v.f; } static inline double unpack_double(const char *buf) { union _apg_doubleconv v; v.i = (uint64_t)unpack_int64(buf); return v.f; } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/hton.pxd0000644000175100001770000000167114705014413017472 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 from libc.stdint cimport int16_t, int32_t, uint16_t, uint32_t, int64_t, uint64_t cdef extern from "./hton.h": cdef void pack_int16(char *buf, int16_t x); cdef void pack_int32(char *buf, int32_t x); cdef void pack_int64(char *buf, int64_t x); cdef void pack_float(char *buf, float f); cdef void pack_double(char *buf, double f); cdef int16_t unpack_int16(const char *buf); cdef uint16_t unpack_uint16(const char *buf); cdef int32_t unpack_int32(const char *buf); cdef uint32_t unpack_uint32(const char *buf); cdef int64_t unpack_int64(const char *buf); cdef uint64_t unpack_uint64(const char *buf); cdef float unpack_float(const char *buf); cdef double unpack_double(const char *buf); ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370385.0 asyncpg-0.30.0/asyncpg/pgproto/pgproto.c0000644000175100001770001011725214705014421017646 0ustar00runnerdocker/* Generated by Cython 3.0.11 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ "asyncpg/pgproto/debug.h", "asyncpg/pgproto/tohex.h" ], "extra_compile_args": [ "-O2", "-fsigned-char", "-Wall", "-Wsign-compare", "-Wconversion" ], "include_dirs": [ "asyncpg/pgproto" ], "name": "asyncpg.pgproto.pgproto", "sources": [ "asyncpg/pgproto/pgproto.pyx" ] }, "module_name": "asyncpg.pgproto.pgproto" } END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj) #else #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj, NULL) #endif #if PY_MAJOR_VERSION <= 2 #define PyDict_GetItemWithError _PyDict_GetItemWithError #endif #if (PY_VERSION_HEX < 0x030700b1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600)) && !defined(PyContextVar_Get) #define PyContextVar_Get(var, d, v) ((d) ? ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) : ((v)[0] = NULL, 0) ) #endif #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000BF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__asyncpg__pgproto__pgproto #define __PYX_HAVE_API__asyncpg__pgproto__pgproto /* Early includes */ #include #include #include #include "pythread.h" #include #include "./hton.h" #include "./tohex.h" #include "debug.h" #include "datetime.h" /* Backport for Python 2.x */ #if PY_MAJOR_VERSION < 3 #ifndef PyDateTime_DELTA_GET_DAYS #define PyDateTime_DELTA_GET_DAYS(o) (((PyDateTime_Delta*)o)->days) #endif #ifndef PyDateTime_DELTA_GET_SECONDS #define PyDateTime_DELTA_GET_SECONDS(o) (((PyDateTime_Delta*)o)->seconds) #endif #ifndef PyDateTime_DELTA_GET_MICROSECONDS #define PyDateTime_DELTA_GET_MICROSECONDS(o) (((PyDateTime_Delta*)o)->microseconds) #endif #endif /* Backport for Python < 3.6 */ #if PY_VERSION_HEX < 0x030600a4 #ifndef PyDateTime_TIME_GET_FOLD #define PyDateTime_TIME_GET_FOLD(o) ((void)(o), 0) #endif #ifndef PyDateTime_DATE_GET_FOLD #define PyDateTime_DATE_GET_FOLD(o) ((void)(o), 0) #endif #endif /* Backport for Python < 3.6 */ #if PY_VERSION_HEX < 0x030600a4 #define __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold) ((void)(fold), PyDateTimeAPI->DateTime_FromDateAndTime(year, month, day, hour, minute, second, microsecond, tz, PyDateTimeAPI->DateTimeType)) #define __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold) ((void)(fold), PyDateTimeAPI->Time_FromTime(hour, minute, second, microsecond, tz, PyDateTimeAPI->TimeType)) #else /* For Python 3.6+ so that we can pass tz */ #define __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold) PyDateTimeAPI->DateTime_FromDateAndTimeAndFold(year, month, day, hour, minute, second, microsecond, tz, fold, PyDateTimeAPI->DateTimeType) #define __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold) PyDateTimeAPI->Time_FromTimeAndFold(hour, minute, second, microsecond, tz, fold, PyDateTimeAPI->TimeType) #endif /* Backport for Python < 3.7 */ #if PY_VERSION_HEX < 0x030700b1 #define __Pyx_TimeZone_UTC NULL #define __Pyx_TimeZone_FromOffsetAndName(offset, name) ((void)(offset), (void)(name), (PyObject*)NULL) #else #define __Pyx_TimeZone_UTC PyDateTime_TimeZone_UTC #define __Pyx_TimeZone_FromOffsetAndName(offset, name) PyTimeZone_FromOffsetAndName(offset, name) #endif /* Backport for Python < 3.10 */ #if PY_VERSION_HEX < 0x030a00a1 #ifndef PyDateTime_TIME_GET_TZINFO #define PyDateTime_TIME_GET_TZINFO(o) ((((PyDateTime_Time*)o)->hastzinfo) ? ((PyDateTime_Time*)o)->tzinfo : Py_None) #endif #ifndef PyDateTime_DATE_GET_TZINFO #define PyDateTime_DATE_GET_TZINFO(o) ((((PyDateTime_DateTime*)o)->hastzinfo) ? ((PyDateTime_DateTime*)o)->tzinfo : Py_None) #endif #endif #include #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "asyncpg/pgproto/./uuid.pyx", "asyncpg/pgproto/./buffer.pyx", "", "asyncpg/pgproto/./codecs/context.pyx", "asyncpg/pgproto/./codecs/int.pyx", ".eggs/Cython-3.0.11-py3.12-linux-x86_64.egg/Cython/Includes/cpython/contextvars.pxd", "asyncpg/pgproto/./frb.pxd", "asyncpg/pgproto/./buffer.pxd", ".eggs/Cython-3.0.11-py3.12-linux-x86_64.egg/Cython/Includes/cpython/datetime.pxd", "asyncpg/pgproto/./frb.pyx", "asyncpg/pgproto/pgproto.pyx", "asyncpg/pgproto/./codecs/bytea.pyx", "asyncpg/pgproto/./codecs/text.pyx", "asyncpg/pgproto/./codecs/datetime.pyx", "asyncpg/pgproto/./codecs/float.pyx", "asyncpg/pgproto/./codecs/json.pyx", "asyncpg/pgproto/./codecs/jsonpath.pyx", "asyncpg/pgproto/./codecs/uuid.pyx", "asyncpg/pgproto/./codecs/numeric.pyx", "asyncpg/pgproto/./codecs/bits.pyx", "asyncpg/pgproto/./codecs/geometry.pyx", "asyncpg/pgproto/./codecs/hstore.pyx", "asyncpg/pgproto/./codecs/misc.pyx", "asyncpg/pgproto/./codecs/network.pyx", "asyncpg/pgproto/./codecs/tid.pyx", "asyncpg/pgproto/./codecs/pg_snapshot.pyx", ".eggs/Cython-3.0.11-py3.12-linux-x86_64.egg/Cython/Includes/cpython/type.pxd", ".eggs/Cython-3.0.11-py3.12-linux-x86_64.egg/Cython/Includes/cpython/bool.pxd", ".eggs/Cython-3.0.11-py3.12-linux-x86_64.egg/Cython/Includes/cpython/complex.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext; struct __pyx_obj_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID; struct __pyx_opt_args_7cpython_11contextvars_get_value; struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default; /* "cpython/contextvars.pxd":112 * * * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the default value of the context variable, */ struct __pyx_opt_args_7cpython_11contextvars_get_value { int __pyx_n; PyObject *default_value; }; /* "cpython/contextvars.pxd":129 * * * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the provided default value if no such value was found. */ struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default { int __pyx_n; PyObject *default_value; }; struct __pyx_opt_args_7cpython_8datetime_time_new; struct __pyx_opt_args_7cpython_8datetime_datetime_new; struct __pyx_opt_args_7cpython_8datetime_timezone_new; struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp; /* "cpython/datetime.pxd":292 * # Create time object using DateTime CAPI factory function * # Note, there are no range checks for any of the arguments. * cdef inline time time_new(int hour, int minute, int second, int microsecond, object tz, int fold=0): # <<<<<<<<<<<<<< * return __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold) * */ struct __pyx_opt_args_7cpython_8datetime_time_new { int __pyx_n; int fold; }; /* "cpython/datetime.pxd":297 * # Create datetime object using DateTime CAPI factory function. * # Note, there are no range checks for any of the arguments. * cdef inline datetime datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz, int fold=0): # <<<<<<<<<<<<<< * return __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold) * */ struct __pyx_opt_args_7cpython_8datetime_datetime_new { int __pyx_n; int fold; }; /* "cpython/datetime.pxd":306 * * # Create timedelta object using DateTime CAPI factory function. * cdef inline object timezone_new(object offset, object name=None): # <<<<<<<<<<<<<< * if PY_VERSION_HEX < 0x030700b1: * raise RuntimeError('Time zones are not available from the C-API.') */ struct __pyx_opt_args_7cpython_8datetime_timezone_new { int __pyx_n; PyObject *name; }; /* "cpython/datetime.pxd":312 * * # Create datetime object using DB API constructor. * cdef inline datetime datetime_from_timestamp(timestamp, tz=None): # <<<<<<<<<<<<<< * return PyDateTimeAPI.DateTime_FromTimestamp( * PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL) */ struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp { int __pyx_n; PyObject *tz; }; struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer; struct __pyx_opt_args_7asyncpg_7pgproto_7pgproto_10ReadBuffer_redirect_messages; /* "asyncpg/pgproto/frb.pxd":10 * cdef: * * struct FRBuffer: # <<<<<<<<<<<<<< * const char* buf * ssize_t len */ struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer { char const *buf; Py_ssize_t len; }; /* "asyncpg/pgproto/buffer.pxd":62 * * * ctypedef const char * (*try_consume_message_method)(object, ssize_t*) # <<<<<<<<<<<<<< * ctypedef int32_t (*take_message_type_method)(object, char) except -1 * ctypedef int32_t (*take_message_method)(object) except -1 */ typedef char const *(*__pyx_t_7asyncpg_7pgproto_7pgproto_try_consume_message_method)(PyObject *, Py_ssize_t *); /* "asyncpg/pgproto/buffer.pxd":63 * * ctypedef const char * (*try_consume_message_method)(object, ssize_t*) * ctypedef int32_t (*take_message_type_method)(object, char) except -1 # <<<<<<<<<<<<<< * ctypedef int32_t (*take_message_method)(object) except -1 * ctypedef char (*get_message_type_method)(object) */ typedef int32_t (*__pyx_t_7asyncpg_7pgproto_7pgproto_take_message_type_method)(PyObject *, char); /* "asyncpg/pgproto/buffer.pxd":64 * ctypedef const char * (*try_consume_message_method)(object, ssize_t*) * ctypedef int32_t (*take_message_type_method)(object, char) except -1 * ctypedef int32_t (*take_message_method)(object) except -1 # <<<<<<<<<<<<<< * ctypedef char (*get_message_type_method)(object) * */ typedef int32_t (*__pyx_t_7asyncpg_7pgproto_7pgproto_take_message_method)(PyObject *); /* "asyncpg/pgproto/buffer.pxd":65 * ctypedef int32_t (*take_message_type_method)(object, char) except -1 * ctypedef int32_t (*take_message_method)(object) except -1 * ctypedef char (*get_message_type_method)(object) # <<<<<<<<<<<<<< * * */ typedef char (*__pyx_t_7asyncpg_7pgproto_7pgproto_get_message_type_method)(PyObject *); /* "asyncpg/pgproto/buffer.pxd":130 * cdef bytes consume_message(self) * cdef discard_message(self) * cdef redirect_messages(self, WriteBuffer buf, char mtype, int stop_at=?) # <<<<<<<<<<<<<< * cdef bytearray consume_messages(self, char mtype) * cdef finish_message(self) */ struct __pyx_opt_args_7asyncpg_7pgproto_7pgproto_10ReadBuffer_redirect_messages { int __pyx_n; int stop_at; }; /* "asyncpg/pgproto/codecs/__init__.pxd":18 * * * ctypedef object (*encode_func)(CodecContext settings, # <<<<<<<<<<<<<< * WriteBuffer buf, * object obj) */ typedef PyObject *(*__pyx_t_7asyncpg_7pgproto_7pgproto_encode_func)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /* "asyncpg/pgproto/codecs/__init__.pxd":22 * object obj) * * ctypedef object (*decode_func)(CodecContext settings, # <<<<<<<<<<<<<< * FRBuffer *buf) * */ typedef PyObject *(*__pyx_t_7asyncpg_7pgproto_7pgproto_decode_func)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /* "asyncpg/pgproto/buffer.pxd":8 * * * cdef class WriteBuffer: # <<<<<<<<<<<<<< * cdef: * # Preallocated small buffer */ struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer { PyObject_HEAD struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_vtab; int _smallbuf_inuse; char _smallbuf[0x400]; char *_buf; Py_ssize_t _size; Py_ssize_t _length; int _view_count; int _message_mode; }; /* "asyncpg/pgproto/buffer.pxd":68 * * * cdef class ReadBuffer: # <<<<<<<<<<<<<< * cdef: * # A deque of buffers (bytes objects) */ struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer { PyObject_HEAD struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_vtab; PyObject *_bufs; PyObject *_bufs_append; PyObject *_bufs_popleft; PyObject *_buf0; PyObject *_buf0_prev; int32_t _bufs_len; Py_ssize_t _pos0; Py_ssize_t _len0; Py_ssize_t _length; char _current_message_type; int32_t _current_message_len; Py_ssize_t _current_message_len_unread; int _current_message_ready; }; /* "asyncpg/pgproto/codecs/__init__.pxd":8 * * * cdef class CodecContext: # <<<<<<<<<<<<<< * * cpdef get_text_codec(self) */ struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext { PyObject_HEAD struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_vtab; }; /* "asyncpg/pgproto/uuid.pyx":125 * * * cdef class __UUIDReplaceMe: # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe { PyObject_HEAD }; /* "asyncpg/pgproto/uuid.pyx":138 * @cython.final * @cython.no_gc_clear * cdef class UUID(__UUIDReplaceMe): # <<<<<<<<<<<<<< * * cdef: */ struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID { struct __pyx_obj_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe __pyx_base; char _data[16]; PyObject *_int; PyObject *_hash; PyObject *__weakref__; }; /* "asyncpg/pgproto/buffer.pyx":18 * @cython.final * @cython.freelist(_BUFFER_FREELIST_SIZE) * cdef class WriteBuffer: # <<<<<<<<<<<<<< * * def __cinit__(self): */ struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer { PyObject *(*len)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *); PyObject *(*write_len_prefixed_utf8)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); PyObject *(*_check_readonly)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *); PyObject *(*_ensure_alloced)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, Py_ssize_t); PyObject *(*_reallocate)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, Py_ssize_t); PyObject *(*reset)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *); PyObject *(*start_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, char); PyObject *(*end_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *); PyObject *(*write_buffer)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *); PyObject *(*write_byte)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, char); PyObject *(*write_bytes)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); PyObject *(*write_len_prefixed_buffer)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *); PyObject *(*write_len_prefixed_bytes)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); PyObject *(*write_bytestring)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); PyObject *(*write_str)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *, PyObject *); PyObject *(*write_frbuf)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); PyObject *(*write_cstr)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, char const *, Py_ssize_t); PyObject *(*write_int16)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int16_t); PyObject *(*write_int32)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int32_t); PyObject *(*write_int64)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int64_t); PyObject *(*write_float)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, float); PyObject *(*write_double)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, double); struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*new_message)(char); struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*new)(void); }; static struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer; static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__check_readonly(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__ensure_alloced(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, Py_ssize_t); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__reallocate(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, Py_ssize_t); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_reset(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_start_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, char); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_end_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_buffer(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_byte(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, char); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_bytes(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_buffer(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_bytes(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_bytestring(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_str(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *, PyObject *); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_frbuf(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_cstr(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, char const *, Py_ssize_t); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int16(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int16_t); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int32_t); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int64_t); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_float(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, float); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_double(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, double); static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_new_message(char); static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_new(void); /* "asyncpg/pgproto/buffer.pyx":241 * @cython.final * @cython.freelist(_BUFFER_FREELIST_SIZE) * cdef class ReadBuffer: # <<<<<<<<<<<<<< * * def __cinit__(self): */ struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer { PyObject *(*len)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); char (*get_message_type)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); int32_t (*get_message_length)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); PyObject *(*feed_data)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, PyObject *); PyObject *(*_ensure_first_buf)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); PyObject *(*_switch_to_next_buf)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); char (*read_byte)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); char const *(*_try_read_bytes)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t); PyObject *(*_read_into)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, char *, Py_ssize_t); PyObject *(*_read_and_discard)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t); PyObject *(*read_bytes)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t); PyObject *(*read_len_prefixed_bytes)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); PyObject *(*read_len_prefixed_utf8)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); PyObject *(*read_uuid)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); int64_t (*read_int64)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); int32_t (*read_int32)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); int16_t (*read_int16)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); PyObject *(*read_null_str)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); int32_t (*take_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); int32_t (*take_message_type)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, char); int32_t (*put_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); char const *(*try_consume_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t *); PyObject *(*consume_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); PyObject *(*discard_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); PyObject *(*redirect_messages)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, char, struct __pyx_opt_args_7asyncpg_7pgproto_7pgproto_10ReadBuffer_redirect_messages *__pyx_optional_args); PyObject *(*consume_messages)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, char); PyObject *(*finish_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); PyObject *(*_finish_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *(*new_message_parser)(PyObject *); }; static struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_ReadBuffer; static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_len(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); static CYTHON_INLINE char __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_type(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); static CYTHON_INLINE int32_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_length(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_feed_data(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, PyObject *); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__switch_to_next_buf(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); static CYTHON_INLINE char __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_byte(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); static CYTHON_INLINE char const *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__try_read_bytes(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__read_into(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, char *, Py_ssize_t); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__read_and_discard(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_bytes(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_len_prefixed_bytes(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_len_prefixed_utf8(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_uuid(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); static CYTHON_INLINE int64_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_int64(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); static CYTHON_INLINE int32_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_int32(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); static CYTHON_INLINE int16_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_int16(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_null_str(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); static int32_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_take_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); static CYTHON_INLINE int32_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_take_message_type(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, char); static int32_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_put_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); static CYTHON_INLINE char const *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_try_consume_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t *); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_consume_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_discard_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_redirect_messages(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, char, struct __pyx_opt_args_7asyncpg_7pgproto_7pgproto_10ReadBuffer_redirect_messages *__pyx_optional_args); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_consume_messages(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, char); static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_finish_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__finish_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_new_message_parser(PyObject *); /* "asyncpg/pgproto/codecs/context.pyx":8 * * * cdef class CodecContext: # <<<<<<<<<<<<<< * * cpdef get_text_codec(self): */ struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext { PyObject *(*get_text_codec)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, int __pyx_skip_dispatch); PyObject *(*is_encoding_utf8)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *); PyObject *(*get_json_decoder)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, int __pyx_skip_dispatch); PyObject *(*is_decoding_json)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *); PyObject *(*get_json_encoder)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, int __pyx_skip_dispatch); PyObject *(*is_encoding_json)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *); }; static struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_CodecContext; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* BuildPyUnicode.proto */ static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, int prepend_sign, char padding_char); /* IncludeStringH.proto */ #include /* CIntToPyUnicode.proto */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char); /* JoinPyUnicode.proto */ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char); /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* WriteUnraisableException.proto */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); /* RaiseUnexpectedTypeError.proto */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* decode_c_string_utf16.proto */ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 0; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = -1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } /* decode_c_bytes.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* decode_bytes.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_bytes( PyObject* string, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { char* as_c_string; Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS as_c_string = PyBytes_AS_STRING(string); size = PyBytes_GET_SIZE(string); #else if (PyBytes_AsStringAndSize(string, &as_c_string, &size) < 0) { return NULL; } #endif return __Pyx_decode_c_bytes( as_c_string, size, start, stop, encoding, errors, decode_func); } /* AssertionsEnabled.proto */ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define __Pyx_init_assertions_enabled() (0) #define __pyx_assertions_enabled() (1) #elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) static int __pyx_assertions_enabled_flag; #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) static int __Pyx_init_assertions_enabled(void) { PyObject *builtins, *debug, *debug_str; int flag; builtins = PyEval_GetBuiltins(); if (!builtins) goto bad; debug_str = PyUnicode_FromStringAndSize("__debug__", 9); if (!debug_str) goto bad; debug = PyObject_GetItem(builtins, debug_str); Py_DECREF(debug_str); if (!debug) goto bad; flag = PyObject_IsTrue(debug); Py_DECREF(debug); if (flag == -1) goto bad; __pyx_assertions_enabled_flag = flag; return 0; bad: __pyx_assertions_enabled_flag = 1; return -1; } #else #define __Pyx_init_assertions_enabled() (0) #define __pyx_assertions_enabled() (!Py_OptimizeFlag) #endif /* RaiseUnboundLocalError.proto */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); /* PyObjectFormatAndDecref.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f); static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f); /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /* PyObjectFormatSimple.proto */ #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ PyObject_Format(s, f)) #elif PY_MAJOR_VERSION < 3 #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\ PyObject_Format(s, f)) #elif CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\ likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\ PyObject_Format(s, f)) #else #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ PyObject_Format(s, f)) #endif /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AndObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_AndObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAnd(op1, op2) : PyNumber_And(op1, op2)) #endif /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_RshiftObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_RshiftObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceRshift(op1, op2) : PyNumber_Rshift(op1, op2)) #endif /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_LshiftObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_LshiftObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceLshift(op1, op2) : PyNumber_Lshift(op1, op2)) #endif /* PyObject_Unicode.proto */ #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyObject_Unicode(obj)\ (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj)) #else #define __Pyx_PyObject_Unicode(obj)\ (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj)) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* DivInt[int64_t].proto */ static CYTHON_INLINE int64_t __Pyx_div_int64_t(int64_t, int64_t); /* ModInt[int64_t].proto */ static CYTHON_INLINE int64_t __Pyx_mod_int64_t(int64_t, int64_t); /* DivInt[long].proto */ static CYTHON_INLINE long __Pyx_div_long(long, long); /* ModInt[long].proto */ static CYTHON_INLINE long __Pyx_mod_long(long, long); /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* HasAttr.proto */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_MultiplyObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2)) #endif /* py_abs.proto */ #if CYTHON_USE_PYLONG_INTERNALS static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num); #define __Pyx_PyNumber_Absolute(x)\ ((likely(PyLong_CheckExact(x))) ?\ (likely(__Pyx_PyLong_IsNonNeg(x)) ? (Py_INCREF(x), (x)) : __Pyx_PyLong_AbsNeg(x)) :\ PyNumber_Absolute(x)) #else #define __Pyx_PyNumber_Absolute(x) PyNumber_Absolute(x) #endif /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_AddCObj(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* CallNextTpTraverse.proto */ static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* SetVTable.proto */ static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable); /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* MergeVTables.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type); #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_11 #define __PYX_HAVE_RT_ImportType_proto_3_0_11 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_11 { __Pyx_ImportType_CheckSize_Error_3_0_11 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_11 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_11 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size); #endif /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* Py3UpdateBases.proto */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value); /* CIntFromPy.proto */ static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value); /* CIntFromPy.proto */ static CYTHON_INLINE int16_t __Pyx_PyInt_As_int16_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value); /* CIntFromPy.proto */ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int8_t __Pyx_PyInt_As_int8_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/ static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_s); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_len(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE char __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_type(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE int32_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_length(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_4year_year(PyDateTime_Date *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_5month_month(PyDateTime_Date *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_3day_day(PyDateTime_Date *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4hour_hour(PyDateTime_Time *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6minute_minute(PyDateTime_Time *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6second_second(PyDateTime_Time *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(PyDateTime_Time *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(PyDateTime_Time *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4fold_fold(PyDateTime_Time *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4year_year(PyDateTime_DateTime *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_5month_month(PyDateTime_DateTime *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_3day_day(PyDateTime_DateTime *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4hour_hour(PyDateTime_DateTime *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_6minute_minute(PyDateTime_DateTime *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_6second_second(PyDateTime_DateTime *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(PyDateTime_DateTime *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(PyDateTime_DateTime *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4fold_fold(PyDateTime_DateTime *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_3day_day(PyDateTime_Delta *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_6second_second(PyDateTime_Delta *__pyx_v_self); /* proto*/ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(PyDateTime_Delta *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__check_readonly(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__ensure_alloced(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, Py_ssize_t __pyx_v_extra_length); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__reallocate(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, Py_ssize_t __pyx_v_new_size); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_start_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, char __pyx_v_type); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_end_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_reset(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_buffer(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_byte(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, char __pyx_v_b); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_bytes(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_data); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_bytestring(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_string); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_str(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_string, PyObject *__pyx_v_encoding); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_buffer(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_bytes(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_data); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_frbuf(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_cstr(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, char const *__pyx_v_data, Py_ssize_t __pyx_v_len); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int16(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, int16_t __pyx_v_i); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, int32_t __pyx_v_i); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, int64_t __pyx_v_i); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_float(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, float __pyx_v_f); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_double(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, double __pyx_v_d); /* proto*/ static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_new_message(char __pyx_v_type); /* proto*/ static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_new(void); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_feed_data(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self, PyObject *__pyx_v_data); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__switch_to_next_buf(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE char const *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__try_read_bytes(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self, Py_ssize_t __pyx_v_nbytes); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__read_into(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self, char *__pyx_v_buf, Py_ssize_t __pyx_v_nbytes); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__read_and_discard(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self, Py_ssize_t __pyx_v_nbytes); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_bytes(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self, Py_ssize_t __pyx_v_nbytes); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_len_prefixed_bytes(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_len_prefixed_utf8(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_uuid(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE char __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_byte(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE int64_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_int64(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE int32_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_int32(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE int16_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_int16(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_null_str(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/ static int32_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_take_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE int32_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_take_message_type(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self, char __pyx_v_mtype); /* proto*/ static int32_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_put_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE char const *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_try_consume_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self, Py_ssize_t *__pyx_v_len); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_discard_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_consume_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_redirect_messages(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, char __pyx_v_mtype, struct __pyx_opt_args_7asyncpg_7pgproto_7pgproto_10ReadBuffer_redirect_messages *__pyx_optional_args); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_consume_messages(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self, char __pyx_v_mtype); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_finish_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__finish_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/ static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_new_message_parser(PyObject *__pyx_v_data); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_12CodecContext_get_text_codec(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_12CodecContext_is_encoding_utf8(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_12CodecContext_get_json_decoder(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_12CodecContext_is_decoding_json(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_12CodecContext_get_json_encoder(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_12CodecContext_is_encoding_json(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_self); /* proto*/ /* Module declarations from "cython" */ /* Module declarations from "cpython.version" */ /* Module declarations from "__builtin__" */ /* Module declarations from "cpython.type" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "cpython.object" */ /* Module declarations from "cpython.ref" */ /* Module declarations from "cpython.exc" */ /* Module declarations from "cpython.module" */ /* Module declarations from "cpython.mem" */ /* Module declarations from "cpython.tuple" */ /* Module declarations from "cpython.list" */ /* Module declarations from "cpython.sequence" */ /* Module declarations from "cpython.mapping" */ /* Module declarations from "cpython.iterator" */ /* Module declarations from "cpython.number" */ /* Module declarations from "cpython.int" */ /* Module declarations from "__builtin__" */ /* Module declarations from "cpython.bool" */ /* Module declarations from "cpython.long" */ /* Module declarations from "cpython.float" */ /* Module declarations from "__builtin__" */ /* Module declarations from "cpython.complex" */ /* Module declarations from "cpython.string" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "cpython.unicode" */ /* Module declarations from "cpython.pyport" */ /* Module declarations from "cpython.dict" */ /* Module declarations from "cpython.instance" */ /* Module declarations from "cpython.function" */ /* Module declarations from "cpython.method" */ /* Module declarations from "cpython.weakref" */ /* Module declarations from "cpython.getargs" */ /* Module declarations from "cpython.pythread" */ /* Module declarations from "cpython.pystate" */ /* Module declarations from "cpython.cobject" */ /* Module declarations from "cpython.oldbuffer" */ /* Module declarations from "cpython.set" */ /* Module declarations from "cpython.buffer" */ /* Module declarations from "cpython.bytes" */ /* Module declarations from "cpython.pycapsule" */ /* Module declarations from "cpython.contextvars" */ /* Module declarations from "datetime" */ /* Module declarations from "cpython.datetime" */ static CYTHON_INLINE void __pyx_f_7cpython_8datetime_import_datetime(void); /*proto*/ /* Module declarations from "cpython" */ /* Module declarations from "libc.stdint" */ /* Module declarations from "asyncpg.pgproto" */ /* Module declarations from "asyncpg.pgproto.cpythonx" */ /* Module declarations from "asyncpg.pgproto.hton" */ /* Module declarations from "asyncpg.pgproto.tohex" */ /* Module declarations from "asyncpg.pgproto.debug" */ /* Module declarations from "libc" */ /* Module declarations from "libc.math" */ /* Module declarations from "asyncpg.pgproto.pgproto" */ static char __pyx_v_7asyncpg_7pgproto_7pgproto__hextable[0x100]; static PyObject *__pyx_v_7asyncpg_7pgproto_7pgproto_std_UUID = 0; static PyObject *__pyx_v_7asyncpg_7pgproto_7pgproto_pg_UUID = 0; static int32_t __pyx_v_7asyncpg_7pgproto_7pgproto_pg_epoch_datetime_ts; static int32_t __pyx_v_7asyncpg_7pgproto_7pgproto_pg_epoch_datetime_utc_ts; static int32_t __pyx_v_7asyncpg_7pgproto_7pgproto_pg_date_offset_ord; static int64_t __pyx_v_7asyncpg_7pgproto_7pgproto_pg_time64_infinity; static int64_t __pyx_v_7asyncpg_7pgproto_7pgproto_pg_time64_negative_infinity; static int32_t __pyx_v_7asyncpg_7pgproto_7pgproto_pg_date_infinity; static int32_t __pyx_v_7asyncpg_7pgproto_7pgproto_pg_date_negative_infinity; static int32_t __pyx_v_7asyncpg_7pgproto_7pgproto_infinity_datetime_ord; static int64_t __pyx_v_7asyncpg_7pgproto_7pgproto_infinity_datetime_ts; static int32_t __pyx_v_7asyncpg_7pgproto_7pgproto_negative_infinity_datetime_ord; static int64_t __pyx_v_7asyncpg_7pgproto_7pgproto_negative_infinity_datetime_ts; static int32_t __pyx_v_7asyncpg_7pgproto_7pgproto_infinity_date_ord; static int32_t __pyx_v_7asyncpg_7pgproto_7pgproto_negative_infinity_date_ord; static CYTHON_INLINE char const *__pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, Py_ssize_t); /*proto*/ static CYTHON_INLINE char const *__pyx_f_7asyncpg_7pgproto_7pgproto_frb_read_all(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_frb_check(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, Py_ssize_t); /*proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_time_decode(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_as_pg_string_and_size(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, PyObject *, char **, Py_ssize_t *); /*proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_encode(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_binary_ex(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, int); /*proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_pg_uuid_bytes_from_str(PyObject *, char *); /*proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_pg_uuid_from_buf(char const *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_decode_pg_string(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, char const *, Py_ssize_t); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto__local_timezone(void); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto__encode_time(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int64_t, int32_t); /*proto*/ static CYTHON_INLINE int32_t __pyx_f_7asyncpg_7pgproto_7pgproto__decode_time(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, int64_t *, int32_t *); /*proto*/ static CYTHON_INLINE char *__pyx_f_7asyncpg_7pgproto_7pgproto__unpack_digit_stripping_lzeros(char *, int64_t); /*proto*/ static CYTHON_INLINE char *__pyx_f_7asyncpg_7pgproto_7pgproto__unpack_digit(char *, int64_t); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto__encode_points(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto__decode_points(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static CYTHON_INLINE uint8_t __pyx_f_7asyncpg_7pgproto_7pgproto__ip_max_prefix_len(int32_t); /*proto*/ static CYTHON_INLINE int32_t __pyx_f_7asyncpg_7pgproto_7pgproto__ip_addr_len(int32_t); /*proto*/ static CYTHON_INLINE int8_t __pyx_f_7asyncpg_7pgproto_7pgproto__ver_to_family(int32_t); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto__net_encode(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int8_t, uint32_t, int8_t, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_net_decode(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, int); /*proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto___pyx_unpickle___UUIDReplaceMe__set_state(struct __pyx_obj_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto___pyx_unpickle_CodecContext__set_state(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, PyObject *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "asyncpg.pgproto.pgproto" extern int __pyx_module_is_main_asyncpg__pgproto__pgproto; int __pyx_module_is_main_asyncpg__pgproto__pgproto = 0; /* Implementation of "asyncpg.pgproto.pgproto" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_AssertionError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_chr; static PyObject *__pyx_builtin_print; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_NotImplemented; static PyObject *__pyx_builtin_NotImplementedError; static PyObject *__pyx_builtin_OverflowError; static PyObject *__pyx_builtin_RuntimeError; /* #### Code section: string_decls ### */ static const char __pyx_k_F[] = "F"; static const char __pyx_k_N[] = "N"; static const char __pyx_k_n[] = "n"; static const char __pyx_k_0e[] = "0e-"; static const char __pyx_k__2[] = ""; static const char __pyx_k__3[] = "\000"; static const char __pyx_k__5[] = "')"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_Box[] = "Box"; static const char __pyx_k_Dec[] = "_Dec"; static const char __pyx_k_NaN[] = "NaN"; static const char __pyx_k__33[] = "."; static const char __pyx_k__34[] = "*"; static const char __pyx_k__54[] = "?"; static const char __pyx_k_add[] = "__add__"; static const char __pyx_k_big[] = "big"; static const char __pyx_k_chr[] = "chr"; static const char __pyx_k_day[] = "day"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_inp[] = "inp"; static const char __pyx_k_int[] = "int"; static const char __pyx_k_len[] = "__len__"; static const char __pyx_k_mro[] = "__mro__"; static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_now[] = "now"; static const char __pyx_k_utc[] = "utc"; static const char __pyx_k_Line[] = "Line"; static const char __pyx_k_Path[] = "Path"; static const char __pyx_k_UUID[] = "UUID('"; static const char __pyx_k_cidr[] = "cidr"; static const char __pyx_k_date[] = "date"; static const char __pyx_k_days[] = "days"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_find[] = "find"; static const char __pyx_k_hour[] = "hour"; static const char __pyx_k_inet[] = "inet"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_node[] = "node"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_sign[] = "sign"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_time[] = "time"; static const char __pyx_k_uuid[] = "uuid"; static const char __pyx_k_year[] = "year"; static const char __pyx_k_Point[] = "Point"; static const char __pyx_k_bases[] = "__bases__"; static const char __pyx_k_bytes[] = "bytes"; static const char __pyx_k_deque[] = "deque"; static const char __pyx_k_int_2[] = "__int__"; static const char __pyx_k_ipnet[] = "_ipnet"; static const char __pyx_k_items[] = "items"; static const char __pyx_k_month[] = "month"; static const char __pyx_k_print[] = "print"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_types[] = "types"; static const char __pyx_k_Circle[] = "Circle"; static const char __pyx_k_UUID_2[] = "UUID"; static const char __pyx_k_append[] = "append"; static const char __pyx_k_decode[] = "decode"; static const char __pyx_k_dict_2[] = "_dict"; static const char __pyx_k_digits[] = "digits"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_ipaddr[] = "_ipaddr"; static const char __pyx_k_minute[] = "minute"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_packed[] = "packed"; static const char __pyx_k_pickle[] = "pickle"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_second[] = "second"; static const char __pyx_k_tzinfo[] = "tzinfo"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_Decimal[] = "Decimal"; static const char __pyx_k_MAXYEAR[] = "MAXYEAR"; static const char __pyx_k_MINYEAR[] = "MINYEAR"; static const char __pyx_k_Polygon[] = "Polygon"; static const char __pyx_k_decimal[] = "decimal"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_ipiface[] = "_ipiface"; static const char __pyx_k_minutes[] = "minutes"; static const char __pyx_k_network[] = "network"; static const char __pyx_k_popleft[] = "popleft"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_replace[] = "replace"; static const char __pyx_k_seconds[] = "seconds"; static const char __pyx_k_unknown[] = "unknown"; static const char __pyx_k_variant[] = "variant"; static const char __pyx_k_version[] = "version"; static const char __pyx_k_Infinity[] = "Infinity"; static const char __pyx_k_RFC_4122[] = "RFC_4122"; static const char __pyx_k_SafeUUID[] = "SafeUUID"; static const char __pyx_k_as_tuple[] = "as_tuple"; static const char __pyx_k_datetime[] = "datetime"; static const char __pyx_k_exponent[] = "exponent"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_time_low[] = "time_low"; static const char __pyx_k_time_mid[] = "time_mid"; static const char __pyx_k_timezone[] = "timezone"; static const char __pyx_k_urn_uuid[] = "urn:uuid:"; static const char __pyx_k_BitString[] = "BitString"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_frombytes[] = "frombytes"; static const char __pyx_k_functools[] = "functools"; static const char __pyx_k_ipaddress[] = "ipaddress"; static const char __pyx_k_is_closed[] = "is_closed"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_prefixlen[] = "prefixlen"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_remaining[] = " remaining "; static const char __pyx_k_timedelta[] = "timedelta"; static const char __pyx_k_timestamp[] = "timestamp"; static const char __pyx_k_toordinal[] = "toordinal"; static const char __pyx_k_utcoffset[] = "utcoffset"; static const char __pyx_k_Infinity_2[] = "-Infinity"; static const char __pyx_k_ReadBuffer[] = "ReadBuffer"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_astimezone[] = "astimezone"; static const char __pyx_k_from_bytes[] = "from_bytes"; static const char __pyx_k_ip_address[] = "ip_address"; static const char __pyx_k_ip_network[] = "ip_network"; static const char __pyx_k_pyx_result[] = "__pyx_result"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_BufferError[] = "BufferError"; static const char __pyx_k_LineSegment[] = "LineSegment"; static const char __pyx_k_MemoryError[] = "MemoryError"; static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_WriteBuffer[] = "WriteBuffer"; static const char __pyx_k_collections[] = "collections"; static const char __pyx_k_fromordinal[] = "fromordinal"; static const char __pyx_k_microsecond[] = "microsecond"; static const char __pyx_k_mro_entries[] = "__mro_entries__"; static const char __pyx_k_CodecContext[] = "CodecContext"; static const char __pyx_k_RESERVED_NCS[] = "RESERVED_NCS"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_empty_buffer[] = "empty buffer"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_invalid_UUID[] = "invalid UUID "; static const char __pyx_k_ip_interface[] = "ip_interface"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_microseconds[] = "microseconds"; static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_use_setstate[] = "use_setstate"; static const char __pyx_k_OverflowError[] = "OverflowError"; static const char __pyx_k_UUIDReplaceMe[] = "__UUIDReplaceMe"; static const char __pyx_k_UUID___reduce[] = "UUID.__reduce__"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_clock_seq_low[] = "clock_seq_low"; static const char __pyx_k_infinity_date[] = "infinity_date"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_pg_epoch_date[] = "pg_epoch_date"; static const char __pyx_k_pgproto_types[] = "pgproto_types"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_AssertionError[] = "AssertionError"; static const char __pyx_k_NotImplemented[] = "NotImplemented"; static const char __pyx_k_get_text_codec[] = "get_text_codec"; static const char __pyx_k_RESERVED_FUTURE[] = "RESERVED_FUTURE"; static const char __pyx_k_buffer_overread[] = "buffer overread"; static const char __pyx_k_network_address[] = "network_address"; static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_string_too_long[] = "string too long"; static const char __pyx_k_time_hi_version[] = "time_hi_version"; static const char __pyx_k_expected_str_got[] = "expected str, got {}"; static const char __pyx_k_get_json_decoder[] = "get_json_decoder"; static const char __pyx_k_get_json_encoder[] = "get_json_encoder"; static const char __pyx_k_date_from_ordinal[] = "date_from_ordinal"; static const char __pyx_k_infinity_datetime[] = "infinity_datetime"; static const char __pyx_k_pg_epoch_datetime[] = "pg_epoch_datetime"; static const char __pyx_k_RESERVED_MICROSOFT[] = "RESERVED_MICROSOFT"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_bit_value_too_long[] = "bit value too long"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_empty_first_buffer[] = "empty first buffer"; static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; static const char __pyx_k_path_value_too_long[] = "path value too long"; static const char __pyx_k_string_is_too_large[] = "string is too large"; static const char __pyx_k_clock_seq_hi_variant[] = "clock_seq_hi_variant"; static const char __pyx_k_unexpected_character[] = ": unexpected character "; static const char __pyx_k_no_message_to_consume[] = "no message to consume"; static const char __pyx_k_no_message_to_discard[] = "no message to discard"; static const char __pyx_k_pg_epoch_datetime_utc[] = "pg_epoch_datetime_utc"; static const char __pyx_k_negative_infinity_date[] = "negative_infinity_date"; static const char __pyx_k_polygon_value_too_long[] = "polygon value too long"; static const char __pyx_k_asyncpg_pgproto_pgproto[] = "asyncpg.pgproto.pgproto"; static const char __pyx_k_unexpected_JSONB_format[] = "unexpected JSONB format: {}"; static const char __pyx_k_asyncpg_pgproto_uuid_pyx[] = "asyncpg/pgproto/./uuid.pyx"; static const char __pyx_k_value_out_of_int16_range[] = "value out of int16 range"; static const char __pyx_k_value_out_of_int32_range[] = "value out of int32 range"; static const char __pyx_k_value_out_of_int64_range[] = "value out of int64 range"; static const char __pyx_k_hstore_value_is_too_large[] = "hstore value is too large"; static const char __pyx_k_pyx_unpickle_CodecContext[] = "__pyx_unpickle_CodecContext"; static const char __pyx_k_value_out_of_uint32_range[] = "value out of uint32 range"; static const char __pyx_k_value_out_of_uint64_range[] = "value out of uint64 range"; static const char __pyx_k_16_bytes_were_expected_got[] = "16 bytes were expected, got "; static const char __pyx_k_ReadBuffer___reduce_cython[] = "ReadBuffer.__reduce_cython__"; static const char __pyx_k_negative_infinity_datetime[] = "negative_infinity_datetime"; static const char __pyx_k_unexpected_jsonpath_format[] = "unexpected jsonpath format: {}"; static const char __pyx_k_value_out_of_float32_range[] = "value out of float32 range"; static const char __pyx_k_CodecContext_get_text_codec[] = "CodecContext.get_text_codec"; static const char __pyx_k_WriteBuffer___reduce_cython[] = "WriteBuffer.__reduce_cython__"; static const char __pyx_k_CodecContext___reduce_cython[] = "CodecContext.__reduce_cython__"; static const char __pyx_k_ReadBuffer___setstate_cython[] = "ReadBuffer.__setstate_cython__"; static const char __pyx_k_pyx_unpickle___UUIDReplaceMe[] = "__pyx_unpickle___UUIDReplaceMe"; static const char __pyx_k_CodecContext_get_json_decoder[] = "CodecContext.get_json_decoder"; static const char __pyx_k_CodecContext_get_json_encoder[] = "CodecContext.get_json_encoder"; static const char __pyx_k_UUIDReplaceMe___reduce_cython[] = "__UUIDReplaceMe.__reduce_cython__"; static const char __pyx_k_WriteBuffer___setstate_cython[] = "WriteBuffer.__setstate_cython__"; static const char __pyx_k_decodes_to_less_than_16_bytes[] = ": decodes to less than 16 bytes"; static const char __pyx_k_decodes_to_more_than_16_bytes[] = ": decodes to more than 16 bytes"; static const char __pyx_k_not_enough_data_to_read_bytes[] = "not enough data to read {} bytes"; static const char __pyx_k_read_null_str_buffer_overread[] = "read_null_str: buffer overread"; static const char __pyx_k_CodecContext___setstate_cython[] = "CodecContext.__setstate_cython__"; static const char __pyx_k_UUIDReplaceMe___setstate_cytho[] = "__UUIDReplaceMe.__setstate_cython__"; static const char __pyx_k_a_boolean_is_required_got_type[] = "a boolean is required (got type {})"; static const char __pyx_k_consume_full_messages_called_on[] = "consume_full_messages called on a buffer without a complete first message"; static const char __pyx_k_discarding_message_r_unread_dat[] = "!!! discarding message {!r} unread data: {!r}"; static const char __pyx_k_end_message_buffer_is_too_small[] = "end_message: buffer is too small"; static const char __pyx_k_invalid_address_family_in_value[] = "invalid address family in \"{}\" value"; static const char __pyx_k_invalid_address_length_in_value[] = "invalid address length in \"{}\" value"; static const char __pyx_k_length_must_be_between_32_36_ch[] = ": length must be between 32..36 characters, got "; static const char __pyx_k_list_or_tuple_expected_got_type[] = "list or tuple expected (got type {})"; static const char __pyx_k_the_buffer_is_in_read_only_mode[] = "the buffer is in read-only mode"; static const char __pyx_k_txid_snapshot_value_is_too_long[] = "txid_snapshot value is too long"; static const char __pyx_k_unexpected_CIDR_flag_set_in_non[] = "unexpected CIDR flag set in non-cidr value"; static const char __pyx_k_Deallocating_buffer_with_attache[] = "Deallocating buffer with attached memoryviews"; static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())"; static const char __pyx_k_Time_zones_are_not_available_fro[] = "Time zones are not available from the C-API."; static const char __pyx_k_a_bytes_or_str_object_expected_g[] = "a bytes or str object expected, got "; static const char __pyx_k_asyncpg_pgproto_codecs_context_p[] = "asyncpg/pgproto/./codecs/context.pyx"; static const char __pyx_k_cannot_decode_UUID_expected_16_b[] = "cannot decode UUID, expected 16 bytes, got "; static const char __pyx_k_cannot_encode_Decimal_value_into[] = "cannot encode Decimal value into numeric: exponent is too small"; static const char __pyx_k_cannot_put_message_no_message_ta[] = "cannot put message: no message taken"; static const char __pyx_k_cannot_start_message_for_a_non_e[] = "cannot start_message for a non-empty buffer"; static const char __pyx_k_consume_full_messages_called_wit[] = "consume_full_messages called with a wrong mtype"; static const char __pyx_k_date_tuple_encoder_expecting_1_e[] = "date tuple encoder: expecting 1 element in tuple, got {}"; static const char __pyx_k_debug_first_buffer_of_ReadBuffer[] = "debug: first buffer of ReadBuffer is empty"; static const char __pyx_k_debug_second_buffer_of_ReadBuffe[] = "debug: second buffer of ReadBuffer is empty"; static const char __pyx_k_end_message_can_only_be_called_w[] = "end_message can only be called with start_message"; static const char __pyx_k_end_message_message_is_too_large[] = "end_message: message is too large"; static const char __pyx_k_expected_a_datetime_date_or_date[] = "expected a datetime.date or datetime.datetime instance, got {!r}"; static const char __pyx_k_failed_to_read_one_byte_on_a_non[] = "failed to read one byte on a non-empty buffer"; static const char __pyx_k_feed_data_a_bytes_or_bytearray_o[] = "feed_data: a bytes or bytearray object expected"; static const char __pyx_k_insufficient_data_in_buffer_requ[] = "insufficient data in buffer: requested "; static const char __pyx_k_interval_tuple_encoder_expecting[] = "interval tuple encoder: expecting 3 elements in tuple, got {}"; static const char __pyx_k_invalid_UUID_u_r_unexpected_char[] = "invalid UUID {u!r}: unexpected character"; static const char __pyx_k_invalid_network_prefix_length_in[] = "invalid network prefix length in \"{}\" value"; static const char __pyx_k_invalid_number_of_elements_in_ti[] = "invalid number of elements in tid tuple, expecting 2"; static const char __pyx_k_invalid_number_of_elements_in_tx[] = "invalid number of elements in txid_snapshot tuple, expecting 4"; static const char __pyx_k_negative_length_for_a_len_prefix[] = "negative length for a len-prefixed bytes value"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; static const char __pyx_k_not_enough_data_to_read_one_byte[] = "not enough data to read one byte"; static const char __pyx_k_null_value_not_allowed_in_hstore[] = "null value not allowed in hstore key"; static const char __pyx_k_read_null_str_only_works_when_th[] = "read_null_str only works when the message guaranteed to be in the buffer"; static const char __pyx_k_time_tuple_encoder_expecting_1_e[] = "time tuple encoder: expecting 1 element in tuple, got {}"; static const char __pyx_k_time_tuple_encoder_expecting_2_e[] = "time tuple encoder: expecting 2 elements2 in tuple, got {}"; static const char __pyx_k_timestamp_tuple_encoder_expectin[] = "timestamp tuple encoder: expecting 1 element in tuple, got {}"; static const char __pyx_k_tuple_id_block_value_out_of_uint[] = "tuple id block value out of uint32 range"; static const char __pyx_k_tuple_id_offset_value_out_of_uin[] = "tuple id offset value out of uint16 range"; static const char __pyx_k_consume_full_messages_called_on_2[] = "consume_full_messages called on a partially read message"; static const char __pyx_k_cannot_encode_Decimal_value_into_2[] = "cannot encode Decimal value into numeric: exponent is too large"; static const char __pyx_k_cannot_encode_Decimal_value_into_3[] = "cannot encode Decimal value into numeric: number of digits is too large"; /* #### Code section: decls ### */ static int __pyx_pf_7asyncpg_7pgproto_7pgproto_11WriteBuffer___cinit__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self); /* proto */ static void __pyx_pf_7asyncpg_7pgproto_7pgproto_11WriteBuffer_2__dealloc__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self); /* proto */ static int __pyx_pf_7asyncpg_7pgproto_7pgproto_11WriteBuffer_4__getbuffer__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /* proto */ static void __pyx_pf_7asyncpg_7pgproto_7pgproto_11WriteBuffer_6__releasebuffer__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, CYTHON_UNUSED Py_buffer *__pyx_v_buffer); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_11WriteBuffer_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_11WriteBuffer_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7asyncpg_7pgproto_7pgproto_10ReadBuffer___cinit__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_10ReadBuffer_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_10ReadBuffer_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_15__UUIDReplaceMe___reduce_cython__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_15__UUIDReplaceMe_2__setstate_cython__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID___cinit__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static int __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_2__init__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self, PyObject *__pyx_v_inp); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_5bytes___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_3int___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_7is_safe___get__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_4__str__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_3hex___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_6__repr__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_8__reduce__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_10__eq__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_12__ne__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_14__lt__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_16__gt__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_18__le__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_20__ge__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static Py_hash_t __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_22__hash__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_24__int__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_8bytes_le___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_6fields___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_8time_low___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_8time_mid___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_15time_hi_version___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_20clock_seq_hi_variant___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_13clock_seq_low___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_4time___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_9clock_seq___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_4node___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_3urn___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_7variant___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_7version___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_12CodecContext_get_text_codec(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_12CodecContext_2get_json_decoder(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_12CodecContext_4get_json_encoder(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_12CodecContext_6__reduce_cython__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_12CodecContext_8__setstate_cython__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto___pyx_unpickle___UUIDReplaceMe(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_2__pyx_unpickle_CodecContext(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_7asyncpg_7pgproto_7pgproto_WriteBuffer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_7pgproto_7pgproto_ReadBuffer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_7pgproto_7pgproto_CodecContext(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_7pgproto_7pgproto_UUID(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_7cpython_4type_type; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_7cpython_4bool_bool; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_7cpython_7complex_complex; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_7cpython_8datetime_date; PyTypeObject *__pyx_ptype_7cpython_8datetime_time; PyTypeObject *__pyx_ptype_7cpython_8datetime_datetime; PyTypeObject *__pyx_ptype_7cpython_8datetime_timedelta; PyTypeObject *__pyx_ptype_7cpython_8datetime_tzinfo; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_7asyncpg_7pgproto_7pgproto_WriteBuffer; PyObject *__pyx_type_7asyncpg_7pgproto_7pgproto_ReadBuffer; PyObject *__pyx_type_7asyncpg_7pgproto_7pgproto_CodecContext; PyObject *__pyx_type_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe; PyObject *__pyx_type_7asyncpg_7pgproto_7pgproto_UUID; #endif PyTypeObject *__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer; PyTypeObject *__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer; PyTypeObject *__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext; PyTypeObject *__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe; PyTypeObject *__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID; PyObject *__pyx_kp_u_0e; PyObject *__pyx_kp_u_16_bytes_were_expected_got; PyObject *__pyx_n_s_AssertionError; PyObject *__pyx_n_s_BitString; PyObject *__pyx_n_s_Box; PyObject *__pyx_n_s_BufferError; PyObject *__pyx_n_s_Circle; PyObject *__pyx_n_s_CodecContext; PyObject *__pyx_n_s_CodecContext___reduce_cython; PyObject *__pyx_n_s_CodecContext___setstate_cython; PyObject *__pyx_n_s_CodecContext_get_json_decoder; PyObject *__pyx_n_s_CodecContext_get_json_encoder; PyObject *__pyx_n_s_CodecContext_get_text_codec; PyObject *__pyx_kp_u_Deallocating_buffer_with_attache; PyObject *__pyx_n_s_Dec; PyObject *__pyx_n_s_Decimal; PyObject *__pyx_n_u_F; PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0; PyObject *__pyx_n_u_Infinity; PyObject *__pyx_kp_u_Infinity_2; PyObject *__pyx_n_s_Line; PyObject *__pyx_n_s_LineSegment; PyObject *__pyx_n_s_MAXYEAR; PyObject *__pyx_n_s_MINYEAR; PyObject *__pyx_n_s_MemoryError; PyObject *__pyx_n_u_N; PyObject *__pyx_n_u_NaN; PyObject *__pyx_n_s_NotImplemented; PyObject *__pyx_n_s_NotImplementedError; PyObject *__pyx_n_s_OverflowError; PyObject *__pyx_n_s_Path; PyObject *__pyx_n_s_PickleError; PyObject *__pyx_n_s_Point; PyObject *__pyx_n_s_Polygon; PyObject *__pyx_n_s_RESERVED_FUTURE; PyObject *__pyx_n_s_RESERVED_MICROSOFT; PyObject *__pyx_n_s_RESERVED_NCS; PyObject *__pyx_n_s_RFC_4122; PyObject *__pyx_n_s_ReadBuffer; PyObject *__pyx_n_s_ReadBuffer___reduce_cython; PyObject *__pyx_n_s_ReadBuffer___setstate_cython; PyObject *__pyx_n_s_RuntimeError; PyObject *__pyx_n_s_SafeUUID; PyObject *__pyx_kp_u_Time_zones_are_not_available_fro; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_kp_u_UUID; PyObject *__pyx_n_s_UUIDReplaceMe; PyObject *__pyx_n_s_UUIDReplaceMe___reduce_cython; PyObject *__pyx_n_s_UUIDReplaceMe___setstate_cytho; PyObject *__pyx_n_s_UUID_2; PyObject *__pyx_n_s_UUID___reduce; PyObject *__pyx_n_s_ValueError; PyObject *__pyx_n_s_WriteBuffer; PyObject *__pyx_n_s_WriteBuffer___reduce_cython; PyObject *__pyx_n_s_WriteBuffer___setstate_cython; PyObject *__pyx_n_s__2; PyObject *__pyx_kp_b__2; PyObject *__pyx_kp_u__2; PyObject *__pyx_kp_b__3; PyObject *__pyx_kp_u__33; PyObject *__pyx_n_s__34; PyObject *__pyx_kp_u__5; PyObject *__pyx_n_s__54; PyObject *__pyx_kp_u_a_boolean_is_required_got_type; PyObject *__pyx_kp_u_a_bytes_or_str_object_expected_g; PyObject *__pyx_n_s_add; PyObject *__pyx_n_s_append; PyObject *__pyx_n_s_as_tuple; PyObject *__pyx_n_s_astimezone; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_kp_s_asyncpg_pgproto_codecs_context_p; PyObject *__pyx_n_s_asyncpg_pgproto_pgproto; PyObject *__pyx_kp_s_asyncpg_pgproto_uuid_pyx; PyObject *__pyx_n_s_bases; PyObject *__pyx_n_u_big; PyObject *__pyx_kp_u_bit_value_too_long; PyObject *__pyx_kp_u_buffer_overread; PyObject *__pyx_n_s_bytes; PyObject *__pyx_kp_u_cannot_decode_UUID_expected_16_b; PyObject *__pyx_kp_u_cannot_encode_Decimal_value_into; PyObject *__pyx_kp_u_cannot_encode_Decimal_value_into_2; PyObject *__pyx_kp_u_cannot_encode_Decimal_value_into_3; PyObject *__pyx_kp_u_cannot_put_message_no_message_ta; PyObject *__pyx_kp_u_cannot_start_message_for_a_non_e; PyObject *__pyx_n_s_chr; PyObject *__pyx_n_u_cidr; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_clock_seq_hi_variant; PyObject *__pyx_n_s_clock_seq_low; PyObject *__pyx_n_s_collections; PyObject *__pyx_kp_u_consume_full_messages_called_on; PyObject *__pyx_kp_u_consume_full_messages_called_on_2; PyObject *__pyx_kp_u_consume_full_messages_called_wit; PyObject *__pyx_n_s_date; PyObject *__pyx_n_s_date_from_ordinal; PyObject *__pyx_kp_u_date_tuple_encoder_expecting_1_e; PyObject *__pyx_n_s_datetime; PyObject *__pyx_n_s_day; PyObject *__pyx_n_s_days; PyObject *__pyx_kp_u_debug_first_buffer_of_ReadBuffer; PyObject *__pyx_kp_u_debug_second_buffer_of_ReadBuffe; PyObject *__pyx_n_s_decimal; PyObject *__pyx_n_s_decode; PyObject *__pyx_kp_u_decodes_to_less_than_16_bytes; PyObject *__pyx_kp_u_decodes_to_more_than_16_bytes; PyObject *__pyx_n_s_deque; PyObject *__pyx_n_s_dict; PyObject *__pyx_n_s_dict_2; PyObject *__pyx_n_s_digits; PyObject *__pyx_kp_u_disable; PyObject *__pyx_kp_u_discarding_message_r_unread_dat; PyObject *__pyx_n_s_doc; PyObject *__pyx_kp_u_empty_buffer; PyObject *__pyx_kp_u_empty_first_buffer; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_encode; PyObject *__pyx_kp_u_end_message_buffer_is_too_small; PyObject *__pyx_kp_u_end_message_can_only_be_called_w; PyObject *__pyx_kp_u_end_message_message_is_too_large; PyObject *__pyx_kp_u_expected_a_datetime_date_or_date; PyObject *__pyx_kp_u_expected_str_got; PyObject *__pyx_n_s_exponent; PyObject *__pyx_kp_u_failed_to_read_one_byte_on_a_non; PyObject *__pyx_kp_u_feed_data_a_bytes_or_bytearray_o; PyObject *__pyx_n_s_find; PyObject *__pyx_n_s_format; PyObject *__pyx_n_s_from_bytes; PyObject *__pyx_n_s_frombytes; PyObject *__pyx_n_s_fromordinal; PyObject *__pyx_n_s_functools; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get_json_decoder; PyObject *__pyx_n_s_get_json_encoder; PyObject *__pyx_n_s_get_text_codec; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_hour; PyObject *__pyx_kp_u_hstore_value_is_too_large; PyObject *__pyx_n_s_import; PyObject *__pyx_n_u_inet; PyObject *__pyx_n_s_infinity_date; PyObject *__pyx_n_s_infinity_datetime; PyObject *__pyx_n_s_init_subclass; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_s_inp; PyObject *__pyx_kp_u_insufficient_data_in_buffer_requ; PyObject *__pyx_n_s_int; PyObject *__pyx_n_u_int_2; PyObject *__pyx_kp_u_interval_tuple_encoder_expecting; PyObject *__pyx_kp_u_invalid_UUID; PyObject *__pyx_kp_u_invalid_UUID_u_r_unexpected_char; PyObject *__pyx_kp_u_invalid_address_family_in_value; PyObject *__pyx_kp_u_invalid_address_length_in_value; PyObject *__pyx_kp_u_invalid_network_prefix_length_in; PyObject *__pyx_kp_u_invalid_number_of_elements_in_ti; PyObject *__pyx_kp_u_invalid_number_of_elements_in_tx; PyObject *__pyx_n_s_ip_address; PyObject *__pyx_n_s_ip_interface; PyObject *__pyx_n_s_ip_network; PyObject *__pyx_n_s_ipaddr; PyObject *__pyx_n_s_ipaddress; PyObject *__pyx_n_s_ipiface; PyObject *__pyx_n_s_ipnet; PyObject *__pyx_n_s_is_closed; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_items; PyObject *__pyx_n_u_items; PyObject *__pyx_n_s_len; PyObject *__pyx_kp_u_length_must_be_between_32_36_ch; PyObject *__pyx_kp_u_list_or_tuple_expected_got_type; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_metaclass; PyObject *__pyx_n_s_microsecond; PyObject *__pyx_n_s_microseconds; PyObject *__pyx_n_s_minute; PyObject *__pyx_n_s_minutes; PyObject *__pyx_n_s_module; PyObject *__pyx_n_s_month; PyObject *__pyx_n_s_mro; PyObject *__pyx_n_s_mro_entries; PyObject *__pyx_n_u_n; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_negative_infinity_date; PyObject *__pyx_n_s_negative_infinity_datetime; PyObject *__pyx_kp_u_negative_length_for_a_len_prefix; PyObject *__pyx_n_s_network; PyObject *__pyx_n_s_network_address; PyObject *__pyx_n_s_new; PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_kp_u_no_message_to_consume; PyObject *__pyx_kp_u_no_message_to_discard; PyObject *__pyx_n_s_node; PyObject *__pyx_kp_u_not_enough_data_to_read_bytes; PyObject *__pyx_kp_u_not_enough_data_to_read_one_byte; PyObject *__pyx_n_s_now; PyObject *__pyx_kp_u_null_value_not_allowed_in_hstore; PyObject *__pyx_n_s_packed; PyObject *__pyx_kp_u_path_value_too_long; PyObject *__pyx_n_s_pg_epoch_date; PyObject *__pyx_n_s_pg_epoch_datetime; PyObject *__pyx_n_s_pg_epoch_datetime_utc; PyObject *__pyx_n_s_pgproto_types; PyObject *__pyx_n_s_pickle; PyObject *__pyx_kp_u_polygon_value_too_long; PyObject *__pyx_n_s_popleft; PyObject *__pyx_n_s_prefixlen; PyObject *__pyx_n_s_prepare; PyObject *__pyx_n_s_print; PyObject *__pyx_n_s_pyx_PickleError; PyObject *__pyx_n_s_pyx_checksum; PyObject *__pyx_n_s_pyx_result; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_pyx_type; PyObject *__pyx_n_s_pyx_unpickle_CodecContext; PyObject *__pyx_n_s_pyx_unpickle___UUIDReplaceMe; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_qualname; PyObject *__pyx_n_s_range; PyObject *__pyx_kp_u_read_null_str_buffer_overread; PyObject *__pyx_kp_u_read_null_str_only_works_when_th; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_kp_u_remaining; PyObject *__pyx_n_s_replace; PyObject *__pyx_n_s_second; PyObject *__pyx_n_s_seconds; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_name; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_sign; PyObject *__pyx_n_s_spec; PyObject *__pyx_n_s_state; PyObject *__pyx_kp_u_string_is_too_large; PyObject *__pyx_kp_u_string_too_long; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_super; PyObject *__pyx_n_s_test; PyObject *__pyx_kp_u_the_buffer_is_in_read_only_mode; PyObject *__pyx_n_s_time; PyObject *__pyx_n_s_time_hi_version; PyObject *__pyx_n_s_time_low; PyObject *__pyx_n_s_time_mid; PyObject *__pyx_kp_u_time_tuple_encoder_expecting_1_e; PyObject *__pyx_kp_u_time_tuple_encoder_expecting_2_e; PyObject *__pyx_n_s_timedelta; PyObject *__pyx_n_s_timestamp; PyObject *__pyx_kp_u_timestamp_tuple_encoder_expectin; PyObject *__pyx_n_s_timezone; PyObject *__pyx_n_s_toordinal; PyObject *__pyx_kp_u_tuple_id_block_value_out_of_uint; PyObject *__pyx_kp_u_tuple_id_offset_value_out_of_uin; PyObject *__pyx_kp_u_txid_snapshot_value_is_too_long; PyObject *__pyx_n_s_types; PyObject *__pyx_n_s_tzinfo; PyObject *__pyx_kp_u_unexpected_CIDR_flag_set_in_non; PyObject *__pyx_kp_u_unexpected_JSONB_format; PyObject *__pyx_kp_u_unexpected_character; PyObject *__pyx_kp_u_unexpected_jsonpath_format; PyObject *__pyx_n_s_unknown; PyObject *__pyx_n_s_update; PyObject *__pyx_kp_u_urn_uuid; PyObject *__pyx_n_s_use_setstate; PyObject *__pyx_n_s_utc; PyObject *__pyx_n_s_utcoffset; PyObject *__pyx_n_s_uuid; PyObject *__pyx_kp_u_value_out_of_float32_range; PyObject *__pyx_kp_u_value_out_of_int16_range; PyObject *__pyx_kp_u_value_out_of_int32_range; PyObject *__pyx_kp_u_value_out_of_int64_range; PyObject *__pyx_kp_u_value_out_of_uint32_range; PyObject *__pyx_kp_u_value_out_of_uint64_range; PyObject *__pyx_n_s_variant; PyObject *__pyx_n_s_version; PyObject *__pyx_n_s_year; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_3; PyObject *__pyx_int_5; PyObject *__pyx_int_7; PyObject *__pyx_int_8; PyObject *__pyx_int_10; PyObject *__pyx_int_12; PyObject *__pyx_int_15; PyObject *__pyx_int_20; PyObject *__pyx_int_23; PyObject *__pyx_int_31; PyObject *__pyx_int_32; PyObject *__pyx_int_48; PyObject *__pyx_int_56; PyObject *__pyx_int_59; PyObject *__pyx_int_63; PyObject *__pyx_int_64; PyObject *__pyx_int_76; PyObject *__pyx_int_80; PyObject *__pyx_int_96; PyObject *__pyx_int_100; PyObject *__pyx_int_255; PyObject *__pyx_int_1000; PyObject *__pyx_int_2000; PyObject *__pyx_int_4095; PyObject *__pyx_int_65535; PyObject *__pyx_int_999999; PyObject *__pyx_int_222419149; PyObject *__pyx_int_228825662; PyObject *__pyx_int_238750788; PyObject *__pyx_int_0xffffffffffff; PyObject *__pyx_int_0x2000000000000000; PyObject *__pyx_int_0x4000000000000000; PyObject *__pyx_int_0x8000000000000000; PyObject *__pyx_int_neg_1; PyObject *__pyx_tuple_; PyObject *__pyx_slice__6; PyObject *__pyx_slice__7; PyObject *__pyx_slice__8; PyObject *__pyx_slice__9; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__13; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__15; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__18; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__20; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__23; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__25; PyObject *__pyx_tuple__26; PyObject *__pyx_tuple__27; PyObject *__pyx_tuple__28; PyObject *__pyx_tuple__29; PyObject *__pyx_tuple__30; PyObject *__pyx_tuple__31; PyObject *__pyx_tuple__32; PyObject *__pyx_tuple__35; PyObject *__pyx_tuple__37; PyObject *__pyx_tuple__41; PyObject *__pyx_tuple__50; PyObject *__pyx_tuple__51; PyObject *__pyx_codeobj__36; PyObject *__pyx_codeobj__38; PyObject *__pyx_codeobj__39; PyObject *__pyx_codeobj__40; PyObject *__pyx_codeobj__42; PyObject *__pyx_codeobj__43; PyObject *__pyx_codeobj__44; PyObject *__pyx_codeobj__45; PyObject *__pyx_codeobj__46; PyObject *__pyx_codeobj__47; PyObject *__pyx_codeobj__48; PyObject *__pyx_codeobj__49; PyObject *__pyx_codeobj__52; PyObject *__pyx_codeobj__53; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool); Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex); Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_date); Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_time); Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_datetime); Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_timedelta); Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_tzinfo); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_7pgproto_7pgproto_WriteBuffer); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_7pgproto_7pgproto_ReadBuffer); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_7pgproto_7pgproto_CodecContext); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_7pgproto_7pgproto_UUID); Py_CLEAR(clear_module_state->__pyx_kp_u_0e); Py_CLEAR(clear_module_state->__pyx_kp_u_16_bytes_were_expected_got); Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError); Py_CLEAR(clear_module_state->__pyx_n_s_BitString); Py_CLEAR(clear_module_state->__pyx_n_s_Box); Py_CLEAR(clear_module_state->__pyx_n_s_BufferError); Py_CLEAR(clear_module_state->__pyx_n_s_Circle); Py_CLEAR(clear_module_state->__pyx_n_s_CodecContext); Py_CLEAR(clear_module_state->__pyx_n_s_CodecContext___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_CodecContext___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_CodecContext_get_json_decoder); Py_CLEAR(clear_module_state->__pyx_n_s_CodecContext_get_json_encoder); Py_CLEAR(clear_module_state->__pyx_n_s_CodecContext_get_text_codec); Py_CLEAR(clear_module_state->__pyx_kp_u_Deallocating_buffer_with_attache); Py_CLEAR(clear_module_state->__pyx_n_s_Dec); Py_CLEAR(clear_module_state->__pyx_n_s_Decimal); Py_CLEAR(clear_module_state->__pyx_n_u_F); Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); Py_CLEAR(clear_module_state->__pyx_n_u_Infinity); Py_CLEAR(clear_module_state->__pyx_kp_u_Infinity_2); Py_CLEAR(clear_module_state->__pyx_n_s_Line); Py_CLEAR(clear_module_state->__pyx_n_s_LineSegment); Py_CLEAR(clear_module_state->__pyx_n_s_MAXYEAR); Py_CLEAR(clear_module_state->__pyx_n_s_MINYEAR); Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError); Py_CLEAR(clear_module_state->__pyx_n_u_N); Py_CLEAR(clear_module_state->__pyx_n_u_NaN); Py_CLEAR(clear_module_state->__pyx_n_s_NotImplemented); Py_CLEAR(clear_module_state->__pyx_n_s_NotImplementedError); Py_CLEAR(clear_module_state->__pyx_n_s_OverflowError); Py_CLEAR(clear_module_state->__pyx_n_s_Path); Py_CLEAR(clear_module_state->__pyx_n_s_PickleError); Py_CLEAR(clear_module_state->__pyx_n_s_Point); Py_CLEAR(clear_module_state->__pyx_n_s_Polygon); Py_CLEAR(clear_module_state->__pyx_n_s_RESERVED_FUTURE); Py_CLEAR(clear_module_state->__pyx_n_s_RESERVED_MICROSOFT); Py_CLEAR(clear_module_state->__pyx_n_s_RESERVED_NCS); Py_CLEAR(clear_module_state->__pyx_n_s_RFC_4122); Py_CLEAR(clear_module_state->__pyx_n_s_ReadBuffer); Py_CLEAR(clear_module_state->__pyx_n_s_ReadBuffer___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_ReadBuffer___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_RuntimeError); Py_CLEAR(clear_module_state->__pyx_n_s_SafeUUID); Py_CLEAR(clear_module_state->__pyx_kp_u_Time_zones_are_not_available_fro); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_kp_u_UUID); Py_CLEAR(clear_module_state->__pyx_n_s_UUIDReplaceMe); Py_CLEAR(clear_module_state->__pyx_n_s_UUIDReplaceMe___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_UUIDReplaceMe___setstate_cytho); Py_CLEAR(clear_module_state->__pyx_n_s_UUID_2); Py_CLEAR(clear_module_state->__pyx_n_s_UUID___reduce); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); Py_CLEAR(clear_module_state->__pyx_n_s_WriteBuffer); Py_CLEAR(clear_module_state->__pyx_n_s_WriteBuffer___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_WriteBuffer___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s__2); Py_CLEAR(clear_module_state->__pyx_kp_b__2); Py_CLEAR(clear_module_state->__pyx_kp_u__2); Py_CLEAR(clear_module_state->__pyx_kp_b__3); Py_CLEAR(clear_module_state->__pyx_kp_u__33); Py_CLEAR(clear_module_state->__pyx_n_s__34); Py_CLEAR(clear_module_state->__pyx_kp_u__5); Py_CLEAR(clear_module_state->__pyx_n_s__54); Py_CLEAR(clear_module_state->__pyx_kp_u_a_boolean_is_required_got_type); Py_CLEAR(clear_module_state->__pyx_kp_u_a_bytes_or_str_object_expected_g); Py_CLEAR(clear_module_state->__pyx_n_s_add); Py_CLEAR(clear_module_state->__pyx_n_s_append); Py_CLEAR(clear_module_state->__pyx_n_s_as_tuple); Py_CLEAR(clear_module_state->__pyx_n_s_astimezone); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_kp_s_asyncpg_pgproto_codecs_context_p); Py_CLEAR(clear_module_state->__pyx_n_s_asyncpg_pgproto_pgproto); Py_CLEAR(clear_module_state->__pyx_kp_s_asyncpg_pgproto_uuid_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_bases); Py_CLEAR(clear_module_state->__pyx_n_u_big); Py_CLEAR(clear_module_state->__pyx_kp_u_bit_value_too_long); Py_CLEAR(clear_module_state->__pyx_kp_u_buffer_overread); Py_CLEAR(clear_module_state->__pyx_n_s_bytes); Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_decode_UUID_expected_16_b); Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_encode_Decimal_value_into); Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_encode_Decimal_value_into_2); Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_encode_Decimal_value_into_3); Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_put_message_no_message_ta); Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_start_message_for_a_non_e); Py_CLEAR(clear_module_state->__pyx_n_s_chr); Py_CLEAR(clear_module_state->__pyx_n_u_cidr); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_clock_seq_hi_variant); Py_CLEAR(clear_module_state->__pyx_n_s_clock_seq_low); Py_CLEAR(clear_module_state->__pyx_n_s_collections); Py_CLEAR(clear_module_state->__pyx_kp_u_consume_full_messages_called_on); Py_CLEAR(clear_module_state->__pyx_kp_u_consume_full_messages_called_on_2); Py_CLEAR(clear_module_state->__pyx_kp_u_consume_full_messages_called_wit); Py_CLEAR(clear_module_state->__pyx_n_s_date); Py_CLEAR(clear_module_state->__pyx_n_s_date_from_ordinal); Py_CLEAR(clear_module_state->__pyx_kp_u_date_tuple_encoder_expecting_1_e); Py_CLEAR(clear_module_state->__pyx_n_s_datetime); Py_CLEAR(clear_module_state->__pyx_n_s_day); Py_CLEAR(clear_module_state->__pyx_n_s_days); Py_CLEAR(clear_module_state->__pyx_kp_u_debug_first_buffer_of_ReadBuffer); Py_CLEAR(clear_module_state->__pyx_kp_u_debug_second_buffer_of_ReadBuffe); Py_CLEAR(clear_module_state->__pyx_n_s_decimal); Py_CLEAR(clear_module_state->__pyx_n_s_decode); Py_CLEAR(clear_module_state->__pyx_kp_u_decodes_to_less_than_16_bytes); Py_CLEAR(clear_module_state->__pyx_kp_u_decodes_to_more_than_16_bytes); Py_CLEAR(clear_module_state->__pyx_n_s_deque); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_n_s_dict_2); Py_CLEAR(clear_module_state->__pyx_n_s_digits); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_kp_u_discarding_message_r_unread_dat); Py_CLEAR(clear_module_state->__pyx_n_s_doc); Py_CLEAR(clear_module_state->__pyx_kp_u_empty_buffer); Py_CLEAR(clear_module_state->__pyx_kp_u_empty_first_buffer); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_encode); Py_CLEAR(clear_module_state->__pyx_kp_u_end_message_buffer_is_too_small); Py_CLEAR(clear_module_state->__pyx_kp_u_end_message_can_only_be_called_w); Py_CLEAR(clear_module_state->__pyx_kp_u_end_message_message_is_too_large); Py_CLEAR(clear_module_state->__pyx_kp_u_expected_a_datetime_date_or_date); Py_CLEAR(clear_module_state->__pyx_kp_u_expected_str_got); Py_CLEAR(clear_module_state->__pyx_n_s_exponent); Py_CLEAR(clear_module_state->__pyx_kp_u_failed_to_read_one_byte_on_a_non); Py_CLEAR(clear_module_state->__pyx_kp_u_feed_data_a_bytes_or_bytearray_o); Py_CLEAR(clear_module_state->__pyx_n_s_find); Py_CLEAR(clear_module_state->__pyx_n_s_format); Py_CLEAR(clear_module_state->__pyx_n_s_from_bytes); Py_CLEAR(clear_module_state->__pyx_n_s_frombytes); Py_CLEAR(clear_module_state->__pyx_n_s_fromordinal); Py_CLEAR(clear_module_state->__pyx_n_s_functools); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get_json_decoder); Py_CLEAR(clear_module_state->__pyx_n_s_get_json_encoder); Py_CLEAR(clear_module_state->__pyx_n_s_get_text_codec); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_hour); Py_CLEAR(clear_module_state->__pyx_kp_u_hstore_value_is_too_large); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_u_inet); Py_CLEAR(clear_module_state->__pyx_n_s_infinity_date); Py_CLEAR(clear_module_state->__pyx_n_s_infinity_datetime); Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_s_inp); Py_CLEAR(clear_module_state->__pyx_kp_u_insufficient_data_in_buffer_requ); Py_CLEAR(clear_module_state->__pyx_n_s_int); Py_CLEAR(clear_module_state->__pyx_n_u_int_2); Py_CLEAR(clear_module_state->__pyx_kp_u_interval_tuple_encoder_expecting); Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_UUID); Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_UUID_u_r_unexpected_char); Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_address_family_in_value); Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_address_length_in_value); Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_network_prefix_length_in); Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_number_of_elements_in_ti); Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_number_of_elements_in_tx); Py_CLEAR(clear_module_state->__pyx_n_s_ip_address); Py_CLEAR(clear_module_state->__pyx_n_s_ip_interface); Py_CLEAR(clear_module_state->__pyx_n_s_ip_network); Py_CLEAR(clear_module_state->__pyx_n_s_ipaddr); Py_CLEAR(clear_module_state->__pyx_n_s_ipaddress); Py_CLEAR(clear_module_state->__pyx_n_s_ipiface); Py_CLEAR(clear_module_state->__pyx_n_s_ipnet); Py_CLEAR(clear_module_state->__pyx_n_s_is_closed); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_items); Py_CLEAR(clear_module_state->__pyx_n_u_items); Py_CLEAR(clear_module_state->__pyx_n_s_len); Py_CLEAR(clear_module_state->__pyx_kp_u_length_must_be_between_32_36_ch); Py_CLEAR(clear_module_state->__pyx_kp_u_list_or_tuple_expected_got_type); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); Py_CLEAR(clear_module_state->__pyx_n_s_microsecond); Py_CLEAR(clear_module_state->__pyx_n_s_microseconds); Py_CLEAR(clear_module_state->__pyx_n_s_minute); Py_CLEAR(clear_module_state->__pyx_n_s_minutes); Py_CLEAR(clear_module_state->__pyx_n_s_module); Py_CLEAR(clear_module_state->__pyx_n_s_month); Py_CLEAR(clear_module_state->__pyx_n_s_mro); Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); Py_CLEAR(clear_module_state->__pyx_n_u_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_negative_infinity_date); Py_CLEAR(clear_module_state->__pyx_n_s_negative_infinity_datetime); Py_CLEAR(clear_module_state->__pyx_kp_u_negative_length_for_a_len_prefix); Py_CLEAR(clear_module_state->__pyx_n_s_network); Py_CLEAR(clear_module_state->__pyx_n_s_network_address); Py_CLEAR(clear_module_state->__pyx_n_s_new); Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_kp_u_no_message_to_consume); Py_CLEAR(clear_module_state->__pyx_kp_u_no_message_to_discard); Py_CLEAR(clear_module_state->__pyx_n_s_node); Py_CLEAR(clear_module_state->__pyx_kp_u_not_enough_data_to_read_bytes); Py_CLEAR(clear_module_state->__pyx_kp_u_not_enough_data_to_read_one_byte); Py_CLEAR(clear_module_state->__pyx_n_s_now); Py_CLEAR(clear_module_state->__pyx_kp_u_null_value_not_allowed_in_hstore); Py_CLEAR(clear_module_state->__pyx_n_s_packed); Py_CLEAR(clear_module_state->__pyx_kp_u_path_value_too_long); Py_CLEAR(clear_module_state->__pyx_n_s_pg_epoch_date); Py_CLEAR(clear_module_state->__pyx_n_s_pg_epoch_datetime); Py_CLEAR(clear_module_state->__pyx_n_s_pg_epoch_datetime_utc); Py_CLEAR(clear_module_state->__pyx_n_s_pgproto_types); Py_CLEAR(clear_module_state->__pyx_n_s_pickle); Py_CLEAR(clear_module_state->__pyx_kp_u_polygon_value_too_long); Py_CLEAR(clear_module_state->__pyx_n_s_popleft); Py_CLEAR(clear_module_state->__pyx_n_s_prefixlen); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_print); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_CodecContext); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle___UUIDReplaceMe); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_n_s_range); Py_CLEAR(clear_module_state->__pyx_kp_u_read_null_str_buffer_overread); Py_CLEAR(clear_module_state->__pyx_kp_u_read_null_str_only_works_when_th); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_kp_u_remaining); Py_CLEAR(clear_module_state->__pyx_n_s_replace); Py_CLEAR(clear_module_state->__pyx_n_s_second); Py_CLEAR(clear_module_state->__pyx_n_s_seconds); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_sign); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_kp_u_string_is_too_large); Py_CLEAR(clear_module_state->__pyx_kp_u_string_too_long); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_kp_u_the_buffer_is_in_read_only_mode); Py_CLEAR(clear_module_state->__pyx_n_s_time); Py_CLEAR(clear_module_state->__pyx_n_s_time_hi_version); Py_CLEAR(clear_module_state->__pyx_n_s_time_low); Py_CLEAR(clear_module_state->__pyx_n_s_time_mid); Py_CLEAR(clear_module_state->__pyx_kp_u_time_tuple_encoder_expecting_1_e); Py_CLEAR(clear_module_state->__pyx_kp_u_time_tuple_encoder_expecting_2_e); Py_CLEAR(clear_module_state->__pyx_n_s_timedelta); Py_CLEAR(clear_module_state->__pyx_n_s_timestamp); Py_CLEAR(clear_module_state->__pyx_kp_u_timestamp_tuple_encoder_expectin); Py_CLEAR(clear_module_state->__pyx_n_s_timezone); Py_CLEAR(clear_module_state->__pyx_n_s_toordinal); Py_CLEAR(clear_module_state->__pyx_kp_u_tuple_id_block_value_out_of_uint); Py_CLEAR(clear_module_state->__pyx_kp_u_tuple_id_offset_value_out_of_uin); Py_CLEAR(clear_module_state->__pyx_kp_u_txid_snapshot_value_is_too_long); Py_CLEAR(clear_module_state->__pyx_n_s_types); Py_CLEAR(clear_module_state->__pyx_n_s_tzinfo); Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_CIDR_flag_set_in_non); Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_JSONB_format); Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_character); Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_jsonpath_format); Py_CLEAR(clear_module_state->__pyx_n_s_unknown); Py_CLEAR(clear_module_state->__pyx_n_s_update); Py_CLEAR(clear_module_state->__pyx_kp_u_urn_uuid); Py_CLEAR(clear_module_state->__pyx_n_s_use_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_utc); Py_CLEAR(clear_module_state->__pyx_n_s_utcoffset); Py_CLEAR(clear_module_state->__pyx_n_s_uuid); Py_CLEAR(clear_module_state->__pyx_kp_u_value_out_of_float32_range); Py_CLEAR(clear_module_state->__pyx_kp_u_value_out_of_int16_range); Py_CLEAR(clear_module_state->__pyx_kp_u_value_out_of_int32_range); Py_CLEAR(clear_module_state->__pyx_kp_u_value_out_of_int64_range); Py_CLEAR(clear_module_state->__pyx_kp_u_value_out_of_uint32_range); Py_CLEAR(clear_module_state->__pyx_kp_u_value_out_of_uint64_range); Py_CLEAR(clear_module_state->__pyx_n_s_variant); Py_CLEAR(clear_module_state->__pyx_n_s_version); Py_CLEAR(clear_module_state->__pyx_n_s_year); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_3); Py_CLEAR(clear_module_state->__pyx_int_5); Py_CLEAR(clear_module_state->__pyx_int_7); Py_CLEAR(clear_module_state->__pyx_int_8); Py_CLEAR(clear_module_state->__pyx_int_10); Py_CLEAR(clear_module_state->__pyx_int_12); Py_CLEAR(clear_module_state->__pyx_int_15); Py_CLEAR(clear_module_state->__pyx_int_20); Py_CLEAR(clear_module_state->__pyx_int_23); Py_CLEAR(clear_module_state->__pyx_int_31); Py_CLEAR(clear_module_state->__pyx_int_32); Py_CLEAR(clear_module_state->__pyx_int_48); Py_CLEAR(clear_module_state->__pyx_int_56); Py_CLEAR(clear_module_state->__pyx_int_59); Py_CLEAR(clear_module_state->__pyx_int_63); Py_CLEAR(clear_module_state->__pyx_int_64); Py_CLEAR(clear_module_state->__pyx_int_76); Py_CLEAR(clear_module_state->__pyx_int_80); Py_CLEAR(clear_module_state->__pyx_int_96); Py_CLEAR(clear_module_state->__pyx_int_100); Py_CLEAR(clear_module_state->__pyx_int_255); Py_CLEAR(clear_module_state->__pyx_int_1000); Py_CLEAR(clear_module_state->__pyx_int_2000); Py_CLEAR(clear_module_state->__pyx_int_4095); Py_CLEAR(clear_module_state->__pyx_int_65535); Py_CLEAR(clear_module_state->__pyx_int_999999); Py_CLEAR(clear_module_state->__pyx_int_222419149); Py_CLEAR(clear_module_state->__pyx_int_228825662); Py_CLEAR(clear_module_state->__pyx_int_238750788); Py_CLEAR(clear_module_state->__pyx_int_0xffffffffffff); Py_CLEAR(clear_module_state->__pyx_int_0x2000000000000000); Py_CLEAR(clear_module_state->__pyx_int_0x4000000000000000); Py_CLEAR(clear_module_state->__pyx_int_0x8000000000000000); Py_CLEAR(clear_module_state->__pyx_int_neg_1); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_slice__6); Py_CLEAR(clear_module_state->__pyx_slice__7); Py_CLEAR(clear_module_state->__pyx_slice__8); Py_CLEAR(clear_module_state->__pyx_slice__9); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__13); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__15); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__18); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__20); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__23); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_tuple__26); Py_CLEAR(clear_module_state->__pyx_tuple__27); Py_CLEAR(clear_module_state->__pyx_tuple__28); Py_CLEAR(clear_module_state->__pyx_tuple__29); Py_CLEAR(clear_module_state->__pyx_tuple__30); Py_CLEAR(clear_module_state->__pyx_tuple__31); Py_CLEAR(clear_module_state->__pyx_tuple__32); Py_CLEAR(clear_module_state->__pyx_tuple__35); Py_CLEAR(clear_module_state->__pyx_tuple__37); Py_CLEAR(clear_module_state->__pyx_tuple__41); Py_CLEAR(clear_module_state->__pyx_tuple__50); Py_CLEAR(clear_module_state->__pyx_tuple__51); Py_CLEAR(clear_module_state->__pyx_codeobj__36); Py_CLEAR(clear_module_state->__pyx_codeobj__38); Py_CLEAR(clear_module_state->__pyx_codeobj__39); Py_CLEAR(clear_module_state->__pyx_codeobj__40); Py_CLEAR(clear_module_state->__pyx_codeobj__42); Py_CLEAR(clear_module_state->__pyx_codeobj__43); Py_CLEAR(clear_module_state->__pyx_codeobj__44); Py_CLEAR(clear_module_state->__pyx_codeobj__45); Py_CLEAR(clear_module_state->__pyx_codeobj__46); Py_CLEAR(clear_module_state->__pyx_codeobj__47); Py_CLEAR(clear_module_state->__pyx_codeobj__48); Py_CLEAR(clear_module_state->__pyx_codeobj__49); Py_CLEAR(clear_module_state->__pyx_codeobj__52); Py_CLEAR(clear_module_state->__pyx_codeobj__53); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool); Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex); Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_date); Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_time); Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_datetime); Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_timedelta); Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_tzinfo); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_7pgproto_7pgproto_WriteBuffer); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_7pgproto_7pgproto_ReadBuffer); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_7pgproto_7pgproto_CodecContext); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_7pgproto_7pgproto_UUID); Py_VISIT(traverse_module_state->__pyx_kp_u_0e); Py_VISIT(traverse_module_state->__pyx_kp_u_16_bytes_were_expected_got); Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError); Py_VISIT(traverse_module_state->__pyx_n_s_BitString); Py_VISIT(traverse_module_state->__pyx_n_s_Box); Py_VISIT(traverse_module_state->__pyx_n_s_BufferError); Py_VISIT(traverse_module_state->__pyx_n_s_Circle); Py_VISIT(traverse_module_state->__pyx_n_s_CodecContext); Py_VISIT(traverse_module_state->__pyx_n_s_CodecContext___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_CodecContext___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_CodecContext_get_json_decoder); Py_VISIT(traverse_module_state->__pyx_n_s_CodecContext_get_json_encoder); Py_VISIT(traverse_module_state->__pyx_n_s_CodecContext_get_text_codec); Py_VISIT(traverse_module_state->__pyx_kp_u_Deallocating_buffer_with_attache); Py_VISIT(traverse_module_state->__pyx_n_s_Dec); Py_VISIT(traverse_module_state->__pyx_n_s_Decimal); Py_VISIT(traverse_module_state->__pyx_n_u_F); Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); Py_VISIT(traverse_module_state->__pyx_n_u_Infinity); Py_VISIT(traverse_module_state->__pyx_kp_u_Infinity_2); Py_VISIT(traverse_module_state->__pyx_n_s_Line); Py_VISIT(traverse_module_state->__pyx_n_s_LineSegment); Py_VISIT(traverse_module_state->__pyx_n_s_MAXYEAR); Py_VISIT(traverse_module_state->__pyx_n_s_MINYEAR); Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError); Py_VISIT(traverse_module_state->__pyx_n_u_N); Py_VISIT(traverse_module_state->__pyx_n_u_NaN); Py_VISIT(traverse_module_state->__pyx_n_s_NotImplemented); Py_VISIT(traverse_module_state->__pyx_n_s_NotImplementedError); Py_VISIT(traverse_module_state->__pyx_n_s_OverflowError); Py_VISIT(traverse_module_state->__pyx_n_s_Path); Py_VISIT(traverse_module_state->__pyx_n_s_PickleError); Py_VISIT(traverse_module_state->__pyx_n_s_Point); Py_VISIT(traverse_module_state->__pyx_n_s_Polygon); Py_VISIT(traverse_module_state->__pyx_n_s_RESERVED_FUTURE); Py_VISIT(traverse_module_state->__pyx_n_s_RESERVED_MICROSOFT); Py_VISIT(traverse_module_state->__pyx_n_s_RESERVED_NCS); Py_VISIT(traverse_module_state->__pyx_n_s_RFC_4122); Py_VISIT(traverse_module_state->__pyx_n_s_ReadBuffer); Py_VISIT(traverse_module_state->__pyx_n_s_ReadBuffer___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_ReadBuffer___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_RuntimeError); Py_VISIT(traverse_module_state->__pyx_n_s_SafeUUID); Py_VISIT(traverse_module_state->__pyx_kp_u_Time_zones_are_not_available_fro); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_kp_u_UUID); Py_VISIT(traverse_module_state->__pyx_n_s_UUIDReplaceMe); Py_VISIT(traverse_module_state->__pyx_n_s_UUIDReplaceMe___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_UUIDReplaceMe___setstate_cytho); Py_VISIT(traverse_module_state->__pyx_n_s_UUID_2); Py_VISIT(traverse_module_state->__pyx_n_s_UUID___reduce); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); Py_VISIT(traverse_module_state->__pyx_n_s_WriteBuffer); Py_VISIT(traverse_module_state->__pyx_n_s_WriteBuffer___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_WriteBuffer___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s__2); Py_VISIT(traverse_module_state->__pyx_kp_b__2); Py_VISIT(traverse_module_state->__pyx_kp_u__2); Py_VISIT(traverse_module_state->__pyx_kp_b__3); Py_VISIT(traverse_module_state->__pyx_kp_u__33); Py_VISIT(traverse_module_state->__pyx_n_s__34); Py_VISIT(traverse_module_state->__pyx_kp_u__5); Py_VISIT(traverse_module_state->__pyx_n_s__54); Py_VISIT(traverse_module_state->__pyx_kp_u_a_boolean_is_required_got_type); Py_VISIT(traverse_module_state->__pyx_kp_u_a_bytes_or_str_object_expected_g); Py_VISIT(traverse_module_state->__pyx_n_s_add); Py_VISIT(traverse_module_state->__pyx_n_s_append); Py_VISIT(traverse_module_state->__pyx_n_s_as_tuple); Py_VISIT(traverse_module_state->__pyx_n_s_astimezone); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_kp_s_asyncpg_pgproto_codecs_context_p); Py_VISIT(traverse_module_state->__pyx_n_s_asyncpg_pgproto_pgproto); Py_VISIT(traverse_module_state->__pyx_kp_s_asyncpg_pgproto_uuid_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_bases); Py_VISIT(traverse_module_state->__pyx_n_u_big); Py_VISIT(traverse_module_state->__pyx_kp_u_bit_value_too_long); Py_VISIT(traverse_module_state->__pyx_kp_u_buffer_overread); Py_VISIT(traverse_module_state->__pyx_n_s_bytes); Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_decode_UUID_expected_16_b); Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_encode_Decimal_value_into); Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_encode_Decimal_value_into_2); Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_encode_Decimal_value_into_3); Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_put_message_no_message_ta); Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_start_message_for_a_non_e); Py_VISIT(traverse_module_state->__pyx_n_s_chr); Py_VISIT(traverse_module_state->__pyx_n_u_cidr); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_clock_seq_hi_variant); Py_VISIT(traverse_module_state->__pyx_n_s_clock_seq_low); Py_VISIT(traverse_module_state->__pyx_n_s_collections); Py_VISIT(traverse_module_state->__pyx_kp_u_consume_full_messages_called_on); Py_VISIT(traverse_module_state->__pyx_kp_u_consume_full_messages_called_on_2); Py_VISIT(traverse_module_state->__pyx_kp_u_consume_full_messages_called_wit); Py_VISIT(traverse_module_state->__pyx_n_s_date); Py_VISIT(traverse_module_state->__pyx_n_s_date_from_ordinal); Py_VISIT(traverse_module_state->__pyx_kp_u_date_tuple_encoder_expecting_1_e); Py_VISIT(traverse_module_state->__pyx_n_s_datetime); Py_VISIT(traverse_module_state->__pyx_n_s_day); Py_VISIT(traverse_module_state->__pyx_n_s_days); Py_VISIT(traverse_module_state->__pyx_kp_u_debug_first_buffer_of_ReadBuffer); Py_VISIT(traverse_module_state->__pyx_kp_u_debug_second_buffer_of_ReadBuffe); Py_VISIT(traverse_module_state->__pyx_n_s_decimal); Py_VISIT(traverse_module_state->__pyx_n_s_decode); Py_VISIT(traverse_module_state->__pyx_kp_u_decodes_to_less_than_16_bytes); Py_VISIT(traverse_module_state->__pyx_kp_u_decodes_to_more_than_16_bytes); Py_VISIT(traverse_module_state->__pyx_n_s_deque); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_n_s_dict_2); Py_VISIT(traverse_module_state->__pyx_n_s_digits); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_kp_u_discarding_message_r_unread_dat); Py_VISIT(traverse_module_state->__pyx_n_s_doc); Py_VISIT(traverse_module_state->__pyx_kp_u_empty_buffer); Py_VISIT(traverse_module_state->__pyx_kp_u_empty_first_buffer); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_encode); Py_VISIT(traverse_module_state->__pyx_kp_u_end_message_buffer_is_too_small); Py_VISIT(traverse_module_state->__pyx_kp_u_end_message_can_only_be_called_w); Py_VISIT(traverse_module_state->__pyx_kp_u_end_message_message_is_too_large); Py_VISIT(traverse_module_state->__pyx_kp_u_expected_a_datetime_date_or_date); Py_VISIT(traverse_module_state->__pyx_kp_u_expected_str_got); Py_VISIT(traverse_module_state->__pyx_n_s_exponent); Py_VISIT(traverse_module_state->__pyx_kp_u_failed_to_read_one_byte_on_a_non); Py_VISIT(traverse_module_state->__pyx_kp_u_feed_data_a_bytes_or_bytearray_o); Py_VISIT(traverse_module_state->__pyx_n_s_find); Py_VISIT(traverse_module_state->__pyx_n_s_format); Py_VISIT(traverse_module_state->__pyx_n_s_from_bytes); Py_VISIT(traverse_module_state->__pyx_n_s_frombytes); Py_VISIT(traverse_module_state->__pyx_n_s_fromordinal); Py_VISIT(traverse_module_state->__pyx_n_s_functools); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get_json_decoder); Py_VISIT(traverse_module_state->__pyx_n_s_get_json_encoder); Py_VISIT(traverse_module_state->__pyx_n_s_get_text_codec); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_hour); Py_VISIT(traverse_module_state->__pyx_kp_u_hstore_value_is_too_large); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_u_inet); Py_VISIT(traverse_module_state->__pyx_n_s_infinity_date); Py_VISIT(traverse_module_state->__pyx_n_s_infinity_datetime); Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_s_inp); Py_VISIT(traverse_module_state->__pyx_kp_u_insufficient_data_in_buffer_requ); Py_VISIT(traverse_module_state->__pyx_n_s_int); Py_VISIT(traverse_module_state->__pyx_n_u_int_2); Py_VISIT(traverse_module_state->__pyx_kp_u_interval_tuple_encoder_expecting); Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_UUID); Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_UUID_u_r_unexpected_char); Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_address_family_in_value); Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_address_length_in_value); Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_network_prefix_length_in); Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_number_of_elements_in_ti); Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_number_of_elements_in_tx); Py_VISIT(traverse_module_state->__pyx_n_s_ip_address); Py_VISIT(traverse_module_state->__pyx_n_s_ip_interface); Py_VISIT(traverse_module_state->__pyx_n_s_ip_network); Py_VISIT(traverse_module_state->__pyx_n_s_ipaddr); Py_VISIT(traverse_module_state->__pyx_n_s_ipaddress); Py_VISIT(traverse_module_state->__pyx_n_s_ipiface); Py_VISIT(traverse_module_state->__pyx_n_s_ipnet); Py_VISIT(traverse_module_state->__pyx_n_s_is_closed); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_items); Py_VISIT(traverse_module_state->__pyx_n_u_items); Py_VISIT(traverse_module_state->__pyx_n_s_len); Py_VISIT(traverse_module_state->__pyx_kp_u_length_must_be_between_32_36_ch); Py_VISIT(traverse_module_state->__pyx_kp_u_list_or_tuple_expected_got_type); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); Py_VISIT(traverse_module_state->__pyx_n_s_microsecond); Py_VISIT(traverse_module_state->__pyx_n_s_microseconds); Py_VISIT(traverse_module_state->__pyx_n_s_minute); Py_VISIT(traverse_module_state->__pyx_n_s_minutes); Py_VISIT(traverse_module_state->__pyx_n_s_module); Py_VISIT(traverse_module_state->__pyx_n_s_month); Py_VISIT(traverse_module_state->__pyx_n_s_mro); Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); Py_VISIT(traverse_module_state->__pyx_n_u_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_negative_infinity_date); Py_VISIT(traverse_module_state->__pyx_n_s_negative_infinity_datetime); Py_VISIT(traverse_module_state->__pyx_kp_u_negative_length_for_a_len_prefix); Py_VISIT(traverse_module_state->__pyx_n_s_network); Py_VISIT(traverse_module_state->__pyx_n_s_network_address); Py_VISIT(traverse_module_state->__pyx_n_s_new); Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_kp_u_no_message_to_consume); Py_VISIT(traverse_module_state->__pyx_kp_u_no_message_to_discard); Py_VISIT(traverse_module_state->__pyx_n_s_node); Py_VISIT(traverse_module_state->__pyx_kp_u_not_enough_data_to_read_bytes); Py_VISIT(traverse_module_state->__pyx_kp_u_not_enough_data_to_read_one_byte); Py_VISIT(traverse_module_state->__pyx_n_s_now); Py_VISIT(traverse_module_state->__pyx_kp_u_null_value_not_allowed_in_hstore); Py_VISIT(traverse_module_state->__pyx_n_s_packed); Py_VISIT(traverse_module_state->__pyx_kp_u_path_value_too_long); Py_VISIT(traverse_module_state->__pyx_n_s_pg_epoch_date); Py_VISIT(traverse_module_state->__pyx_n_s_pg_epoch_datetime); Py_VISIT(traverse_module_state->__pyx_n_s_pg_epoch_datetime_utc); Py_VISIT(traverse_module_state->__pyx_n_s_pgproto_types); Py_VISIT(traverse_module_state->__pyx_n_s_pickle); Py_VISIT(traverse_module_state->__pyx_kp_u_polygon_value_too_long); Py_VISIT(traverse_module_state->__pyx_n_s_popleft); Py_VISIT(traverse_module_state->__pyx_n_s_prefixlen); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_print); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_CodecContext); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle___UUIDReplaceMe); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_n_s_range); Py_VISIT(traverse_module_state->__pyx_kp_u_read_null_str_buffer_overread); Py_VISIT(traverse_module_state->__pyx_kp_u_read_null_str_only_works_when_th); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_kp_u_remaining); Py_VISIT(traverse_module_state->__pyx_n_s_replace); Py_VISIT(traverse_module_state->__pyx_n_s_second); Py_VISIT(traverse_module_state->__pyx_n_s_seconds); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_sign); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_kp_u_string_is_too_large); Py_VISIT(traverse_module_state->__pyx_kp_u_string_too_long); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_kp_u_the_buffer_is_in_read_only_mode); Py_VISIT(traverse_module_state->__pyx_n_s_time); Py_VISIT(traverse_module_state->__pyx_n_s_time_hi_version); Py_VISIT(traverse_module_state->__pyx_n_s_time_low); Py_VISIT(traverse_module_state->__pyx_n_s_time_mid); Py_VISIT(traverse_module_state->__pyx_kp_u_time_tuple_encoder_expecting_1_e); Py_VISIT(traverse_module_state->__pyx_kp_u_time_tuple_encoder_expecting_2_e); Py_VISIT(traverse_module_state->__pyx_n_s_timedelta); Py_VISIT(traverse_module_state->__pyx_n_s_timestamp); Py_VISIT(traverse_module_state->__pyx_kp_u_timestamp_tuple_encoder_expectin); Py_VISIT(traverse_module_state->__pyx_n_s_timezone); Py_VISIT(traverse_module_state->__pyx_n_s_toordinal); Py_VISIT(traverse_module_state->__pyx_kp_u_tuple_id_block_value_out_of_uint); Py_VISIT(traverse_module_state->__pyx_kp_u_tuple_id_offset_value_out_of_uin); Py_VISIT(traverse_module_state->__pyx_kp_u_txid_snapshot_value_is_too_long); Py_VISIT(traverse_module_state->__pyx_n_s_types); Py_VISIT(traverse_module_state->__pyx_n_s_tzinfo); Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_CIDR_flag_set_in_non); Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_JSONB_format); Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_character); Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_jsonpath_format); Py_VISIT(traverse_module_state->__pyx_n_s_unknown); Py_VISIT(traverse_module_state->__pyx_n_s_update); Py_VISIT(traverse_module_state->__pyx_kp_u_urn_uuid); Py_VISIT(traverse_module_state->__pyx_n_s_use_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_utc); Py_VISIT(traverse_module_state->__pyx_n_s_utcoffset); Py_VISIT(traverse_module_state->__pyx_n_s_uuid); Py_VISIT(traverse_module_state->__pyx_kp_u_value_out_of_float32_range); Py_VISIT(traverse_module_state->__pyx_kp_u_value_out_of_int16_range); Py_VISIT(traverse_module_state->__pyx_kp_u_value_out_of_int32_range); Py_VISIT(traverse_module_state->__pyx_kp_u_value_out_of_int64_range); Py_VISIT(traverse_module_state->__pyx_kp_u_value_out_of_uint32_range); Py_VISIT(traverse_module_state->__pyx_kp_u_value_out_of_uint64_range); Py_VISIT(traverse_module_state->__pyx_n_s_variant); Py_VISIT(traverse_module_state->__pyx_n_s_version); Py_VISIT(traverse_module_state->__pyx_n_s_year); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_3); Py_VISIT(traverse_module_state->__pyx_int_5); Py_VISIT(traverse_module_state->__pyx_int_7); Py_VISIT(traverse_module_state->__pyx_int_8); Py_VISIT(traverse_module_state->__pyx_int_10); Py_VISIT(traverse_module_state->__pyx_int_12); Py_VISIT(traverse_module_state->__pyx_int_15); Py_VISIT(traverse_module_state->__pyx_int_20); Py_VISIT(traverse_module_state->__pyx_int_23); Py_VISIT(traverse_module_state->__pyx_int_31); Py_VISIT(traverse_module_state->__pyx_int_32); Py_VISIT(traverse_module_state->__pyx_int_48); Py_VISIT(traverse_module_state->__pyx_int_56); Py_VISIT(traverse_module_state->__pyx_int_59); Py_VISIT(traverse_module_state->__pyx_int_63); Py_VISIT(traverse_module_state->__pyx_int_64); Py_VISIT(traverse_module_state->__pyx_int_76); Py_VISIT(traverse_module_state->__pyx_int_80); Py_VISIT(traverse_module_state->__pyx_int_96); Py_VISIT(traverse_module_state->__pyx_int_100); Py_VISIT(traverse_module_state->__pyx_int_255); Py_VISIT(traverse_module_state->__pyx_int_1000); Py_VISIT(traverse_module_state->__pyx_int_2000); Py_VISIT(traverse_module_state->__pyx_int_4095); Py_VISIT(traverse_module_state->__pyx_int_65535); Py_VISIT(traverse_module_state->__pyx_int_999999); Py_VISIT(traverse_module_state->__pyx_int_222419149); Py_VISIT(traverse_module_state->__pyx_int_228825662); Py_VISIT(traverse_module_state->__pyx_int_238750788); Py_VISIT(traverse_module_state->__pyx_int_0xffffffffffff); Py_VISIT(traverse_module_state->__pyx_int_0x2000000000000000); Py_VISIT(traverse_module_state->__pyx_int_0x4000000000000000); Py_VISIT(traverse_module_state->__pyx_int_0x8000000000000000); Py_VISIT(traverse_module_state->__pyx_int_neg_1); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_slice__6); Py_VISIT(traverse_module_state->__pyx_slice__7); Py_VISIT(traverse_module_state->__pyx_slice__8); Py_VISIT(traverse_module_state->__pyx_slice__9); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__13); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__15); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__18); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__20); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__23); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_tuple__26); Py_VISIT(traverse_module_state->__pyx_tuple__27); Py_VISIT(traverse_module_state->__pyx_tuple__28); Py_VISIT(traverse_module_state->__pyx_tuple__29); Py_VISIT(traverse_module_state->__pyx_tuple__30); Py_VISIT(traverse_module_state->__pyx_tuple__31); Py_VISIT(traverse_module_state->__pyx_tuple__32); Py_VISIT(traverse_module_state->__pyx_tuple__35); Py_VISIT(traverse_module_state->__pyx_tuple__37); Py_VISIT(traverse_module_state->__pyx_tuple__41); Py_VISIT(traverse_module_state->__pyx_tuple__50); Py_VISIT(traverse_module_state->__pyx_tuple__51); Py_VISIT(traverse_module_state->__pyx_codeobj__36); Py_VISIT(traverse_module_state->__pyx_codeobj__38); Py_VISIT(traverse_module_state->__pyx_codeobj__39); Py_VISIT(traverse_module_state->__pyx_codeobj__40); Py_VISIT(traverse_module_state->__pyx_codeobj__42); Py_VISIT(traverse_module_state->__pyx_codeobj__43); Py_VISIT(traverse_module_state->__pyx_codeobj__44); Py_VISIT(traverse_module_state->__pyx_codeobj__45); Py_VISIT(traverse_module_state->__pyx_codeobj__46); Py_VISIT(traverse_module_state->__pyx_codeobj__47); Py_VISIT(traverse_module_state->__pyx_codeobj__48); Py_VISIT(traverse_module_state->__pyx_codeobj__49); Py_VISIT(traverse_module_state->__pyx_codeobj__52); Py_VISIT(traverse_module_state->__pyx_codeobj__53); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_7cpython_4bool_bool __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_7cpython_7complex_complex __pyx_mstate_global->__pyx_ptype_7cpython_7complex_complex #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_7cpython_8datetime_date __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_date #define __pyx_ptype_7cpython_8datetime_time __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_time #define __pyx_ptype_7cpython_8datetime_datetime __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_datetime #define __pyx_ptype_7cpython_8datetime_timedelta __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_timedelta #define __pyx_ptype_7cpython_8datetime_tzinfo __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_tzinfo #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_7asyncpg_7pgproto_7pgproto_WriteBuffer __pyx_mstate_global->__pyx_type_7asyncpg_7pgproto_7pgproto_WriteBuffer #define __pyx_type_7asyncpg_7pgproto_7pgproto_ReadBuffer __pyx_mstate_global->__pyx_type_7asyncpg_7pgproto_7pgproto_ReadBuffer #define __pyx_type_7asyncpg_7pgproto_7pgproto_CodecContext __pyx_mstate_global->__pyx_type_7asyncpg_7pgproto_7pgproto_CodecContext #define __pyx_type_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe __pyx_mstate_global->__pyx_type_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe #define __pyx_type_7asyncpg_7pgproto_7pgproto_UUID __pyx_mstate_global->__pyx_type_7asyncpg_7pgproto_7pgproto_UUID #endif #define __pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer #define __pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer #define __pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext #define __pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe #define __pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID #define __pyx_kp_u_0e __pyx_mstate_global->__pyx_kp_u_0e #define __pyx_kp_u_16_bytes_were_expected_got __pyx_mstate_global->__pyx_kp_u_16_bytes_were_expected_got #define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError #define __pyx_n_s_BitString __pyx_mstate_global->__pyx_n_s_BitString #define __pyx_n_s_Box __pyx_mstate_global->__pyx_n_s_Box #define __pyx_n_s_BufferError __pyx_mstate_global->__pyx_n_s_BufferError #define __pyx_n_s_Circle __pyx_mstate_global->__pyx_n_s_Circle #define __pyx_n_s_CodecContext __pyx_mstate_global->__pyx_n_s_CodecContext #define __pyx_n_s_CodecContext___reduce_cython __pyx_mstate_global->__pyx_n_s_CodecContext___reduce_cython #define __pyx_n_s_CodecContext___setstate_cython __pyx_mstate_global->__pyx_n_s_CodecContext___setstate_cython #define __pyx_n_s_CodecContext_get_json_decoder __pyx_mstate_global->__pyx_n_s_CodecContext_get_json_decoder #define __pyx_n_s_CodecContext_get_json_encoder __pyx_mstate_global->__pyx_n_s_CodecContext_get_json_encoder #define __pyx_n_s_CodecContext_get_text_codec __pyx_mstate_global->__pyx_n_s_CodecContext_get_text_codec #define __pyx_kp_u_Deallocating_buffer_with_attache __pyx_mstate_global->__pyx_kp_u_Deallocating_buffer_with_attache #define __pyx_n_s_Dec __pyx_mstate_global->__pyx_n_s_Dec #define __pyx_n_s_Decimal __pyx_mstate_global->__pyx_n_s_Decimal #define __pyx_n_u_F __pyx_mstate_global->__pyx_n_u_F #define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0 #define __pyx_n_u_Infinity __pyx_mstate_global->__pyx_n_u_Infinity #define __pyx_kp_u_Infinity_2 __pyx_mstate_global->__pyx_kp_u_Infinity_2 #define __pyx_n_s_Line __pyx_mstate_global->__pyx_n_s_Line #define __pyx_n_s_LineSegment __pyx_mstate_global->__pyx_n_s_LineSegment #define __pyx_n_s_MAXYEAR __pyx_mstate_global->__pyx_n_s_MAXYEAR #define __pyx_n_s_MINYEAR __pyx_mstate_global->__pyx_n_s_MINYEAR #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError #define __pyx_n_u_N __pyx_mstate_global->__pyx_n_u_N #define __pyx_n_u_NaN __pyx_mstate_global->__pyx_n_u_NaN #define __pyx_n_s_NotImplemented __pyx_mstate_global->__pyx_n_s_NotImplemented #define __pyx_n_s_NotImplementedError __pyx_mstate_global->__pyx_n_s_NotImplementedError #define __pyx_n_s_OverflowError __pyx_mstate_global->__pyx_n_s_OverflowError #define __pyx_n_s_Path __pyx_mstate_global->__pyx_n_s_Path #define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError #define __pyx_n_s_Point __pyx_mstate_global->__pyx_n_s_Point #define __pyx_n_s_Polygon __pyx_mstate_global->__pyx_n_s_Polygon #define __pyx_n_s_RESERVED_FUTURE __pyx_mstate_global->__pyx_n_s_RESERVED_FUTURE #define __pyx_n_s_RESERVED_MICROSOFT __pyx_mstate_global->__pyx_n_s_RESERVED_MICROSOFT #define __pyx_n_s_RESERVED_NCS __pyx_mstate_global->__pyx_n_s_RESERVED_NCS #define __pyx_n_s_RFC_4122 __pyx_mstate_global->__pyx_n_s_RFC_4122 #define __pyx_n_s_ReadBuffer __pyx_mstate_global->__pyx_n_s_ReadBuffer #define __pyx_n_s_ReadBuffer___reduce_cython __pyx_mstate_global->__pyx_n_s_ReadBuffer___reduce_cython #define __pyx_n_s_ReadBuffer___setstate_cython __pyx_mstate_global->__pyx_n_s_ReadBuffer___setstate_cython #define __pyx_n_s_RuntimeError __pyx_mstate_global->__pyx_n_s_RuntimeError #define __pyx_n_s_SafeUUID __pyx_mstate_global->__pyx_n_s_SafeUUID #define __pyx_kp_u_Time_zones_are_not_available_fro __pyx_mstate_global->__pyx_kp_u_Time_zones_are_not_available_fro #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_kp_u_UUID __pyx_mstate_global->__pyx_kp_u_UUID #define __pyx_n_s_UUIDReplaceMe __pyx_mstate_global->__pyx_n_s_UUIDReplaceMe #define __pyx_n_s_UUIDReplaceMe___reduce_cython __pyx_mstate_global->__pyx_n_s_UUIDReplaceMe___reduce_cython #define __pyx_n_s_UUIDReplaceMe___setstate_cytho __pyx_mstate_global->__pyx_n_s_UUIDReplaceMe___setstate_cytho #define __pyx_n_s_UUID_2 __pyx_mstate_global->__pyx_n_s_UUID_2 #define __pyx_n_s_UUID___reduce __pyx_mstate_global->__pyx_n_s_UUID___reduce #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError #define __pyx_n_s_WriteBuffer __pyx_mstate_global->__pyx_n_s_WriteBuffer #define __pyx_n_s_WriteBuffer___reduce_cython __pyx_mstate_global->__pyx_n_s_WriteBuffer___reduce_cython #define __pyx_n_s_WriteBuffer___setstate_cython __pyx_mstate_global->__pyx_n_s_WriteBuffer___setstate_cython #define __pyx_n_s__2 __pyx_mstate_global->__pyx_n_s__2 #define __pyx_kp_b__2 __pyx_mstate_global->__pyx_kp_b__2 #define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 #define __pyx_kp_b__3 __pyx_mstate_global->__pyx_kp_b__3 #define __pyx_kp_u__33 __pyx_mstate_global->__pyx_kp_u__33 #define __pyx_n_s__34 __pyx_mstate_global->__pyx_n_s__34 #define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 #define __pyx_n_s__54 __pyx_mstate_global->__pyx_n_s__54 #define __pyx_kp_u_a_boolean_is_required_got_type __pyx_mstate_global->__pyx_kp_u_a_boolean_is_required_got_type #define __pyx_kp_u_a_bytes_or_str_object_expected_g __pyx_mstate_global->__pyx_kp_u_a_bytes_or_str_object_expected_g #define __pyx_n_s_add __pyx_mstate_global->__pyx_n_s_add #define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append #define __pyx_n_s_as_tuple __pyx_mstate_global->__pyx_n_s_as_tuple #define __pyx_n_s_astimezone __pyx_mstate_global->__pyx_n_s_astimezone #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_kp_s_asyncpg_pgproto_codecs_context_p __pyx_mstate_global->__pyx_kp_s_asyncpg_pgproto_codecs_context_p #define __pyx_n_s_asyncpg_pgproto_pgproto __pyx_mstate_global->__pyx_n_s_asyncpg_pgproto_pgproto #define __pyx_kp_s_asyncpg_pgproto_uuid_pyx __pyx_mstate_global->__pyx_kp_s_asyncpg_pgproto_uuid_pyx #define __pyx_n_s_bases __pyx_mstate_global->__pyx_n_s_bases #define __pyx_n_u_big __pyx_mstate_global->__pyx_n_u_big #define __pyx_kp_u_bit_value_too_long __pyx_mstate_global->__pyx_kp_u_bit_value_too_long #define __pyx_kp_u_buffer_overread __pyx_mstate_global->__pyx_kp_u_buffer_overread #define __pyx_n_s_bytes __pyx_mstate_global->__pyx_n_s_bytes #define __pyx_kp_u_cannot_decode_UUID_expected_16_b __pyx_mstate_global->__pyx_kp_u_cannot_decode_UUID_expected_16_b #define __pyx_kp_u_cannot_encode_Decimal_value_into __pyx_mstate_global->__pyx_kp_u_cannot_encode_Decimal_value_into #define __pyx_kp_u_cannot_encode_Decimal_value_into_2 __pyx_mstate_global->__pyx_kp_u_cannot_encode_Decimal_value_into_2 #define __pyx_kp_u_cannot_encode_Decimal_value_into_3 __pyx_mstate_global->__pyx_kp_u_cannot_encode_Decimal_value_into_3 #define __pyx_kp_u_cannot_put_message_no_message_ta __pyx_mstate_global->__pyx_kp_u_cannot_put_message_no_message_ta #define __pyx_kp_u_cannot_start_message_for_a_non_e __pyx_mstate_global->__pyx_kp_u_cannot_start_message_for_a_non_e #define __pyx_n_s_chr __pyx_mstate_global->__pyx_n_s_chr #define __pyx_n_u_cidr __pyx_mstate_global->__pyx_n_u_cidr #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_clock_seq_hi_variant __pyx_mstate_global->__pyx_n_s_clock_seq_hi_variant #define __pyx_n_s_clock_seq_low __pyx_mstate_global->__pyx_n_s_clock_seq_low #define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections #define __pyx_kp_u_consume_full_messages_called_on __pyx_mstate_global->__pyx_kp_u_consume_full_messages_called_on #define __pyx_kp_u_consume_full_messages_called_on_2 __pyx_mstate_global->__pyx_kp_u_consume_full_messages_called_on_2 #define __pyx_kp_u_consume_full_messages_called_wit __pyx_mstate_global->__pyx_kp_u_consume_full_messages_called_wit #define __pyx_n_s_date __pyx_mstate_global->__pyx_n_s_date #define __pyx_n_s_date_from_ordinal __pyx_mstate_global->__pyx_n_s_date_from_ordinal #define __pyx_kp_u_date_tuple_encoder_expecting_1_e __pyx_mstate_global->__pyx_kp_u_date_tuple_encoder_expecting_1_e #define __pyx_n_s_datetime __pyx_mstate_global->__pyx_n_s_datetime #define __pyx_n_s_day __pyx_mstate_global->__pyx_n_s_day #define __pyx_n_s_days __pyx_mstate_global->__pyx_n_s_days #define __pyx_kp_u_debug_first_buffer_of_ReadBuffer __pyx_mstate_global->__pyx_kp_u_debug_first_buffer_of_ReadBuffer #define __pyx_kp_u_debug_second_buffer_of_ReadBuffe __pyx_mstate_global->__pyx_kp_u_debug_second_buffer_of_ReadBuffe #define __pyx_n_s_decimal __pyx_mstate_global->__pyx_n_s_decimal #define __pyx_n_s_decode __pyx_mstate_global->__pyx_n_s_decode #define __pyx_kp_u_decodes_to_less_than_16_bytes __pyx_mstate_global->__pyx_kp_u_decodes_to_less_than_16_bytes #define __pyx_kp_u_decodes_to_more_than_16_bytes __pyx_mstate_global->__pyx_kp_u_decodes_to_more_than_16_bytes #define __pyx_n_s_deque __pyx_mstate_global->__pyx_n_s_deque #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2 #define __pyx_n_s_digits __pyx_mstate_global->__pyx_n_s_digits #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_kp_u_discarding_message_r_unread_dat __pyx_mstate_global->__pyx_kp_u_discarding_message_r_unread_dat #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc #define __pyx_kp_u_empty_buffer __pyx_mstate_global->__pyx_kp_u_empty_buffer #define __pyx_kp_u_empty_first_buffer __pyx_mstate_global->__pyx_kp_u_empty_first_buffer #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode #define __pyx_kp_u_end_message_buffer_is_too_small __pyx_mstate_global->__pyx_kp_u_end_message_buffer_is_too_small #define __pyx_kp_u_end_message_can_only_be_called_w __pyx_mstate_global->__pyx_kp_u_end_message_can_only_be_called_w #define __pyx_kp_u_end_message_message_is_too_large __pyx_mstate_global->__pyx_kp_u_end_message_message_is_too_large #define __pyx_kp_u_expected_a_datetime_date_or_date __pyx_mstate_global->__pyx_kp_u_expected_a_datetime_date_or_date #define __pyx_kp_u_expected_str_got __pyx_mstate_global->__pyx_kp_u_expected_str_got #define __pyx_n_s_exponent __pyx_mstate_global->__pyx_n_s_exponent #define __pyx_kp_u_failed_to_read_one_byte_on_a_non __pyx_mstate_global->__pyx_kp_u_failed_to_read_one_byte_on_a_non #define __pyx_kp_u_feed_data_a_bytes_or_bytearray_o __pyx_mstate_global->__pyx_kp_u_feed_data_a_bytes_or_bytearray_o #define __pyx_n_s_find __pyx_mstate_global->__pyx_n_s_find #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format #define __pyx_n_s_from_bytes __pyx_mstate_global->__pyx_n_s_from_bytes #define __pyx_n_s_frombytes __pyx_mstate_global->__pyx_n_s_frombytes #define __pyx_n_s_fromordinal __pyx_mstate_global->__pyx_n_s_fromordinal #define __pyx_n_s_functools __pyx_mstate_global->__pyx_n_s_functools #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get_json_decoder __pyx_mstate_global->__pyx_n_s_get_json_decoder #define __pyx_n_s_get_json_encoder __pyx_mstate_global->__pyx_n_s_get_json_encoder #define __pyx_n_s_get_text_codec __pyx_mstate_global->__pyx_n_s_get_text_codec #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_hour __pyx_mstate_global->__pyx_n_s_hour #define __pyx_kp_u_hstore_value_is_too_large __pyx_mstate_global->__pyx_kp_u_hstore_value_is_too_large #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_u_inet __pyx_mstate_global->__pyx_n_u_inet #define __pyx_n_s_infinity_date __pyx_mstate_global->__pyx_n_s_infinity_date #define __pyx_n_s_infinity_datetime __pyx_mstate_global->__pyx_n_s_infinity_datetime #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_s_inp __pyx_mstate_global->__pyx_n_s_inp #define __pyx_kp_u_insufficient_data_in_buffer_requ __pyx_mstate_global->__pyx_kp_u_insufficient_data_in_buffer_requ #define __pyx_n_s_int __pyx_mstate_global->__pyx_n_s_int #define __pyx_n_u_int_2 __pyx_mstate_global->__pyx_n_u_int_2 #define __pyx_kp_u_interval_tuple_encoder_expecting __pyx_mstate_global->__pyx_kp_u_interval_tuple_encoder_expecting #define __pyx_kp_u_invalid_UUID __pyx_mstate_global->__pyx_kp_u_invalid_UUID #define __pyx_kp_u_invalid_UUID_u_r_unexpected_char __pyx_mstate_global->__pyx_kp_u_invalid_UUID_u_r_unexpected_char #define __pyx_kp_u_invalid_address_family_in_value __pyx_mstate_global->__pyx_kp_u_invalid_address_family_in_value #define __pyx_kp_u_invalid_address_length_in_value __pyx_mstate_global->__pyx_kp_u_invalid_address_length_in_value #define __pyx_kp_u_invalid_network_prefix_length_in __pyx_mstate_global->__pyx_kp_u_invalid_network_prefix_length_in #define __pyx_kp_u_invalid_number_of_elements_in_ti __pyx_mstate_global->__pyx_kp_u_invalid_number_of_elements_in_ti #define __pyx_kp_u_invalid_number_of_elements_in_tx __pyx_mstate_global->__pyx_kp_u_invalid_number_of_elements_in_tx #define __pyx_n_s_ip_address __pyx_mstate_global->__pyx_n_s_ip_address #define __pyx_n_s_ip_interface __pyx_mstate_global->__pyx_n_s_ip_interface #define __pyx_n_s_ip_network __pyx_mstate_global->__pyx_n_s_ip_network #define __pyx_n_s_ipaddr __pyx_mstate_global->__pyx_n_s_ipaddr #define __pyx_n_s_ipaddress __pyx_mstate_global->__pyx_n_s_ipaddress #define __pyx_n_s_ipiface __pyx_mstate_global->__pyx_n_s_ipiface #define __pyx_n_s_ipnet __pyx_mstate_global->__pyx_n_s_ipnet #define __pyx_n_s_is_closed __pyx_mstate_global->__pyx_n_s_is_closed #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_items __pyx_mstate_global->__pyx_n_s_items #define __pyx_n_u_items __pyx_mstate_global->__pyx_n_u_items #define __pyx_n_s_len __pyx_mstate_global->__pyx_n_s_len #define __pyx_kp_u_length_must_be_between_32_36_ch __pyx_mstate_global->__pyx_kp_u_length_must_be_between_32_36_ch #define __pyx_kp_u_list_or_tuple_expected_got_type __pyx_mstate_global->__pyx_kp_u_list_or_tuple_expected_got_type #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass #define __pyx_n_s_microsecond __pyx_mstate_global->__pyx_n_s_microsecond #define __pyx_n_s_microseconds __pyx_mstate_global->__pyx_n_s_microseconds #define __pyx_n_s_minute __pyx_mstate_global->__pyx_n_s_minute #define __pyx_n_s_minutes __pyx_mstate_global->__pyx_n_s_minutes #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module #define __pyx_n_s_month __pyx_mstate_global->__pyx_n_s_month #define __pyx_n_s_mro __pyx_mstate_global->__pyx_n_s_mro #define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries #define __pyx_n_u_n __pyx_mstate_global->__pyx_n_u_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_negative_infinity_date __pyx_mstate_global->__pyx_n_s_negative_infinity_date #define __pyx_n_s_negative_infinity_datetime __pyx_mstate_global->__pyx_n_s_negative_infinity_datetime #define __pyx_kp_u_negative_length_for_a_len_prefix __pyx_mstate_global->__pyx_kp_u_negative_length_for_a_len_prefix #define __pyx_n_s_network __pyx_mstate_global->__pyx_n_s_network #define __pyx_n_s_network_address __pyx_mstate_global->__pyx_n_s_network_address #define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_kp_u_no_message_to_consume __pyx_mstate_global->__pyx_kp_u_no_message_to_consume #define __pyx_kp_u_no_message_to_discard __pyx_mstate_global->__pyx_kp_u_no_message_to_discard #define __pyx_n_s_node __pyx_mstate_global->__pyx_n_s_node #define __pyx_kp_u_not_enough_data_to_read_bytes __pyx_mstate_global->__pyx_kp_u_not_enough_data_to_read_bytes #define __pyx_kp_u_not_enough_data_to_read_one_byte __pyx_mstate_global->__pyx_kp_u_not_enough_data_to_read_one_byte #define __pyx_n_s_now __pyx_mstate_global->__pyx_n_s_now #define __pyx_kp_u_null_value_not_allowed_in_hstore __pyx_mstate_global->__pyx_kp_u_null_value_not_allowed_in_hstore #define __pyx_n_s_packed __pyx_mstate_global->__pyx_n_s_packed #define __pyx_kp_u_path_value_too_long __pyx_mstate_global->__pyx_kp_u_path_value_too_long #define __pyx_n_s_pg_epoch_date __pyx_mstate_global->__pyx_n_s_pg_epoch_date #define __pyx_n_s_pg_epoch_datetime __pyx_mstate_global->__pyx_n_s_pg_epoch_datetime #define __pyx_n_s_pg_epoch_datetime_utc __pyx_mstate_global->__pyx_n_s_pg_epoch_datetime_utc #define __pyx_n_s_pgproto_types __pyx_mstate_global->__pyx_n_s_pgproto_types #define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle #define __pyx_kp_u_polygon_value_too_long __pyx_mstate_global->__pyx_kp_u_polygon_value_too_long #define __pyx_n_s_popleft __pyx_mstate_global->__pyx_n_s_popleft #define __pyx_n_s_prefixlen __pyx_mstate_global->__pyx_n_s_prefixlen #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare #define __pyx_n_s_print __pyx_mstate_global->__pyx_n_s_print #define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError #define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum #define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type #define __pyx_n_s_pyx_unpickle_CodecContext __pyx_mstate_global->__pyx_n_s_pyx_unpickle_CodecContext #define __pyx_n_s_pyx_unpickle___UUIDReplaceMe __pyx_mstate_global->__pyx_n_s_pyx_unpickle___UUIDReplaceMe #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range #define __pyx_kp_u_read_null_str_buffer_overread __pyx_mstate_global->__pyx_kp_u_read_null_str_buffer_overread #define __pyx_kp_u_read_null_str_only_works_when_th __pyx_mstate_global->__pyx_kp_u_read_null_str_only_works_when_th #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_kp_u_remaining __pyx_mstate_global->__pyx_kp_u_remaining #define __pyx_n_s_replace __pyx_mstate_global->__pyx_n_s_replace #define __pyx_n_s_second __pyx_mstate_global->__pyx_n_s_second #define __pyx_n_s_seconds __pyx_mstate_global->__pyx_n_s_seconds #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_sign __pyx_mstate_global->__pyx_n_s_sign #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_kp_u_string_is_too_large __pyx_mstate_global->__pyx_kp_u_string_is_too_large #define __pyx_kp_u_string_too_long __pyx_mstate_global->__pyx_kp_u_string_too_long #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_kp_u_the_buffer_is_in_read_only_mode __pyx_mstate_global->__pyx_kp_u_the_buffer_is_in_read_only_mode #define __pyx_n_s_time __pyx_mstate_global->__pyx_n_s_time #define __pyx_n_s_time_hi_version __pyx_mstate_global->__pyx_n_s_time_hi_version #define __pyx_n_s_time_low __pyx_mstate_global->__pyx_n_s_time_low #define __pyx_n_s_time_mid __pyx_mstate_global->__pyx_n_s_time_mid #define __pyx_kp_u_time_tuple_encoder_expecting_1_e __pyx_mstate_global->__pyx_kp_u_time_tuple_encoder_expecting_1_e #define __pyx_kp_u_time_tuple_encoder_expecting_2_e __pyx_mstate_global->__pyx_kp_u_time_tuple_encoder_expecting_2_e #define __pyx_n_s_timedelta __pyx_mstate_global->__pyx_n_s_timedelta #define __pyx_n_s_timestamp __pyx_mstate_global->__pyx_n_s_timestamp #define __pyx_kp_u_timestamp_tuple_encoder_expectin __pyx_mstate_global->__pyx_kp_u_timestamp_tuple_encoder_expectin #define __pyx_n_s_timezone __pyx_mstate_global->__pyx_n_s_timezone #define __pyx_n_s_toordinal __pyx_mstate_global->__pyx_n_s_toordinal #define __pyx_kp_u_tuple_id_block_value_out_of_uint __pyx_mstate_global->__pyx_kp_u_tuple_id_block_value_out_of_uint #define __pyx_kp_u_tuple_id_offset_value_out_of_uin __pyx_mstate_global->__pyx_kp_u_tuple_id_offset_value_out_of_uin #define __pyx_kp_u_txid_snapshot_value_is_too_long __pyx_mstate_global->__pyx_kp_u_txid_snapshot_value_is_too_long #define __pyx_n_s_types __pyx_mstate_global->__pyx_n_s_types #define __pyx_n_s_tzinfo __pyx_mstate_global->__pyx_n_s_tzinfo #define __pyx_kp_u_unexpected_CIDR_flag_set_in_non __pyx_mstate_global->__pyx_kp_u_unexpected_CIDR_flag_set_in_non #define __pyx_kp_u_unexpected_JSONB_format __pyx_mstate_global->__pyx_kp_u_unexpected_JSONB_format #define __pyx_kp_u_unexpected_character __pyx_mstate_global->__pyx_kp_u_unexpected_character #define __pyx_kp_u_unexpected_jsonpath_format __pyx_mstate_global->__pyx_kp_u_unexpected_jsonpath_format #define __pyx_n_s_unknown __pyx_mstate_global->__pyx_n_s_unknown #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update #define __pyx_kp_u_urn_uuid __pyx_mstate_global->__pyx_kp_u_urn_uuid #define __pyx_n_s_use_setstate __pyx_mstate_global->__pyx_n_s_use_setstate #define __pyx_n_s_utc __pyx_mstate_global->__pyx_n_s_utc #define __pyx_n_s_utcoffset __pyx_mstate_global->__pyx_n_s_utcoffset #define __pyx_n_s_uuid __pyx_mstate_global->__pyx_n_s_uuid #define __pyx_kp_u_value_out_of_float32_range __pyx_mstate_global->__pyx_kp_u_value_out_of_float32_range #define __pyx_kp_u_value_out_of_int16_range __pyx_mstate_global->__pyx_kp_u_value_out_of_int16_range #define __pyx_kp_u_value_out_of_int32_range __pyx_mstate_global->__pyx_kp_u_value_out_of_int32_range #define __pyx_kp_u_value_out_of_int64_range __pyx_mstate_global->__pyx_kp_u_value_out_of_int64_range #define __pyx_kp_u_value_out_of_uint32_range __pyx_mstate_global->__pyx_kp_u_value_out_of_uint32_range #define __pyx_kp_u_value_out_of_uint64_range __pyx_mstate_global->__pyx_kp_u_value_out_of_uint64_range #define __pyx_n_s_variant __pyx_mstate_global->__pyx_n_s_variant #define __pyx_n_s_version __pyx_mstate_global->__pyx_n_s_version #define __pyx_n_s_year __pyx_mstate_global->__pyx_n_s_year #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_3 __pyx_mstate_global->__pyx_int_3 #define __pyx_int_5 __pyx_mstate_global->__pyx_int_5 #define __pyx_int_7 __pyx_mstate_global->__pyx_int_7 #define __pyx_int_8 __pyx_mstate_global->__pyx_int_8 #define __pyx_int_10 __pyx_mstate_global->__pyx_int_10 #define __pyx_int_12 __pyx_mstate_global->__pyx_int_12 #define __pyx_int_15 __pyx_mstate_global->__pyx_int_15 #define __pyx_int_20 __pyx_mstate_global->__pyx_int_20 #define __pyx_int_23 __pyx_mstate_global->__pyx_int_23 #define __pyx_int_31 __pyx_mstate_global->__pyx_int_31 #define __pyx_int_32 __pyx_mstate_global->__pyx_int_32 #define __pyx_int_48 __pyx_mstate_global->__pyx_int_48 #define __pyx_int_56 __pyx_mstate_global->__pyx_int_56 #define __pyx_int_59 __pyx_mstate_global->__pyx_int_59 #define __pyx_int_63 __pyx_mstate_global->__pyx_int_63 #define __pyx_int_64 __pyx_mstate_global->__pyx_int_64 #define __pyx_int_76 __pyx_mstate_global->__pyx_int_76 #define __pyx_int_80 __pyx_mstate_global->__pyx_int_80 #define __pyx_int_96 __pyx_mstate_global->__pyx_int_96 #define __pyx_int_100 __pyx_mstate_global->__pyx_int_100 #define __pyx_int_255 __pyx_mstate_global->__pyx_int_255 #define __pyx_int_1000 __pyx_mstate_global->__pyx_int_1000 #define __pyx_int_2000 __pyx_mstate_global->__pyx_int_2000 #define __pyx_int_4095 __pyx_mstate_global->__pyx_int_4095 #define __pyx_int_65535 __pyx_mstate_global->__pyx_int_65535 #define __pyx_int_999999 __pyx_mstate_global->__pyx_int_999999 #define __pyx_int_222419149 __pyx_mstate_global->__pyx_int_222419149 #define __pyx_int_228825662 __pyx_mstate_global->__pyx_int_228825662 #define __pyx_int_238750788 __pyx_mstate_global->__pyx_int_238750788 #define __pyx_int_0xffffffffffff __pyx_mstate_global->__pyx_int_0xffffffffffff #define __pyx_int_0x2000000000000000 __pyx_mstate_global->__pyx_int_0x2000000000000000 #define __pyx_int_0x4000000000000000 __pyx_mstate_global->__pyx_int_0x4000000000000000 #define __pyx_int_0x8000000000000000 __pyx_mstate_global->__pyx_int_0x8000000000000000 #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_slice__6 __pyx_mstate_global->__pyx_slice__6 #define __pyx_slice__7 __pyx_mstate_global->__pyx_slice__7 #define __pyx_slice__8 __pyx_mstate_global->__pyx_slice__8 #define __pyx_slice__9 __pyx_mstate_global->__pyx_slice__9 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 #define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 #define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 #define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32 #define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35 #define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 #define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41 #define __pyx_tuple__50 __pyx_mstate_global->__pyx_tuple__50 #define __pyx_tuple__51 __pyx_mstate_global->__pyx_tuple__51 #define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 #define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 #define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39 #define __pyx_codeobj__40 __pyx_mstate_global->__pyx_codeobj__40 #define __pyx_codeobj__42 __pyx_mstate_global->__pyx_codeobj__42 #define __pyx_codeobj__43 __pyx_mstate_global->__pyx_codeobj__43 #define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44 #define __pyx_codeobj__45 __pyx_mstate_global->__pyx_codeobj__45 #define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 #define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47 #define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 #define __pyx_codeobj__49 __pyx_mstate_global->__pyx_codeobj__49 #define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52 #define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53 /* #### Code section: module_code ### */ /* "cpython/complex.pxd":19 * * @property * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<< * return self.cval.real * */ static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) { double __pyx_r; /* "cpython/complex.pxd":20 * @property * cdef inline double real(self) noexcept: * return self.cval.real # <<<<<<<<<<<<<< * * @property */ __pyx_r = __pyx_v_self->cval.real; goto __pyx_L0; /* "cpython/complex.pxd":19 * * @property * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<< * return self.cval.real * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/complex.pxd":23 * * @property * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<< * return self.cval.imag * */ static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) { double __pyx_r; /* "cpython/complex.pxd":24 * @property * cdef inline double imag(self) noexcept: * return self.cval.imag # <<<<<<<<<<<<<< * * # PyTypeObject PyComplex_Type */ __pyx_r = __pyx_v_self->cval.imag; goto __pyx_L0; /* "cpython/complex.pxd":23 * * @property * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<< * return self.cval.imag * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/contextvars.pxd":112 * * * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the default value of the context variable, */ static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value *__pyx_optional_args) { PyObject *__pyx_v_default_value = ((PyObject *)Py_None); PyObject *__pyx_v_value; PyObject *__pyx_v_pyvalue = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_value", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_default_value = __pyx_optional_args->default_value; } } /* "cpython/contextvars.pxd":117 * or None if no such value or default was found. * """ * cdef PyObject *value = NULL # <<<<<<<<<<<<<< * PyContextVar_Get(var, NULL, &value) * if value is NULL: */ __pyx_v_value = NULL; /* "cpython/contextvars.pxd":118 * """ * cdef PyObject *value = NULL * PyContextVar_Get(var, NULL, &value) # <<<<<<<<<<<<<< * if value is NULL: * # context variable does not have a default */ __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 118, __pyx_L1_error) /* "cpython/contextvars.pxd":119 * cdef PyObject *value = NULL * PyContextVar_Get(var, NULL, &value) * if value is NULL: # <<<<<<<<<<<<<< * # context variable does not have a default * pyvalue = default_value */ __pyx_t_2 = (__pyx_v_value == NULL); if (__pyx_t_2) { /* "cpython/contextvars.pxd":121 * if value is NULL: * # context variable does not have a default * pyvalue = default_value # <<<<<<<<<<<<<< * else: * # value or default value of context variable */ __Pyx_INCREF(__pyx_v_default_value); __pyx_v_pyvalue = __pyx_v_default_value; /* "cpython/contextvars.pxd":119 * cdef PyObject *value = NULL * PyContextVar_Get(var, NULL, &value) * if value is NULL: # <<<<<<<<<<<<<< * # context variable does not have a default * pyvalue = default_value */ goto __pyx_L3; } /* "cpython/contextvars.pxd":124 * else: * # value or default value of context variable * pyvalue = value # <<<<<<<<<<<<<< * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue */ /*else*/ { __pyx_t_3 = ((PyObject *)__pyx_v_value); __Pyx_INCREF(__pyx_t_3); __pyx_v_pyvalue = __pyx_t_3; __pyx_t_3 = 0; /* "cpython/contextvars.pxd":125 * # value or default value of context variable * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<< * return pyvalue * */ Py_XDECREF(__pyx_v_value); } __pyx_L3:; /* "cpython/contextvars.pxd":126 * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_pyvalue); __pyx_r = __pyx_v_pyvalue; goto __pyx_L0; /* "cpython/contextvars.pxd":112 * * * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the default value of the context variable, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cpython.contextvars.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_pyvalue); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cpython/contextvars.pxd":129 * * * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the provided default value if no such value was found. */ static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_default(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default *__pyx_optional_args) { PyObject *__pyx_v_default_value = ((PyObject *)Py_None); PyObject *__pyx_v_value; PyObject *__pyx_v_pyvalue = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_value_no_default", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_default_value = __pyx_optional_args->default_value; } } /* "cpython/contextvars.pxd":135 * Ignores the default value of the context variable, if any. * """ * cdef PyObject *value = NULL # <<<<<<<<<<<<<< * PyContextVar_Get(var, default_value, &value) * # value of context variable or 'default_value' */ __pyx_v_value = NULL; /* "cpython/contextvars.pxd":136 * """ * cdef PyObject *value = NULL * PyContextVar_Get(var, default_value, &value) # <<<<<<<<<<<<<< * # value of context variable or 'default_value' * pyvalue = value */ __pyx_t_1 = PyContextVar_Get(__pyx_v_var, ((PyObject *)__pyx_v_default_value), (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 136, __pyx_L1_error) /* "cpython/contextvars.pxd":138 * PyContextVar_Get(var, default_value, &value) * # value of context variable or 'default_value' * pyvalue = value # <<<<<<<<<<<<<< * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue */ __pyx_t_2 = ((PyObject *)__pyx_v_value); __Pyx_INCREF(__pyx_t_2); __pyx_v_pyvalue = __pyx_t_2; __pyx_t_2 = 0; /* "cpython/contextvars.pxd":139 * # value of context variable or 'default_value' * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<< * return pyvalue */ Py_XDECREF(__pyx_v_value); /* "cpython/contextvars.pxd":140 * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_pyvalue); __pyx_r = __pyx_v_pyvalue; goto __pyx_L0; /* "cpython/contextvars.pxd":129 * * * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the provided default value if no such value was found. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cpython.contextvars.get_value_no_default", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_pyvalue); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/frb.pxd":14 * ssize_t len * * inline ssize_t frb_get_len(FRBuffer *frb): # <<<<<<<<<<<<<< * return frb.len * */ static CYTHON_INLINE Py_ssize_t __pyx_f_7asyncpg_7pgproto_7pgproto_frb_get_len(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_frb) { Py_ssize_t __pyx_r; /* "asyncpg/pgproto/frb.pxd":15 * * inline ssize_t frb_get_len(FRBuffer *frb): * return frb.len # <<<<<<<<<<<<<< * * inline void frb_set_len(FRBuffer *frb, ssize_t new_len): */ __pyx_r = __pyx_v_frb->len; goto __pyx_L0; /* "asyncpg/pgproto/frb.pxd":14 * ssize_t len * * inline ssize_t frb_get_len(FRBuffer *frb): # <<<<<<<<<<<<<< * return frb.len * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "asyncpg/pgproto/frb.pxd":17 * return frb.len * * inline void frb_set_len(FRBuffer *frb, ssize_t new_len): # <<<<<<<<<<<<<< * frb.len = new_len * */ static CYTHON_INLINE void __pyx_f_7asyncpg_7pgproto_7pgproto_frb_set_len(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_frb, Py_ssize_t __pyx_v_new_len) { /* "asyncpg/pgproto/frb.pxd":18 * * inline void frb_set_len(FRBuffer *frb, ssize_t new_len): * frb.len = new_len # <<<<<<<<<<<<<< * * inline void frb_init(FRBuffer *frb, const char *buf, ssize_t len): */ __pyx_v_frb->len = __pyx_v_new_len; /* "asyncpg/pgproto/frb.pxd":17 * return frb.len * * inline void frb_set_len(FRBuffer *frb, ssize_t new_len): # <<<<<<<<<<<<<< * frb.len = new_len * */ /* function exit code */ } /* "asyncpg/pgproto/frb.pxd":20 * frb.len = new_len * * inline void frb_init(FRBuffer *frb, const char *buf, ssize_t len): # <<<<<<<<<<<<<< * frb.buf = buf * frb.len = len */ static CYTHON_INLINE void __pyx_f_7asyncpg_7pgproto_7pgproto_frb_init(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_frb, char const *__pyx_v_buf, Py_ssize_t __pyx_v_len) { /* "asyncpg/pgproto/frb.pxd":21 * * inline void frb_init(FRBuffer *frb, const char *buf, ssize_t len): * frb.buf = buf # <<<<<<<<<<<<<< * frb.len = len * */ __pyx_v_frb->buf = __pyx_v_buf; /* "asyncpg/pgproto/frb.pxd":22 * inline void frb_init(FRBuffer *frb, const char *buf, ssize_t len): * frb.buf = buf * frb.len = len # <<<<<<<<<<<<<< * * inline const char* frb_read(FRBuffer *frb, ssize_t n) except NULL: */ __pyx_v_frb->len = __pyx_v_len; /* "asyncpg/pgproto/frb.pxd":20 * frb.len = new_len * * inline void frb_init(FRBuffer *frb, const char *buf, ssize_t len): # <<<<<<<<<<<<<< * frb.buf = buf * frb.len = len */ /* function exit code */ } /* "asyncpg/pgproto/frb.pxd":24 * frb.len = len * * inline const char* frb_read(FRBuffer *frb, ssize_t n) except NULL: # <<<<<<<<<<<<<< * cdef const char *result * */ static CYTHON_INLINE char const *__pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_frb, Py_ssize_t __pyx_v_n) { char const *__pyx_v_result; char const *__pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("frb_read", 1); /* "asyncpg/pgproto/frb.pxd":27 * cdef const char *result * * frb_check(frb, n) # <<<<<<<<<<<<<< * * result = frb.buf */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_check(__pyx_v_frb, __pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/frb.pxd":29 * frb_check(frb, n) * * result = frb.buf # <<<<<<<<<<<<<< * frb.buf += n * frb.len -= n */ __pyx_t_2 = __pyx_v_frb->buf; __pyx_v_result = __pyx_t_2; /* "asyncpg/pgproto/frb.pxd":30 * * result = frb.buf * frb.buf += n # <<<<<<<<<<<<<< * frb.len -= n * */ __pyx_v_frb->buf = (__pyx_v_frb->buf + __pyx_v_n); /* "asyncpg/pgproto/frb.pxd":31 * result = frb.buf * frb.buf += n * frb.len -= n # <<<<<<<<<<<<<< * * return result */ __pyx_v_frb->len = (__pyx_v_frb->len - __pyx_v_n); /* "asyncpg/pgproto/frb.pxd":33 * frb.len -= n * * return result # <<<<<<<<<<<<<< * * inline const char* frb_read_all(FRBuffer *frb): */ __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/pgproto/frb.pxd":24 * frb.len = len * * inline const char* frb_read(FRBuffer *frb, ssize_t n) except NULL: # <<<<<<<<<<<<<< * cdef const char *result * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.frb_read", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/frb.pxd":35 * return result * * inline const char* frb_read_all(FRBuffer *frb): # <<<<<<<<<<<<<< * cdef const char *result * result = frb.buf */ static CYTHON_INLINE char const *__pyx_f_7asyncpg_7pgproto_7pgproto_frb_read_all(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_frb) { char const *__pyx_v_result; char const *__pyx_r; char const *__pyx_t_1; /* "asyncpg/pgproto/frb.pxd":37 * inline const char* frb_read_all(FRBuffer *frb): * cdef const char *result * result = frb.buf # <<<<<<<<<<<<<< * frb.buf += frb.len * frb.len = 0 */ __pyx_t_1 = __pyx_v_frb->buf; __pyx_v_result = __pyx_t_1; /* "asyncpg/pgproto/frb.pxd":38 * cdef const char *result * result = frb.buf * frb.buf += frb.len # <<<<<<<<<<<<<< * frb.len = 0 * return result */ __pyx_v_frb->buf = (__pyx_v_frb->buf + __pyx_v_frb->len); /* "asyncpg/pgproto/frb.pxd":39 * result = frb.buf * frb.buf += frb.len * frb.len = 0 # <<<<<<<<<<<<<< * return result * */ __pyx_v_frb->len = 0; /* "asyncpg/pgproto/frb.pxd":40 * frb.buf += frb.len * frb.len = 0 * return result # <<<<<<<<<<<<<< * * inline FRBuffer *frb_slice_from(FRBuffer *frb, */ __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/pgproto/frb.pxd":35 * return result * * inline const char* frb_read_all(FRBuffer *frb): # <<<<<<<<<<<<<< * cdef const char *result * result = frb.buf */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "asyncpg/pgproto/frb.pxd":42 * return result * * inline FRBuffer *frb_slice_from(FRBuffer *frb, # <<<<<<<<<<<<<< * FRBuffer* source, ssize_t len): * frb.buf = frb_read(source, len) */ static CYTHON_INLINE struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_f_7asyncpg_7pgproto_7pgproto_frb_slice_from(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_frb, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_source, Py_ssize_t __pyx_v_len) { struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_r; char const *__pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "asyncpg/pgproto/frb.pxd":44 * inline FRBuffer *frb_slice_from(FRBuffer *frb, * FRBuffer* source, ssize_t len): * frb.buf = frb_read(source, len) # <<<<<<<<<<<<<< * frb.len = len * return frb */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_source, __pyx_v_len); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(6, 44, __pyx_L1_error) __pyx_v_frb->buf = __pyx_t_1; /* "asyncpg/pgproto/frb.pxd":45 * FRBuffer* source, ssize_t len): * frb.buf = frb_read(source, len) * frb.len = len # <<<<<<<<<<<<<< * return frb * */ __pyx_v_frb->len = __pyx_v_len; /* "asyncpg/pgproto/frb.pxd":46 * frb.buf = frb_read(source, len) * frb.len = len * return frb # <<<<<<<<<<<<<< * * object frb_check(FRBuffer *frb, ssize_t n) */ __pyx_r = __pyx_v_frb; goto __pyx_L0; /* "asyncpg/pgproto/frb.pxd":42 * return result * * inline FRBuffer *frb_slice_from(FRBuffer *frb, # <<<<<<<<<<<<<< * FRBuffer* source, ssize_t len): * frb.buf = frb_read(source, len) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.pgproto.pgproto.frb_slice_from", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; return __pyx_r; } /* "asyncpg/pgproto/buffer.pxd":28 * bint _message_mode * * cdef inline len(self): # <<<<<<<<<<<<<< * return self._length * */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("len", 1); /* "asyncpg/pgproto/buffer.pxd":29 * * cdef inline len(self): * return self._length # <<<<<<<<<<<<<< * * cdef inline write_len_prefixed_utf8(self, str s): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pxd":28 * bint _message_mode * * cdef inline len(self): # <<<<<<<<<<<<<< * return self._length * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.len", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pxd":31 * return self._length * * cdef inline write_len_prefixed_utf8(self, str s): # <<<<<<<<<<<<<< * return self.write_len_prefixed_bytes(s.encode('utf-8')) * */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_s) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_len_prefixed_utf8", 1); /* "asyncpg/pgproto/buffer.pxd":32 * * cdef inline write_len_prefixed_utf8(self, str s): * return self.write_len_prefixed_bytes(s.encode('utf-8')) # <<<<<<<<<<<<<< * * cdef inline _check_readonly(self) */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_s == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); __PYX_ERR(7, 32, __pyx_L1_error) } __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_bytes(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pxd":31 * return self._length * * cdef inline write_len_prefixed_utf8(self, str s): # <<<<<<<<<<<<<< * return self.write_len_prefixed_bytes(s.encode('utf-8')) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.write_len_prefixed_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pxd":100 * bint _current_message_ready * * cdef inline len(self): # <<<<<<<<<<<<<< * return self._length * */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_len(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("len", 1); /* "asyncpg/pgproto/buffer.pxd":101 * * cdef inline len(self): * return self._length # <<<<<<<<<<<<<< * * cdef inline char get_message_type(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pxd":100 * bint _current_message_ready * * cdef inline len(self): # <<<<<<<<<<<<<< * return self._length * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.len", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pxd":103 * return self._length * * cdef inline char get_message_type(self): # <<<<<<<<<<<<<< * return self._current_message_type * */ static CYTHON_INLINE char __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_type(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { char __pyx_r; /* "asyncpg/pgproto/buffer.pxd":104 * * cdef inline char get_message_type(self): * return self._current_message_type # <<<<<<<<<<<<<< * * cdef inline int32_t get_message_length(self): */ __pyx_r = __pyx_v_self->_current_message_type; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pxd":103 * return self._length * * cdef inline char get_message_type(self): # <<<<<<<<<<<<<< * return self._current_message_type * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "asyncpg/pgproto/buffer.pxd":106 * return self._current_message_type * * cdef inline int32_t get_message_length(self): # <<<<<<<<<<<<<< * return self._current_message_len * */ static CYTHON_INLINE int32_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_length(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { int32_t __pyx_r; /* "asyncpg/pgproto/buffer.pxd":107 * * cdef inline int32_t get_message_length(self): * return self._current_message_len # <<<<<<<<<<<<<< * * cdef feed_data(self, data) */ __pyx_r = __pyx_v_self->_current_message_len; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pxd":106 * return self._current_message_type * * cdef inline int32_t get_message_length(self): # <<<<<<<<<<<<<< * return self._current_message_len * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":72 * ctypedef extern class datetime.date[object PyDateTime_Date]: * @property * cdef inline int year(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_YEAR(self) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_4year_year(PyDateTime_Date *__pyx_v_self) { int __pyx_r; /* "cpython/datetime.pxd":73 * @property * cdef inline int year(self) noexcept: * return PyDateTime_GET_YEAR(self) # <<<<<<<<<<<<<< * * @property */ __pyx_r = PyDateTime_GET_YEAR(((PyObject *)__pyx_v_self)); goto __pyx_L0; /* "cpython/datetime.pxd":72 * ctypedef extern class datetime.date[object PyDateTime_Date]: * @property * cdef inline int year(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_YEAR(self) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":76 * * @property * cdef inline int month(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_MONTH(self) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_5month_month(PyDateTime_Date *__pyx_v_self) { int __pyx_r; /* "cpython/datetime.pxd":77 * @property * cdef inline int month(self) noexcept: * return PyDateTime_GET_MONTH(self) # <<<<<<<<<<<<<< * * @property */ __pyx_r = PyDateTime_GET_MONTH(((PyObject *)__pyx_v_self)); goto __pyx_L0; /* "cpython/datetime.pxd":76 * * @property * cdef inline int month(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_MONTH(self) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":80 * * @property * cdef inline int day(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_DAY(self) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_3day_day(PyDateTime_Date *__pyx_v_self) { int __pyx_r; /* "cpython/datetime.pxd":81 * @property * cdef inline int day(self) noexcept: * return PyDateTime_GET_DAY(self) # <<<<<<<<<<<<<< * * ctypedef extern class datetime.time[object PyDateTime_Time]: */ __pyx_r = PyDateTime_GET_DAY(((PyObject *)__pyx_v_self)); goto __pyx_L0; /* "cpython/datetime.pxd":80 * * @property * cdef inline int day(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_DAY(self) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":85 * ctypedef extern class datetime.time[object PyDateTime_Time]: * @property * cdef inline int hour(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_TIME_GET_HOUR(self) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4hour_hour(PyDateTime_Time *__pyx_v_self) { int __pyx_r; /* "cpython/datetime.pxd":86 * @property * cdef inline int hour(self) noexcept: * return PyDateTime_TIME_GET_HOUR(self) # <<<<<<<<<<<<<< * * @property */ __pyx_r = PyDateTime_TIME_GET_HOUR(((PyObject *)__pyx_v_self)); goto __pyx_L0; /* "cpython/datetime.pxd":85 * ctypedef extern class datetime.time[object PyDateTime_Time]: * @property * cdef inline int hour(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_TIME_GET_HOUR(self) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":89 * * @property * cdef inline int minute(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_TIME_GET_MINUTE(self) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6minute_minute(PyDateTime_Time *__pyx_v_self) { int __pyx_r; /* "cpython/datetime.pxd":90 * @property * cdef inline int minute(self) noexcept: * return PyDateTime_TIME_GET_MINUTE(self) # <<<<<<<<<<<<<< * * @property */ __pyx_r = PyDateTime_TIME_GET_MINUTE(((PyObject *)__pyx_v_self)); goto __pyx_L0; /* "cpython/datetime.pxd":89 * * @property * cdef inline int minute(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_TIME_GET_MINUTE(self) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":93 * * @property * cdef inline int second(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_TIME_GET_SECOND(self) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6second_second(PyDateTime_Time *__pyx_v_self) { int __pyx_r; /* "cpython/datetime.pxd":94 * @property * cdef inline int second(self) noexcept: * return PyDateTime_TIME_GET_SECOND(self) # <<<<<<<<<<<<<< * * @property */ __pyx_r = PyDateTime_TIME_GET_SECOND(((PyObject *)__pyx_v_self)); goto __pyx_L0; /* "cpython/datetime.pxd":93 * * @property * cdef inline int second(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_TIME_GET_SECOND(self) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":97 * * @property * cdef inline int microsecond(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_TIME_GET_MICROSECOND(self) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(PyDateTime_Time *__pyx_v_self) { int __pyx_r; /* "cpython/datetime.pxd":98 * @property * cdef inline int microsecond(self) noexcept: * return PyDateTime_TIME_GET_MICROSECOND(self) # <<<<<<<<<<<<<< * * @property */ __pyx_r = PyDateTime_TIME_GET_MICROSECOND(((PyObject *)__pyx_v_self)); goto __pyx_L0; /* "cpython/datetime.pxd":97 * * @property * cdef inline int microsecond(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_TIME_GET_MICROSECOND(self) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":101 * * @property * cdef inline object tzinfo(self): # <<<<<<<<<<<<<< * return PyDateTime_TIME_GET_TZINFO(self) * */ static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(PyDateTime_Time *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1; __Pyx_RefNannySetupContext("tzinfo", 1); /* "cpython/datetime.pxd":102 * @property * cdef inline object tzinfo(self): * return PyDateTime_TIME_GET_TZINFO(self) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyDateTime_TIME_GET_TZINFO(((PyObject *)__pyx_v_self)); __Pyx_INCREF(((PyObject *)__pyx_t_1)); __pyx_r = ((PyObject *)__pyx_t_1); goto __pyx_L0; /* "cpython/datetime.pxd":101 * * @property * cdef inline object tzinfo(self): # <<<<<<<<<<<<<< * return PyDateTime_TIME_GET_TZINFO(self) * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cpython/datetime.pxd":105 * * @property * cdef inline int fold(self) noexcept: # <<<<<<<<<<<<<< * # For Python < 3.6 this returns 0 no matter what * return PyDateTime_TIME_GET_FOLD(self) */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4fold_fold(PyDateTime_Time *__pyx_v_self) { int __pyx_r; /* "cpython/datetime.pxd":107 * cdef inline int fold(self) noexcept: * # For Python < 3.6 this returns 0 no matter what * return PyDateTime_TIME_GET_FOLD(self) # <<<<<<<<<<<<<< * * ctypedef extern class datetime.datetime[object PyDateTime_DateTime]: */ __pyx_r = PyDateTime_TIME_GET_FOLD(((PyObject *)__pyx_v_self)); goto __pyx_L0; /* "cpython/datetime.pxd":105 * * @property * cdef inline int fold(self) noexcept: # <<<<<<<<<<<<<< * # For Python < 3.6 this returns 0 no matter what * return PyDateTime_TIME_GET_FOLD(self) */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":111 * ctypedef extern class datetime.datetime[object PyDateTime_DateTime]: * @property * cdef inline int year(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_YEAR(self) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4year_year(PyDateTime_DateTime *__pyx_v_self) { int __pyx_r; /* "cpython/datetime.pxd":112 * @property * cdef inline int year(self) noexcept: * return PyDateTime_GET_YEAR(self) # <<<<<<<<<<<<<< * * @property */ __pyx_r = PyDateTime_GET_YEAR(((PyObject *)__pyx_v_self)); goto __pyx_L0; /* "cpython/datetime.pxd":111 * ctypedef extern class datetime.datetime[object PyDateTime_DateTime]: * @property * cdef inline int year(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_YEAR(self) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":115 * * @property * cdef inline int month(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_MONTH(self) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_5month_month(PyDateTime_DateTime *__pyx_v_self) { int __pyx_r; /* "cpython/datetime.pxd":116 * @property * cdef inline int month(self) noexcept: * return PyDateTime_GET_MONTH(self) # <<<<<<<<<<<<<< * * @property */ __pyx_r = PyDateTime_GET_MONTH(((PyObject *)__pyx_v_self)); goto __pyx_L0; /* "cpython/datetime.pxd":115 * * @property * cdef inline int month(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_MONTH(self) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":119 * * @property * cdef inline int day(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_DAY(self) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_3day_day(PyDateTime_DateTime *__pyx_v_self) { int __pyx_r; /* "cpython/datetime.pxd":120 * @property * cdef inline int day(self) noexcept: * return PyDateTime_GET_DAY(self) # <<<<<<<<<<<<<< * * @property */ __pyx_r = PyDateTime_GET_DAY(((PyObject *)__pyx_v_self)); goto __pyx_L0; /* "cpython/datetime.pxd":119 * * @property * cdef inline int day(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_DAY(self) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":123 * * @property * cdef inline int hour(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DATE_GET_HOUR(self) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4hour_hour(PyDateTime_DateTime *__pyx_v_self) { int __pyx_r; /* "cpython/datetime.pxd":124 * @property * cdef inline int hour(self) noexcept: * return PyDateTime_DATE_GET_HOUR(self) # <<<<<<<<<<<<<< * * @property */ __pyx_r = PyDateTime_DATE_GET_HOUR(((PyObject *)__pyx_v_self)); goto __pyx_L0; /* "cpython/datetime.pxd":123 * * @property * cdef inline int hour(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DATE_GET_HOUR(self) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":127 * * @property * cdef inline int minute(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DATE_GET_MINUTE(self) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_6minute_minute(PyDateTime_DateTime *__pyx_v_self) { int __pyx_r; /* "cpython/datetime.pxd":128 * @property * cdef inline int minute(self) noexcept: * return PyDateTime_DATE_GET_MINUTE(self) # <<<<<<<<<<<<<< * * @property */ __pyx_r = PyDateTime_DATE_GET_MINUTE(((PyObject *)__pyx_v_self)); goto __pyx_L0; /* "cpython/datetime.pxd":127 * * @property * cdef inline int minute(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DATE_GET_MINUTE(self) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":131 * * @property * cdef inline int second(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DATE_GET_SECOND(self) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_6second_second(PyDateTime_DateTime *__pyx_v_self) { int __pyx_r; /* "cpython/datetime.pxd":132 * @property * cdef inline int second(self) noexcept: * return PyDateTime_DATE_GET_SECOND(self) # <<<<<<<<<<<<<< * * @property */ __pyx_r = PyDateTime_DATE_GET_SECOND(((PyObject *)__pyx_v_self)); goto __pyx_L0; /* "cpython/datetime.pxd":131 * * @property * cdef inline int second(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DATE_GET_SECOND(self) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":135 * * @property * cdef inline int microsecond(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DATE_GET_MICROSECOND(self) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(PyDateTime_DateTime *__pyx_v_self) { int __pyx_r; /* "cpython/datetime.pxd":136 * @property * cdef inline int microsecond(self) noexcept: * return PyDateTime_DATE_GET_MICROSECOND(self) # <<<<<<<<<<<<<< * * @property */ __pyx_r = PyDateTime_DATE_GET_MICROSECOND(((PyObject *)__pyx_v_self)); goto __pyx_L0; /* "cpython/datetime.pxd":135 * * @property * cdef inline int microsecond(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DATE_GET_MICROSECOND(self) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":139 * * @property * cdef inline object tzinfo(self): # <<<<<<<<<<<<<< * return PyDateTime_DATE_GET_TZINFO(self) * */ static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(PyDateTime_DateTime *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1; __Pyx_RefNannySetupContext("tzinfo", 1); /* "cpython/datetime.pxd":140 * @property * cdef inline object tzinfo(self): * return PyDateTime_DATE_GET_TZINFO(self) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyDateTime_DATE_GET_TZINFO(((PyObject *)__pyx_v_self)); __Pyx_INCREF(((PyObject *)__pyx_t_1)); __pyx_r = ((PyObject *)__pyx_t_1); goto __pyx_L0; /* "cpython/datetime.pxd":139 * * @property * cdef inline object tzinfo(self): # <<<<<<<<<<<<<< * return PyDateTime_DATE_GET_TZINFO(self) * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cpython/datetime.pxd":143 * * @property * cdef inline int fold(self) noexcept: # <<<<<<<<<<<<<< * # For Python < 3.6 this returns 0 no matter what * return PyDateTime_DATE_GET_FOLD(self) */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4fold_fold(PyDateTime_DateTime *__pyx_v_self) { int __pyx_r; /* "cpython/datetime.pxd":145 * cdef inline int fold(self) noexcept: * # For Python < 3.6 this returns 0 no matter what * return PyDateTime_DATE_GET_FOLD(self) # <<<<<<<<<<<<<< * * ctypedef extern class datetime.timedelta[object PyDateTime_Delta]: */ __pyx_r = PyDateTime_DATE_GET_FOLD(((PyObject *)__pyx_v_self)); goto __pyx_L0; /* "cpython/datetime.pxd":143 * * @property * cdef inline int fold(self) noexcept: # <<<<<<<<<<<<<< * # For Python < 3.6 this returns 0 no matter what * return PyDateTime_DATE_GET_FOLD(self) */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":149 * ctypedef extern class datetime.timedelta[object PyDateTime_Delta]: * @property * cdef inline int day(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DELTA_GET_DAYS(self) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_3day_day(PyDateTime_Delta *__pyx_v_self) { int __pyx_r; /* "cpython/datetime.pxd":150 * @property * cdef inline int day(self) noexcept: * return PyDateTime_DELTA_GET_DAYS(self) # <<<<<<<<<<<<<< * * @property */ __pyx_r = PyDateTime_DELTA_GET_DAYS(((PyObject *)__pyx_v_self)); goto __pyx_L0; /* "cpython/datetime.pxd":149 * ctypedef extern class datetime.timedelta[object PyDateTime_Delta]: * @property * cdef inline int day(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DELTA_GET_DAYS(self) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":153 * * @property * cdef inline int second(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DELTA_GET_SECONDS(self) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_6second_second(PyDateTime_Delta *__pyx_v_self) { int __pyx_r; /* "cpython/datetime.pxd":154 * @property * cdef inline int second(self) noexcept: * return PyDateTime_DELTA_GET_SECONDS(self) # <<<<<<<<<<<<<< * * @property */ __pyx_r = PyDateTime_DELTA_GET_SECONDS(((PyObject *)__pyx_v_self)); goto __pyx_L0; /* "cpython/datetime.pxd":153 * * @property * cdef inline int second(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DELTA_GET_SECONDS(self) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":157 * * @property * cdef inline int microsecond(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DELTA_GET_MICROSECONDS(self) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(PyDateTime_Delta *__pyx_v_self) { int __pyx_r; /* "cpython/datetime.pxd":158 * @property * cdef inline int microsecond(self) noexcept: * return PyDateTime_DELTA_GET_MICROSECONDS(self) # <<<<<<<<<<<<<< * * ctypedef extern class datetime.tzinfo[object PyDateTime_TZInfo]: */ __pyx_r = PyDateTime_DELTA_GET_MICROSECONDS(((PyObject *)__pyx_v_self)); goto __pyx_L0; /* "cpython/datetime.pxd":157 * * @property * cdef inline int microsecond(self) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DELTA_GET_MICROSECONDS(self) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":282 * # Datetime C API initialization function. * # You have to call it before any usage of DateTime CAPI functions. * cdef inline void import_datetime() noexcept: # <<<<<<<<<<<<<< * PyDateTime_IMPORT * */ static CYTHON_INLINE void __pyx_f_7cpython_8datetime_import_datetime(void) { /* "cpython/datetime.pxd":283 * # You have to call it before any usage of DateTime CAPI functions. * cdef inline void import_datetime() noexcept: * PyDateTime_IMPORT # <<<<<<<<<<<<<< * * # Create date object using DateTime CAPI factory function. */ (void)(PyDateTime_IMPORT); /* "cpython/datetime.pxd":282 * # Datetime C API initialization function. * # You have to call it before any usage of DateTime CAPI functions. * cdef inline void import_datetime() noexcept: # <<<<<<<<<<<<<< * PyDateTime_IMPORT * */ /* function exit code */ } /* "cpython/datetime.pxd":287 * # Create date object using DateTime CAPI factory function. * # Note, there are no range checks for any of the arguments. * cdef inline date date_new(int year, int month, int day): # <<<<<<<<<<<<<< * return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType) * */ static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cpython_8datetime_date_new(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day) { PyDateTime_Date *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("date_new", 1); /* "cpython/datetime.pxd":288 * # Note, there are no range checks for any of the arguments. * cdef inline date date_new(int year, int month, int day): * return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType) # <<<<<<<<<<<<<< * * # Create time object using DateTime CAPI factory function */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)PyDateTimeAPI->Date_FromDate(__pyx_v_year, __pyx_v_month, __pyx_v_day, PyDateTimeAPI->DateType)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyDateTime_Date *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "cpython/datetime.pxd":287 * # Create date object using DateTime CAPI factory function. * # Note, there are no range checks for any of the arguments. * cdef inline date date_new(int year, int month, int day): # <<<<<<<<<<<<<< * return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cpython.datetime.date_new", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cpython/datetime.pxd":292 * # Create time object using DateTime CAPI factory function * # Note, there are no range checks for any of the arguments. * cdef inline time time_new(int hour, int minute, int second, int microsecond, object tz, int fold=0): # <<<<<<<<<<<<<< * return __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold) * */ static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cpython_8datetime_time_new(int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, PyObject *__pyx_v_tz, struct __pyx_opt_args_7cpython_8datetime_time_new *__pyx_optional_args) { int __pyx_v_fold = ((int)0); PyDateTime_Time *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("time_new", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_fold = __pyx_optional_args->fold; } } /* "cpython/datetime.pxd":293 * # Note, there are no range checks for any of the arguments. * cdef inline time time_new(int hour, int minute, int second, int microsecond, object tz, int fold=0): * return __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold) # <<<<<<<<<<<<<< * * # Create datetime object using DateTime CAPI factory function. */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)__Pyx_DateTime_TimeWithFold(__pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_tz, __pyx_v_fold)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(8, 293, __pyx_L1_error) __pyx_r = ((PyDateTime_Time *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "cpython/datetime.pxd":292 * # Create time object using DateTime CAPI factory function * # Note, there are no range checks for any of the arguments. * cdef inline time time_new(int hour, int minute, int second, int microsecond, object tz, int fold=0): # <<<<<<<<<<<<<< * return __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cpython.datetime.time_new", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cpython/datetime.pxd":297 * # Create datetime object using DateTime CAPI factory function. * # Note, there are no range checks for any of the arguments. * cdef inline datetime datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz, int fold=0): # <<<<<<<<<<<<<< * return __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold) * */ static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cpython_8datetime_datetime_new(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day, int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, PyObject *__pyx_v_tz, struct __pyx_opt_args_7cpython_8datetime_datetime_new *__pyx_optional_args) { int __pyx_v_fold = ((int)0); PyDateTime_DateTime *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("datetime_new", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_fold = __pyx_optional_args->fold; } } /* "cpython/datetime.pxd":298 * # Note, there are no range checks for any of the arguments. * cdef inline datetime datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz, int fold=0): * return __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold) # <<<<<<<<<<<<<< * * # Create timedelta object using DateTime CAPI factory function. */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)__Pyx_DateTime_DateTimeWithFold(__pyx_v_year, __pyx_v_month, __pyx_v_day, __pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_tz, __pyx_v_fold)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "cpython/datetime.pxd":297 * # Create datetime object using DateTime CAPI factory function. * # Note, there are no range checks for any of the arguments. * cdef inline datetime datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz, int fold=0): # <<<<<<<<<<<<<< * return __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cpython.datetime.datetime_new", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cpython/datetime.pxd":302 * # Create timedelta object using DateTime CAPI factory function. * # Note, there are no range checks for any of the arguments. * cdef inline timedelta timedelta_new(int days, int seconds, int useconds): # <<<<<<<<<<<<<< * return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType) * */ static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cpython_8datetime_timedelta_new(int __pyx_v_days, int __pyx_v_seconds, int __pyx_v_useconds) { PyDateTime_Delta *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("timedelta_new", 1); /* "cpython/datetime.pxd":303 * # Note, there are no range checks for any of the arguments. * cdef inline timedelta timedelta_new(int days, int seconds, int useconds): * return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType) # <<<<<<<<<<<<<< * * # Create timedelta object using DateTime CAPI factory function. */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = ((PyObject *)PyDateTimeAPI->Delta_FromDelta(__pyx_v_days, __pyx_v_seconds, __pyx_v_useconds, 1, PyDateTimeAPI->DeltaType)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyDateTime_Delta *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "cpython/datetime.pxd":302 * # Create timedelta object using DateTime CAPI factory function. * # Note, there are no range checks for any of the arguments. * cdef inline timedelta timedelta_new(int days, int seconds, int useconds): # <<<<<<<<<<<<<< * return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cpython.datetime.timedelta_new", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cpython/datetime.pxd":306 * * # Create timedelta object using DateTime CAPI factory function. * cdef inline object timezone_new(object offset, object name=None): # <<<<<<<<<<<<<< * if PY_VERSION_HEX < 0x030700b1: * raise RuntimeError('Time zones are not available from the C-API.') */ static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_timezone_new(PyObject *__pyx_v_offset, struct __pyx_opt_args_7cpython_8datetime_timezone_new *__pyx_optional_args) { PyObject *__pyx_v_name = ((PyObject *)Py_None); PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("timezone_new", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_name = __pyx_optional_args->name; } } /* "cpython/datetime.pxd":307 * # Create timedelta object using DateTime CAPI factory function. * cdef inline object timezone_new(object offset, object name=None): * if PY_VERSION_HEX < 0x030700b1: # <<<<<<<<<<<<<< * raise RuntimeError('Time zones are not available from the C-API.') * return __Pyx_TimeZone_FromOffsetAndName(offset, name if name is not None else NULL) */ __pyx_t_1 = (PY_VERSION_HEX < 0x030700b1); if (unlikely(__pyx_t_1)) { /* "cpython/datetime.pxd":308 * cdef inline object timezone_new(object offset, object name=None): * if PY_VERSION_HEX < 0x030700b1: * raise RuntimeError('Time zones are not available from the C-API.') # <<<<<<<<<<<<<< * return __Pyx_TimeZone_FromOffsetAndName(offset, name if name is not None else NULL) * */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(8, 308, __pyx_L1_error) /* "cpython/datetime.pxd":307 * # Create timedelta object using DateTime CAPI factory function. * cdef inline object timezone_new(object offset, object name=None): * if PY_VERSION_HEX < 0x030700b1: # <<<<<<<<<<<<<< * raise RuntimeError('Time zones are not available from the C-API.') * return __Pyx_TimeZone_FromOffsetAndName(offset, name if name is not None else NULL) */ } /* "cpython/datetime.pxd":309 * if PY_VERSION_HEX < 0x030700b1: * raise RuntimeError('Time zones are not available from the C-API.') * return __Pyx_TimeZone_FromOffsetAndName(offset, name if name is not None else NULL) # <<<<<<<<<<<<<< * * # Create datetime object using DB API constructor. */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = (__pyx_v_name != Py_None); if (__pyx_t_1) { __pyx_t_3 = ((PyObject *)__pyx_v_name); } else { __pyx_t_3 = NULL; } __pyx_t_2 = __Pyx_TimeZone_FromOffsetAndName(__pyx_v_offset, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "cpython/datetime.pxd":306 * * # Create timedelta object using DateTime CAPI factory function. * cdef inline object timezone_new(object offset, object name=None): # <<<<<<<<<<<<<< * if PY_VERSION_HEX < 0x030700b1: * raise RuntimeError('Time zones are not available from the C-API.') */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cpython.datetime.timezone_new", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cpython/datetime.pxd":312 * * # Create datetime object using DB API constructor. * cdef inline datetime datetime_from_timestamp(timestamp, tz=None): # <<<<<<<<<<<<<< * return PyDateTimeAPI.DateTime_FromTimestamp( * PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL) */ static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cpython_8datetime_datetime_from_timestamp(PyObject *__pyx_v_timestamp, struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp *__pyx_optional_args) { PyObject *__pyx_v_tz = ((PyObject *)Py_None); PyDateTime_DateTime *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("datetime_from_timestamp", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_tz = __pyx_optional_args->tz; } } /* "cpython/datetime.pxd":313 * # Create datetime object using DB API constructor. * cdef inline datetime datetime_from_timestamp(timestamp, tz=None): * return PyDateTimeAPI.DateTime_FromTimestamp( # <<<<<<<<<<<<<< * PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL) * */ __Pyx_XDECREF((PyObject *)__pyx_r); /* "cpython/datetime.pxd":314 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None): * return PyDateTimeAPI.DateTime_FromTimestamp( * PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL) # <<<<<<<<<<<<<< * * # Create date object using DB API constructor. */ __pyx_t_2 = (__pyx_v_tz != Py_None); if (__pyx_t_2) { __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_timestamp); __Pyx_GIVEREF(__pyx_v_timestamp); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_timestamp)) __PYX_ERR(8, 314, __pyx_L1_error); __Pyx_INCREF(__pyx_v_tz); __Pyx_GIVEREF(__pyx_v_tz); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_tz)) __PYX_ERR(8, 314, __pyx_L1_error); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_timestamp); __Pyx_GIVEREF(__pyx_v_timestamp); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_timestamp)) __PYX_ERR(8, 314, __pyx_L1_error); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } /* "cpython/datetime.pxd":313 * # Create datetime object using DB API constructor. * cdef inline datetime datetime_from_timestamp(timestamp, tz=None): * return PyDateTimeAPI.DateTime_FromTimestamp( # <<<<<<<<<<<<<< * PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL) * */ __pyx_t_3 = ((PyObject *)PyDateTimeAPI->DateTime_FromTimestamp(((PyObject *)PyDateTimeAPI->DateTimeType), __pyx_t_1, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((PyDateTime_DateTime *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; /* "cpython/datetime.pxd":312 * * # Create datetime object using DB API constructor. * cdef inline datetime datetime_from_timestamp(timestamp, tz=None): # <<<<<<<<<<<<<< * return PyDateTimeAPI.DateTime_FromTimestamp( * PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cpython.datetime.datetime_from_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cpython/datetime.pxd":317 * * # Create date object using DB API constructor. * cdef inline date date_from_timestamp(timestamp): # <<<<<<<<<<<<<< * return PyDateTimeAPI.Date_FromTimestamp(PyDateTimeAPI.DateType, (timestamp,)) * */ static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cpython_8datetime_date_from_timestamp(PyObject *__pyx_v_timestamp) { PyDateTime_Date *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("date_from_timestamp", 1); /* "cpython/datetime.pxd":318 * # Create date object using DB API constructor. * cdef inline date date_from_timestamp(timestamp): * return PyDateTimeAPI.Date_FromTimestamp(PyDateTimeAPI.DateType, (timestamp,)) # <<<<<<<<<<<<<< * * # More recognizable getters for date/time/datetime/timedelta. */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_timestamp); __Pyx_GIVEREF(__pyx_v_timestamp); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_timestamp)) __PYX_ERR(8, 318, __pyx_L1_error); __pyx_t_2 = ((PyObject *)PyDateTimeAPI->Date_FromTimestamp(((PyObject *)PyDateTimeAPI->DateType), __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((PyDateTime_Date *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "cpython/datetime.pxd":317 * * # Create date object using DB API constructor. * cdef inline date date_from_timestamp(timestamp): # <<<<<<<<<<<<<< * return PyDateTimeAPI.Date_FromTimestamp(PyDateTimeAPI.DateType, (timestamp,)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cpython.datetime.date_from_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cpython/datetime.pxd":326 * * # Get UTC singleton * cdef inline object get_utc(): # <<<<<<<<<<<<<< * if PY_VERSION_HEX < 0x030700b1: * raise RuntimeError('Time zones are not available from the C-API.') */ static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_get_utc(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_utc", 1); /* "cpython/datetime.pxd":327 * # Get UTC singleton * cdef inline object get_utc(): * if PY_VERSION_HEX < 0x030700b1: # <<<<<<<<<<<<<< * raise RuntimeError('Time zones are not available from the C-API.') * return __Pyx_TimeZone_UTC */ __pyx_t_1 = (PY_VERSION_HEX < 0x030700b1); if (unlikely(__pyx_t_1)) { /* "cpython/datetime.pxd":328 * cdef inline object get_utc(): * if PY_VERSION_HEX < 0x030700b1: * raise RuntimeError('Time zones are not available from the C-API.') # <<<<<<<<<<<<<< * return __Pyx_TimeZone_UTC * */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(8, 328, __pyx_L1_error) /* "cpython/datetime.pxd":327 * # Get UTC singleton * cdef inline object get_utc(): * if PY_VERSION_HEX < 0x030700b1: # <<<<<<<<<<<<<< * raise RuntimeError('Time zones are not available from the C-API.') * return __Pyx_TimeZone_UTC */ } /* "cpython/datetime.pxd":329 * if PY_VERSION_HEX < 0x030700b1: * raise RuntimeError('Time zones are not available from the C-API.') * return __Pyx_TimeZone_UTC # <<<<<<<<<<<<<< * * # Get tzinfo of time */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__Pyx_TimeZone_UTC)); __pyx_r = ((PyObject *)__Pyx_TimeZone_UTC); goto __pyx_L0; /* "cpython/datetime.pxd":326 * * # Get UTC singleton * cdef inline object get_utc(): # <<<<<<<<<<<<<< * if PY_VERSION_HEX < 0x030700b1: * raise RuntimeError('Time zones are not available from the C-API.') */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cpython.datetime.get_utc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cpython/datetime.pxd":332 * * # Get tzinfo of time * cdef inline object time_tzinfo(object o): # <<<<<<<<<<<<<< * return PyDateTime_TIME_GET_TZINFO(o) * */ static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_time_tzinfo(PyObject *__pyx_v_o) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1; __Pyx_RefNannySetupContext("time_tzinfo", 1); /* "cpython/datetime.pxd":333 * # Get tzinfo of time * cdef inline object time_tzinfo(object o): * return PyDateTime_TIME_GET_TZINFO(o) # <<<<<<<<<<<<<< * * # Get tzinfo of datetime */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyDateTime_TIME_GET_TZINFO(__pyx_v_o); __Pyx_INCREF(((PyObject *)__pyx_t_1)); __pyx_r = ((PyObject *)__pyx_t_1); goto __pyx_L0; /* "cpython/datetime.pxd":332 * * # Get tzinfo of time * cdef inline object time_tzinfo(object o): # <<<<<<<<<<<<<< * return PyDateTime_TIME_GET_TZINFO(o) * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cpython/datetime.pxd":336 * * # Get tzinfo of datetime * cdef inline object datetime_tzinfo(object o): # <<<<<<<<<<<<<< * return PyDateTime_DATE_GET_TZINFO(o) * */ static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_datetime_tzinfo(PyObject *__pyx_v_o) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1; __Pyx_RefNannySetupContext("datetime_tzinfo", 1); /* "cpython/datetime.pxd":337 * # Get tzinfo of datetime * cdef inline object datetime_tzinfo(object o): * return PyDateTime_DATE_GET_TZINFO(o) # <<<<<<<<<<<<<< * * # Get year of date */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyDateTime_DATE_GET_TZINFO(__pyx_v_o); __Pyx_INCREF(((PyObject *)__pyx_t_1)); __pyx_r = ((PyObject *)__pyx_t_1); goto __pyx_L0; /* "cpython/datetime.pxd":336 * * # Get tzinfo of datetime * cdef inline object datetime_tzinfo(object o): # <<<<<<<<<<<<<< * return PyDateTime_DATE_GET_TZINFO(o) * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cpython/datetime.pxd":340 * * # Get year of date * cdef inline int date_year(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_YEAR(o) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_year(PyObject *__pyx_v_o) { int __pyx_r; /* "cpython/datetime.pxd":341 * # Get year of date * cdef inline int date_year(object o) noexcept: * return PyDateTime_GET_YEAR(o) # <<<<<<<<<<<<<< * * # Get month of date */ __pyx_r = PyDateTime_GET_YEAR(__pyx_v_o); goto __pyx_L0; /* "cpython/datetime.pxd":340 * * # Get year of date * cdef inline int date_year(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_YEAR(o) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":344 * * # Get month of date * cdef inline int date_month(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_MONTH(o) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_month(PyObject *__pyx_v_o) { int __pyx_r; /* "cpython/datetime.pxd":345 * # Get month of date * cdef inline int date_month(object o) noexcept: * return PyDateTime_GET_MONTH(o) # <<<<<<<<<<<<<< * * # Get day of date */ __pyx_r = PyDateTime_GET_MONTH(__pyx_v_o); goto __pyx_L0; /* "cpython/datetime.pxd":344 * * # Get month of date * cdef inline int date_month(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_MONTH(o) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":348 * * # Get day of date * cdef inline int date_day(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_DAY(o) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_day(PyObject *__pyx_v_o) { int __pyx_r; /* "cpython/datetime.pxd":349 * # Get day of date * cdef inline int date_day(object o) noexcept: * return PyDateTime_GET_DAY(o) # <<<<<<<<<<<<<< * * # Get year of datetime */ __pyx_r = PyDateTime_GET_DAY(__pyx_v_o); goto __pyx_L0; /* "cpython/datetime.pxd":348 * * # Get day of date * cdef inline int date_day(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_DAY(o) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":352 * * # Get year of datetime * cdef inline int datetime_year(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_YEAR(o) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_year(PyObject *__pyx_v_o) { int __pyx_r; /* "cpython/datetime.pxd":353 * # Get year of datetime * cdef inline int datetime_year(object o) noexcept: * return PyDateTime_GET_YEAR(o) # <<<<<<<<<<<<<< * * # Get month of datetime */ __pyx_r = PyDateTime_GET_YEAR(__pyx_v_o); goto __pyx_L0; /* "cpython/datetime.pxd":352 * * # Get year of datetime * cdef inline int datetime_year(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_YEAR(o) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":356 * * # Get month of datetime * cdef inline int datetime_month(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_MONTH(o) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_month(PyObject *__pyx_v_o) { int __pyx_r; /* "cpython/datetime.pxd":357 * # Get month of datetime * cdef inline int datetime_month(object o) noexcept: * return PyDateTime_GET_MONTH(o) # <<<<<<<<<<<<<< * * # Get day of datetime */ __pyx_r = PyDateTime_GET_MONTH(__pyx_v_o); goto __pyx_L0; /* "cpython/datetime.pxd":356 * * # Get month of datetime * cdef inline int datetime_month(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_MONTH(o) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":360 * * # Get day of datetime * cdef inline int datetime_day(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_DAY(o) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_day(PyObject *__pyx_v_o) { int __pyx_r; /* "cpython/datetime.pxd":361 * # Get day of datetime * cdef inline int datetime_day(object o) noexcept: * return PyDateTime_GET_DAY(o) # <<<<<<<<<<<<<< * * # Get hour of time */ __pyx_r = PyDateTime_GET_DAY(__pyx_v_o); goto __pyx_L0; /* "cpython/datetime.pxd":360 * * # Get day of datetime * cdef inline int datetime_day(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_GET_DAY(o) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":364 * * # Get hour of time * cdef inline int time_hour(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_TIME_GET_HOUR(o) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_hour(PyObject *__pyx_v_o) { int __pyx_r; /* "cpython/datetime.pxd":365 * # Get hour of time * cdef inline int time_hour(object o) noexcept: * return PyDateTime_TIME_GET_HOUR(o) # <<<<<<<<<<<<<< * * # Get minute of time */ __pyx_r = PyDateTime_TIME_GET_HOUR(__pyx_v_o); goto __pyx_L0; /* "cpython/datetime.pxd":364 * * # Get hour of time * cdef inline int time_hour(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_TIME_GET_HOUR(o) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":368 * * # Get minute of time * cdef inline int time_minute(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_TIME_GET_MINUTE(o) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_minute(PyObject *__pyx_v_o) { int __pyx_r; /* "cpython/datetime.pxd":369 * # Get minute of time * cdef inline int time_minute(object o) noexcept: * return PyDateTime_TIME_GET_MINUTE(o) # <<<<<<<<<<<<<< * * # Get second of time */ __pyx_r = PyDateTime_TIME_GET_MINUTE(__pyx_v_o); goto __pyx_L0; /* "cpython/datetime.pxd":368 * * # Get minute of time * cdef inline int time_minute(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_TIME_GET_MINUTE(o) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":372 * * # Get second of time * cdef inline int time_second(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_TIME_GET_SECOND(o) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_second(PyObject *__pyx_v_o) { int __pyx_r; /* "cpython/datetime.pxd":373 * # Get second of time * cdef inline int time_second(object o) noexcept: * return PyDateTime_TIME_GET_SECOND(o) # <<<<<<<<<<<<<< * * # Get microsecond of time */ __pyx_r = PyDateTime_TIME_GET_SECOND(__pyx_v_o); goto __pyx_L0; /* "cpython/datetime.pxd":372 * * # Get second of time * cdef inline int time_second(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_TIME_GET_SECOND(o) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":376 * * # Get microsecond of time * cdef inline int time_microsecond(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_TIME_GET_MICROSECOND(o) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_microsecond(PyObject *__pyx_v_o) { int __pyx_r; /* "cpython/datetime.pxd":377 * # Get microsecond of time * cdef inline int time_microsecond(object o) noexcept: * return PyDateTime_TIME_GET_MICROSECOND(o) # <<<<<<<<<<<<<< * * # Get fold of time */ __pyx_r = PyDateTime_TIME_GET_MICROSECOND(__pyx_v_o); goto __pyx_L0; /* "cpython/datetime.pxd":376 * * # Get microsecond of time * cdef inline int time_microsecond(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_TIME_GET_MICROSECOND(o) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":380 * * # Get fold of time * cdef inline int time_fold(object o) noexcept: # <<<<<<<<<<<<<< * # For Python < 3.6 this returns 0 no matter what * return PyDateTime_TIME_GET_FOLD(o) */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_fold(PyObject *__pyx_v_o) { int __pyx_r; /* "cpython/datetime.pxd":382 * cdef inline int time_fold(object o) noexcept: * # For Python < 3.6 this returns 0 no matter what * return PyDateTime_TIME_GET_FOLD(o) # <<<<<<<<<<<<<< * * # Get hour of datetime */ __pyx_r = PyDateTime_TIME_GET_FOLD(__pyx_v_o); goto __pyx_L0; /* "cpython/datetime.pxd":380 * * # Get fold of time * cdef inline int time_fold(object o) noexcept: # <<<<<<<<<<<<<< * # For Python < 3.6 this returns 0 no matter what * return PyDateTime_TIME_GET_FOLD(o) */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":385 * * # Get hour of datetime * cdef inline int datetime_hour(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DATE_GET_HOUR(o) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_hour(PyObject *__pyx_v_o) { int __pyx_r; /* "cpython/datetime.pxd":386 * # Get hour of datetime * cdef inline int datetime_hour(object o) noexcept: * return PyDateTime_DATE_GET_HOUR(o) # <<<<<<<<<<<<<< * * # Get minute of datetime */ __pyx_r = PyDateTime_DATE_GET_HOUR(__pyx_v_o); goto __pyx_L0; /* "cpython/datetime.pxd":385 * * # Get hour of datetime * cdef inline int datetime_hour(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DATE_GET_HOUR(o) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":389 * * # Get minute of datetime * cdef inline int datetime_minute(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DATE_GET_MINUTE(o) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_minute(PyObject *__pyx_v_o) { int __pyx_r; /* "cpython/datetime.pxd":390 * # Get minute of datetime * cdef inline int datetime_minute(object o) noexcept: * return PyDateTime_DATE_GET_MINUTE(o) # <<<<<<<<<<<<<< * * # Get second of datetime */ __pyx_r = PyDateTime_DATE_GET_MINUTE(__pyx_v_o); goto __pyx_L0; /* "cpython/datetime.pxd":389 * * # Get minute of datetime * cdef inline int datetime_minute(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DATE_GET_MINUTE(o) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":393 * * # Get second of datetime * cdef inline int datetime_second(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DATE_GET_SECOND(o) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_second(PyObject *__pyx_v_o) { int __pyx_r; /* "cpython/datetime.pxd":394 * # Get second of datetime * cdef inline int datetime_second(object o) noexcept: * return PyDateTime_DATE_GET_SECOND(o) # <<<<<<<<<<<<<< * * # Get microsecond of datetime */ __pyx_r = PyDateTime_DATE_GET_SECOND(__pyx_v_o); goto __pyx_L0; /* "cpython/datetime.pxd":393 * * # Get second of datetime * cdef inline int datetime_second(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DATE_GET_SECOND(o) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":397 * * # Get microsecond of datetime * cdef inline int datetime_microsecond(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DATE_GET_MICROSECOND(o) * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_microsecond(PyObject *__pyx_v_o) { int __pyx_r; /* "cpython/datetime.pxd":398 * # Get microsecond of datetime * cdef inline int datetime_microsecond(object o) noexcept: * return PyDateTime_DATE_GET_MICROSECOND(o) # <<<<<<<<<<<<<< * * # Get fold of datetime */ __pyx_r = PyDateTime_DATE_GET_MICROSECOND(__pyx_v_o); goto __pyx_L0; /* "cpython/datetime.pxd":397 * * # Get microsecond of datetime * cdef inline int datetime_microsecond(object o) noexcept: # <<<<<<<<<<<<<< * return PyDateTime_DATE_GET_MICROSECOND(o) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":401 * * # Get fold of datetime * cdef inline int datetime_fold(object o) noexcept: # <<<<<<<<<<<<<< * # For Python < 3.6 this returns 0 no matter what * return PyDateTime_DATE_GET_FOLD(o) */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_fold(PyObject *__pyx_v_o) { int __pyx_r; /* "cpython/datetime.pxd":403 * cdef inline int datetime_fold(object o) noexcept: * # For Python < 3.6 this returns 0 no matter what * return PyDateTime_DATE_GET_FOLD(o) # <<<<<<<<<<<<<< * * # Get days of timedelta */ __pyx_r = PyDateTime_DATE_GET_FOLD(__pyx_v_o); goto __pyx_L0; /* "cpython/datetime.pxd":401 * * # Get fold of datetime * cdef inline int datetime_fold(object o) noexcept: # <<<<<<<<<<<<<< * # For Python < 3.6 this returns 0 no matter what * return PyDateTime_DATE_GET_FOLD(o) */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":406 * * # Get days of timedelta * cdef inline int timedelta_days(object o) noexcept: # <<<<<<<<<<<<<< * return (o).days * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_days(PyObject *__pyx_v_o) { int __pyx_r; /* "cpython/datetime.pxd":407 * # Get days of timedelta * cdef inline int timedelta_days(object o) noexcept: * return (o).days # <<<<<<<<<<<<<< * * # Get seconds of timedelta */ __pyx_r = ((PyDateTime_Delta *)__pyx_v_o)->days; goto __pyx_L0; /* "cpython/datetime.pxd":406 * * # Get days of timedelta * cdef inline int timedelta_days(object o) noexcept: # <<<<<<<<<<<<<< * return (o).days * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":410 * * # Get seconds of timedelta * cdef inline int timedelta_seconds(object o) noexcept: # <<<<<<<<<<<<<< * return (o).seconds * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_seconds(PyObject *__pyx_v_o) { int __pyx_r; /* "cpython/datetime.pxd":411 * # Get seconds of timedelta * cdef inline int timedelta_seconds(object o) noexcept: * return (o).seconds # <<<<<<<<<<<<<< * * # Get microseconds of timedelta */ __pyx_r = ((PyDateTime_Delta *)__pyx_v_o)->seconds; goto __pyx_L0; /* "cpython/datetime.pxd":410 * * # Get seconds of timedelta * cdef inline int timedelta_seconds(object o) noexcept: # <<<<<<<<<<<<<< * return (o).seconds * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":414 * * # Get microseconds of timedelta * cdef inline int timedelta_microseconds(object o) noexcept: # <<<<<<<<<<<<<< * return (o).microseconds * */ static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_microseconds(PyObject *__pyx_v_o) { int __pyx_r; /* "cpython/datetime.pxd":415 * # Get microseconds of timedelta * cdef inline int timedelta_microseconds(object o) noexcept: * return (o).microseconds # <<<<<<<<<<<<<< * * cdef inline double total_seconds(timedelta obj) noexcept: */ __pyx_r = ((PyDateTime_Delta *)__pyx_v_o)->microseconds; goto __pyx_L0; /* "cpython/datetime.pxd":414 * * # Get microseconds of timedelta * cdef inline int timedelta_microseconds(object o) noexcept: # <<<<<<<<<<<<<< * return (o).microseconds * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/datetime.pxd":417 * return (o).microseconds * * cdef inline double total_seconds(timedelta obj) noexcept: # <<<<<<<<<<<<<< * # Mirrors the "timedelta.total_seconds()" method. * # Note that this implementation is not guaranteed to give *exactly* the same */ static CYTHON_INLINE double __pyx_f_7cpython_8datetime_total_seconds(PyDateTime_Delta *__pyx_v_obj) { double __pyx_v_days; double __pyx_v_seconds; double __pyx_v_micros; double __pyx_r; /* "cpython/datetime.pxd":423 * cdef: * double days, seconds, micros * days = PyDateTime_DELTA_GET_DAYS(obj) # <<<<<<<<<<<<<< * seconds = PyDateTime_DELTA_GET_SECONDS(obj) * micros = PyDateTime_DELTA_GET_MICROSECONDS(obj) */ __pyx_v_days = ((double)PyDateTime_DELTA_GET_DAYS(((PyObject *)__pyx_v_obj))); /* "cpython/datetime.pxd":424 * double days, seconds, micros * days = PyDateTime_DELTA_GET_DAYS(obj) * seconds = PyDateTime_DELTA_GET_SECONDS(obj) # <<<<<<<<<<<<<< * micros = PyDateTime_DELTA_GET_MICROSECONDS(obj) * return days * 24 * 3600 + seconds + micros / 1_000_000 */ __pyx_v_seconds = ((double)PyDateTime_DELTA_GET_SECONDS(((PyObject *)__pyx_v_obj))); /* "cpython/datetime.pxd":425 * days = PyDateTime_DELTA_GET_DAYS(obj) * seconds = PyDateTime_DELTA_GET_SECONDS(obj) * micros = PyDateTime_DELTA_GET_MICROSECONDS(obj) # <<<<<<<<<<<<<< * return days * 24 * 3600 + seconds + micros / 1_000_000 */ __pyx_v_micros = ((double)PyDateTime_DELTA_GET_MICROSECONDS(((PyObject *)__pyx_v_obj))); /* "cpython/datetime.pxd":426 * seconds = PyDateTime_DELTA_GET_SECONDS(obj) * micros = PyDateTime_DELTA_GET_MICROSECONDS(obj) * return days * 24 * 3600 + seconds + micros / 1_000_000 # <<<<<<<<<<<<<< */ __pyx_r = ((((__pyx_v_days * 24.0) * 3600.0) + __pyx_v_seconds) + (__pyx_v_micros / 1000000.0)); goto __pyx_L0; /* "cpython/datetime.pxd":417 * return (o).microseconds * * cdef inline double total_seconds(timedelta obj) noexcept: # <<<<<<<<<<<<<< * # Mirrors the "timedelta.total_seconds()" method. * # Note that this implementation is not guaranteed to give *exactly* the same */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "asyncpg/pgproto/frb.pyx":8 * * * cdef object frb_check(FRBuffer *frb, ssize_t n): # <<<<<<<<<<<<<< * if n > frb.len: * raise AssertionError( */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_frb_check(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_frb, Py_ssize_t __pyx_v_n) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; Py_UCS4 __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("frb_check", 1); /* "asyncpg/pgproto/frb.pyx":9 * * cdef object frb_check(FRBuffer *frb, ssize_t n): * if n > frb.len: # <<<<<<<<<<<<<< * raise AssertionError( * f'insufficient data in buffer: requested {n} ' */ __pyx_t_1 = (__pyx_v_n > __pyx_v_frb->len); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/frb.pyx":11 * if n > frb.len: * raise AssertionError( * f'insufficient data in buffer: requested {n} ' # <<<<<<<<<<<<<< * f'remaining {frb.len}') */ __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = 127; __Pyx_INCREF(__pyx_kp_u_insufficient_data_in_buffer_requ); __pyx_t_3 += 39; __Pyx_GIVEREF(__pyx_kp_u_insufficient_data_in_buffer_requ); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_insufficient_data_in_buffer_requ); __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_n, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_kp_u_remaining); __pyx_t_3 += 11; __Pyx_GIVEREF(__pyx_kp_u_remaining); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_remaining); /* "asyncpg/pgproto/frb.pyx":12 * raise AssertionError( * f'insufficient data in buffer: requested {n} ' * f'remaining {frb.len}') # <<<<<<<<<<<<<< */ __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_frb->len, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/pgproto/frb.pyx":11 * if n > frb.len: * raise AssertionError( * f'insufficient data in buffer: requested {n} ' # <<<<<<<<<<<<<< * f'remaining {frb.len}') */ __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/frb.pyx":10 * cdef object frb_check(FRBuffer *frb, ssize_t n): * if n > frb.len: * raise AssertionError( # <<<<<<<<<<<<<< * f'insufficient data in buffer: requested {n} ' * f'remaining {frb.len}') */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(9, 10, __pyx_L1_error) /* "asyncpg/pgproto/frb.pyx":9 * * cdef object frb_check(FRBuffer *frb, ssize_t n): * if n > frb.len: # <<<<<<<<<<<<<< * raise AssertionError( * f'insufficient data in buffer: requested {n} ' */ } /* "asyncpg/pgproto/frb.pyx":8 * * * cdef object frb_check(FRBuffer *frb, ssize_t n): # <<<<<<<<<<<<<< * if n > frb.len: * raise AssertionError( */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.frb_check", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":20 * cdef class WriteBuffer: * * def __cinit__(self): # <<<<<<<<<<<<<< * self._smallbuf_inuse = True * self._buf = self._smallbuf */ /* Python wrapper */ static int __pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_11WriteBuffer___cinit__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7asyncpg_7pgproto_7pgproto_11WriteBuffer___cinit__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self) { int __pyx_r; char *__pyx_t_1; /* "asyncpg/pgproto/buffer.pyx":21 * * def __cinit__(self): * self._smallbuf_inuse = True # <<<<<<<<<<<<<< * self._buf = self._smallbuf * self._size = _BUFFER_INITIAL_SIZE */ __pyx_v_self->_smallbuf_inuse = 1; /* "asyncpg/pgproto/buffer.pyx":22 * def __cinit__(self): * self._smallbuf_inuse = True * self._buf = self._smallbuf # <<<<<<<<<<<<<< * self._size = _BUFFER_INITIAL_SIZE * self._length = 0 */ __pyx_t_1 = __pyx_v_self->_smallbuf; __pyx_v_self->_buf = __pyx_t_1; /* "asyncpg/pgproto/buffer.pyx":23 * self._smallbuf_inuse = True * self._buf = self._smallbuf * self._size = _BUFFER_INITIAL_SIZE # <<<<<<<<<<<<<< * self._length = 0 * self._message_mode = 0 */ __pyx_v_self->_size = 0x400; /* "asyncpg/pgproto/buffer.pyx":24 * self._buf = self._smallbuf * self._size = _BUFFER_INITIAL_SIZE * self._length = 0 # <<<<<<<<<<<<<< * self._message_mode = 0 * */ __pyx_v_self->_length = 0; /* "asyncpg/pgproto/buffer.pyx":25 * self._size = _BUFFER_INITIAL_SIZE * self._length = 0 * self._message_mode = 0 # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->_message_mode = 0; /* "asyncpg/pgproto/buffer.pyx":20 * cdef class WriteBuffer: * * def __cinit__(self): # <<<<<<<<<<<<<< * self._smallbuf_inuse = True * self._buf = self._smallbuf */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":27 * self._message_mode = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self._buf is not NULL and not self._smallbuf_inuse: * cpython.PyMem_Free(self._buf) */ /* Python wrapper */ static void __pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_7asyncpg_7pgproto_7pgproto_11WriteBuffer_2__dealloc__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_7asyncpg_7pgproto_7pgproto_11WriteBuffer_2__dealloc__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 1); /* "asyncpg/pgproto/buffer.pyx":28 * * def __dealloc__(self): * if self._buf is not NULL and not self._smallbuf_inuse: # <<<<<<<<<<<<<< * cpython.PyMem_Free(self._buf) * self._buf = NULL */ __pyx_t_2 = (__pyx_v_self->_buf != NULL); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (!__pyx_v_self->_smallbuf_inuse); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":29 * def __dealloc__(self): * if self._buf is not NULL and not self._smallbuf_inuse: * cpython.PyMem_Free(self._buf) # <<<<<<<<<<<<<< * self._buf = NULL * self._size = 0 */ PyMem_Free(__pyx_v_self->_buf); /* "asyncpg/pgproto/buffer.pyx":30 * if self._buf is not NULL and not self._smallbuf_inuse: * cpython.PyMem_Free(self._buf) * self._buf = NULL # <<<<<<<<<<<<<< * self._size = 0 * */ __pyx_v_self->_buf = NULL; /* "asyncpg/pgproto/buffer.pyx":31 * cpython.PyMem_Free(self._buf) * self._buf = NULL * self._size = 0 # <<<<<<<<<<<<<< * * if self._view_count: */ __pyx_v_self->_size = 0; /* "asyncpg/pgproto/buffer.pyx":28 * * def __dealloc__(self): * if self._buf is not NULL and not self._smallbuf_inuse: # <<<<<<<<<<<<<< * cpython.PyMem_Free(self._buf) * self._buf = NULL */ } /* "asyncpg/pgproto/buffer.pyx":33 * self._size = 0 * * if self._view_count: # <<<<<<<<<<<<<< * raise BufferError( * 'Deallocating buffer with attached memoryviews') */ __pyx_t_1 = (__pyx_v_self->_view_count != 0); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/buffer.pyx":34 * * if self._view_count: * raise BufferError( # <<<<<<<<<<<<<< * 'Deallocating buffer with attached memoryviews') * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_Deallocating_buffer_with_attache}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 34, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":33 * self._size = 0 * * if self._view_count: # <<<<<<<<<<<<<< * raise BufferError( * 'Deallocating buffer with attached memoryviews') */ } /* "asyncpg/pgproto/buffer.pyx":27 * self._message_mode = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self._buf is not NULL and not self._smallbuf_inuse: * cpython.PyMem_Free(self._buf) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_WriteUnraisable("asyncpg.pgproto.pgproto.WriteBuffer.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "asyncpg/pgproto/buffer.pyx":37 * 'Deallocating buffer with attached memoryviews') * * def __getbuffer__(self, Py_buffer *buffer, int flags): # <<<<<<<<<<<<<< * self._view_count += 1 * */ /* Python wrapper */ CYTHON_UNUSED static int __pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /*proto*/ CYTHON_UNUSED static int __pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_11WriteBuffer_4__getbuffer__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_buffer), ((int)__pyx_v_flags)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7asyncpg_7pgproto_7pgproto_11WriteBuffer_4__getbuffer__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; if (unlikely(__pyx_v_buffer == NULL)) { PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); return -1; } __Pyx_RefNannySetupContext("__getbuffer__", 0); __pyx_v_buffer->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_buffer->obj); /* "asyncpg/pgproto/buffer.pyx":38 * * def __getbuffer__(self, Py_buffer *buffer, int flags): * self._view_count += 1 # <<<<<<<<<<<<<< * * cpython.PyBuffer_FillInfo( */ __pyx_v_self->_view_count = (__pyx_v_self->_view_count + 1); /* "asyncpg/pgproto/buffer.pyx":40 * self._view_count += 1 * * cpython.PyBuffer_FillInfo( # <<<<<<<<<<<<<< * buffer, self, self._buf, self._length, * 1, # read-only */ __pyx_t_1 = PyBuffer_FillInfo(__pyx_v_buffer, ((PyObject *)__pyx_v_self), __pyx_v_self->_buf, __pyx_v_self->_length, 1, __pyx_v_flags); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 40, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":37 * 'Deallocating buffer with attached memoryviews') * * def __getbuffer__(self, Py_buffer *buffer, int flags): # <<<<<<<<<<<<<< * self._view_count += 1 * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; if (__pyx_v_buffer->obj != NULL) { __Pyx_GOTREF(__pyx_v_buffer->obj); __Pyx_DECREF(__pyx_v_buffer->obj); __pyx_v_buffer->obj = 0; } goto __pyx_L2; __pyx_L0:; if (__pyx_v_buffer->obj == Py_None) { __Pyx_GOTREF(__pyx_v_buffer->obj); __Pyx_DECREF(__pyx_v_buffer->obj); __pyx_v_buffer->obj = 0; } __pyx_L2:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":45 * flags) * * def __releasebuffer__(self, Py_buffer *buffer): # <<<<<<<<<<<<<< * self._view_count -= 1 * */ /* Python wrapper */ CYTHON_UNUSED static void __pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer); /*proto*/ CYTHON_UNUSED static void __pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_pf_7asyncpg_7pgproto_7pgproto_11WriteBuffer_6__releasebuffer__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_buffer)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_7asyncpg_7pgproto_7pgproto_11WriteBuffer_6__releasebuffer__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, CYTHON_UNUSED Py_buffer *__pyx_v_buffer) { /* "asyncpg/pgproto/buffer.pyx":46 * * def __releasebuffer__(self, Py_buffer *buffer): * self._view_count -= 1 # <<<<<<<<<<<<<< * * cdef inline _check_readonly(self): */ __pyx_v_self->_view_count = (__pyx_v_self->_view_count - 1); /* "asyncpg/pgproto/buffer.pyx":45 * flags) * * def __releasebuffer__(self, Py_buffer *buffer): # <<<<<<<<<<<<<< * self._view_count -= 1 * */ /* function exit code */ } /* "asyncpg/pgproto/buffer.pyx":48 * self._view_count -= 1 * * cdef inline _check_readonly(self): # <<<<<<<<<<<<<< * if self._view_count: * raise BufferError('the buffer is in read-only mode') */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__check_readonly(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_check_readonly", 1); /* "asyncpg/pgproto/buffer.pyx":49 * * cdef inline _check_readonly(self): * if self._view_count: # <<<<<<<<<<<<<< * raise BufferError('the buffer is in read-only mode') * */ __pyx_t_1 = (__pyx_v_self->_view_count != 0); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/buffer.pyx":50 * cdef inline _check_readonly(self): * if self._view_count: * raise BufferError('the buffer is in read-only mode') # <<<<<<<<<<<<<< * * cdef inline _ensure_alloced(self, ssize_t extra_length): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_the_buffer_is_in_read_only_mode}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 50, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":49 * * cdef inline _check_readonly(self): * if self._view_count: # <<<<<<<<<<<<<< * raise BufferError('the buffer is in read-only mode') * */ } /* "asyncpg/pgproto/buffer.pyx":48 * self._view_count -= 1 * * cdef inline _check_readonly(self): # <<<<<<<<<<<<<< * if self._view_count: * raise BufferError('the buffer is in read-only mode') */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer._check_readonly", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":52 * raise BufferError('the buffer is in read-only mode') * * cdef inline _ensure_alloced(self, ssize_t extra_length): # <<<<<<<<<<<<<< * cdef ssize_t new_size = extra_length + self._length * */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__ensure_alloced(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, Py_ssize_t __pyx_v_extra_length) { Py_ssize_t __pyx_v_new_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_ensure_alloced", 1); /* "asyncpg/pgproto/buffer.pyx":53 * * cdef inline _ensure_alloced(self, ssize_t extra_length): * cdef ssize_t new_size = extra_length + self._length # <<<<<<<<<<<<<< * * if new_size > self._size: */ __pyx_v_new_size = (__pyx_v_extra_length + __pyx_v_self->_length); /* "asyncpg/pgproto/buffer.pyx":55 * cdef ssize_t new_size = extra_length + self._length * * if new_size > self._size: # <<<<<<<<<<<<<< * self._reallocate(new_size) * */ __pyx_t_1 = (__pyx_v_new_size > __pyx_v_self->_size); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":56 * * if new_size > self._size: * self._reallocate(new_size) # <<<<<<<<<<<<<< * * cdef _reallocate(self, ssize_t new_size): */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__reallocate(__pyx_v_self, __pyx_v_new_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":55 * cdef ssize_t new_size = extra_length + self._length * * if new_size > self._size: # <<<<<<<<<<<<<< * self._reallocate(new_size) * */ } /* "asyncpg/pgproto/buffer.pyx":52 * raise BufferError('the buffer is in read-only mode') * * cdef inline _ensure_alloced(self, ssize_t extra_length): # <<<<<<<<<<<<<< * cdef ssize_t new_size = extra_length + self._length * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer._ensure_alloced", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":58 * self._reallocate(new_size) * * cdef _reallocate(self, ssize_t new_size): # <<<<<<<<<<<<<< * cdef char *new_buf * */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__reallocate(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, Py_ssize_t __pyx_v_new_size) { char *__pyx_v_new_buf; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_reallocate", 1); /* "asyncpg/pgproto/buffer.pyx":61 * cdef char *new_buf * * if new_size < _BUFFER_MAX_GROW: # <<<<<<<<<<<<<< * new_size = _BUFFER_MAX_GROW * else: */ __pyx_t_1 = (__pyx_v_new_size < 0x10000); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":62 * * if new_size < _BUFFER_MAX_GROW: * new_size = _BUFFER_MAX_GROW # <<<<<<<<<<<<<< * else: * # Add a little extra */ __pyx_v_new_size = 0x10000; /* "asyncpg/pgproto/buffer.pyx":61 * cdef char *new_buf * * if new_size < _BUFFER_MAX_GROW: # <<<<<<<<<<<<<< * new_size = _BUFFER_MAX_GROW * else: */ goto __pyx_L3; } /* "asyncpg/pgproto/buffer.pyx":65 * else: * # Add a little extra * new_size += _BUFFER_INITIAL_SIZE # <<<<<<<<<<<<<< * * if self._smallbuf_inuse: */ /*else*/ { __pyx_v_new_size = (__pyx_v_new_size + 0x400); } __pyx_L3:; /* "asyncpg/pgproto/buffer.pyx":67 * new_size += _BUFFER_INITIAL_SIZE * * if self._smallbuf_inuse: # <<<<<<<<<<<<<< * new_buf = cpython.PyMem_Malloc( * sizeof(char) * new_size) */ if (__pyx_v_self->_smallbuf_inuse) { /* "asyncpg/pgproto/buffer.pyx":68 * * if self._smallbuf_inuse: * new_buf = cpython.PyMem_Malloc( # <<<<<<<<<<<<<< * sizeof(char) * new_size) * if new_buf is NULL: */ __pyx_v_new_buf = ((char *)PyMem_Malloc(((sizeof(char)) * ((size_t)__pyx_v_new_size)))); /* "asyncpg/pgproto/buffer.pyx":70 * new_buf = cpython.PyMem_Malloc( * sizeof(char) * new_size) * if new_buf is NULL: # <<<<<<<<<<<<<< * self._buf = NULL * self._size = 0 */ __pyx_t_1 = (__pyx_v_new_buf == NULL); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/buffer.pyx":71 * sizeof(char) * new_size) * if new_buf is NULL: * self._buf = NULL # <<<<<<<<<<<<<< * self._size = 0 * self._length = 0 */ __pyx_v_self->_buf = NULL; /* "asyncpg/pgproto/buffer.pyx":72 * if new_buf is NULL: * self._buf = NULL * self._size = 0 # <<<<<<<<<<<<<< * self._length = 0 * raise MemoryError */ __pyx_v_self->_size = 0; /* "asyncpg/pgproto/buffer.pyx":73 * self._buf = NULL * self._size = 0 * self._length = 0 # <<<<<<<<<<<<<< * raise MemoryError * memcpy(new_buf, self._buf, self._size) */ __pyx_v_self->_length = 0; /* "asyncpg/pgproto/buffer.pyx":74 * self._size = 0 * self._length = 0 * raise MemoryError # <<<<<<<<<<<<<< * memcpy(new_buf, self._buf, self._size) * self._size = new_size */ PyErr_NoMemory(); __PYX_ERR(1, 74, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":70 * new_buf = cpython.PyMem_Malloc( * sizeof(char) * new_size) * if new_buf is NULL: # <<<<<<<<<<<<<< * self._buf = NULL * self._size = 0 */ } /* "asyncpg/pgproto/buffer.pyx":75 * self._length = 0 * raise MemoryError * memcpy(new_buf, self._buf, self._size) # <<<<<<<<<<<<<< * self._size = new_size * self._buf = new_buf */ (void)(memcpy(__pyx_v_new_buf, __pyx_v_self->_buf, ((size_t)__pyx_v_self->_size))); /* "asyncpg/pgproto/buffer.pyx":76 * raise MemoryError * memcpy(new_buf, self._buf, self._size) * self._size = new_size # <<<<<<<<<<<<<< * self._buf = new_buf * self._smallbuf_inuse = False */ __pyx_v_self->_size = __pyx_v_new_size; /* "asyncpg/pgproto/buffer.pyx":77 * memcpy(new_buf, self._buf, self._size) * self._size = new_size * self._buf = new_buf # <<<<<<<<<<<<<< * self._smallbuf_inuse = False * else: */ __pyx_v_self->_buf = __pyx_v_new_buf; /* "asyncpg/pgproto/buffer.pyx":78 * self._size = new_size * self._buf = new_buf * self._smallbuf_inuse = False # <<<<<<<<<<<<<< * else: * new_buf = cpython.PyMem_Realloc( */ __pyx_v_self->_smallbuf_inuse = 0; /* "asyncpg/pgproto/buffer.pyx":67 * new_size += _BUFFER_INITIAL_SIZE * * if self._smallbuf_inuse: # <<<<<<<<<<<<<< * new_buf = cpython.PyMem_Malloc( * sizeof(char) * new_size) */ goto __pyx_L4; } /* "asyncpg/pgproto/buffer.pyx":80 * self._smallbuf_inuse = False * else: * new_buf = cpython.PyMem_Realloc( # <<<<<<<<<<<<<< * self._buf, new_size) * if new_buf is NULL: */ /*else*/ { /* "asyncpg/pgproto/buffer.pyx":81 * else: * new_buf = cpython.PyMem_Realloc( * self._buf, new_size) # <<<<<<<<<<<<<< * if new_buf is NULL: * cpython.PyMem_Free(self._buf) */ __pyx_v_new_buf = ((char *)PyMem_Realloc(((void *)__pyx_v_self->_buf), ((size_t)__pyx_v_new_size))); /* "asyncpg/pgproto/buffer.pyx":82 * new_buf = cpython.PyMem_Realloc( * self._buf, new_size) * if new_buf is NULL: # <<<<<<<<<<<<<< * cpython.PyMem_Free(self._buf) * self._buf = NULL */ __pyx_t_1 = (__pyx_v_new_buf == NULL); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/buffer.pyx":83 * self._buf, new_size) * if new_buf is NULL: * cpython.PyMem_Free(self._buf) # <<<<<<<<<<<<<< * self._buf = NULL * self._size = 0 */ PyMem_Free(__pyx_v_self->_buf); /* "asyncpg/pgproto/buffer.pyx":84 * if new_buf is NULL: * cpython.PyMem_Free(self._buf) * self._buf = NULL # <<<<<<<<<<<<<< * self._size = 0 * self._length = 0 */ __pyx_v_self->_buf = NULL; /* "asyncpg/pgproto/buffer.pyx":85 * cpython.PyMem_Free(self._buf) * self._buf = NULL * self._size = 0 # <<<<<<<<<<<<<< * self._length = 0 * raise MemoryError */ __pyx_v_self->_size = 0; /* "asyncpg/pgproto/buffer.pyx":86 * self._buf = NULL * self._size = 0 * self._length = 0 # <<<<<<<<<<<<<< * raise MemoryError * self._buf = new_buf */ __pyx_v_self->_length = 0; /* "asyncpg/pgproto/buffer.pyx":87 * self._size = 0 * self._length = 0 * raise MemoryError # <<<<<<<<<<<<<< * self._buf = new_buf * self._size = new_size */ PyErr_NoMemory(); __PYX_ERR(1, 87, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":82 * new_buf = cpython.PyMem_Realloc( * self._buf, new_size) * if new_buf is NULL: # <<<<<<<<<<<<<< * cpython.PyMem_Free(self._buf) * self._buf = NULL */ } /* "asyncpg/pgproto/buffer.pyx":88 * self._length = 0 * raise MemoryError * self._buf = new_buf # <<<<<<<<<<<<<< * self._size = new_size * */ __pyx_v_self->_buf = __pyx_v_new_buf; /* "asyncpg/pgproto/buffer.pyx":89 * raise MemoryError * self._buf = new_buf * self._size = new_size # <<<<<<<<<<<<<< * * cdef inline start_message(self, char type): */ __pyx_v_self->_size = __pyx_v_new_size; } __pyx_L4:; /* "asyncpg/pgproto/buffer.pyx":58 * self._reallocate(new_size) * * cdef _reallocate(self, ssize_t new_size): # <<<<<<<<<<<<<< * cdef char *new_buf * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer._reallocate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":91 * self._size = new_size * * cdef inline start_message(self, char type): # <<<<<<<<<<<<<< * if self._length != 0: * raise BufferError( */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_start_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, char __pyx_v_type) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("start_message", 1); /* "asyncpg/pgproto/buffer.pyx":92 * * cdef inline start_message(self, char type): * if self._length != 0: # <<<<<<<<<<<<<< * raise BufferError( * 'cannot start_message for a non-empty buffer') */ __pyx_t_1 = (__pyx_v_self->_length != 0); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/buffer.pyx":93 * cdef inline start_message(self, char type): * if self._length != 0: * raise BufferError( # <<<<<<<<<<<<<< * 'cannot start_message for a non-empty buffer') * self._ensure_alloced(5) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_cannot_start_message_for_a_non_e}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 93, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":92 * * cdef inline start_message(self, char type): * if self._length != 0: # <<<<<<<<<<<<<< * raise BufferError( * 'cannot start_message for a non-empty buffer') */ } /* "asyncpg/pgproto/buffer.pyx":95 * raise BufferError( * 'cannot start_message for a non-empty buffer') * self._ensure_alloced(5) # <<<<<<<<<<<<<< * self._message_mode = 1 * self._buf[0] = type */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__ensure_alloced(__pyx_v_self, 5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":96 * 'cannot start_message for a non-empty buffer') * self._ensure_alloced(5) * self._message_mode = 1 # <<<<<<<<<<<<<< * self._buf[0] = type * self._length = 5 */ __pyx_v_self->_message_mode = 1; /* "asyncpg/pgproto/buffer.pyx":97 * self._ensure_alloced(5) * self._message_mode = 1 * self._buf[0] = type # <<<<<<<<<<<<<< * self._length = 5 * */ (__pyx_v_self->_buf[0]) = __pyx_v_type; /* "asyncpg/pgproto/buffer.pyx":98 * self._message_mode = 1 * self._buf[0] = type * self._length = 5 # <<<<<<<<<<<<<< * * cdef inline end_message(self): */ __pyx_v_self->_length = 5; /* "asyncpg/pgproto/buffer.pyx":91 * self._size = new_size * * cdef inline start_message(self, char type): # <<<<<<<<<<<<<< * if self._length != 0: * raise BufferError( */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.start_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":100 * self._length = 5 * * cdef inline end_message(self): # <<<<<<<<<<<<<< * # "length-1" to exclude the message type byte * cdef ssize_t mlen = self._length - 1 */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_end_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self) { Py_ssize_t __pyx_v_mlen; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("end_message", 1); /* "asyncpg/pgproto/buffer.pyx":102 * cdef inline end_message(self): * # "length-1" to exclude the message type byte * cdef ssize_t mlen = self._length - 1 # <<<<<<<<<<<<<< * * self._check_readonly() */ __pyx_v_mlen = (__pyx_v_self->_length - 1); /* "asyncpg/pgproto/buffer.pyx":104 * cdef ssize_t mlen = self._length - 1 * * self._check_readonly() # <<<<<<<<<<<<<< * if not self._message_mode: * raise BufferError( */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__check_readonly(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":105 * * self._check_readonly() * if not self._message_mode: # <<<<<<<<<<<<<< * raise BufferError( * 'end_message can only be called with start_message') */ __pyx_t_2 = (!__pyx_v_self->_message_mode); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/buffer.pyx":106 * self._check_readonly() * if not self._message_mode: * raise BufferError( # <<<<<<<<<<<<<< * 'end_message can only be called with start_message') * if self._length < 5: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_end_message_can_only_be_called_w}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 106, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":105 * * self._check_readonly() * if not self._message_mode: # <<<<<<<<<<<<<< * raise BufferError( * 'end_message can only be called with start_message') */ } /* "asyncpg/pgproto/buffer.pyx":108 * raise BufferError( * 'end_message can only be called with start_message') * if self._length < 5: # <<<<<<<<<<<<<< * raise BufferError('end_message: buffer is too small') * if mlen > _MAXINT32: */ __pyx_t_2 = (__pyx_v_self->_length < 5); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/buffer.pyx":109 * 'end_message can only be called with start_message') * if self._length < 5: * raise BufferError('end_message: buffer is too small') # <<<<<<<<<<<<<< * if mlen > _MAXINT32: * raise BufferError('end_message: message is too large') */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_end_message_buffer_is_too_small}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 109, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":108 * raise BufferError( * 'end_message can only be called with start_message') * if self._length < 5: # <<<<<<<<<<<<<< * raise BufferError('end_message: buffer is too small') * if mlen > _MAXINT32: */ } /* "asyncpg/pgproto/buffer.pyx":110 * if self._length < 5: * raise BufferError('end_message: buffer is too small') * if mlen > _MAXINT32: # <<<<<<<<<<<<<< * raise BufferError('end_message: message is too large') * */ __pyx_t_2 = (__pyx_v_mlen > 0x7FFFFFFF); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/buffer.pyx":111 * raise BufferError('end_message: buffer is too small') * if mlen > _MAXINT32: * raise BufferError('end_message: message is too large') # <<<<<<<<<<<<<< * * hton.pack_int32(&self._buf[1], mlen) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_end_message_message_is_too_large}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 111, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":110 * if self._length < 5: * raise BufferError('end_message: buffer is too small') * if mlen > _MAXINT32: # <<<<<<<<<<<<<< * raise BufferError('end_message: message is too large') * */ } /* "asyncpg/pgproto/buffer.pyx":113 * raise BufferError('end_message: message is too large') * * hton.pack_int32(&self._buf[1], mlen) # <<<<<<<<<<<<<< * return self * */ pack_int32((&(__pyx_v_self->_buf[1])), ((int32_t)__pyx_v_mlen)); /* "asyncpg/pgproto/buffer.pyx":114 * * hton.pack_int32(&self._buf[1], mlen) * return self # <<<<<<<<<<<<<< * * cdef inline reset(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":100 * self._length = 5 * * cdef inline end_message(self): # <<<<<<<<<<<<<< * # "length-1" to exclude the message type byte * cdef ssize_t mlen = self._length - 1 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.end_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":116 * return self * * cdef inline reset(self): # <<<<<<<<<<<<<< * self._length = 0 * self._message_mode = 0 */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_reset(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset", 1); /* "asyncpg/pgproto/buffer.pyx":117 * * cdef inline reset(self): * self._length = 0 # <<<<<<<<<<<<<< * self._message_mode = 0 * */ __pyx_v_self->_length = 0; /* "asyncpg/pgproto/buffer.pyx":118 * cdef inline reset(self): * self._length = 0 * self._message_mode = 0 # <<<<<<<<<<<<<< * * cdef write_buffer(self, WriteBuffer buf): */ __pyx_v_self->_message_mode = 0; /* "asyncpg/pgproto/buffer.pyx":116 * return self * * cdef inline reset(self): # <<<<<<<<<<<<<< * self._length = 0 * self._message_mode = 0 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":120 * self._message_mode = 0 * * cdef write_buffer(self, WriteBuffer buf): # <<<<<<<<<<<<<< * self._check_readonly() * */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_buffer(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_buffer", 1); /* "asyncpg/pgproto/buffer.pyx":121 * * cdef write_buffer(self, WriteBuffer buf): * self._check_readonly() # <<<<<<<<<<<<<< * * if not buf._length: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__check_readonly(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":123 * self._check_readonly() * * if not buf._length: # <<<<<<<<<<<<<< * return * */ __pyx_t_2 = (!(__pyx_v_buf->_length != 0)); if (__pyx_t_2) { /* "asyncpg/pgproto/buffer.pyx":124 * * if not buf._length: * return # <<<<<<<<<<<<<< * * self._ensure_alloced(buf._length) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":123 * self._check_readonly() * * if not buf._length: # <<<<<<<<<<<<<< * return * */ } /* "asyncpg/pgproto/buffer.pyx":126 * return * * self._ensure_alloced(buf._length) # <<<<<<<<<<<<<< * memcpy(self._buf + self._length, * buf._buf, */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__ensure_alloced(__pyx_v_self, __pyx_v_buf->_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":127 * * self._ensure_alloced(buf._length) * memcpy(self._buf + self._length, # <<<<<<<<<<<<<< * buf._buf, * buf._length) */ (void)(memcpy((__pyx_v_self->_buf + __pyx_v_self->_length), ((void *)__pyx_v_buf->_buf), ((size_t)__pyx_v_buf->_length))); /* "asyncpg/pgproto/buffer.pyx":130 * buf._buf, * buf._length) * self._length += buf._length # <<<<<<<<<<<<<< * * cdef write_byte(self, char b): */ __pyx_v_self->_length = (__pyx_v_self->_length + __pyx_v_buf->_length); /* "asyncpg/pgproto/buffer.pyx":120 * self._message_mode = 0 * * cdef write_buffer(self, WriteBuffer buf): # <<<<<<<<<<<<<< * self._check_readonly() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.write_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":132 * self._length += buf._length * * cdef write_byte(self, char b): # <<<<<<<<<<<<<< * self._check_readonly() * */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_byte(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, char __pyx_v_b) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_byte", 1); /* "asyncpg/pgproto/buffer.pyx":133 * * cdef write_byte(self, char b): * self._check_readonly() # <<<<<<<<<<<<<< * * self._ensure_alloced(1) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__check_readonly(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":135 * self._check_readonly() * * self._ensure_alloced(1) # <<<<<<<<<<<<<< * self._buf[self._length] = b * self._length += 1 */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__ensure_alloced(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":136 * * self._ensure_alloced(1) * self._buf[self._length] = b # <<<<<<<<<<<<<< * self._length += 1 * */ (__pyx_v_self->_buf[__pyx_v_self->_length]) = __pyx_v_b; /* "asyncpg/pgproto/buffer.pyx":137 * self._ensure_alloced(1) * self._buf[self._length] = b * self._length += 1 # <<<<<<<<<<<<<< * * cdef write_bytes(self, bytes data): */ __pyx_v_self->_length = (__pyx_v_self->_length + 1); /* "asyncpg/pgproto/buffer.pyx":132 * self._length += buf._length * * cdef write_byte(self, char b): # <<<<<<<<<<<<<< * self._check_readonly() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.write_byte", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":139 * self._length += 1 * * cdef write_bytes(self, bytes data): # <<<<<<<<<<<<<< * cdef char* buf * cdef ssize_t len */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_bytes(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_data) { char *__pyx_v_buf; Py_ssize_t __pyx_v_len; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_bytes", 1); /* "asyncpg/pgproto/buffer.pyx":143 * cdef ssize_t len * * cpython.PyBytes_AsStringAndSize(data, &buf, &len) # <<<<<<<<<<<<<< * self.write_cstr(buf, len) * */ __pyx_t_1 = PyBytes_AsStringAndSize(__pyx_v_data, (&__pyx_v_buf), ((Py_ssize_t *)(&__pyx_v_len))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 143, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":144 * * cpython.PyBytes_AsStringAndSize(data, &buf, &len) * self.write_cstr(buf, len) # <<<<<<<<<<<<<< * * cdef write_bytestring(self, bytes string): */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_cstr(__pyx_v_self, __pyx_v_buf, __pyx_v_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":139 * self._length += 1 * * cdef write_bytes(self, bytes data): # <<<<<<<<<<<<<< * cdef char* buf * cdef ssize_t len */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.write_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":146 * self.write_cstr(buf, len) * * cdef write_bytestring(self, bytes string): # <<<<<<<<<<<<<< * cdef char* buf * cdef ssize_t len */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_bytestring(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_string) { char *__pyx_v_buf; Py_ssize_t __pyx_v_len; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_bytestring", 1); /* "asyncpg/pgproto/buffer.pyx":150 * cdef ssize_t len * * cpython.PyBytes_AsStringAndSize(string, &buf, &len) # <<<<<<<<<<<<<< * # PyBytes_AsStringAndSize returns a null-terminated buffer, * # but the null byte is not counted in len. hence the + 1 */ __pyx_t_1 = PyBytes_AsStringAndSize(__pyx_v_string, (&__pyx_v_buf), ((Py_ssize_t *)(&__pyx_v_len))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 150, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":153 * # PyBytes_AsStringAndSize returns a null-terminated buffer, * # but the null byte is not counted in len. hence the + 1 * self.write_cstr(buf, len + 1) # <<<<<<<<<<<<<< * * cdef write_str(self, str string, str encoding): */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_cstr(__pyx_v_self, __pyx_v_buf, (__pyx_v_len + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":146 * self.write_cstr(buf, len) * * cdef write_bytestring(self, bytes string): # <<<<<<<<<<<<<< * cdef char* buf * cdef ssize_t len */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.write_bytestring", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":155 * self.write_cstr(buf, len + 1) * * cdef write_str(self, str string, str encoding): # <<<<<<<<<<<<<< * self.write_bytestring(string.encode(encoding)) * */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_str(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_string, PyObject *__pyx_v_encoding) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_str", 1); /* "asyncpg/pgproto/buffer.pyx":156 * * cdef write_str(self, str string, str encoding): * self.write_bytestring(string.encode(encoding)) # <<<<<<<<<<<<<< * * cdef write_len_prefixed_buffer(self, WriteBuffer buf): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_string, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_encoding}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(1, 156, __pyx_L1_error) __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_bytestring(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":155 * self.write_cstr(buf, len + 1) * * cdef write_str(self, str string, str encoding): # <<<<<<<<<<<<<< * self.write_bytestring(string.encode(encoding)) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.write_str", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":158 * self.write_bytestring(string.encode(encoding)) * * cdef write_len_prefixed_buffer(self, WriteBuffer buf): # <<<<<<<<<<<<<< * # Write a length-prefixed (not NULL-terminated) bytes sequence. * self.write_int32(buf.len()) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_buffer(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int32_t __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_len_prefixed_buffer", 1); /* "asyncpg/pgproto/buffer.pyx":160 * cdef write_len_prefixed_buffer(self, WriteBuffer buf): * # Write a length-prefixed (not NULL-terminated) bytes sequence. * self.write_int32(buf.len()) # <<<<<<<<<<<<<< * self.write_buffer(buf) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_self, ((int32_t)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":161 * # Write a length-prefixed (not NULL-terminated) bytes sequence. * self.write_int32(buf.len()) * self.write_buffer(buf) # <<<<<<<<<<<<<< * * cdef write_len_prefixed_bytes(self, bytes data): */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_buffer(__pyx_v_self, __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":158 * self.write_bytestring(string.encode(encoding)) * * cdef write_len_prefixed_buffer(self, WriteBuffer buf): # <<<<<<<<<<<<<< * # Write a length-prefixed (not NULL-terminated) bytes sequence. * self.write_int32(buf.len()) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.write_len_prefixed_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":163 * self.write_buffer(buf) * * cdef write_len_prefixed_bytes(self, bytes data): # <<<<<<<<<<<<<< * # Write a length-prefixed (not NULL-terminated) bytes sequence. * cdef: */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_bytes(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_data) { char *__pyx_v_buf; Py_ssize_t __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_len_prefixed_bytes", 1); /* "asyncpg/pgproto/buffer.pyx":169 * ssize_t size * * cpython.PyBytes_AsStringAndSize(data, &buf, &size) # <<<<<<<<<<<<<< * if size > _MAXINT32: * raise BufferError('string is too large') */ __pyx_t_1 = PyBytes_AsStringAndSize(__pyx_v_data, (&__pyx_v_buf), ((Py_ssize_t *)(&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 169, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":170 * * cpython.PyBytes_AsStringAndSize(data, &buf, &size) * if size > _MAXINT32: # <<<<<<<<<<<<<< * raise BufferError('string is too large') * # `size` does not account for the NULL at the end. */ __pyx_t_2 = (__pyx_v_size > 0x7FFFFFFF); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/buffer.pyx":171 * cpython.PyBytes_AsStringAndSize(data, &buf, &size) * if size > _MAXINT32: * raise BufferError('string is too large') # <<<<<<<<<<<<<< * # `size` does not account for the NULL at the end. * self.write_int32(size) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_string_is_too_large}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 171, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":170 * * cpython.PyBytes_AsStringAndSize(data, &buf, &size) * if size > _MAXINT32: # <<<<<<<<<<<<<< * raise BufferError('string is too large') * # `size` does not account for the NULL at the end. */ } /* "asyncpg/pgproto/buffer.pyx":173 * raise BufferError('string is too large') * # `size` does not account for the NULL at the end. * self.write_int32(size) # <<<<<<<<<<<<<< * self.write_cstr(buf, size) * */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_self, ((int32_t)__pyx_v_size)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":174 * # `size` does not account for the NULL at the end. * self.write_int32(size) * self.write_cstr(buf, size) # <<<<<<<<<<<<<< * * cdef write_frbuf(self, FRBuffer *buf): */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_cstr(__pyx_v_self, __pyx_v_buf, __pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":163 * self.write_buffer(buf) * * cdef write_len_prefixed_bytes(self, bytes data): # <<<<<<<<<<<<<< * # Write a length-prefixed (not NULL-terminated) bytes sequence. * cdef: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.write_len_prefixed_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":176 * self.write_cstr(buf, size) * * cdef write_frbuf(self, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * ssize_t buf_len = buf.len */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_frbuf(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { Py_ssize_t __pyx_v_buf_len; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; char const *__pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_frbuf", 1); /* "asyncpg/pgproto/buffer.pyx":178 * cdef write_frbuf(self, FRBuffer *buf): * cdef: * ssize_t buf_len = buf.len # <<<<<<<<<<<<<< * if buf_len > 0: * self.write_cstr(frb_read_all(buf), buf_len) */ __pyx_t_1 = __pyx_v_buf->len; __pyx_v_buf_len = __pyx_t_1; /* "asyncpg/pgproto/buffer.pyx":179 * cdef: * ssize_t buf_len = buf.len * if buf_len > 0: # <<<<<<<<<<<<<< * self.write_cstr(frb_read_all(buf), buf_len) * */ __pyx_t_2 = (__pyx_v_buf_len > 0); if (__pyx_t_2) { /* "asyncpg/pgproto/buffer.pyx":180 * ssize_t buf_len = buf.len * if buf_len > 0: * self.write_cstr(frb_read_all(buf), buf_len) # <<<<<<<<<<<<<< * * cdef write_cstr(self, const char *data, ssize_t len): */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read_all(__pyx_v_buf); if (unlikely(__pyx_t_3 == ((char const *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 180, __pyx_L1_error) __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_cstr(__pyx_v_self, __pyx_t_3, __pyx_v_buf_len); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/buffer.pyx":179 * cdef: * ssize_t buf_len = buf.len * if buf_len > 0: # <<<<<<<<<<<<<< * self.write_cstr(frb_read_all(buf), buf_len) * */ } /* "asyncpg/pgproto/buffer.pyx":176 * self.write_cstr(buf, size) * * cdef write_frbuf(self, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * ssize_t buf_len = buf.len */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.write_frbuf", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":182 * self.write_cstr(frb_read_all(buf), buf_len) * * cdef write_cstr(self, const char *data, ssize_t len): # <<<<<<<<<<<<<< * self._check_readonly() * self._ensure_alloced(len) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_cstr(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, char const *__pyx_v_data, Py_ssize_t __pyx_v_len) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_cstr", 1); /* "asyncpg/pgproto/buffer.pyx":183 * * cdef write_cstr(self, const char *data, ssize_t len): * self._check_readonly() # <<<<<<<<<<<<<< * self._ensure_alloced(len) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__check_readonly(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":184 * cdef write_cstr(self, const char *data, ssize_t len): * self._check_readonly() * self._ensure_alloced(len) # <<<<<<<<<<<<<< * * memcpy(self._buf + self._length, data, len) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__ensure_alloced(__pyx_v_self, __pyx_v_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":186 * self._ensure_alloced(len) * * memcpy(self._buf + self._length, data, len) # <<<<<<<<<<<<<< * self._length += len * */ (void)(memcpy((__pyx_v_self->_buf + __pyx_v_self->_length), ((void *)__pyx_v_data), ((size_t)__pyx_v_len))); /* "asyncpg/pgproto/buffer.pyx":187 * * memcpy(self._buf + self._length, data, len) * self._length += len # <<<<<<<<<<<<<< * * cdef write_int16(self, int16_t i): */ __pyx_v_self->_length = (__pyx_v_self->_length + __pyx_v_len); /* "asyncpg/pgproto/buffer.pyx":182 * self.write_cstr(frb_read_all(buf), buf_len) * * cdef write_cstr(self, const char *data, ssize_t len): # <<<<<<<<<<<<<< * self._check_readonly() * self._ensure_alloced(len) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.write_cstr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":189 * self._length += len * * cdef write_int16(self, int16_t i): # <<<<<<<<<<<<<< * self._check_readonly() * self._ensure_alloced(2) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int16(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, int16_t __pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_int16", 1); /* "asyncpg/pgproto/buffer.pyx":190 * * cdef write_int16(self, int16_t i): * self._check_readonly() # <<<<<<<<<<<<<< * self._ensure_alloced(2) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__check_readonly(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":191 * cdef write_int16(self, int16_t i): * self._check_readonly() * self._ensure_alloced(2) # <<<<<<<<<<<<<< * * hton.pack_int16(&self._buf[self._length], i) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__ensure_alloced(__pyx_v_self, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":193 * self._ensure_alloced(2) * * hton.pack_int16(&self._buf[self._length], i) # <<<<<<<<<<<<<< * self._length += 2 * */ pack_int16((&(__pyx_v_self->_buf[__pyx_v_self->_length])), __pyx_v_i); /* "asyncpg/pgproto/buffer.pyx":194 * * hton.pack_int16(&self._buf[self._length], i) * self._length += 2 # <<<<<<<<<<<<<< * * cdef write_int32(self, int32_t i): */ __pyx_v_self->_length = (__pyx_v_self->_length + 2); /* "asyncpg/pgproto/buffer.pyx":189 * self._length += len * * cdef write_int16(self, int16_t i): # <<<<<<<<<<<<<< * self._check_readonly() * self._ensure_alloced(2) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.write_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":196 * self._length += 2 * * cdef write_int32(self, int32_t i): # <<<<<<<<<<<<<< * self._check_readonly() * self._ensure_alloced(4) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, int32_t __pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_int32", 1); /* "asyncpg/pgproto/buffer.pyx":197 * * cdef write_int32(self, int32_t i): * self._check_readonly() # <<<<<<<<<<<<<< * self._ensure_alloced(4) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__check_readonly(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":198 * cdef write_int32(self, int32_t i): * self._check_readonly() * self._ensure_alloced(4) # <<<<<<<<<<<<<< * * hton.pack_int32(&self._buf[self._length], i) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__ensure_alloced(__pyx_v_self, 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":200 * self._ensure_alloced(4) * * hton.pack_int32(&self._buf[self._length], i) # <<<<<<<<<<<<<< * self._length += 4 * */ pack_int32((&(__pyx_v_self->_buf[__pyx_v_self->_length])), __pyx_v_i); /* "asyncpg/pgproto/buffer.pyx":201 * * hton.pack_int32(&self._buf[self._length], i) * self._length += 4 # <<<<<<<<<<<<<< * * cdef write_int64(self, int64_t i): */ __pyx_v_self->_length = (__pyx_v_self->_length + 4); /* "asyncpg/pgproto/buffer.pyx":196 * self._length += 2 * * cdef write_int32(self, int32_t i): # <<<<<<<<<<<<<< * self._check_readonly() * self._ensure_alloced(4) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.write_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":203 * self._length += 4 * * cdef write_int64(self, int64_t i): # <<<<<<<<<<<<<< * self._check_readonly() * self._ensure_alloced(8) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, int64_t __pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_int64", 1); /* "asyncpg/pgproto/buffer.pyx":204 * * cdef write_int64(self, int64_t i): * self._check_readonly() # <<<<<<<<<<<<<< * self._ensure_alloced(8) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__check_readonly(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":205 * cdef write_int64(self, int64_t i): * self._check_readonly() * self._ensure_alloced(8) # <<<<<<<<<<<<<< * * hton.pack_int64(&self._buf[self._length], i) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__ensure_alloced(__pyx_v_self, 8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":207 * self._ensure_alloced(8) * * hton.pack_int64(&self._buf[self._length], i) # <<<<<<<<<<<<<< * self._length += 8 * */ pack_int64((&(__pyx_v_self->_buf[__pyx_v_self->_length])), __pyx_v_i); /* "asyncpg/pgproto/buffer.pyx":208 * * hton.pack_int64(&self._buf[self._length], i) * self._length += 8 # <<<<<<<<<<<<<< * * cdef write_float(self, float f): */ __pyx_v_self->_length = (__pyx_v_self->_length + 8); /* "asyncpg/pgproto/buffer.pyx":203 * self._length += 4 * * cdef write_int64(self, int64_t i): # <<<<<<<<<<<<<< * self._check_readonly() * self._ensure_alloced(8) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.write_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":210 * self._length += 8 * * cdef write_float(self, float f): # <<<<<<<<<<<<<< * self._check_readonly() * self._ensure_alloced(4) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_float(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, float __pyx_v_f) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_float", 1); /* "asyncpg/pgproto/buffer.pyx":211 * * cdef write_float(self, float f): * self._check_readonly() # <<<<<<<<<<<<<< * self._ensure_alloced(4) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__check_readonly(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":212 * cdef write_float(self, float f): * self._check_readonly() * self._ensure_alloced(4) # <<<<<<<<<<<<<< * * hton.pack_float(&self._buf[self._length], f) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__ensure_alloced(__pyx_v_self, 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":214 * self._ensure_alloced(4) * * hton.pack_float(&self._buf[self._length], f) # <<<<<<<<<<<<<< * self._length += 4 * */ pack_float((&(__pyx_v_self->_buf[__pyx_v_self->_length])), __pyx_v_f); /* "asyncpg/pgproto/buffer.pyx":215 * * hton.pack_float(&self._buf[self._length], f) * self._length += 4 # <<<<<<<<<<<<<< * * cdef write_double(self, double d): */ __pyx_v_self->_length = (__pyx_v_self->_length + 4); /* "asyncpg/pgproto/buffer.pyx":210 * self._length += 8 * * cdef write_float(self, float f): # <<<<<<<<<<<<<< * self._check_readonly() * self._ensure_alloced(4) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.write_float", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":217 * self._length += 4 * * cdef write_double(self, double d): # <<<<<<<<<<<<<< * self._check_readonly() * self._ensure_alloced(8) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_double(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, double __pyx_v_d) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_double", 1); /* "asyncpg/pgproto/buffer.pyx":218 * * cdef write_double(self, double d): * self._check_readonly() # <<<<<<<<<<<<<< * self._ensure_alloced(8) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__check_readonly(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":219 * cdef write_double(self, double d): * self._check_readonly() * self._ensure_alloced(8) # <<<<<<<<<<<<<< * * hton.pack_double(&self._buf[self._length], d) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__ensure_alloced(__pyx_v_self, 8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":221 * self._ensure_alloced(8) * * hton.pack_double(&self._buf[self._length], d) # <<<<<<<<<<<<<< * self._length += 8 * */ pack_double((&(__pyx_v_self->_buf[__pyx_v_self->_length])), __pyx_v_d); /* "asyncpg/pgproto/buffer.pyx":222 * * hton.pack_double(&self._buf[self._length], d) * self._length += 8 # <<<<<<<<<<<<<< * * @staticmethod */ __pyx_v_self->_length = (__pyx_v_self->_length + 8); /* "asyncpg/pgproto/buffer.pyx":217 * self._length += 4 * * cdef write_double(self, double d): # <<<<<<<<<<<<<< * self._check_readonly() * self._ensure_alloced(8) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.write_double", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":225 * * @staticmethod * cdef WriteBuffer new_message(char type): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * buf = WriteBuffer.__new__(WriteBuffer) */ static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_new_message(char __pyx_v_type) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new_message", 1); /* "asyncpg/pgproto/buffer.pyx":227 * cdef WriteBuffer new_message(char type): * cdef WriteBuffer buf * buf = WriteBuffer.__new__(WriteBuffer) # <<<<<<<<<<<<<< * buf.start_message(type) * return buf */ __pyx_t_1 = ((PyObject *)__pyx_tp_new_7asyncpg_7pgproto_7pgproto_WriteBuffer(((PyTypeObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 227, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":228 * cdef WriteBuffer buf * buf = WriteBuffer.__new__(WriteBuffer) * buf.start_message(type) # <<<<<<<<<<<<<< * return buf * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_start_message(__pyx_v_buf, __pyx_v_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":229 * buf = WriteBuffer.__new__(WriteBuffer) * buf.start_message(type) * return buf # <<<<<<<<<<<<<< * * @staticmethod */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_buf); __pyx_r = __pyx_v_buf; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":225 * * @staticmethod * cdef WriteBuffer new_message(char type): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * buf = WriteBuffer.__new__(WriteBuffer) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.new_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":232 * * @staticmethod * cdef WriteBuffer new(): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * buf = WriteBuffer.__new__(WriteBuffer) */ static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_new(void) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new", 1); /* "asyncpg/pgproto/buffer.pyx":234 * cdef WriteBuffer new(): * cdef WriteBuffer buf * buf = WriteBuffer.__new__(WriteBuffer) # <<<<<<<<<<<<<< * return buf * */ __pyx_t_1 = ((PyObject *)__pyx_tp_new_7asyncpg_7pgproto_7pgproto_WriteBuffer(((PyTypeObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":235 * cdef WriteBuffer buf * buf = WriteBuffer.__new__(WriteBuffer) * return buf # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_buf); __pyx_r = __pyx_v_buf; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":232 * * @staticmethod * cdef WriteBuffer new(): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * buf = WriteBuffer.__new__(WriteBuffer) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.new", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_9__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_7pgproto_7pgproto_11WriteBuffer_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_9__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_11WriteBuffer_8__reduce_cython__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_11WriteBuffer_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(2, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_11__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_7pgproto_7pgproto_11WriteBuffer_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_11__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_11WriteBuffer_10__setstate_cython__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_11WriteBuffer_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(2, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":243 * cdef class ReadBuffer: * * def __cinit__(self): # <<<<<<<<<<<<<< * self._bufs = collections.deque() * self._bufs_append = self._bufs.append */ /* Python wrapper */ static int __pyx_pw_7asyncpg_7pgproto_7pgproto_10ReadBuffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7asyncpg_7pgproto_7pgproto_10ReadBuffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_10ReadBuffer___cinit__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7asyncpg_7pgproto_7pgproto_10ReadBuffer___cinit__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 1); /* "asyncpg/pgproto/buffer.pyx":244 * * def __cinit__(self): * self._bufs = collections.deque() # <<<<<<<<<<<<<< * self._bufs_append = self._bufs.append * self._bufs_popleft = self._bufs.popleft */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_collections); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_deque); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_bufs); __Pyx_DECREF(__pyx_v_self->_bufs); __pyx_v_self->_bufs = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":245 * def __cinit__(self): * self._bufs = collections.deque() * self._bufs_append = self._bufs.append # <<<<<<<<<<<<<< * self._bufs_popleft = self._bufs.popleft * self._bufs_len = 0 */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_bufs, __pyx_n_s_append); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_bufs_append); __Pyx_DECREF(__pyx_v_self->_bufs_append); __pyx_v_self->_bufs_append = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":246 * self._bufs = collections.deque() * self._bufs_append = self._bufs.append * self._bufs_popleft = self._bufs.popleft # <<<<<<<<<<<<<< * self._bufs_len = 0 * self._buf0 = None */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_bufs, __pyx_n_s_popleft); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_bufs_popleft); __Pyx_DECREF(__pyx_v_self->_bufs_popleft); __pyx_v_self->_bufs_popleft = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":247 * self._bufs_append = self._bufs.append * self._bufs_popleft = self._bufs.popleft * self._bufs_len = 0 # <<<<<<<<<<<<<< * self._buf0 = None * self._buf0_prev = None */ __pyx_v_self->_bufs_len = 0; /* "asyncpg/pgproto/buffer.pyx":248 * self._bufs_popleft = self._bufs.popleft * self._bufs_len = 0 * self._buf0 = None # <<<<<<<<<<<<<< * self._buf0_prev = None * self._pos0 = 0 */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_buf0); __Pyx_DECREF(__pyx_v_self->_buf0); __pyx_v_self->_buf0 = ((PyObject*)Py_None); /* "asyncpg/pgproto/buffer.pyx":249 * self._bufs_len = 0 * self._buf0 = None * self._buf0_prev = None # <<<<<<<<<<<<<< * self._pos0 = 0 * self._len0 = 0 */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_buf0_prev); __Pyx_DECREF(__pyx_v_self->_buf0_prev); __pyx_v_self->_buf0_prev = ((PyObject*)Py_None); /* "asyncpg/pgproto/buffer.pyx":250 * self._buf0 = None * self._buf0_prev = None * self._pos0 = 0 # <<<<<<<<<<<<<< * self._len0 = 0 * self._length = 0 */ __pyx_v_self->_pos0 = 0; /* "asyncpg/pgproto/buffer.pyx":251 * self._buf0_prev = None * self._pos0 = 0 * self._len0 = 0 # <<<<<<<<<<<<<< * self._length = 0 * */ __pyx_v_self->_len0 = 0; /* "asyncpg/pgproto/buffer.pyx":252 * self._pos0 = 0 * self._len0 = 0 * self._length = 0 # <<<<<<<<<<<<<< * * self._current_message_type = 0 */ __pyx_v_self->_length = 0; /* "asyncpg/pgproto/buffer.pyx":254 * self._length = 0 * * self._current_message_type = 0 # <<<<<<<<<<<<<< * self._current_message_len = 0 * self._current_message_len_unread = 0 */ __pyx_v_self->_current_message_type = 0; /* "asyncpg/pgproto/buffer.pyx":255 * * self._current_message_type = 0 * self._current_message_len = 0 # <<<<<<<<<<<<<< * self._current_message_len_unread = 0 * self._current_message_ready = 0 */ __pyx_v_self->_current_message_len = 0; /* "asyncpg/pgproto/buffer.pyx":256 * self._current_message_type = 0 * self._current_message_len = 0 * self._current_message_len_unread = 0 # <<<<<<<<<<<<<< * self._current_message_ready = 0 * */ __pyx_v_self->_current_message_len_unread = 0; /* "asyncpg/pgproto/buffer.pyx":257 * self._current_message_len = 0 * self._current_message_len_unread = 0 * self._current_message_ready = 0 # <<<<<<<<<<<<<< * * cdef feed_data(self, data): */ __pyx_v_self->_current_message_ready = 0; /* "asyncpg/pgproto/buffer.pyx":243 * cdef class ReadBuffer: * * def __cinit__(self): # <<<<<<<<<<<<<< * self._bufs = collections.deque() * self._bufs_append = self._bufs.append */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":259 * self._current_message_ready = 0 * * cdef feed_data(self, data): # <<<<<<<<<<<<<< * cdef: * ssize_t dlen */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_feed_data(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self, PyObject *__pyx_v_data) { Py_ssize_t __pyx_v_dlen; PyObject *__pyx_v_data_bytes = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("feed_data", 0); __Pyx_INCREF(__pyx_v_data); /* "asyncpg/pgproto/buffer.pyx":264 * bytes data_bytes * * if not cpython.PyBytes_CheckExact(data): # <<<<<<<<<<<<<< * if cpythonx.PyByteArray_CheckExact(data): * # ProactorEventLoop in Python 3.10+ seems to be sending */ __pyx_t_1 = (!PyBytes_CheckExact(__pyx_v_data)); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":265 * * if not cpython.PyBytes_CheckExact(data): * if cpythonx.PyByteArray_CheckExact(data): # <<<<<<<<<<<<<< * # ProactorEventLoop in Python 3.10+ seems to be sending * # bytearray objects instead of bytes. Handle this here */ __pyx_t_1 = (PyByteArray_CheckExact(__pyx_v_data) != 0); if (likely(__pyx_t_1)) { /* "asyncpg/pgproto/buffer.pyx":269 * # bytearray objects instead of bytes. Handle this here * # to avoid duplicating this check in every data_received(). * data = bytes(data) # <<<<<<<<<<<<<< * else: * raise BufferError( */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":265 * * if not cpython.PyBytes_CheckExact(data): * if cpythonx.PyByteArray_CheckExact(data): # <<<<<<<<<<<<<< * # ProactorEventLoop in Python 3.10+ seems to be sending * # bytearray objects instead of bytes. Handle this here */ goto __pyx_L4; } /* "asyncpg/pgproto/buffer.pyx":271 * data = bytes(data) * else: * raise BufferError( # <<<<<<<<<<<<<< * 'feed_data: a bytes or bytearray object expected') * */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_feed_data_a_bytes_or_bytearray_o}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 271, __pyx_L1_error) } __pyx_L4:; /* "asyncpg/pgproto/buffer.pyx":264 * bytes data_bytes * * if not cpython.PyBytes_CheckExact(data): # <<<<<<<<<<<<<< * if cpythonx.PyByteArray_CheckExact(data): * # ProactorEventLoop in Python 3.10+ seems to be sending */ } /* "asyncpg/pgproto/buffer.pyx":284 * # return * * data_bytes = data # <<<<<<<<<<<<<< * * dlen = cpython.Py_SIZE(data_bytes) */ __pyx_t_2 = __pyx_v_data; __Pyx_INCREF(__pyx_t_2); __pyx_v_data_bytes = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":286 * data_bytes = data * * dlen = cpython.Py_SIZE(data_bytes) # <<<<<<<<<<<<<< * if dlen == 0: * # EOF? */ __pyx_v_dlen = Py_SIZE(__pyx_v_data_bytes); /* "asyncpg/pgproto/buffer.pyx":287 * * dlen = cpython.Py_SIZE(data_bytes) * if dlen == 0: # <<<<<<<<<<<<<< * # EOF? * return */ __pyx_t_1 = (__pyx_v_dlen == 0); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":289 * if dlen == 0: * # EOF? * return # <<<<<<<<<<<<<< * * self._bufs_append(data_bytes) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":287 * * dlen = cpython.Py_SIZE(data_bytes) * if dlen == 0: # <<<<<<<<<<<<<< * # EOF? * return */ } /* "asyncpg/pgproto/buffer.pyx":291 * return * * self._bufs_append(data_bytes) # <<<<<<<<<<<<<< * self._length += dlen * */ __Pyx_INCREF(__pyx_v_self->_bufs_append); __pyx_t_3 = __pyx_v_self->_bufs_append; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_data_bytes}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":292 * * self._bufs_append(data_bytes) * self._length += dlen # <<<<<<<<<<<<<< * * if self._bufs_len == 0: */ __pyx_v_self->_length = (__pyx_v_self->_length + __pyx_v_dlen); /* "asyncpg/pgproto/buffer.pyx":294 * self._length += dlen * * if self._bufs_len == 0: # <<<<<<<<<<<<<< * # First buffer * self._len0 = dlen */ __pyx_t_1 = (__pyx_v_self->_bufs_len == 0); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":296 * if self._bufs_len == 0: * # First buffer * self._len0 = dlen # <<<<<<<<<<<<<< * self._buf0 = data_bytes * */ __pyx_v_self->_len0 = __pyx_v_dlen; /* "asyncpg/pgproto/buffer.pyx":297 * # First buffer * self._len0 = dlen * self._buf0 = data_bytes # <<<<<<<<<<<<<< * * self._bufs_len += 1 */ __Pyx_INCREF(__pyx_v_data_bytes); __Pyx_GIVEREF(__pyx_v_data_bytes); __Pyx_GOTREF(__pyx_v_self->_buf0); __Pyx_DECREF(__pyx_v_self->_buf0); __pyx_v_self->_buf0 = __pyx_v_data_bytes; /* "asyncpg/pgproto/buffer.pyx":294 * self._length += dlen * * if self._bufs_len == 0: # <<<<<<<<<<<<<< * # First buffer * self._len0 = dlen */ } /* "asyncpg/pgproto/buffer.pyx":299 * self._buf0 = data_bytes * * self._bufs_len += 1 # <<<<<<<<<<<<<< * * cdef inline _ensure_first_buf(self): */ __pyx_v_self->_bufs_len = (__pyx_v_self->_bufs_len + 1); /* "asyncpg/pgproto/buffer.pyx":259 * self._current_message_ready = 0 * * cdef feed_data(self, data): # <<<<<<<<<<<<<< * cdef: * ssize_t dlen */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.feed_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_data_bytes); __Pyx_XDECREF(__pyx_v_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":301 * self._bufs_len += 1 * * cdef inline _ensure_first_buf(self): # <<<<<<<<<<<<<< * if PG_DEBUG: * if self._len0 == 0: */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_ensure_first_buf", 1); /* "asyncpg/pgproto/buffer.pyx":302 * * cdef inline _ensure_first_buf(self): * if PG_DEBUG: # <<<<<<<<<<<<<< * if self._len0 == 0: * raise BufferError('empty first buffer') */ __pyx_t_1 = (PG_DEBUG != 0); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":303 * cdef inline _ensure_first_buf(self): * if PG_DEBUG: * if self._len0 == 0: # <<<<<<<<<<<<<< * raise BufferError('empty first buffer') * if self._length == 0: */ __pyx_t_1 = (__pyx_v_self->_len0 == 0); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/buffer.pyx":304 * if PG_DEBUG: * if self._len0 == 0: * raise BufferError('empty first buffer') # <<<<<<<<<<<<<< * if self._length == 0: * raise BufferError('empty buffer') */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_empty_first_buffer}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 304, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":303 * cdef inline _ensure_first_buf(self): * if PG_DEBUG: * if self._len0 == 0: # <<<<<<<<<<<<<< * raise BufferError('empty first buffer') * if self._length == 0: */ } /* "asyncpg/pgproto/buffer.pyx":305 * if self._len0 == 0: * raise BufferError('empty first buffer') * if self._length == 0: # <<<<<<<<<<<<<< * raise BufferError('empty buffer') * */ __pyx_t_1 = (__pyx_v_self->_length == 0); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/buffer.pyx":306 * raise BufferError('empty first buffer') * if self._length == 0: * raise BufferError('empty buffer') # <<<<<<<<<<<<<< * * if self._pos0 == self._len0: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_empty_buffer}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 306, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":305 * if self._len0 == 0: * raise BufferError('empty first buffer') * if self._length == 0: # <<<<<<<<<<<<<< * raise BufferError('empty buffer') * */ } /* "asyncpg/pgproto/buffer.pyx":302 * * cdef inline _ensure_first_buf(self): * if PG_DEBUG: # <<<<<<<<<<<<<< * if self._len0 == 0: * raise BufferError('empty first buffer') */ } /* "asyncpg/pgproto/buffer.pyx":308 * raise BufferError('empty buffer') * * if self._pos0 == self._len0: # <<<<<<<<<<<<<< * self._switch_to_next_buf() * */ __pyx_t_1 = (__pyx_v_self->_pos0 == __pyx_v_self->_len0); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":309 * * if self._pos0 == self._len0: * self._switch_to_next_buf() # <<<<<<<<<<<<<< * * cdef _switch_to_next_buf(self): */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__switch_to_next_buf(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":308 * raise BufferError('empty buffer') * * if self._pos0 == self._len0: # <<<<<<<<<<<<<< * self._switch_to_next_buf() * */ } /* "asyncpg/pgproto/buffer.pyx":301 * self._bufs_len += 1 * * cdef inline _ensure_first_buf(self): # <<<<<<<<<<<<<< * if PG_DEBUG: * if self._len0 == 0: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer._ensure_first_buf", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":311 * self._switch_to_next_buf() * * cdef _switch_to_next_buf(self): # <<<<<<<<<<<<<< * # The first buffer is fully read, discard it * self._bufs_popleft() */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__switch_to_next_buf(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; Py_ssize_t __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_switch_to_next_buf", 1); /* "asyncpg/pgproto/buffer.pyx":313 * cdef _switch_to_next_buf(self): * # The first buffer is fully read, discard it * self._bufs_popleft() # <<<<<<<<<<<<<< * self._bufs_len -= 1 * */ __Pyx_INCREF(__pyx_v_self->_bufs_popleft); __pyx_t_2 = __pyx_v_self->_bufs_popleft; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":314 * # The first buffer is fully read, discard it * self._bufs_popleft() * self._bufs_len -= 1 # <<<<<<<<<<<<<< * * # Shouldn't fail, since we've checked that `_length >= 1` */ __pyx_v_self->_bufs_len = (__pyx_v_self->_bufs_len - 1); /* "asyncpg/pgproto/buffer.pyx":318 * # Shouldn't fail, since we've checked that `_length >= 1` * # in _ensure_first_buf() * self._buf0_prev = self._buf0 # <<<<<<<<<<<<<< * self._buf0 = self._bufs[0] * */ __pyx_t_1 = __pyx_v_self->_buf0; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_buf0_prev); __Pyx_DECREF(__pyx_v_self->_buf0_prev); __pyx_v_self->_buf0_prev = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":319 * # in _ensure_first_buf() * self._buf0_prev = self._buf0 * self._buf0 = self._bufs[0] # <<<<<<<<<<<<<< * * self._pos0 = 0 */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->_bufs, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->_buf0); __Pyx_DECREF(__pyx_v_self->_buf0); __pyx_v_self->_buf0 = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":321 * self._buf0 = self._bufs[0] * * self._pos0 = 0 # <<<<<<<<<<<<<< * self._len0 = len(self._buf0) * */ __pyx_v_self->_pos0 = 0; /* "asyncpg/pgproto/buffer.pyx":322 * * self._pos0 = 0 * self._len0 = len(self._buf0) # <<<<<<<<<<<<<< * * if PG_DEBUG: */ __pyx_t_2 = __pyx_v_self->_buf0; __Pyx_INCREF(__pyx_t_2); if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(1, 322, __pyx_L1_error) } __pyx_t_5 = __Pyx_PyBytes_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 322, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->_len0 = __pyx_t_5; /* "asyncpg/pgproto/buffer.pyx":324 * self._len0 = len(self._buf0) * * if PG_DEBUG: # <<<<<<<<<<<<<< * if self._len0 < 1: * raise BufferError( */ __pyx_t_6 = (PG_DEBUG != 0); if (__pyx_t_6) { /* "asyncpg/pgproto/buffer.pyx":325 * * if PG_DEBUG: * if self._len0 < 1: # <<<<<<<<<<<<<< * raise BufferError( * 'debug: second buffer of ReadBuffer is empty') */ __pyx_t_6 = (__pyx_v_self->_len0 < 1); if (unlikely(__pyx_t_6)) { /* "asyncpg/pgproto/buffer.pyx":326 * if PG_DEBUG: * if self._len0 < 1: * raise BufferError( # <<<<<<<<<<<<<< * 'debug: second buffer of ReadBuffer is empty') * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_debug_second_buffer_of_ReadBuffe}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 326, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":325 * * if PG_DEBUG: * if self._len0 < 1: # <<<<<<<<<<<<<< * raise BufferError( * 'debug: second buffer of ReadBuffer is empty') */ } /* "asyncpg/pgproto/buffer.pyx":324 * self._len0 = len(self._buf0) * * if PG_DEBUG: # <<<<<<<<<<<<<< * if self._len0 < 1: * raise BufferError( */ } /* "asyncpg/pgproto/buffer.pyx":311 * self._switch_to_next_buf() * * cdef _switch_to_next_buf(self): # <<<<<<<<<<<<<< * # The first buffer is fully read, discard it * self._bufs_popleft() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer._switch_to_next_buf", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":329 * 'debug: second buffer of ReadBuffer is empty') * * cdef inline const char* _try_read_bytes(self, ssize_t nbytes): # <<<<<<<<<<<<<< * # Try to read *nbytes* from the first buffer. * # */ static CYTHON_INLINE char const *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__try_read_bytes(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self, Py_ssize_t __pyx_v_nbytes) { char const *__pyx_v_result; char const *__pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("_try_read_bytes", 1); /* "asyncpg/pgproto/buffer.pyx":341 * const char *result * * if PG_DEBUG: # <<<<<<<<<<<<<< * if nbytes > self._length: * return NULL */ __pyx_t_1 = (PG_DEBUG != 0); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":342 * * if PG_DEBUG: * if nbytes > self._length: # <<<<<<<<<<<<<< * return NULL * */ __pyx_t_1 = (__pyx_v_nbytes > __pyx_v_self->_length); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":343 * if PG_DEBUG: * if nbytes > self._length: * return NULL # <<<<<<<<<<<<<< * * if self._current_message_ready: */ __pyx_r = NULL; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":342 * * if PG_DEBUG: * if nbytes > self._length: # <<<<<<<<<<<<<< * return NULL * */ } /* "asyncpg/pgproto/buffer.pyx":341 * const char *result * * if PG_DEBUG: # <<<<<<<<<<<<<< * if nbytes > self._length: * return NULL */ } /* "asyncpg/pgproto/buffer.pyx":345 * return NULL * * if self._current_message_ready: # <<<<<<<<<<<<<< * if self._current_message_len_unread < nbytes: * return NULL */ if (__pyx_v_self->_current_message_ready) { /* "asyncpg/pgproto/buffer.pyx":346 * * if self._current_message_ready: * if self._current_message_len_unread < nbytes: # <<<<<<<<<<<<<< * return NULL * */ __pyx_t_1 = (__pyx_v_self->_current_message_len_unread < __pyx_v_nbytes); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":347 * if self._current_message_ready: * if self._current_message_len_unread < nbytes: * return NULL # <<<<<<<<<<<<<< * * if self._pos0 + nbytes <= self._len0: */ __pyx_r = NULL; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":346 * * if self._current_message_ready: * if self._current_message_len_unread < nbytes: # <<<<<<<<<<<<<< * return NULL * */ } /* "asyncpg/pgproto/buffer.pyx":345 * return NULL * * if self._current_message_ready: # <<<<<<<<<<<<<< * if self._current_message_len_unread < nbytes: * return NULL */ } /* "asyncpg/pgproto/buffer.pyx":349 * return NULL * * if self._pos0 + nbytes <= self._len0: # <<<<<<<<<<<<<< * result = cpython.PyBytes_AS_STRING(self._buf0) * result += self._pos0 */ __pyx_t_1 = ((__pyx_v_self->_pos0 + __pyx_v_nbytes) <= __pyx_v_self->_len0); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":350 * * if self._pos0 + nbytes <= self._len0: * result = cpython.PyBytes_AS_STRING(self._buf0) # <<<<<<<<<<<<<< * result += self._pos0 * self._pos0 += nbytes */ __pyx_t_2 = __pyx_v_self->_buf0; __Pyx_INCREF(__pyx_t_2); __pyx_v_result = PyBytes_AS_STRING(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":351 * if self._pos0 + nbytes <= self._len0: * result = cpython.PyBytes_AS_STRING(self._buf0) * result += self._pos0 # <<<<<<<<<<<<<< * self._pos0 += nbytes * self._length -= nbytes */ __pyx_v_result = (__pyx_v_result + __pyx_v_self->_pos0); /* "asyncpg/pgproto/buffer.pyx":352 * result = cpython.PyBytes_AS_STRING(self._buf0) * result += self._pos0 * self._pos0 += nbytes # <<<<<<<<<<<<<< * self._length -= nbytes * if self._current_message_ready: */ __pyx_v_self->_pos0 = (__pyx_v_self->_pos0 + __pyx_v_nbytes); /* "asyncpg/pgproto/buffer.pyx":353 * result += self._pos0 * self._pos0 += nbytes * self._length -= nbytes # <<<<<<<<<<<<<< * if self._current_message_ready: * self._current_message_len_unread -= nbytes */ __pyx_v_self->_length = (__pyx_v_self->_length - __pyx_v_nbytes); /* "asyncpg/pgproto/buffer.pyx":354 * self._pos0 += nbytes * self._length -= nbytes * if self._current_message_ready: # <<<<<<<<<<<<<< * self._current_message_len_unread -= nbytes * return result */ if (__pyx_v_self->_current_message_ready) { /* "asyncpg/pgproto/buffer.pyx":355 * self._length -= nbytes * if self._current_message_ready: * self._current_message_len_unread -= nbytes # <<<<<<<<<<<<<< * return result * else: */ __pyx_v_self->_current_message_len_unread = (__pyx_v_self->_current_message_len_unread - __pyx_v_nbytes); /* "asyncpg/pgproto/buffer.pyx":354 * self._pos0 += nbytes * self._length -= nbytes * if self._current_message_ready: # <<<<<<<<<<<<<< * self._current_message_len_unread -= nbytes * return result */ } /* "asyncpg/pgproto/buffer.pyx":356 * if self._current_message_ready: * self._current_message_len_unread -= nbytes * return result # <<<<<<<<<<<<<< * else: * return NULL */ __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":349 * return NULL * * if self._pos0 + nbytes <= self._len0: # <<<<<<<<<<<<<< * result = cpython.PyBytes_AS_STRING(self._buf0) * result += self._pos0 */ } /* "asyncpg/pgproto/buffer.pyx":358 * return result * else: * return NULL # <<<<<<<<<<<<<< * * cdef inline _read_into(self, char *buf, ssize_t nbytes): */ /*else*/ { __pyx_r = NULL; goto __pyx_L0; } /* "asyncpg/pgproto/buffer.pyx":329 * 'debug: second buffer of ReadBuffer is empty') * * cdef inline const char* _try_read_bytes(self, ssize_t nbytes): # <<<<<<<<<<<<<< * # Try to read *nbytes* from the first buffer. * # */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":360 * return NULL * * cdef inline _read_into(self, char *buf, ssize_t nbytes): # <<<<<<<<<<<<<< * cdef: * ssize_t nread */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__read_into(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self, char *__pyx_v_buf, Py_ssize_t __pyx_v_nbytes) { Py_ssize_t __pyx_v_nread; char *__pyx_v_buf0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_read_into", 1); /* "asyncpg/pgproto/buffer.pyx":365 * char *buf0 * * while True: # <<<<<<<<<<<<<< * buf0 = cpython.PyBytes_AS_STRING(self._buf0) * */ while (1) { /* "asyncpg/pgproto/buffer.pyx":366 * * while True: * buf0 = cpython.PyBytes_AS_STRING(self._buf0) # <<<<<<<<<<<<<< * * if self._pos0 + nbytes > self._len0: */ __pyx_t_1 = __pyx_v_self->_buf0; __Pyx_INCREF(__pyx_t_1); __pyx_v_buf0 = PyBytes_AS_STRING(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":368 * buf0 = cpython.PyBytes_AS_STRING(self._buf0) * * if self._pos0 + nbytes > self._len0: # <<<<<<<<<<<<<< * nread = self._len0 - self._pos0 * memcpy(buf, buf0 + self._pos0, nread) */ __pyx_t_2 = ((__pyx_v_self->_pos0 + __pyx_v_nbytes) > __pyx_v_self->_len0); if (__pyx_t_2) { /* "asyncpg/pgproto/buffer.pyx":369 * * if self._pos0 + nbytes > self._len0: * nread = self._len0 - self._pos0 # <<<<<<<<<<<<<< * memcpy(buf, buf0 + self._pos0, nread) * self._pos0 = self._len0 */ __pyx_v_nread = (__pyx_v_self->_len0 - __pyx_v_self->_pos0); /* "asyncpg/pgproto/buffer.pyx":370 * if self._pos0 + nbytes > self._len0: * nread = self._len0 - self._pos0 * memcpy(buf, buf0 + self._pos0, nread) # <<<<<<<<<<<<<< * self._pos0 = self._len0 * self._length -= nread */ (void)(memcpy(__pyx_v_buf, (__pyx_v_buf0 + __pyx_v_self->_pos0), ((size_t)__pyx_v_nread))); /* "asyncpg/pgproto/buffer.pyx":371 * nread = self._len0 - self._pos0 * memcpy(buf, buf0 + self._pos0, nread) * self._pos0 = self._len0 # <<<<<<<<<<<<<< * self._length -= nread * nbytes -= nread */ __pyx_t_3 = __pyx_v_self->_len0; __pyx_v_self->_pos0 = __pyx_t_3; /* "asyncpg/pgproto/buffer.pyx":372 * memcpy(buf, buf0 + self._pos0, nread) * self._pos0 = self._len0 * self._length -= nread # <<<<<<<<<<<<<< * nbytes -= nread * buf += nread */ __pyx_v_self->_length = (__pyx_v_self->_length - __pyx_v_nread); /* "asyncpg/pgproto/buffer.pyx":373 * self._pos0 = self._len0 * self._length -= nread * nbytes -= nread # <<<<<<<<<<<<<< * buf += nread * self._ensure_first_buf() */ __pyx_v_nbytes = (__pyx_v_nbytes - __pyx_v_nread); /* "asyncpg/pgproto/buffer.pyx":374 * self._length -= nread * nbytes -= nread * buf += nread # <<<<<<<<<<<<<< * self._ensure_first_buf() * */ __pyx_v_buf = (__pyx_v_buf + __pyx_v_nread); /* "asyncpg/pgproto/buffer.pyx":375 * nbytes -= nread * buf += nread * self._ensure_first_buf() # <<<<<<<<<<<<<< * * else: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":368 * buf0 = cpython.PyBytes_AS_STRING(self._buf0) * * if self._pos0 + nbytes > self._len0: # <<<<<<<<<<<<<< * nread = self._len0 - self._pos0 * memcpy(buf, buf0 + self._pos0, nread) */ goto __pyx_L5; } /* "asyncpg/pgproto/buffer.pyx":378 * * else: * memcpy(buf, buf0 + self._pos0, nbytes) # <<<<<<<<<<<<<< * self._pos0 += nbytes * self._length -= nbytes */ /*else*/ { (void)(memcpy(__pyx_v_buf, (__pyx_v_buf0 + __pyx_v_self->_pos0), ((size_t)__pyx_v_nbytes))); /* "asyncpg/pgproto/buffer.pyx":379 * else: * memcpy(buf, buf0 + self._pos0, nbytes) * self._pos0 += nbytes # <<<<<<<<<<<<<< * self._length -= nbytes * break */ __pyx_v_self->_pos0 = (__pyx_v_self->_pos0 + __pyx_v_nbytes); /* "asyncpg/pgproto/buffer.pyx":380 * memcpy(buf, buf0 + self._pos0, nbytes) * self._pos0 += nbytes * self._length -= nbytes # <<<<<<<<<<<<<< * break * */ __pyx_v_self->_length = (__pyx_v_self->_length - __pyx_v_nbytes); /* "asyncpg/pgproto/buffer.pyx":381 * self._pos0 += nbytes * self._length -= nbytes * break # <<<<<<<<<<<<<< * * cdef inline _read_and_discard(self, ssize_t nbytes): */ goto __pyx_L4_break; } __pyx_L5:; } __pyx_L4_break:; /* "asyncpg/pgproto/buffer.pyx":360 * return NULL * * cdef inline _read_into(self, char *buf, ssize_t nbytes): # <<<<<<<<<<<<<< * cdef: * ssize_t nread */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer._read_into", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":383 * break * * cdef inline _read_and_discard(self, ssize_t nbytes): # <<<<<<<<<<<<<< * cdef: * ssize_t nread */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__read_and_discard(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self, Py_ssize_t __pyx_v_nbytes) { Py_ssize_t __pyx_v_nread; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_read_and_discard", 1); /* "asyncpg/pgproto/buffer.pyx":387 * ssize_t nread * * self._ensure_first_buf() # <<<<<<<<<<<<<< * while True: * if self._pos0 + nbytes > self._len0: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":388 * * self._ensure_first_buf() * while True: # <<<<<<<<<<<<<< * if self._pos0 + nbytes > self._len0: * nread = self._len0 - self._pos0 */ while (1) { /* "asyncpg/pgproto/buffer.pyx":389 * self._ensure_first_buf() * while True: * if self._pos0 + nbytes > self._len0: # <<<<<<<<<<<<<< * nread = self._len0 - self._pos0 * self._pos0 = self._len0 */ __pyx_t_2 = ((__pyx_v_self->_pos0 + __pyx_v_nbytes) > __pyx_v_self->_len0); if (__pyx_t_2) { /* "asyncpg/pgproto/buffer.pyx":390 * while True: * if self._pos0 + nbytes > self._len0: * nread = self._len0 - self._pos0 # <<<<<<<<<<<<<< * self._pos0 = self._len0 * self._length -= nread */ __pyx_v_nread = (__pyx_v_self->_len0 - __pyx_v_self->_pos0); /* "asyncpg/pgproto/buffer.pyx":391 * if self._pos0 + nbytes > self._len0: * nread = self._len0 - self._pos0 * self._pos0 = self._len0 # <<<<<<<<<<<<<< * self._length -= nread * nbytes -= nread */ __pyx_t_3 = __pyx_v_self->_len0; __pyx_v_self->_pos0 = __pyx_t_3; /* "asyncpg/pgproto/buffer.pyx":392 * nread = self._len0 - self._pos0 * self._pos0 = self._len0 * self._length -= nread # <<<<<<<<<<<<<< * nbytes -= nread * self._ensure_first_buf() */ __pyx_v_self->_length = (__pyx_v_self->_length - __pyx_v_nread); /* "asyncpg/pgproto/buffer.pyx":393 * self._pos0 = self._len0 * self._length -= nread * nbytes -= nread # <<<<<<<<<<<<<< * self._ensure_first_buf() * */ __pyx_v_nbytes = (__pyx_v_nbytes - __pyx_v_nread); /* "asyncpg/pgproto/buffer.pyx":394 * self._length -= nread * nbytes -= nread * self._ensure_first_buf() # <<<<<<<<<<<<<< * * else: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":389 * self._ensure_first_buf() * while True: * if self._pos0 + nbytes > self._len0: # <<<<<<<<<<<<<< * nread = self._len0 - self._pos0 * self._pos0 = self._len0 */ goto __pyx_L5; } /* "asyncpg/pgproto/buffer.pyx":397 * * else: * self._pos0 += nbytes # <<<<<<<<<<<<<< * self._length -= nbytes * break */ /*else*/ { __pyx_v_self->_pos0 = (__pyx_v_self->_pos0 + __pyx_v_nbytes); /* "asyncpg/pgproto/buffer.pyx":398 * else: * self._pos0 += nbytes * self._length -= nbytes # <<<<<<<<<<<<<< * break * */ __pyx_v_self->_length = (__pyx_v_self->_length - __pyx_v_nbytes); /* "asyncpg/pgproto/buffer.pyx":399 * self._pos0 += nbytes * self._length -= nbytes * break # <<<<<<<<<<<<<< * * cdef bytes read_bytes(self, ssize_t nbytes): */ goto __pyx_L4_break; } __pyx_L5:; } __pyx_L4_break:; /* "asyncpg/pgproto/buffer.pyx":383 * break * * cdef inline _read_and_discard(self, ssize_t nbytes): # <<<<<<<<<<<<<< * cdef: * ssize_t nread */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer._read_and_discard", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":401 * break * * cdef bytes read_bytes(self, ssize_t nbytes): # <<<<<<<<<<<<<< * cdef: * bytes result */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_bytes(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self, Py_ssize_t __pyx_v_nbytes) { PyObject *__pyx_v_result = 0; char const *__pyx_v_cbuf; char *__pyx_v_buf; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_bytes", 1); /* "asyncpg/pgproto/buffer.pyx":408 * char *buf * * self._ensure_first_buf() # <<<<<<<<<<<<<< * cbuf = self._try_read_bytes(nbytes) * if cbuf != NULL: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":409 * * self._ensure_first_buf() * cbuf = self._try_read_bytes(nbytes) # <<<<<<<<<<<<<< * if cbuf != NULL: * return cpython.PyBytes_FromStringAndSize(cbuf, nbytes) */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__try_read_bytes(__pyx_v_self, __pyx_v_nbytes); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 409, __pyx_L1_error) __pyx_v_cbuf = __pyx_t_2; /* "asyncpg/pgproto/buffer.pyx":410 * self._ensure_first_buf() * cbuf = self._try_read_bytes(nbytes) * if cbuf != NULL: # <<<<<<<<<<<<<< * return cpython.PyBytes_FromStringAndSize(cbuf, nbytes) * */ __pyx_t_3 = (__pyx_v_cbuf != NULL); if (__pyx_t_3) { /* "asyncpg/pgproto/buffer.pyx":411 * cbuf = self._try_read_bytes(nbytes) * if cbuf != NULL: * return cpython.PyBytes_FromStringAndSize(cbuf, nbytes) # <<<<<<<<<<<<<< * * if nbytes > self._length: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_cbuf, __pyx_v_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":410 * self._ensure_first_buf() * cbuf = self._try_read_bytes(nbytes) * if cbuf != NULL: # <<<<<<<<<<<<<< * return cpython.PyBytes_FromStringAndSize(cbuf, nbytes) * */ } /* "asyncpg/pgproto/buffer.pyx":413 * return cpython.PyBytes_FromStringAndSize(cbuf, nbytes) * * if nbytes > self._length: # <<<<<<<<<<<<<< * raise BufferError( * 'not enough data to read {} bytes'.format(nbytes)) */ __pyx_t_3 = (__pyx_v_nbytes > __pyx_v_self->_length); if (unlikely(__pyx_t_3)) { /* "asyncpg/pgproto/buffer.pyx":414 * * if nbytes > self._length: * raise BufferError( # <<<<<<<<<<<<<< * 'not enough data to read {} bytes'.format(nbytes)) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/pgproto/buffer.pyx":415 * if nbytes > self._length: * raise BufferError( * 'not enough data to read {} bytes'.format(nbytes)) # <<<<<<<<<<<<<< * * if self._current_message_ready: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_not_enough_data_to_read_bytes, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 414, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":413 * return cpython.PyBytes_FromStringAndSize(cbuf, nbytes) * * if nbytes > self._length: # <<<<<<<<<<<<<< * raise BufferError( * 'not enough data to read {} bytes'.format(nbytes)) */ } /* "asyncpg/pgproto/buffer.pyx":417 * 'not enough data to read {} bytes'.format(nbytes)) * * if self._current_message_ready: # <<<<<<<<<<<<<< * self._current_message_len_unread -= nbytes * if self._current_message_len_unread < 0: */ if (__pyx_v_self->_current_message_ready) { /* "asyncpg/pgproto/buffer.pyx":418 * * if self._current_message_ready: * self._current_message_len_unread -= nbytes # <<<<<<<<<<<<<< * if self._current_message_len_unread < 0: * raise BufferError('buffer overread') */ __pyx_v_self->_current_message_len_unread = (__pyx_v_self->_current_message_len_unread - __pyx_v_nbytes); /* "asyncpg/pgproto/buffer.pyx":419 * if self._current_message_ready: * self._current_message_len_unread -= nbytes * if self._current_message_len_unread < 0: # <<<<<<<<<<<<<< * raise BufferError('buffer overread') * */ __pyx_t_3 = (__pyx_v_self->_current_message_len_unread < 0); if (unlikely(__pyx_t_3)) { /* "asyncpg/pgproto/buffer.pyx":420 * self._current_message_len_unread -= nbytes * if self._current_message_len_unread < 0: * raise BufferError('buffer overread') # <<<<<<<<<<<<<< * * result = cpython.PyBytes_FromStringAndSize(NULL, nbytes) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_buffer_overread}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 420, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":419 * if self._current_message_ready: * self._current_message_len_unread -= nbytes * if self._current_message_len_unread < 0: # <<<<<<<<<<<<<< * raise BufferError('buffer overread') * */ } /* "asyncpg/pgproto/buffer.pyx":417 * 'not enough data to read {} bytes'.format(nbytes)) * * if self._current_message_ready: # <<<<<<<<<<<<<< * self._current_message_len_unread -= nbytes * if self._current_message_len_unread < 0: */ } /* "asyncpg/pgproto/buffer.pyx":422 * raise BufferError('buffer overread') * * result = cpython.PyBytes_FromStringAndSize(NULL, nbytes) # <<<<<<<<<<<<<< * buf = cpython.PyBytes_AS_STRING(result) * self._read_into(buf, nbytes) */ __pyx_t_1 = PyBytes_FromStringAndSize(NULL, __pyx_v_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":423 * * result = cpython.PyBytes_FromStringAndSize(NULL, nbytes) * buf = cpython.PyBytes_AS_STRING(result) # <<<<<<<<<<<<<< * self._read_into(buf, nbytes) * return result */ __pyx_v_buf = PyBytes_AS_STRING(__pyx_v_result); /* "asyncpg/pgproto/buffer.pyx":424 * result = cpython.PyBytes_FromStringAndSize(NULL, nbytes) * buf = cpython.PyBytes_AS_STRING(result) * self._read_into(buf, nbytes) # <<<<<<<<<<<<<< * return result * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__read_into(__pyx_v_self, __pyx_v_buf, __pyx_v_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":425 * buf = cpython.PyBytes_AS_STRING(result) * self._read_into(buf, nbytes) * return result # <<<<<<<<<<<<<< * * cdef bytes read_len_prefixed_bytes(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":401 * break * * cdef bytes read_bytes(self, ssize_t nbytes): # <<<<<<<<<<<<<< * cdef: * bytes result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.read_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":427 * return result * * cdef bytes read_len_prefixed_bytes(self): # <<<<<<<<<<<<<< * cdef int32_t size = self.read_int32() * if size < 0: */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_len_prefixed_bytes(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { int32_t __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int32_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_len_prefixed_bytes", 1); /* "asyncpg/pgproto/buffer.pyx":428 * * cdef bytes read_len_prefixed_bytes(self): * cdef int32_t size = self.read_int32() # <<<<<<<<<<<<<< * if size < 0: * raise BufferError( */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_int32(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 428, __pyx_L1_error) __pyx_v_size = __pyx_t_1; /* "asyncpg/pgproto/buffer.pyx":429 * cdef bytes read_len_prefixed_bytes(self): * cdef int32_t size = self.read_int32() * if size < 0: # <<<<<<<<<<<<<< * raise BufferError( * 'negative length for a len-prefixed bytes value') */ __pyx_t_2 = (__pyx_v_size < 0); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/buffer.pyx":430 * cdef int32_t size = self.read_int32() * if size < 0: * raise BufferError( # <<<<<<<<<<<<<< * 'negative length for a len-prefixed bytes value') * if size == 0: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_negative_length_for_a_len_prefix}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 430, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":429 * cdef bytes read_len_prefixed_bytes(self): * cdef int32_t size = self.read_int32() * if size < 0: # <<<<<<<<<<<<<< * raise BufferError( * 'negative length for a len-prefixed bytes value') */ } /* "asyncpg/pgproto/buffer.pyx":432 * raise BufferError( * 'negative length for a len-prefixed bytes value') * if size == 0: # <<<<<<<<<<<<<< * return b'' * return self.read_bytes(size) */ __pyx_t_2 = (__pyx_v_size == 0); if (__pyx_t_2) { /* "asyncpg/pgproto/buffer.pyx":433 * 'negative length for a len-prefixed bytes value') * if size == 0: * return b'' # <<<<<<<<<<<<<< * return self.read_bytes(size) * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_b__2); __pyx_r = __pyx_kp_b__2; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":432 * raise BufferError( * 'negative length for a len-prefixed bytes value') * if size == 0: # <<<<<<<<<<<<<< * return b'' * return self.read_bytes(size) */ } /* "asyncpg/pgproto/buffer.pyx":434 * if size == 0: * return b'' * return self.read_bytes(size) # <<<<<<<<<<<<<< * * cdef str read_len_prefixed_utf8(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_bytes(__pyx_v_self, __pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":427 * return result * * cdef bytes read_len_prefixed_bytes(self): # <<<<<<<<<<<<<< * cdef int32_t size = self.read_int32() * if size < 0: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.read_len_prefixed_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":436 * return self.read_bytes(size) * * cdef str read_len_prefixed_utf8(self): # <<<<<<<<<<<<<< * cdef: * int32_t size */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_len_prefixed_utf8(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { int32_t __pyx_v_size; char const *__pyx_v_cbuf; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int32_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; char const *__pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_len_prefixed_utf8", 1); /* "asyncpg/pgproto/buffer.pyx":441 * const char *cbuf * * size = self.read_int32() # <<<<<<<<<<<<<< * if size < 0: * raise BufferError( */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_int32(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 441, __pyx_L1_error) __pyx_v_size = __pyx_t_1; /* "asyncpg/pgproto/buffer.pyx":442 * * size = self.read_int32() * if size < 0: # <<<<<<<<<<<<<< * raise BufferError( * 'negative length for a len-prefixed bytes value') */ __pyx_t_2 = (__pyx_v_size < 0); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/buffer.pyx":443 * size = self.read_int32() * if size < 0: * raise BufferError( # <<<<<<<<<<<<<< * 'negative length for a len-prefixed bytes value') * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_negative_length_for_a_len_prefix}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 443, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":442 * * size = self.read_int32() * if size < 0: # <<<<<<<<<<<<<< * raise BufferError( * 'negative length for a len-prefixed bytes value') */ } /* "asyncpg/pgproto/buffer.pyx":446 * 'negative length for a len-prefixed bytes value') * * if size == 0: # <<<<<<<<<<<<<< * return '' * */ __pyx_t_2 = (__pyx_v_size == 0); if (__pyx_t_2) { /* "asyncpg/pgproto/buffer.pyx":447 * * if size == 0: * return '' # <<<<<<<<<<<<<< * * self._ensure_first_buf() */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_u__2); __pyx_r = __pyx_kp_u__2; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":446 * 'negative length for a len-prefixed bytes value') * * if size == 0: # <<<<<<<<<<<<<< * return '' * */ } /* "asyncpg/pgproto/buffer.pyx":449 * return '' * * self._ensure_first_buf() # <<<<<<<<<<<<<< * cbuf = self._try_read_bytes(size) * if cbuf != NULL: */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":450 * * self._ensure_first_buf() * cbuf = self._try_read_bytes(size) # <<<<<<<<<<<<<< * if cbuf != NULL: * return cpython.PyUnicode_DecodeUTF8(cbuf, size, NULL) */ __pyx_t_7 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__try_read_bytes(__pyx_v_self, __pyx_v_size); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 450, __pyx_L1_error) __pyx_v_cbuf = __pyx_t_7; /* "asyncpg/pgproto/buffer.pyx":451 * self._ensure_first_buf() * cbuf = self._try_read_bytes(size) * if cbuf != NULL: # <<<<<<<<<<<<<< * return cpython.PyUnicode_DecodeUTF8(cbuf, size, NULL) * else: */ __pyx_t_2 = (__pyx_v_cbuf != NULL); if (__pyx_t_2) { /* "asyncpg/pgproto/buffer.pyx":452 * cbuf = self._try_read_bytes(size) * if cbuf != NULL: * return cpython.PyUnicode_DecodeUTF8(cbuf, size, NULL) # <<<<<<<<<<<<<< * else: * return self.read_bytes(size).decode('utf-8') */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyUnicode_DecodeUTF8(__pyx_v_cbuf, __pyx_v_size, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":451 * self._ensure_first_buf() * cbuf = self._try_read_bytes(size) * if cbuf != NULL: # <<<<<<<<<<<<<< * return cpython.PyUnicode_DecodeUTF8(cbuf, size, NULL) * else: */ } /* "asyncpg/pgproto/buffer.pyx":454 * return cpython.PyUnicode_DecodeUTF8(cbuf, size, NULL) * else: * return self.read_bytes(size).decode('utf-8') # <<<<<<<<<<<<<< * * cdef read_uuid(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_bytes(__pyx_v_self, __pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__pyx_t_3 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode"); __PYX_ERR(1, 454, __pyx_L1_error) } __pyx_t_4 = __Pyx_decode_bytes(__pyx_t_3, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; } /* "asyncpg/pgproto/buffer.pyx":436 * return self.read_bytes(size) * * cdef str read_len_prefixed_utf8(self): # <<<<<<<<<<<<<< * cdef: * int32_t size */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.read_len_prefixed_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":456 * return self.read_bytes(size).decode('utf-8') * * cdef read_uuid(self): # <<<<<<<<<<<<<< * cdef: * bytes mem */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_uuid(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { char const *__pyx_v_cbuf; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_uuid", 1); /* "asyncpg/pgproto/buffer.pyx":461 * const char *cbuf * * self._ensure_first_buf() # <<<<<<<<<<<<<< * cbuf = self._try_read_bytes(16) * if cbuf != NULL: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":462 * * self._ensure_first_buf() * cbuf = self._try_read_bytes(16) # <<<<<<<<<<<<<< * if cbuf != NULL: * return pg_uuid_from_buf(cbuf) */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__try_read_bytes(__pyx_v_self, 16); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 462, __pyx_L1_error) __pyx_v_cbuf = __pyx_t_2; /* "asyncpg/pgproto/buffer.pyx":463 * self._ensure_first_buf() * cbuf = self._try_read_bytes(16) * if cbuf != NULL: # <<<<<<<<<<<<<< * return pg_uuid_from_buf(cbuf) * else: */ __pyx_t_3 = (__pyx_v_cbuf != NULL); if (__pyx_t_3) { /* "asyncpg/pgproto/buffer.pyx":464 * cbuf = self._try_read_bytes(16) * if cbuf != NULL: * return pg_uuid_from_buf(cbuf) # <<<<<<<<<<<<<< * else: * return pg_UUID(self.read_bytes(16)) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_pg_uuid_from_buf(__pyx_v_cbuf); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":463 * self._ensure_first_buf() * cbuf = self._try_read_bytes(16) * if cbuf != NULL: # <<<<<<<<<<<<<< * return pg_uuid_from_buf(cbuf) * else: */ } /* "asyncpg/pgproto/buffer.pyx":466 * return pg_uuid_from_buf(cbuf) * else: * return pg_UUID(self.read_bytes(16)) # <<<<<<<<<<<<<< * * cdef inline char read_byte(self) except? -1: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_bytes(__pyx_v_self, 16); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_7asyncpg_7pgproto_7pgproto_pg_UUID); __pyx_t_5 = __pyx_v_7asyncpg_7pgproto_7pgproto_pg_UUID; __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "asyncpg/pgproto/buffer.pyx":456 * return self.read_bytes(size).decode('utf-8') * * cdef read_uuid(self): # <<<<<<<<<<<<<< * cdef: * bytes mem */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.read_uuid", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":468 * return pg_UUID(self.read_bytes(16)) * * cdef inline char read_byte(self) except? -1: # <<<<<<<<<<<<<< * cdef const char *first_byte * */ static CYTHON_INLINE char __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_byte(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { char const *__pyx_v_first_byte; char __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; char const *__pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_byte", 1); /* "asyncpg/pgproto/buffer.pyx":471 * cdef const char *first_byte * * if PG_DEBUG: # <<<<<<<<<<<<<< * if not self._buf0: * raise BufferError( */ __pyx_t_1 = (PG_DEBUG != 0); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":472 * * if PG_DEBUG: * if not self._buf0: # <<<<<<<<<<<<<< * raise BufferError( * 'debug: first buffer of ReadBuffer is empty') */ __pyx_t_1 = (__pyx_v_self->_buf0 != Py_None)&&(PyBytes_GET_SIZE(__pyx_v_self->_buf0) != 0); __pyx_t_2 = (!__pyx_t_1); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/buffer.pyx":473 * if PG_DEBUG: * if not self._buf0: * raise BufferError( # <<<<<<<<<<<<<< * 'debug: first buffer of ReadBuffer is empty') * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_debug_first_buffer_of_ReadBuffer}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 473, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":472 * * if PG_DEBUG: * if not self._buf0: # <<<<<<<<<<<<<< * raise BufferError( * 'debug: first buffer of ReadBuffer is empty') */ } /* "asyncpg/pgproto/buffer.pyx":471 * cdef const char *first_byte * * if PG_DEBUG: # <<<<<<<<<<<<<< * if not self._buf0: * raise BufferError( */ } /* "asyncpg/pgproto/buffer.pyx":476 * 'debug: first buffer of ReadBuffer is empty') * * self._ensure_first_buf() # <<<<<<<<<<<<<< * first_byte = self._try_read_bytes(1) * if first_byte is NULL: */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":477 * * self._ensure_first_buf() * first_byte = self._try_read_bytes(1) # <<<<<<<<<<<<<< * if first_byte is NULL: * raise BufferError('not enough data to read one byte') */ __pyx_t_7 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__try_read_bytes(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 477, __pyx_L1_error) __pyx_v_first_byte = __pyx_t_7; /* "asyncpg/pgproto/buffer.pyx":478 * self._ensure_first_buf() * first_byte = self._try_read_bytes(1) * if first_byte is NULL: # <<<<<<<<<<<<<< * raise BufferError('not enough data to read one byte') * */ __pyx_t_2 = (__pyx_v_first_byte == NULL); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/buffer.pyx":479 * first_byte = self._try_read_bytes(1) * if first_byte is NULL: * raise BufferError('not enough data to read one byte') # <<<<<<<<<<<<<< * * return first_byte[0] */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_not_enough_data_to_read_one_byte}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 479, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":478 * self._ensure_first_buf() * first_byte = self._try_read_bytes(1) * if first_byte is NULL: # <<<<<<<<<<<<<< * raise BufferError('not enough data to read one byte') * */ } /* "asyncpg/pgproto/buffer.pyx":481 * raise BufferError('not enough data to read one byte') * * return first_byte[0] # <<<<<<<<<<<<<< * * cdef inline int64_t read_int64(self) except? -1: */ __pyx_r = (__pyx_v_first_byte[0]); goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":468 * return pg_UUID(self.read_bytes(16)) * * cdef inline char read_byte(self) except? -1: # <<<<<<<<<<<<<< * cdef const char *first_byte * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.read_byte", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":483 * return first_byte[0] * * cdef inline int64_t read_int64(self) except? -1: # <<<<<<<<<<<<<< * cdef: * bytes mem */ static CYTHON_INLINE int64_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_int64(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { PyObject *__pyx_v_mem = 0; char const *__pyx_v_cbuf; int64_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_int64", 1); /* "asyncpg/pgproto/buffer.pyx":488 * const char *cbuf * * self._ensure_first_buf() # <<<<<<<<<<<<<< * cbuf = self._try_read_bytes(8) * if cbuf != NULL: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":489 * * self._ensure_first_buf() * cbuf = self._try_read_bytes(8) # <<<<<<<<<<<<<< * if cbuf != NULL: * return hton.unpack_int64(cbuf) */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__try_read_bytes(__pyx_v_self, 8); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 489, __pyx_L1_error) __pyx_v_cbuf = __pyx_t_2; /* "asyncpg/pgproto/buffer.pyx":490 * self._ensure_first_buf() * cbuf = self._try_read_bytes(8) * if cbuf != NULL: # <<<<<<<<<<<<<< * return hton.unpack_int64(cbuf) * else: */ __pyx_t_3 = (__pyx_v_cbuf != NULL); if (__pyx_t_3) { /* "asyncpg/pgproto/buffer.pyx":491 * cbuf = self._try_read_bytes(8) * if cbuf != NULL: * return hton.unpack_int64(cbuf) # <<<<<<<<<<<<<< * else: * mem = self.read_bytes(8) */ __pyx_r = unpack_int64(__pyx_v_cbuf); goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":490 * self._ensure_first_buf() * cbuf = self._try_read_bytes(8) * if cbuf != NULL: # <<<<<<<<<<<<<< * return hton.unpack_int64(cbuf) * else: */ } /* "asyncpg/pgproto/buffer.pyx":493 * return hton.unpack_int64(cbuf) * else: * mem = self.read_bytes(8) # <<<<<<<<<<<<<< * return hton.unpack_int64(cpython.PyBytes_AS_STRING(mem)) * */ /*else*/ { __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_bytes(__pyx_v_self, 8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":494 * else: * mem = self.read_bytes(8) * return hton.unpack_int64(cpython.PyBytes_AS_STRING(mem)) # <<<<<<<<<<<<<< * * cdef inline int32_t read_int32(self) except? -1: */ __pyx_r = unpack_int64(PyBytes_AS_STRING(__pyx_v_mem)); goto __pyx_L0; } /* "asyncpg/pgproto/buffer.pyx":483 * return first_byte[0] * * cdef inline int64_t read_int64(self) except? -1: # <<<<<<<<<<<<<< * cdef: * bytes mem */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.read_int64", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1L; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mem); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":496 * return hton.unpack_int64(cpython.PyBytes_AS_STRING(mem)) * * cdef inline int32_t read_int32(self) except? -1: # <<<<<<<<<<<<<< * cdef: * bytes mem */ static CYTHON_INLINE int32_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_int32(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { PyObject *__pyx_v_mem = 0; char const *__pyx_v_cbuf; int32_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_int32", 1); /* "asyncpg/pgproto/buffer.pyx":501 * const char *cbuf * * self._ensure_first_buf() # <<<<<<<<<<<<<< * cbuf = self._try_read_bytes(4) * if cbuf != NULL: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":502 * * self._ensure_first_buf() * cbuf = self._try_read_bytes(4) # <<<<<<<<<<<<<< * if cbuf != NULL: * return hton.unpack_int32(cbuf) */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__try_read_bytes(__pyx_v_self, 4); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 502, __pyx_L1_error) __pyx_v_cbuf = __pyx_t_2; /* "asyncpg/pgproto/buffer.pyx":503 * self._ensure_first_buf() * cbuf = self._try_read_bytes(4) * if cbuf != NULL: # <<<<<<<<<<<<<< * return hton.unpack_int32(cbuf) * else: */ __pyx_t_3 = (__pyx_v_cbuf != NULL); if (__pyx_t_3) { /* "asyncpg/pgproto/buffer.pyx":504 * cbuf = self._try_read_bytes(4) * if cbuf != NULL: * return hton.unpack_int32(cbuf) # <<<<<<<<<<<<<< * else: * mem = self.read_bytes(4) */ __pyx_r = unpack_int32(__pyx_v_cbuf); goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":503 * self._ensure_first_buf() * cbuf = self._try_read_bytes(4) * if cbuf != NULL: # <<<<<<<<<<<<<< * return hton.unpack_int32(cbuf) * else: */ } /* "asyncpg/pgproto/buffer.pyx":506 * return hton.unpack_int32(cbuf) * else: * mem = self.read_bytes(4) # <<<<<<<<<<<<<< * return hton.unpack_int32(cpython.PyBytes_AS_STRING(mem)) * */ /*else*/ { __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_bytes(__pyx_v_self, 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":507 * else: * mem = self.read_bytes(4) * return hton.unpack_int32(cpython.PyBytes_AS_STRING(mem)) # <<<<<<<<<<<<<< * * cdef inline int16_t read_int16(self) except? -1: */ __pyx_r = unpack_int32(PyBytes_AS_STRING(__pyx_v_mem)); goto __pyx_L0; } /* "asyncpg/pgproto/buffer.pyx":496 * return hton.unpack_int64(cpython.PyBytes_AS_STRING(mem)) * * cdef inline int32_t read_int32(self) except? -1: # <<<<<<<<<<<<<< * cdef: * bytes mem */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.read_int32", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mem); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":509 * return hton.unpack_int32(cpython.PyBytes_AS_STRING(mem)) * * cdef inline int16_t read_int16(self) except? -1: # <<<<<<<<<<<<<< * cdef: * bytes mem */ static CYTHON_INLINE int16_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_int16(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { PyObject *__pyx_v_mem = 0; char const *__pyx_v_cbuf; int16_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_int16", 1); /* "asyncpg/pgproto/buffer.pyx":514 * const char *cbuf * * self._ensure_first_buf() # <<<<<<<<<<<<<< * cbuf = self._try_read_bytes(2) * if cbuf != NULL: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":515 * * self._ensure_first_buf() * cbuf = self._try_read_bytes(2) # <<<<<<<<<<<<<< * if cbuf != NULL: * return hton.unpack_int16(cbuf) */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__try_read_bytes(__pyx_v_self, 2); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 515, __pyx_L1_error) __pyx_v_cbuf = __pyx_t_2; /* "asyncpg/pgproto/buffer.pyx":516 * self._ensure_first_buf() * cbuf = self._try_read_bytes(2) * if cbuf != NULL: # <<<<<<<<<<<<<< * return hton.unpack_int16(cbuf) * else: */ __pyx_t_3 = (__pyx_v_cbuf != NULL); if (__pyx_t_3) { /* "asyncpg/pgproto/buffer.pyx":517 * cbuf = self._try_read_bytes(2) * if cbuf != NULL: * return hton.unpack_int16(cbuf) # <<<<<<<<<<<<<< * else: * mem = self.read_bytes(2) */ __pyx_r = unpack_int16(__pyx_v_cbuf); goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":516 * self._ensure_first_buf() * cbuf = self._try_read_bytes(2) * if cbuf != NULL: # <<<<<<<<<<<<<< * return hton.unpack_int16(cbuf) * else: */ } /* "asyncpg/pgproto/buffer.pyx":519 * return hton.unpack_int16(cbuf) * else: * mem = self.read_bytes(2) # <<<<<<<<<<<<<< * return hton.unpack_int16(cpython.PyBytes_AS_STRING(mem)) * */ /*else*/ { __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_bytes(__pyx_v_self, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":520 * else: * mem = self.read_bytes(2) * return hton.unpack_int16(cpython.PyBytes_AS_STRING(mem)) # <<<<<<<<<<<<<< * * cdef inline read_null_str(self): */ __pyx_r = unpack_int16(PyBytes_AS_STRING(__pyx_v_mem)); goto __pyx_L0; } /* "asyncpg/pgproto/buffer.pyx":509 * return hton.unpack_int32(cpython.PyBytes_AS_STRING(mem)) * * cdef inline int16_t read_int16(self) except? -1: # <<<<<<<<<<<<<< * cdef: * bytes mem */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.read_int16", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mem); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":522 * return hton.unpack_int16(cpython.PyBytes_AS_STRING(mem)) * * cdef inline read_null_str(self): # <<<<<<<<<<<<<< * if not self._current_message_ready: * raise BufferError( */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_null_str(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { Py_ssize_t __pyx_v_pos; Py_ssize_t __pyx_v_nread; PyObject *__pyx_v_result = 0; char const *__pyx_v_buf; char const *__pyx_v_buf_start; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read_null_str", 1); /* "asyncpg/pgproto/buffer.pyx":523 * * cdef inline read_null_str(self): * if not self._current_message_ready: # <<<<<<<<<<<<<< * raise BufferError( * 'read_null_str only works when the message guaranteed ' */ __pyx_t_1 = (!__pyx_v_self->_current_message_ready); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/buffer.pyx":524 * cdef inline read_null_str(self): * if not self._current_message_ready: * raise BufferError( # <<<<<<<<<<<<<< * 'read_null_str only works when the message guaranteed ' * 'to be in the buffer') */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_read_null_str_only_works_when_th}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 524, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":523 * * cdef inline read_null_str(self): * if not self._current_message_ready: # <<<<<<<<<<<<<< * raise BufferError( * 'read_null_str only works when the message guaranteed ' */ } /* "asyncpg/pgproto/buffer.pyx":535 * const char *buf_start * * self._ensure_first_buf() # <<<<<<<<<<<<<< * * buf_start = cpython.PyBytes_AS_STRING(self._buf0) */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":537 * self._ensure_first_buf() * * buf_start = cpython.PyBytes_AS_STRING(self._buf0) # <<<<<<<<<<<<<< * buf = buf_start + self._pos0 * while buf - buf_start < self._len0: */ __pyx_t_2 = __pyx_v_self->_buf0; __Pyx_INCREF(__pyx_t_2); __pyx_v_buf_start = PyBytes_AS_STRING(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":538 * * buf_start = cpython.PyBytes_AS_STRING(self._buf0) * buf = buf_start + self._pos0 # <<<<<<<<<<<<<< * while buf - buf_start < self._len0: * if buf[0] == 0: */ __pyx_v_buf = (__pyx_v_buf_start + __pyx_v_self->_pos0); /* "asyncpg/pgproto/buffer.pyx":539 * buf_start = cpython.PyBytes_AS_STRING(self._buf0) * buf = buf_start + self._pos0 * while buf - buf_start < self._len0: # <<<<<<<<<<<<<< * if buf[0] == 0: * pos = buf - buf_start */ while (1) { __pyx_t_1 = ((__pyx_v_buf - __pyx_v_buf_start) < __pyx_v_self->_len0); if (!__pyx_t_1) break; /* "asyncpg/pgproto/buffer.pyx":540 * buf = buf_start + self._pos0 * while buf - buf_start < self._len0: * if buf[0] == 0: # <<<<<<<<<<<<<< * pos = buf - buf_start * nread = pos - self._pos0 */ __pyx_t_1 = ((__pyx_v_buf[0]) == 0); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":541 * while buf - buf_start < self._len0: * if buf[0] == 0: * pos = buf - buf_start # <<<<<<<<<<<<<< * nread = pos - self._pos0 * buf = self._try_read_bytes(nread + 1) */ __pyx_v_pos = (__pyx_v_buf - __pyx_v_buf_start); /* "asyncpg/pgproto/buffer.pyx":542 * if buf[0] == 0: * pos = buf - buf_start * nread = pos - self._pos0 # <<<<<<<<<<<<<< * buf = self._try_read_bytes(nread + 1) * if buf != NULL: */ __pyx_v_nread = (__pyx_v_pos - __pyx_v_self->_pos0); /* "asyncpg/pgproto/buffer.pyx":543 * pos = buf - buf_start * nread = pos - self._pos0 * buf = self._try_read_bytes(nread + 1) # <<<<<<<<<<<<<< * if buf != NULL: * return cpython.PyBytes_FromStringAndSize(buf, nread) */ __pyx_t_6 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__try_read_bytes(__pyx_v_self, (__pyx_v_nread + 1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 543, __pyx_L1_error) __pyx_v_buf = __pyx_t_6; /* "asyncpg/pgproto/buffer.pyx":544 * nread = pos - self._pos0 * buf = self._try_read_bytes(nread + 1) * if buf != NULL: # <<<<<<<<<<<<<< * return cpython.PyBytes_FromStringAndSize(buf, nread) * else: */ __pyx_t_1 = (__pyx_v_buf != NULL); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":545 * buf = self._try_read_bytes(nread + 1) * if buf != NULL: * return cpython.PyBytes_FromStringAndSize(buf, nread) # <<<<<<<<<<<<<< * else: * break */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyBytes_FromStringAndSize(__pyx_v_buf, __pyx_v_nread); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":544 * nread = pos - self._pos0 * buf = self._try_read_bytes(nread + 1) * if buf != NULL: # <<<<<<<<<<<<<< * return cpython.PyBytes_FromStringAndSize(buf, nread) * else: */ } /* "asyncpg/pgproto/buffer.pyx":547 * return cpython.PyBytes_FromStringAndSize(buf, nread) * else: * break # <<<<<<<<<<<<<< * else: * buf += 1 */ /*else*/ { goto __pyx_L5_break; } /* "asyncpg/pgproto/buffer.pyx":540 * buf = buf_start + self._pos0 * while buf - buf_start < self._len0: * if buf[0] == 0: # <<<<<<<<<<<<<< * pos = buf - buf_start * nread = pos - self._pos0 */ } /* "asyncpg/pgproto/buffer.pyx":549 * break * else: * buf += 1 # <<<<<<<<<<<<<< * * result = b'' */ /*else*/ { __pyx_v_buf = (__pyx_v_buf + 1); } } __pyx_L5_break:; /* "asyncpg/pgproto/buffer.pyx":551 * buf += 1 * * result = b'' # <<<<<<<<<<<<<< * while True: * pos = self._buf0.find(b'\x00', self._pos0) */ __Pyx_INCREF(__pyx_kp_b__2); __pyx_v_result = __pyx_kp_b__2; /* "asyncpg/pgproto/buffer.pyx":552 * * result = b'' * while True: # <<<<<<<<<<<<<< * pos = self._buf0.find(b'\x00', self._pos0) * if pos >= 0: */ while (1) { /* "asyncpg/pgproto/buffer.pyx":553 * result = b'' * while True: * pos = self._buf0.find(b'\x00', self._pos0) # <<<<<<<<<<<<<< * if pos >= 0: * result += self._buf0[self._pos0 : pos] */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_buf0, __pyx_n_s_find); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_self->_pos0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_kp_b__3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_8 = PyInt_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 553, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_pos = __pyx_t_8; /* "asyncpg/pgproto/buffer.pyx":554 * while True: * pos = self._buf0.find(b'\x00', self._pos0) * if pos >= 0: # <<<<<<<<<<<<<< * result += self._buf0[self._pos0 : pos] * nread = pos - self._pos0 + 1 */ __pyx_t_1 = (__pyx_v_pos >= 0); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":555 * pos = self._buf0.find(b'\x00', self._pos0) * if pos >= 0: * result += self._buf0[self._pos0 : pos] # <<<<<<<<<<<<<< * nread = pos - self._pos0 + 1 * self._pos0 = pos + 1 */ if (unlikely(__pyx_v_self->_buf0 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 555, __pyx_L1_error) } __pyx_t_2 = PySequence_GetSlice(__pyx_v_self->_buf0, __pyx_v_self->_pos0, __pyx_v_pos); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":556 * if pos >= 0: * result += self._buf0[self._pos0 : pos] * nread = pos - self._pos0 + 1 # <<<<<<<<<<<<<< * self._pos0 = pos + 1 * self._length -= nread */ __pyx_v_nread = ((__pyx_v_pos - __pyx_v_self->_pos0) + 1); /* "asyncpg/pgproto/buffer.pyx":557 * result += self._buf0[self._pos0 : pos] * nread = pos - self._pos0 + 1 * self._pos0 = pos + 1 # <<<<<<<<<<<<<< * self._length -= nread * */ __pyx_v_self->_pos0 = (__pyx_v_pos + 1); /* "asyncpg/pgproto/buffer.pyx":558 * nread = pos - self._pos0 + 1 * self._pos0 = pos + 1 * self._length -= nread # <<<<<<<<<<<<<< * * self._current_message_len_unread -= nread */ __pyx_v_self->_length = (__pyx_v_self->_length - __pyx_v_nread); /* "asyncpg/pgproto/buffer.pyx":560 * self._length -= nread * * self._current_message_len_unread -= nread # <<<<<<<<<<<<<< * if self._current_message_len_unread < 0: * raise BufferError( */ __pyx_v_self->_current_message_len_unread = (__pyx_v_self->_current_message_len_unread - __pyx_v_nread); /* "asyncpg/pgproto/buffer.pyx":561 * * self._current_message_len_unread -= nread * if self._current_message_len_unread < 0: # <<<<<<<<<<<<<< * raise BufferError( * 'read_null_str: buffer overread') */ __pyx_t_1 = (__pyx_v_self->_current_message_len_unread < 0); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/buffer.pyx":562 * self._current_message_len_unread -= nread * if self._current_message_len_unread < 0: * raise BufferError( # <<<<<<<<<<<<<< * 'read_null_str: buffer overread') * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_read_null_str_buffer_overread}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 562, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":561 * * self._current_message_len_unread -= nread * if self._current_message_len_unread < 0: # <<<<<<<<<<<<<< * raise BufferError( * 'read_null_str: buffer overread') */ } /* "asyncpg/pgproto/buffer.pyx":565 * 'read_null_str: buffer overread') * * return result # <<<<<<<<<<<<<< * * else: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":554 * while True: * pos = self._buf0.find(b'\x00', self._pos0) * if pos >= 0: # <<<<<<<<<<<<<< * result += self._buf0[self._pos0 : pos] * nread = pos - self._pos0 + 1 */ } /* "asyncpg/pgproto/buffer.pyx":568 * * else: * result += self._buf0[self._pos0:] # <<<<<<<<<<<<<< * nread = self._len0 - self._pos0 * self._pos0 = self._len0 */ /*else*/ { if (unlikely(__pyx_v_self->_buf0 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 568, __pyx_L1_error) } __pyx_t_3 = PySequence_GetSlice(__pyx_v_self->_buf0, __pyx_v_self->_pos0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":569 * else: * result += self._buf0[self._pos0:] * nread = self._len0 - self._pos0 # <<<<<<<<<<<<<< * self._pos0 = self._len0 * self._length -= nread */ __pyx_v_nread = (__pyx_v_self->_len0 - __pyx_v_self->_pos0); /* "asyncpg/pgproto/buffer.pyx":570 * result += self._buf0[self._pos0:] * nread = self._len0 - self._pos0 * self._pos0 = self._len0 # <<<<<<<<<<<<<< * self._length -= nread * */ __pyx_t_8 = __pyx_v_self->_len0; __pyx_v_self->_pos0 = __pyx_t_8; /* "asyncpg/pgproto/buffer.pyx":571 * nread = self._len0 - self._pos0 * self._pos0 = self._len0 * self._length -= nread # <<<<<<<<<<<<<< * * self._current_message_len_unread -= nread */ __pyx_v_self->_length = (__pyx_v_self->_length - __pyx_v_nread); /* "asyncpg/pgproto/buffer.pyx":573 * self._length -= nread * * self._current_message_len_unread -= nread # <<<<<<<<<<<<<< * if self._current_message_len_unread < 0: * raise BufferError( */ __pyx_v_self->_current_message_len_unread = (__pyx_v_self->_current_message_len_unread - __pyx_v_nread); /* "asyncpg/pgproto/buffer.pyx":574 * * self._current_message_len_unread -= nread * if self._current_message_len_unread < 0: # <<<<<<<<<<<<<< * raise BufferError( * 'read_null_str: buffer overread') */ __pyx_t_1 = (__pyx_v_self->_current_message_len_unread < 0); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/buffer.pyx":575 * self._current_message_len_unread -= nread * if self._current_message_len_unread < 0: * raise BufferError( # <<<<<<<<<<<<<< * 'read_null_str: buffer overread') * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_read_null_str_buffer_overread}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 575, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":574 * * self._current_message_len_unread -= nread * if self._current_message_len_unread < 0: # <<<<<<<<<<<<<< * raise BufferError( * 'read_null_str: buffer overread') */ } /* "asyncpg/pgproto/buffer.pyx":578 * 'read_null_str: buffer overread') * * self._ensure_first_buf() # <<<<<<<<<<<<<< * * cdef int32_t take_message(self) except -1: */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } /* "asyncpg/pgproto/buffer.pyx":522 * return hton.unpack_int16(cpython.PyBytes_AS_STRING(mem)) * * cdef inline read_null_str(self): # <<<<<<<<<<<<<< * if not self._current_message_ready: * raise BufferError( */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.read_null_str", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":580 * self._ensure_first_buf() * * cdef int32_t take_message(self) except -1: # <<<<<<<<<<<<<< * cdef: * const char *cbuf */ static int32_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_take_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { char const *__pyx_v_cbuf; int32_t __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; char const *__pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int32_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("take_message", 1); /* "asyncpg/pgproto/buffer.pyx":584 * const char *cbuf * * if self._current_message_ready: # <<<<<<<<<<<<<< * return 1 * */ if (__pyx_v_self->_current_message_ready) { /* "asyncpg/pgproto/buffer.pyx":585 * * if self._current_message_ready: * return 1 # <<<<<<<<<<<<<< * * if self._current_message_type == 0: */ __pyx_r = 1; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":584 * const char *cbuf * * if self._current_message_ready: # <<<<<<<<<<<<<< * return 1 * */ } /* "asyncpg/pgproto/buffer.pyx":587 * return 1 * * if self._current_message_type == 0: # <<<<<<<<<<<<<< * if self._length < 1: * return 0 */ __pyx_t_1 = (__pyx_v_self->_current_message_type == 0); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":588 * * if self._current_message_type == 0: * if self._length < 1: # <<<<<<<<<<<<<< * return 0 * self._ensure_first_buf() */ __pyx_t_1 = (__pyx_v_self->_length < 1); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":589 * if self._current_message_type == 0: * if self._length < 1: * return 0 # <<<<<<<<<<<<<< * self._ensure_first_buf() * cbuf = self._try_read_bytes(1) */ __pyx_r = 0; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":588 * * if self._current_message_type == 0: * if self._length < 1: # <<<<<<<<<<<<<< * return 0 * self._ensure_first_buf() */ } /* "asyncpg/pgproto/buffer.pyx":590 * if self._length < 1: * return 0 * self._ensure_first_buf() # <<<<<<<<<<<<<< * cbuf = self._try_read_bytes(1) * if cbuf == NULL: */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":591 * return 0 * self._ensure_first_buf() * cbuf = self._try_read_bytes(1) # <<<<<<<<<<<<<< * if cbuf == NULL: * raise BufferError( */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__try_read_bytes(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 591, __pyx_L1_error) __pyx_v_cbuf = __pyx_t_3; /* "asyncpg/pgproto/buffer.pyx":592 * self._ensure_first_buf() * cbuf = self._try_read_bytes(1) * if cbuf == NULL: # <<<<<<<<<<<<<< * raise BufferError( * 'failed to read one byte on a non-empty buffer') */ __pyx_t_1 = (__pyx_v_cbuf == NULL); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/buffer.pyx":593 * cbuf = self._try_read_bytes(1) * if cbuf == NULL: * raise BufferError( # <<<<<<<<<<<<<< * 'failed to read one byte on a non-empty buffer') * self._current_message_type = cbuf[0] */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_failed_to_read_one_byte_on_a_non}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 593, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":592 * self._ensure_first_buf() * cbuf = self._try_read_bytes(1) * if cbuf == NULL: # <<<<<<<<<<<<<< * raise BufferError( * 'failed to read one byte on a non-empty buffer') */ } /* "asyncpg/pgproto/buffer.pyx":595 * raise BufferError( * 'failed to read one byte on a non-empty buffer') * self._current_message_type = cbuf[0] # <<<<<<<<<<<<<< * * if self._current_message_len == 0: */ __pyx_v_self->_current_message_type = (__pyx_v_cbuf[0]); /* "asyncpg/pgproto/buffer.pyx":587 * return 1 * * if self._current_message_type == 0: # <<<<<<<<<<<<<< * if self._length < 1: * return 0 */ } /* "asyncpg/pgproto/buffer.pyx":597 * self._current_message_type = cbuf[0] * * if self._current_message_len == 0: # <<<<<<<<<<<<<< * if self._length < 4: * return 0 */ __pyx_t_1 = (__pyx_v_self->_current_message_len == 0); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":598 * * if self._current_message_len == 0: * if self._length < 4: # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = (__pyx_v_self->_length < 4); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":599 * if self._current_message_len == 0: * if self._length < 4: * return 0 # <<<<<<<<<<<<<< * * self._ensure_first_buf() */ __pyx_r = 0; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":598 * * if self._current_message_len == 0: * if self._length < 4: # <<<<<<<<<<<<<< * return 0 * */ } /* "asyncpg/pgproto/buffer.pyx":601 * return 0 * * self._ensure_first_buf() # <<<<<<<<<<<<<< * cbuf = self._try_read_bytes(4) * if cbuf != NULL: */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":602 * * self._ensure_first_buf() * cbuf = self._try_read_bytes(4) # <<<<<<<<<<<<<< * if cbuf != NULL: * self._current_message_len = hton.unpack_int32(cbuf) */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__try_read_bytes(__pyx_v_self, 4); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 602, __pyx_L1_error) __pyx_v_cbuf = __pyx_t_3; /* "asyncpg/pgproto/buffer.pyx":603 * self._ensure_first_buf() * cbuf = self._try_read_bytes(4) * if cbuf != NULL: # <<<<<<<<<<<<<< * self._current_message_len = hton.unpack_int32(cbuf) * else: */ __pyx_t_1 = (__pyx_v_cbuf != NULL); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":604 * cbuf = self._try_read_bytes(4) * if cbuf != NULL: * self._current_message_len = hton.unpack_int32(cbuf) # <<<<<<<<<<<<<< * else: * self._current_message_len = self.read_int32() */ __pyx_v_self->_current_message_len = unpack_int32(__pyx_v_cbuf); /* "asyncpg/pgproto/buffer.pyx":603 * self._ensure_first_buf() * cbuf = self._try_read_bytes(4) * if cbuf != NULL: # <<<<<<<<<<<<<< * self._current_message_len = hton.unpack_int32(cbuf) * else: */ goto __pyx_L9; } /* "asyncpg/pgproto/buffer.pyx":606 * self._current_message_len = hton.unpack_int32(cbuf) * else: * self._current_message_len = self.read_int32() # <<<<<<<<<<<<<< * * self._current_message_len_unread = self._current_message_len - 4 */ /*else*/ { __pyx_t_7 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_int32(__pyx_v_self); if (unlikely(__pyx_t_7 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 606, __pyx_L1_error) __pyx_v_self->_current_message_len = __pyx_t_7; } __pyx_L9:; /* "asyncpg/pgproto/buffer.pyx":608 * self._current_message_len = self.read_int32() * * self._current_message_len_unread = self._current_message_len - 4 # <<<<<<<<<<<<<< * * if self._length < self._current_message_len_unread: */ __pyx_v_self->_current_message_len_unread = (__pyx_v_self->_current_message_len - 4); /* "asyncpg/pgproto/buffer.pyx":597 * self._current_message_type = cbuf[0] * * if self._current_message_len == 0: # <<<<<<<<<<<<<< * if self._length < 4: * return 0 */ } /* "asyncpg/pgproto/buffer.pyx":610 * self._current_message_len_unread = self._current_message_len - 4 * * if self._length < self._current_message_len_unread: # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = (__pyx_v_self->_length < __pyx_v_self->_current_message_len_unread); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":611 * * if self._length < self._current_message_len_unread: * return 0 # <<<<<<<<<<<<<< * * self._current_message_ready = 1 */ __pyx_r = 0; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":610 * self._current_message_len_unread = self._current_message_len - 4 * * if self._length < self._current_message_len_unread: # <<<<<<<<<<<<<< * return 0 * */ } /* "asyncpg/pgproto/buffer.pyx":613 * return 0 * * self._current_message_ready = 1 # <<<<<<<<<<<<<< * return 1 * */ __pyx_v_self->_current_message_ready = 1; /* "asyncpg/pgproto/buffer.pyx":614 * * self._current_message_ready = 1 * return 1 # <<<<<<<<<<<<<< * * cdef inline int32_t take_message_type(self, char mtype) except -1: */ __pyx_r = 1; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":580 * self._ensure_first_buf() * * cdef int32_t take_message(self) except -1: # <<<<<<<<<<<<<< * cdef: * const char *cbuf */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.take_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":616 * return 1 * * cdef inline int32_t take_message_type(self, char mtype) except -1: # <<<<<<<<<<<<<< * cdef const char *buf0 * */ static CYTHON_INLINE int32_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_take_message_type(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self, char __pyx_v_mtype) { char const *__pyx_v_buf0; int32_t __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int32_t __pyx_t_3; int32_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("take_message_type", 1); /* "asyncpg/pgproto/buffer.pyx":619 * cdef const char *buf0 * * if self._current_message_ready: # <<<<<<<<<<<<<< * return self._current_message_type == mtype * elif self._length >= 1: */ if (__pyx_v_self->_current_message_ready) { /* "asyncpg/pgproto/buffer.pyx":620 * * if self._current_message_ready: * return self._current_message_type == mtype # <<<<<<<<<<<<<< * elif self._length >= 1: * self._ensure_first_buf() */ __pyx_r = (__pyx_v_self->_current_message_type == __pyx_v_mtype); goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":619 * cdef const char *buf0 * * if self._current_message_ready: # <<<<<<<<<<<<<< * return self._current_message_type == mtype * elif self._length >= 1: */ } /* "asyncpg/pgproto/buffer.pyx":621 * if self._current_message_ready: * return self._current_message_type == mtype * elif self._length >= 1: # <<<<<<<<<<<<<< * self._ensure_first_buf() * buf0 = cpython.PyBytes_AS_STRING(self._buf0) */ __pyx_t_1 = (__pyx_v_self->_length >= 1); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":622 * return self._current_message_type == mtype * elif self._length >= 1: * self._ensure_first_buf() # <<<<<<<<<<<<<< * buf0 = cpython.PyBytes_AS_STRING(self._buf0) * */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":623 * elif self._length >= 1: * self._ensure_first_buf() * buf0 = cpython.PyBytes_AS_STRING(self._buf0) # <<<<<<<<<<<<<< * * return buf0[self._pos0] == mtype and self.take_message() */ __pyx_t_2 = __pyx_v_self->_buf0; __Pyx_INCREF(__pyx_t_2); __pyx_v_buf0 = PyBytes_AS_STRING(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":625 * buf0 = cpython.PyBytes_AS_STRING(self._buf0) * * return buf0[self._pos0] == mtype and self.take_message() # <<<<<<<<<<<<<< * else: * return 0 */ __pyx_t_1 = ((__pyx_v_buf0[__pyx_v_self->_pos0]) == __pyx_v_mtype); if (__pyx_t_1) { } else { __pyx_t_3 = __pyx_t_1; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_take_message(__pyx_v_self); if (unlikely(__pyx_t_4 == ((int32_t)-1))) __PYX_ERR(1, 625, __pyx_L1_error) __pyx_t_3 = __pyx_t_4; __pyx_L4_bool_binop_done:; __pyx_r = __pyx_t_3; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":621 * if self._current_message_ready: * return self._current_message_type == mtype * elif self._length >= 1: # <<<<<<<<<<<<<< * self._ensure_first_buf() * buf0 = cpython.PyBytes_AS_STRING(self._buf0) */ } /* "asyncpg/pgproto/buffer.pyx":627 * return buf0[self._pos0] == mtype and self.take_message() * else: * return 0 # <<<<<<<<<<<<<< * * cdef int32_t put_message(self) except -1: */ /*else*/ { __pyx_r = 0; goto __pyx_L0; } /* "asyncpg/pgproto/buffer.pyx":616 * return 1 * * cdef inline int32_t take_message_type(self, char mtype) except -1: # <<<<<<<<<<<<<< * cdef const char *buf0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.take_message_type", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":629 * return 0 * * cdef int32_t put_message(self) except -1: # <<<<<<<<<<<<<< * if not self._current_message_ready: * raise BufferError( */ static int32_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_put_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { int32_t __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("put_message", 1); /* "asyncpg/pgproto/buffer.pyx":630 * * cdef int32_t put_message(self) except -1: * if not self._current_message_ready: # <<<<<<<<<<<<<< * raise BufferError( * 'cannot put message: no message taken') */ __pyx_t_1 = (!__pyx_v_self->_current_message_ready); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/buffer.pyx":631 * cdef int32_t put_message(self) except -1: * if not self._current_message_ready: * raise BufferError( # <<<<<<<<<<<<<< * 'cannot put message: no message taken') * self._current_message_ready = False */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_cannot_put_message_no_message_ta}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 631, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":630 * * cdef int32_t put_message(self) except -1: * if not self._current_message_ready: # <<<<<<<<<<<<<< * raise BufferError( * 'cannot put message: no message taken') */ } /* "asyncpg/pgproto/buffer.pyx":633 * raise BufferError( * 'cannot put message: no message taken') * self._current_message_ready = False # <<<<<<<<<<<<<< * return 0 * */ __pyx_v_self->_current_message_ready = 0; /* "asyncpg/pgproto/buffer.pyx":634 * 'cannot put message: no message taken') * self._current_message_ready = False * return 0 # <<<<<<<<<<<<<< * * cdef inline const char* try_consume_message(self, ssize_t* len): */ __pyx_r = 0; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":629 * return 0 * * cdef int32_t put_message(self) except -1: # <<<<<<<<<<<<<< * if not self._current_message_ready: * raise BufferError( */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.put_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":636 * return 0 * * cdef inline const char* try_consume_message(self, ssize_t* len): # <<<<<<<<<<<<<< * cdef: * ssize_t buf_len */ static CYTHON_INLINE char const *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_try_consume_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self, Py_ssize_t *__pyx_v_len) { Py_ssize_t __pyx_v_buf_len; char const *__pyx_v_buf; char const *__pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; char const *__pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("try_consume_message", 1); /* "asyncpg/pgproto/buffer.pyx":641 * const char *buf * * if not self._current_message_ready: # <<<<<<<<<<<<<< * return NULL * */ __pyx_t_1 = (!__pyx_v_self->_current_message_ready); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":642 * * if not self._current_message_ready: * return NULL # <<<<<<<<<<<<<< * * self._ensure_first_buf() */ __pyx_r = NULL; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":641 * const char *buf * * if not self._current_message_ready: # <<<<<<<<<<<<<< * return NULL * */ } /* "asyncpg/pgproto/buffer.pyx":644 * return NULL * * self._ensure_first_buf() # <<<<<<<<<<<<<< * buf_len = self._current_message_len_unread * buf = self._try_read_bytes(buf_len) */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":645 * * self._ensure_first_buf() * buf_len = self._current_message_len_unread # <<<<<<<<<<<<<< * buf = self._try_read_bytes(buf_len) * if buf != NULL: */ __pyx_t_3 = __pyx_v_self->_current_message_len_unread; __pyx_v_buf_len = __pyx_t_3; /* "asyncpg/pgproto/buffer.pyx":646 * self._ensure_first_buf() * buf_len = self._current_message_len_unread * buf = self._try_read_bytes(buf_len) # <<<<<<<<<<<<<< * if buf != NULL: * len[0] = buf_len */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__try_read_bytes(__pyx_v_self, __pyx_v_buf_len); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 646, __pyx_L1_error) __pyx_v_buf = __pyx_t_4; /* "asyncpg/pgproto/buffer.pyx":647 * buf_len = self._current_message_len_unread * buf = self._try_read_bytes(buf_len) * if buf != NULL: # <<<<<<<<<<<<<< * len[0] = buf_len * self._finish_message() */ __pyx_t_1 = (__pyx_v_buf != NULL); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":648 * buf = self._try_read_bytes(buf_len) * if buf != NULL: * len[0] = buf_len # <<<<<<<<<<<<<< * self._finish_message() * return buf */ (__pyx_v_len[0]) = __pyx_v_buf_len; /* "asyncpg/pgproto/buffer.pyx":649 * if buf != NULL: * len[0] = buf_len * self._finish_message() # <<<<<<<<<<<<<< * return buf * */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__finish_message(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":647 * buf_len = self._current_message_len_unread * buf = self._try_read_bytes(buf_len) * if buf != NULL: # <<<<<<<<<<<<<< * len[0] = buf_len * self._finish_message() */ } /* "asyncpg/pgproto/buffer.pyx":650 * len[0] = buf_len * self._finish_message() * return buf # <<<<<<<<<<<<<< * * cdef discard_message(self): */ __pyx_r = __pyx_v_buf; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":636 * return 0 * * cdef inline const char* try_consume_message(self, ssize_t* len): # <<<<<<<<<<<<<< * cdef: * ssize_t buf_len */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.try_consume_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":652 * return buf * * cdef discard_message(self): # <<<<<<<<<<<<<< * if not self._current_message_ready: * raise BufferError('no message to discard') */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_discard_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("discard_message", 1); /* "asyncpg/pgproto/buffer.pyx":653 * * cdef discard_message(self): * if not self._current_message_ready: # <<<<<<<<<<<<<< * raise BufferError('no message to discard') * if self._current_message_len_unread > 0: */ __pyx_t_1 = (!__pyx_v_self->_current_message_ready); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/buffer.pyx":654 * cdef discard_message(self): * if not self._current_message_ready: * raise BufferError('no message to discard') # <<<<<<<<<<<<<< * if self._current_message_len_unread > 0: * self._read_and_discard(self._current_message_len_unread) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_no_message_to_discard}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 654, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":653 * * cdef discard_message(self): * if not self._current_message_ready: # <<<<<<<<<<<<<< * raise BufferError('no message to discard') * if self._current_message_len_unread > 0: */ } /* "asyncpg/pgproto/buffer.pyx":655 * if not self._current_message_ready: * raise BufferError('no message to discard') * if self._current_message_len_unread > 0: # <<<<<<<<<<<<<< * self._read_and_discard(self._current_message_len_unread) * self._current_message_len_unread = 0 */ __pyx_t_1 = (__pyx_v_self->_current_message_len_unread > 0); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":656 * raise BufferError('no message to discard') * if self._current_message_len_unread > 0: * self._read_and_discard(self._current_message_len_unread) # <<<<<<<<<<<<<< * self._current_message_len_unread = 0 * self._finish_message() */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__read_and_discard(__pyx_v_self, __pyx_v_self->_current_message_len_unread); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":657 * if self._current_message_len_unread > 0: * self._read_and_discard(self._current_message_len_unread) * self._current_message_len_unread = 0 # <<<<<<<<<<<<<< * self._finish_message() * */ __pyx_v_self->_current_message_len_unread = 0; /* "asyncpg/pgproto/buffer.pyx":655 * if not self._current_message_ready: * raise BufferError('no message to discard') * if self._current_message_len_unread > 0: # <<<<<<<<<<<<<< * self._read_and_discard(self._current_message_len_unread) * self._current_message_len_unread = 0 */ } /* "asyncpg/pgproto/buffer.pyx":658 * self._read_and_discard(self._current_message_len_unread) * self._current_message_len_unread = 0 * self._finish_message() # <<<<<<<<<<<<<< * * cdef bytes consume_message(self): */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__finish_message(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":652 * return buf * * cdef discard_message(self): # <<<<<<<<<<<<<< * if not self._current_message_ready: * raise BufferError('no message to discard') */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.discard_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":660 * self._finish_message() * * cdef bytes consume_message(self): # <<<<<<<<<<<<<< * if not self._current_message_ready: * raise BufferError('no message to consume') */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_consume_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { PyObject *__pyx_v_mem = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("consume_message", 1); /* "asyncpg/pgproto/buffer.pyx":661 * * cdef bytes consume_message(self): * if not self._current_message_ready: # <<<<<<<<<<<<<< * raise BufferError('no message to consume') * if self._current_message_len_unread > 0: */ __pyx_t_1 = (!__pyx_v_self->_current_message_ready); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/buffer.pyx":662 * cdef bytes consume_message(self): * if not self._current_message_ready: * raise BufferError('no message to consume') # <<<<<<<<<<<<<< * if self._current_message_len_unread > 0: * mem = self.read_bytes(self._current_message_len_unread) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_no_message_to_consume}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 662, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":661 * * cdef bytes consume_message(self): * if not self._current_message_ready: # <<<<<<<<<<<<<< * raise BufferError('no message to consume') * if self._current_message_len_unread > 0: */ } /* "asyncpg/pgproto/buffer.pyx":663 * if not self._current_message_ready: * raise BufferError('no message to consume') * if self._current_message_len_unread > 0: # <<<<<<<<<<<<<< * mem = self.read_bytes(self._current_message_len_unread) * else: */ __pyx_t_1 = (__pyx_v_self->_current_message_len_unread > 0); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":664 * raise BufferError('no message to consume') * if self._current_message_len_unread > 0: * mem = self.read_bytes(self._current_message_len_unread) # <<<<<<<<<<<<<< * else: * mem = b'' */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_bytes(__pyx_v_self, __pyx_v_self->_current_message_len_unread); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_mem = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":663 * if not self._current_message_ready: * raise BufferError('no message to consume') * if self._current_message_len_unread > 0: # <<<<<<<<<<<<<< * mem = self.read_bytes(self._current_message_len_unread) * else: */ goto __pyx_L4; } /* "asyncpg/pgproto/buffer.pyx":666 * mem = self.read_bytes(self._current_message_len_unread) * else: * mem = b'' # <<<<<<<<<<<<<< * self._finish_message() * return mem */ /*else*/ { __Pyx_INCREF(__pyx_kp_b__2); __pyx_v_mem = __pyx_kp_b__2; } __pyx_L4:; /* "asyncpg/pgproto/buffer.pyx":667 * else: * mem = b'' * self._finish_message() # <<<<<<<<<<<<<< * return mem * */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__finish_message(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":668 * mem = b'' * self._finish_message() * return mem # <<<<<<<<<<<<<< * * cdef redirect_messages(self, WriteBuffer buf, char mtype, */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_mem); __pyx_r = __pyx_v_mem; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":660 * self._finish_message() * * cdef bytes consume_message(self): # <<<<<<<<<<<<<< * if not self._current_message_ready: * raise BufferError('no message to consume') */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.consume_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mem); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":670 * return mem * * cdef redirect_messages(self, WriteBuffer buf, char mtype, # <<<<<<<<<<<<<< * int stop_at=0): * if not self._current_message_ready: */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_redirect_messages(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, char __pyx_v_mtype, struct __pyx_opt_args_7asyncpg_7pgproto_7pgproto_10ReadBuffer_redirect_messages *__pyx_optional_args) { int __pyx_v_stop_at = ((int)0); char const *__pyx_v_cbuf; Py_ssize_t __pyx_v_cbuf_len; int32_t __pyx_v_msg_len; Py_ssize_t __pyx_v_new_pos0; Py_ssize_t __pyx_v_pos_delta; int32_t __pyx_v_done; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; char const *__pyx_t_6; int __pyx_t_7; Py_ssize_t __pyx_t_8; int32_t __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("redirect_messages", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_stop_at = __pyx_optional_args->stop_at; } } /* "asyncpg/pgproto/buffer.pyx":672 * cdef redirect_messages(self, WriteBuffer buf, char mtype, * int stop_at=0): * if not self._current_message_ready: # <<<<<<<<<<<<<< * raise BufferError( * 'consume_full_messages called on a buffer without a ' */ __pyx_t_1 = (!__pyx_v_self->_current_message_ready); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/buffer.pyx":673 * int stop_at=0): * if not self._current_message_ready: * raise BufferError( # <<<<<<<<<<<<<< * 'consume_full_messages called on a buffer without a ' * 'complete first message') */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_consume_full_messages_called_on}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 673, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":672 * cdef redirect_messages(self, WriteBuffer buf, char mtype, * int stop_at=0): * if not self._current_message_ready: # <<<<<<<<<<<<<< * raise BufferError( * 'consume_full_messages called on a buffer without a ' */ } /* "asyncpg/pgproto/buffer.pyx":676 * 'consume_full_messages called on a buffer without a ' * 'complete first message') * if mtype != self._current_message_type: # <<<<<<<<<<<<<< * raise BufferError( * 'consume_full_messages called with a wrong mtype') */ __pyx_t_1 = (__pyx_v_mtype != __pyx_v_self->_current_message_type); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/buffer.pyx":677 * 'complete first message') * if mtype != self._current_message_type: * raise BufferError( # <<<<<<<<<<<<<< * 'consume_full_messages called with a wrong mtype') * if self._current_message_len_unread != self._current_message_len - 4: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_consume_full_messages_called_wit}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 677, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":676 * 'consume_full_messages called on a buffer without a ' * 'complete first message') * if mtype != self._current_message_type: # <<<<<<<<<<<<<< * raise BufferError( * 'consume_full_messages called with a wrong mtype') */ } /* "asyncpg/pgproto/buffer.pyx":679 * raise BufferError( * 'consume_full_messages called with a wrong mtype') * if self._current_message_len_unread != self._current_message_len - 4: # <<<<<<<<<<<<<< * raise BufferError( * 'consume_full_messages called on a partially read message') */ __pyx_t_1 = (__pyx_v_self->_current_message_len_unread != (__pyx_v_self->_current_message_len - 4)); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/buffer.pyx":680 * 'consume_full_messages called with a wrong mtype') * if self._current_message_len_unread != self._current_message_len - 4: * raise BufferError( # <<<<<<<<<<<<<< * 'consume_full_messages called on a partially read message') * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BufferError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_consume_full_messages_called_on_2}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 680, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":679 * raise BufferError( * 'consume_full_messages called with a wrong mtype') * if self._current_message_len_unread != self._current_message_len - 4: # <<<<<<<<<<<<<< * raise BufferError( * 'consume_full_messages called on a partially read message') */ } /* "asyncpg/pgproto/buffer.pyx":691 * int32_t done * * while True: # <<<<<<<<<<<<<< * buf.write_byte(mtype) * buf.write_int32(self._current_message_len) */ while (1) { /* "asyncpg/pgproto/buffer.pyx":692 * * while True: * buf.write_byte(mtype) # <<<<<<<<<<<<<< * buf.write_int32(self._current_message_len) * */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_byte(__pyx_v_buf, __pyx_v_mtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":693 * while True: * buf.write_byte(mtype) * buf.write_int32(self._current_message_len) # <<<<<<<<<<<<<< * * cbuf = self.try_consume_message(&cbuf_len) */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_v_self->_current_message_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":695 * buf.write_int32(self._current_message_len) * * cbuf = self.try_consume_message(&cbuf_len) # <<<<<<<<<<<<<< * if cbuf != NULL: * buf.write_cstr(cbuf, cbuf_len) */ __pyx_t_6 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_try_consume_message(__pyx_v_self, (&__pyx_v_cbuf_len)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 695, __pyx_L1_error) __pyx_v_cbuf = __pyx_t_6; /* "asyncpg/pgproto/buffer.pyx":696 * * cbuf = self.try_consume_message(&cbuf_len) * if cbuf != NULL: # <<<<<<<<<<<<<< * buf.write_cstr(cbuf, cbuf_len) * else: */ __pyx_t_1 = (__pyx_v_cbuf != NULL); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":697 * cbuf = self.try_consume_message(&cbuf_len) * if cbuf != NULL: * buf.write_cstr(cbuf, cbuf_len) # <<<<<<<<<<<<<< * else: * buf.write_bytes(self.consume_message()) */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_cstr(__pyx_v_buf, __pyx_v_cbuf, __pyx_v_cbuf_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/buffer.pyx":696 * * cbuf = self.try_consume_message(&cbuf_len) * if cbuf != NULL: # <<<<<<<<<<<<<< * buf.write_cstr(cbuf, cbuf_len) * else: */ goto __pyx_L8; } /* "asyncpg/pgproto/buffer.pyx":699 * buf.write_cstr(cbuf, cbuf_len) * else: * buf.write_bytes(self.consume_message()) # <<<<<<<<<<<<<< * * if self._length > 0: */ /*else*/ { __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_consume_message(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_bytes(__pyx_v_buf, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L8:; /* "asyncpg/pgproto/buffer.pyx":701 * buf.write_bytes(self.consume_message()) * * if self._length > 0: # <<<<<<<<<<<<<< * self._ensure_first_buf() * else: */ __pyx_t_1 = (__pyx_v_self->_length > 0); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":702 * * if self._length > 0: * self._ensure_first_buf() # <<<<<<<<<<<<<< * else: * return */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":701 * buf.write_bytes(self.consume_message()) * * if self._length > 0: # <<<<<<<<<<<<<< * self._ensure_first_buf() * else: */ goto __pyx_L9; } /* "asyncpg/pgproto/buffer.pyx":704 * self._ensure_first_buf() * else: * return # <<<<<<<<<<<<<< * * if stop_at and buf._length >= stop_at: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } __pyx_L9:; /* "asyncpg/pgproto/buffer.pyx":706 * return * * if stop_at and buf._length >= stop_at: # <<<<<<<<<<<<<< * return * */ __pyx_t_7 = (__pyx_v_stop_at != 0); if (__pyx_t_7) { } else { __pyx_t_1 = __pyx_t_7; goto __pyx_L11_bool_binop_done; } __pyx_t_7 = (__pyx_v_buf->_length >= __pyx_v_stop_at); __pyx_t_1 = __pyx_t_7; __pyx_L11_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":707 * * if stop_at and buf._length >= stop_at: * return # <<<<<<<<<<<<<< * * # Fast path: exhaust buf0 as efficiently as possible. */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":706 * return * * if stop_at and buf._length >= stop_at: # <<<<<<<<<<<<<< * return * */ } /* "asyncpg/pgproto/buffer.pyx":710 * * # Fast path: exhaust buf0 as efficiently as possible. * if self._pos0 + 5 <= self._len0: # <<<<<<<<<<<<<< * cbuf = cpython.PyBytes_AS_STRING(self._buf0) * new_pos0 = self._pos0 */ __pyx_t_1 = ((__pyx_v_self->_pos0 + 5) <= __pyx_v_self->_len0); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":711 * # Fast path: exhaust buf0 as efficiently as possible. * if self._pos0 + 5 <= self._len0: * cbuf = cpython.PyBytes_AS_STRING(self._buf0) # <<<<<<<<<<<<<< * new_pos0 = self._pos0 * cbuf_len = self._len0 */ __pyx_t_3 = __pyx_v_self->_buf0; __Pyx_INCREF(__pyx_t_3); __pyx_v_cbuf = PyBytes_AS_STRING(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":712 * if self._pos0 + 5 <= self._len0: * cbuf = cpython.PyBytes_AS_STRING(self._buf0) * new_pos0 = self._pos0 # <<<<<<<<<<<<<< * cbuf_len = self._len0 * */ __pyx_t_8 = __pyx_v_self->_pos0; __pyx_v_new_pos0 = __pyx_t_8; /* "asyncpg/pgproto/buffer.pyx":713 * cbuf = cpython.PyBytes_AS_STRING(self._buf0) * new_pos0 = self._pos0 * cbuf_len = self._len0 # <<<<<<<<<<<<<< * * done = 0 */ __pyx_t_8 = __pyx_v_self->_len0; __pyx_v_cbuf_len = __pyx_t_8; /* "asyncpg/pgproto/buffer.pyx":715 * cbuf_len = self._len0 * * done = 0 # <<<<<<<<<<<<<< * # Scan the first buffer and find the position of the * # end of the last "mtype" message. */ __pyx_v_done = 0; /* "asyncpg/pgproto/buffer.pyx":718 * # Scan the first buffer and find the position of the * # end of the last "mtype" message. * while new_pos0 + 5 <= cbuf_len: # <<<<<<<<<<<<<< * if (cbuf + new_pos0)[0] != mtype: * done = 1 */ while (1) { __pyx_t_1 = ((__pyx_v_new_pos0 + 5) <= __pyx_v_cbuf_len); if (!__pyx_t_1) break; /* "asyncpg/pgproto/buffer.pyx":719 * # end of the last "mtype" message. * while new_pos0 + 5 <= cbuf_len: * if (cbuf + new_pos0)[0] != mtype: # <<<<<<<<<<<<<< * done = 1 * break */ __pyx_t_1 = (((__pyx_v_cbuf + __pyx_v_new_pos0)[0]) != __pyx_v_mtype); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":720 * while new_pos0 + 5 <= cbuf_len: * if (cbuf + new_pos0)[0] != mtype: * done = 1 # <<<<<<<<<<<<<< * break * if (stop_at and */ __pyx_v_done = 1; /* "asyncpg/pgproto/buffer.pyx":721 * if (cbuf + new_pos0)[0] != mtype: * done = 1 * break # <<<<<<<<<<<<<< * if (stop_at and * (buf._length + new_pos0 - self._pos0) > stop_at): */ goto __pyx_L15_break; /* "asyncpg/pgproto/buffer.pyx":719 * # end of the last "mtype" message. * while new_pos0 + 5 <= cbuf_len: * if (cbuf + new_pos0)[0] != mtype: # <<<<<<<<<<<<<< * done = 1 * break */ } /* "asyncpg/pgproto/buffer.pyx":722 * done = 1 * break * if (stop_at and # <<<<<<<<<<<<<< * (buf._length + new_pos0 - self._pos0) > stop_at): * done = 1 */ __pyx_t_7 = (__pyx_v_stop_at != 0); if (__pyx_t_7) { } else { __pyx_t_1 = __pyx_t_7; goto __pyx_L18_bool_binop_done; } /* "asyncpg/pgproto/buffer.pyx":723 * break * if (stop_at and * (buf._length + new_pos0 - self._pos0) > stop_at): # <<<<<<<<<<<<<< * done = 1 * break */ __pyx_t_7 = (((__pyx_v_buf->_length + __pyx_v_new_pos0) - __pyx_v_self->_pos0) > __pyx_v_stop_at); __pyx_t_1 = __pyx_t_7; __pyx_L18_bool_binop_done:; /* "asyncpg/pgproto/buffer.pyx":722 * done = 1 * break * if (stop_at and # <<<<<<<<<<<<<< * (buf._length + new_pos0 - self._pos0) > stop_at): * done = 1 */ if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":724 * if (stop_at and * (buf._length + new_pos0 - self._pos0) > stop_at): * done = 1 # <<<<<<<<<<<<<< * break * msg_len = hton.unpack_int32(cbuf + new_pos0 + 1) + 1 */ __pyx_v_done = 1; /* "asyncpg/pgproto/buffer.pyx":725 * (buf._length + new_pos0 - self._pos0) > stop_at): * done = 1 * break # <<<<<<<<<<<<<< * msg_len = hton.unpack_int32(cbuf + new_pos0 + 1) + 1 * if new_pos0 + msg_len > cbuf_len: */ goto __pyx_L15_break; /* "asyncpg/pgproto/buffer.pyx":722 * done = 1 * break * if (stop_at and # <<<<<<<<<<<<<< * (buf._length + new_pos0 - self._pos0) > stop_at): * done = 1 */ } /* "asyncpg/pgproto/buffer.pyx":726 * done = 1 * break * msg_len = hton.unpack_int32(cbuf + new_pos0 + 1) + 1 # <<<<<<<<<<<<<< * if new_pos0 + msg_len > cbuf_len: * break */ __pyx_v_msg_len = (unpack_int32(((__pyx_v_cbuf + __pyx_v_new_pos0) + 1)) + 1); /* "asyncpg/pgproto/buffer.pyx":727 * break * msg_len = hton.unpack_int32(cbuf + new_pos0 + 1) + 1 * if new_pos0 + msg_len > cbuf_len: # <<<<<<<<<<<<<< * break * new_pos0 += msg_len */ __pyx_t_1 = ((__pyx_v_new_pos0 + __pyx_v_msg_len) > __pyx_v_cbuf_len); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":728 * msg_len = hton.unpack_int32(cbuf + new_pos0 + 1) + 1 * if new_pos0 + msg_len > cbuf_len: * break # <<<<<<<<<<<<<< * new_pos0 += msg_len * */ goto __pyx_L15_break; /* "asyncpg/pgproto/buffer.pyx":727 * break * msg_len = hton.unpack_int32(cbuf + new_pos0 + 1) + 1 * if new_pos0 + msg_len > cbuf_len: # <<<<<<<<<<<<<< * break * new_pos0 += msg_len */ } /* "asyncpg/pgproto/buffer.pyx":729 * if new_pos0 + msg_len > cbuf_len: * break * new_pos0 += msg_len # <<<<<<<<<<<<<< * * if new_pos0 != self._pos0: */ __pyx_v_new_pos0 = (__pyx_v_new_pos0 + __pyx_v_msg_len); } __pyx_L15_break:; /* "asyncpg/pgproto/buffer.pyx":731 * new_pos0 += msg_len * * if new_pos0 != self._pos0: # <<<<<<<<<<<<<< * assert self._pos0 < new_pos0 <= self._len0 * */ __pyx_t_1 = (__pyx_v_new_pos0 != __pyx_v_self->_pos0); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":732 * * if new_pos0 != self._pos0: * assert self._pos0 < new_pos0 <= self._len0 # <<<<<<<<<<<<<< * * pos_delta = new_pos0 - self._pos0 */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_self->_pos0 < __pyx_v_new_pos0); if (__pyx_t_1) { __pyx_t_1 = (__pyx_v_new_pos0 <= __pyx_v_self->_len0); } if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(1, 732, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(1, 732, __pyx_L1_error) #endif /* "asyncpg/pgproto/buffer.pyx":734 * assert self._pos0 < new_pos0 <= self._len0 * * pos_delta = new_pos0 - self._pos0 # <<<<<<<<<<<<<< * buf.write_cstr( * cbuf + self._pos0, */ __pyx_v_pos_delta = (__pyx_v_new_pos0 - __pyx_v_self->_pos0); /* "asyncpg/pgproto/buffer.pyx":735 * * pos_delta = new_pos0 - self._pos0 * buf.write_cstr( # <<<<<<<<<<<<<< * cbuf + self._pos0, * pos_delta) */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_cstr(__pyx_v_buf, (__pyx_v_cbuf + __pyx_v_self->_pos0), __pyx_v_pos_delta); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":739 * pos_delta) * * self._pos0 = new_pos0 # <<<<<<<<<<<<<< * self._length -= pos_delta * */ __pyx_v_self->_pos0 = __pyx_v_new_pos0; /* "asyncpg/pgproto/buffer.pyx":740 * * self._pos0 = new_pos0 * self._length -= pos_delta # <<<<<<<<<<<<<< * * assert self._length >= 0 */ __pyx_v_self->_length = (__pyx_v_self->_length - __pyx_v_pos_delta); /* "asyncpg/pgproto/buffer.pyx":742 * self._length -= pos_delta * * assert self._length >= 0 # <<<<<<<<<<<<<< * * if done: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_v_self->_length >= 0); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(1, 742, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(1, 742, __pyx_L1_error) #endif /* "asyncpg/pgproto/buffer.pyx":731 * new_pos0 += msg_len * * if new_pos0 != self._pos0: # <<<<<<<<<<<<<< * assert self._pos0 < new_pos0 <= self._len0 * */ } /* "asyncpg/pgproto/buffer.pyx":744 * assert self._length >= 0 * * if done: # <<<<<<<<<<<<<< * # The next message is of a different type. * return */ __pyx_t_1 = (__pyx_v_done != 0); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":746 * if done: * # The next message is of a different type. * return # <<<<<<<<<<<<<< * * # Back to slow path. */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":744 * assert self._length >= 0 * * if done: # <<<<<<<<<<<<<< * # The next message is of a different type. * return */ } /* "asyncpg/pgproto/buffer.pyx":710 * * # Fast path: exhaust buf0 as efficiently as possible. * if self._pos0 + 5 <= self._len0: # <<<<<<<<<<<<<< * cbuf = cpython.PyBytes_AS_STRING(self._buf0) * new_pos0 = self._pos0 */ } /* "asyncpg/pgproto/buffer.pyx":749 * * # Back to slow path. * if not self.take_message_type(mtype): # <<<<<<<<<<<<<< * return * */ __pyx_t_9 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_take_message_type(__pyx_v_self, __pyx_v_mtype); if (unlikely(__pyx_t_9 == ((int32_t)-1))) __PYX_ERR(1, 749, __pyx_L1_error) __pyx_t_1 = (!(__pyx_t_9 != 0)); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":750 * # Back to slow path. * if not self.take_message_type(mtype): * return # <<<<<<<<<<<<<< * * cdef bytearray consume_messages(self, char mtype): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":749 * * # Back to slow path. * if not self.take_message_type(mtype): # <<<<<<<<<<<<<< * return * */ } } /* "asyncpg/pgproto/buffer.pyx":670 * return mem * * cdef redirect_messages(self, WriteBuffer buf, char mtype, # <<<<<<<<<<<<<< * int stop_at=0): * if not self._current_message_ready: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.redirect_messages", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":752 * return * * cdef bytearray consume_messages(self, char mtype): # <<<<<<<<<<<<<< * """Consume consecutive messages of the same type.""" * cdef: */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_consume_messages(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self, char __pyx_v_mtype) { char *__pyx_v_buf; Py_ssize_t __pyx_v_nbytes; Py_ssize_t __pyx_v_total_bytes; PyObject *__pyx_v_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int32_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("consume_messages", 1); /* "asyncpg/pgproto/buffer.pyx":757 * char *buf * ssize_t nbytes * ssize_t total_bytes = 0 # <<<<<<<<<<<<<< * bytearray result * */ __pyx_v_total_bytes = 0; /* "asyncpg/pgproto/buffer.pyx":760 * bytearray result * * if not self.take_message_type(mtype): # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_take_message_type(__pyx_v_self, __pyx_v_mtype); if (unlikely(__pyx_t_1 == ((int32_t)-1))) __PYX_ERR(1, 760, __pyx_L1_error) __pyx_t_2 = (!(__pyx_t_1 != 0)); if (__pyx_t_2) { /* "asyncpg/pgproto/buffer.pyx":761 * * if not self.take_message_type(mtype): * return None # <<<<<<<<<<<<<< * * # consume_messages is a volume-oriented method, so */ __Pyx_XDECREF(__pyx_r); __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":760 * bytearray result * * if not self.take_message_type(mtype): # <<<<<<<<<<<<<< * return None * */ } /* "asyncpg/pgproto/buffer.pyx":766 * # we assume that the remainder of the buffer will contain * # messages of the requested type. * result = cpythonx.PyByteArray_FromStringAndSize(NULL, self._length) # <<<<<<<<<<<<<< * buf = cpythonx.PyByteArray_AsString(result) * */ __pyx_t_3 = PyByteArray_FromStringAndSize(NULL, __pyx_v_self->_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(PyByteArray_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytearray", __pyx_t_3))) __PYX_ERR(1, 766, __pyx_L1_error) __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":767 * # messages of the requested type. * result = cpythonx.PyByteArray_FromStringAndSize(NULL, self._length) * buf = cpythonx.PyByteArray_AsString(result) # <<<<<<<<<<<<<< * * while self.take_message_type(mtype): */ __pyx_v_buf = PyByteArray_AsString(__pyx_v_result); /* "asyncpg/pgproto/buffer.pyx":769 * buf = cpythonx.PyByteArray_AsString(result) * * while self.take_message_type(mtype): # <<<<<<<<<<<<<< * self._ensure_first_buf() * nbytes = self._current_message_len_unread */ while (1) { __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_take_message_type(__pyx_v_self, __pyx_v_mtype); if (unlikely(__pyx_t_1 == ((int32_t)-1))) __PYX_ERR(1, 769, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (!__pyx_t_2) break; /* "asyncpg/pgproto/buffer.pyx":770 * * while self.take_message_type(mtype): * self._ensure_first_buf() # <<<<<<<<<<<<<< * nbytes = self._current_message_len_unread * self._read_into(buf, nbytes) */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":771 * while self.take_message_type(mtype): * self._ensure_first_buf() * nbytes = self._current_message_len_unread # <<<<<<<<<<<<<< * self._read_into(buf, nbytes) * buf += nbytes */ __pyx_t_4 = __pyx_v_self->_current_message_len_unread; __pyx_v_nbytes = __pyx_t_4; /* "asyncpg/pgproto/buffer.pyx":772 * self._ensure_first_buf() * nbytes = self._current_message_len_unread * self._read_into(buf, nbytes) # <<<<<<<<<<<<<< * buf += nbytes * total_bytes += nbytes */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__read_into(__pyx_v_self, __pyx_v_buf, __pyx_v_nbytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":773 * nbytes = self._current_message_len_unread * self._read_into(buf, nbytes) * buf += nbytes # <<<<<<<<<<<<<< * total_bytes += nbytes * self._finish_message() */ __pyx_v_buf = (__pyx_v_buf + __pyx_v_nbytes); /* "asyncpg/pgproto/buffer.pyx":774 * self._read_into(buf, nbytes) * buf += nbytes * total_bytes += nbytes # <<<<<<<<<<<<<< * self._finish_message() * */ __pyx_v_total_bytes = (__pyx_v_total_bytes + __pyx_v_nbytes); /* "asyncpg/pgproto/buffer.pyx":775 * buf += nbytes * total_bytes += nbytes * self._finish_message() # <<<<<<<<<<<<<< * * # Clamp the result to an actual size read. */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__finish_message(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "asyncpg/pgproto/buffer.pyx":778 * * # Clamp the result to an actual size read. * cpythonx.PyByteArray_Resize(result, total_bytes) # <<<<<<<<<<<<<< * * return result */ __pyx_t_5 = PyByteArray_Resize(__pyx_v_result, __pyx_v_total_bytes); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 778, __pyx_L1_error) /* "asyncpg/pgproto/buffer.pyx":780 * cpythonx.PyByteArray_Resize(result, total_bytes) * * return result # <<<<<<<<<<<<<< * * cdef finish_message(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":752 * return * * cdef bytearray consume_messages(self, char mtype): # <<<<<<<<<<<<<< * """Consume consecutive messages of the same type.""" * cdef: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.consume_messages", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":782 * return result * * cdef finish_message(self): # <<<<<<<<<<<<<< * if self._current_message_type == 0 or not self._current_message_ready: * # The message has already been finished (e.g by consume_message()), */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_finish_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { PyObject *__pyx_v_mtype = NULL; PyObject *__pyx_v_discarded = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("finish_message", 1); /* "asyncpg/pgproto/buffer.pyx":783 * * cdef finish_message(self): * if self._current_message_type == 0 or not self._current_message_ready: # <<<<<<<<<<<<<< * # The message has already been finished (e.g by consume_message()), * # or has been put back by put_message(). */ __pyx_t_2 = (__pyx_v_self->_current_message_type == 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (!__pyx_v_self->_current_message_ready); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":786 * # The message has already been finished (e.g by consume_message()), * # or has been put back by put_message(). * return # <<<<<<<<<<<<<< * * if self._current_message_len_unread: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":783 * * cdef finish_message(self): * if self._current_message_type == 0 or not self._current_message_ready: # <<<<<<<<<<<<<< * # The message has already been finished (e.g by consume_message()), * # or has been put back by put_message(). */ } /* "asyncpg/pgproto/buffer.pyx":788 * return * * if self._current_message_len_unread: # <<<<<<<<<<<<<< * if PG_DEBUG: * mtype = chr(self._current_message_type) */ __pyx_t_1 = (__pyx_v_self->_current_message_len_unread != 0); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":789 * * if self._current_message_len_unread: * if PG_DEBUG: # <<<<<<<<<<<<<< * mtype = chr(self._current_message_type) * */ __pyx_t_1 = (PG_DEBUG != 0); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":790 * if self._current_message_len_unread: * if PG_DEBUG: * mtype = chr(self._current_message_type) # <<<<<<<<<<<<<< * * discarded = self.consume_message() */ __pyx_t_3 = __Pyx_PyInt_From_char(__pyx_v_self->_current_message_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_mtype = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/pgproto/buffer.pyx":789 * * if self._current_message_len_unread: * if PG_DEBUG: # <<<<<<<<<<<<<< * mtype = chr(self._current_message_type) * */ } /* "asyncpg/pgproto/buffer.pyx":792 * mtype = chr(self._current_message_type) * * discarded = self.consume_message() # <<<<<<<<<<<<<< * * if PG_DEBUG: */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_consume_message(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_discarded = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/buffer.pyx":794 * discarded = self.consume_message() * * if PG_DEBUG: # <<<<<<<<<<<<<< * print('!!! discarding message {!r} unread data: {!r}'.format( * mtype, */ __pyx_t_1 = (PG_DEBUG != 0); if (__pyx_t_1) { /* "asyncpg/pgproto/buffer.pyx":795 * * if PG_DEBUG: * print('!!! discarding message {!r} unread data: {!r}'.format( # <<<<<<<<<<<<<< * mtype, * discarded)) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_discarding_message_r_unread_dat, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/pgproto/buffer.pyx":796 * if PG_DEBUG: * print('!!! discarding message {!r} unread data: {!r}'.format( * mtype, # <<<<<<<<<<<<<< * discarded)) * */ if (unlikely(!__pyx_v_mtype)) { __Pyx_RaiseUnboundLocalError("mtype"); __PYX_ERR(1, 796, __pyx_L1_error) } /* "asyncpg/pgproto/buffer.pyx":797 * print('!!! discarding message {!r} unread data: {!r}'.format( * mtype, * discarded)) # <<<<<<<<<<<<<< * * self._finish_message() */ __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_mtype, __pyx_v_discarded}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "asyncpg/pgproto/buffer.pyx":795 * * if PG_DEBUG: * print('!!! discarding message {!r} unread data: {!r}'.format( # <<<<<<<<<<<<<< * mtype, * discarded)) */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":794 * discarded = self.consume_message() * * if PG_DEBUG: # <<<<<<<<<<<<<< * print('!!! discarding message {!r} unread data: {!r}'.format( * mtype, */ } /* "asyncpg/pgproto/buffer.pyx":788 * return * * if self._current_message_len_unread: # <<<<<<<<<<<<<< * if PG_DEBUG: * mtype = chr(self._current_message_type) */ } /* "asyncpg/pgproto/buffer.pyx":799 * discarded)) * * self._finish_message() # <<<<<<<<<<<<<< * * cdef inline _finish_message(self): */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__finish_message(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":782 * return result * * cdef finish_message(self): # <<<<<<<<<<<<<< * if self._current_message_type == 0 or not self._current_message_ready: * # The message has already been finished (e.g by consume_message()), */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.finish_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mtype); __Pyx_XDECREF(__pyx_v_discarded); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":801 * self._finish_message() * * cdef inline _finish_message(self): # <<<<<<<<<<<<<< * self._current_message_type = 0 * self._current_message_len = 0 */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__finish_message(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_finish_message", 1); /* "asyncpg/pgproto/buffer.pyx":802 * * cdef inline _finish_message(self): * self._current_message_type = 0 # <<<<<<<<<<<<<< * self._current_message_len = 0 * self._current_message_ready = 0 */ __pyx_v_self->_current_message_type = 0; /* "asyncpg/pgproto/buffer.pyx":803 * cdef inline _finish_message(self): * self._current_message_type = 0 * self._current_message_len = 0 # <<<<<<<<<<<<<< * self._current_message_ready = 0 * self._current_message_len_unread = 0 */ __pyx_v_self->_current_message_len = 0; /* "asyncpg/pgproto/buffer.pyx":804 * self._current_message_type = 0 * self._current_message_len = 0 * self._current_message_ready = 0 # <<<<<<<<<<<<<< * self._current_message_len_unread = 0 * */ __pyx_v_self->_current_message_ready = 0; /* "asyncpg/pgproto/buffer.pyx":805 * self._current_message_len = 0 * self._current_message_ready = 0 * self._current_message_len_unread = 0 # <<<<<<<<<<<<<< * * @staticmethod */ __pyx_v_self->_current_message_len_unread = 0; /* "asyncpg/pgproto/buffer.pyx":801 * self._finish_message() * * cdef inline _finish_message(self): # <<<<<<<<<<<<<< * self._current_message_type = 0 * self._current_message_len = 0 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pyx":808 * * @staticmethod * cdef ReadBuffer new_message_parser(object data): # <<<<<<<<<<<<<< * cdef ReadBuffer buf * */ static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_new_message_parser(PyObject *__pyx_v_data) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_buf = 0; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new_message_parser", 1); /* "asyncpg/pgproto/buffer.pyx":811 * cdef ReadBuffer buf * * buf = ReadBuffer.__new__(ReadBuffer) # <<<<<<<<<<<<<< * buf.feed_data(data) * */ __pyx_t_1 = ((PyObject *)__pyx_tp_new_7asyncpg_7pgproto_7pgproto_ReadBuffer(((PyTypeObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 811, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":812 * * buf = ReadBuffer.__new__(ReadBuffer) * buf.feed_data(data) # <<<<<<<<<<<<<< * * buf._current_message_ready = 1 */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_feed_data(__pyx_v_buf, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/buffer.pyx":814 * buf.feed_data(data) * * buf._current_message_ready = 1 # <<<<<<<<<<<<<< * buf._current_message_len_unread = buf._len0 * */ __pyx_v_buf->_current_message_ready = 1; /* "asyncpg/pgproto/buffer.pyx":815 * * buf._current_message_ready = 1 * buf._current_message_len_unread = buf._len0 # <<<<<<<<<<<<<< * * return buf */ __pyx_t_2 = __pyx_v_buf->_len0; __pyx_v_buf->_current_message_len_unread = __pyx_t_2; /* "asyncpg/pgproto/buffer.pyx":817 * buf._current_message_len_unread = buf._len0 * * return buf # <<<<<<<<<<<<<< */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_buf); __pyx_r = __pyx_v_buf; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pyx":808 * * @staticmethod * cdef ReadBuffer new_message_parser(object data): # <<<<<<<<<<<<<< * cdef ReadBuffer buf * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.new_message_parser", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_10ReadBuffer_3__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_7pgproto_7pgproto_10ReadBuffer_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_10ReadBuffer_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_10ReadBuffer_3__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_10ReadBuffer_2__reduce_cython__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_10ReadBuffer_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(2, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_10ReadBuffer_5__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_7pgproto_7pgproto_10ReadBuffer_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_10ReadBuffer_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_10ReadBuffer_5__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_10ReadBuffer_4__setstate_cython__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_10ReadBuffer_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(2, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":78 * * * cdef pg_uuid_bytes_from_str(str u, char *out): # <<<<<<<<<<<<<< * cdef: * const char *orig_buf */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_pg_uuid_bytes_from_str(PyObject *__pyx_v_u, char *__pyx_v_out) { char const *__pyx_v_orig_buf; Py_ssize_t __pyx_v_size; unsigned char __pyx_v_ch; uint8_t __pyx_v_acc; uint8_t __pyx_v_part; uint8_t __pyx_v_acc_set; int __pyx_v_i; int __pyx_v_j; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; Py_UCS4 __pyx_t_6; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; int __pyx_t_9; Py_ssize_t __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pg_uuid_bytes_from_str", 1); /* "asyncpg/pgproto/uuid.pyx":86 * int i, j * * orig_buf = PyUnicode_AsUTF8AndSize(u, &size) # <<<<<<<<<<<<<< * if size > 36 or size < 32: * raise ValueError( */ __pyx_t_1 = PyUnicode_AsUTF8AndSize(__pyx_v_u, (&__pyx_v_size)); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_v_orig_buf = __pyx_t_1; /* "asyncpg/pgproto/uuid.pyx":87 * * orig_buf = PyUnicode_AsUTF8AndSize(u, &size) * if size > 36 or size < 32: # <<<<<<<<<<<<<< * raise ValueError( * f'invalid UUID {u!r}: ' */ __pyx_t_3 = (__pyx_v_size > 36); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_size < 32); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/uuid.pyx":89 * if size > 36 or size < 32: * raise ValueError( * f'invalid UUID {u!r}: ' # <<<<<<<<<<<<<< * f'length must be between 32..36 characters, got {size}') * */ __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = 127; __Pyx_INCREF(__pyx_kp_u_invalid_UUID); __pyx_t_5 += 13; __Pyx_GIVEREF(__pyx_kp_u_invalid_UUID); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_invalid_UUID); __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_u), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6; __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7); __pyx_t_7 = 0; __Pyx_INCREF(__pyx_kp_u_length_must_be_between_32_36_ch); __pyx_t_5 += 48; __Pyx_GIVEREF(__pyx_kp_u_length_must_be_between_32_36_ch); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_length_must_be_between_32_36_ch); /* "asyncpg/pgproto/uuid.pyx":90 * raise ValueError( * f'invalid UUID {u!r}: ' * f'length must be between 32..36 characters, got {size}') # <<<<<<<<<<<<<< * * acc_set = 0 */ __pyx_t_7 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/pgproto/uuid.pyx":89 * if size > 36 or size < 32: * raise ValueError( * f'invalid UUID {u!r}: ' # <<<<<<<<<<<<<< * f'length must be between 32..36 characters, got {size}') * */ __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_4, 4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/uuid.pyx":88 * orig_buf = PyUnicode_AsUTF8AndSize(u, &size) * if size > 36 or size < 32: * raise ValueError( # <<<<<<<<<<<<<< * f'invalid UUID {u!r}: ' * f'length must be between 32..36 characters, got {size}') */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 88, __pyx_L1_error) /* "asyncpg/pgproto/uuid.pyx":87 * * orig_buf = PyUnicode_AsUTF8AndSize(u, &size) * if size > 36 or size < 32: # <<<<<<<<<<<<<< * raise ValueError( * f'invalid UUID {u!r}: ' */ } /* "asyncpg/pgproto/uuid.pyx":92 * f'length must be between 32..36 characters, got {size}') * * acc_set = 0 # <<<<<<<<<<<<<< * j = 0 * for i in range(size): */ __pyx_v_acc_set = 0; /* "asyncpg/pgproto/uuid.pyx":93 * * acc_set = 0 * j = 0 # <<<<<<<<<<<<<< * for i in range(size): * ch = orig_buf[i] */ __pyx_v_j = 0; /* "asyncpg/pgproto/uuid.pyx":94 * acc_set = 0 * j = 0 * for i in range(size): # <<<<<<<<<<<<<< * ch = orig_buf[i] * if ch == b'-': */ __pyx_t_5 = __pyx_v_size; __pyx_t_8 = __pyx_t_5; for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_v_i = __pyx_t_9; /* "asyncpg/pgproto/uuid.pyx":95 * j = 0 * for i in range(size): * ch = orig_buf[i] # <<<<<<<<<<<<<< * if ch == b'-': * continue */ __pyx_v_ch = ((unsigned char)(__pyx_v_orig_buf[__pyx_v_i])); /* "asyncpg/pgproto/uuid.pyx":96 * for i in range(size): * ch = orig_buf[i] * if ch == b'-': # <<<<<<<<<<<<<< * continue * */ __pyx_t_2 = (__pyx_v_ch == ((unsigned char)'-')); if (__pyx_t_2) { /* "asyncpg/pgproto/uuid.pyx":97 * ch = orig_buf[i] * if ch == b'-': * continue # <<<<<<<<<<<<<< * * part = _hextable[ch] */ goto __pyx_L6_continue; /* "asyncpg/pgproto/uuid.pyx":96 * for i in range(size): * ch = orig_buf[i] * if ch == b'-': # <<<<<<<<<<<<<< * continue * */ } /* "asyncpg/pgproto/uuid.pyx":99 * continue * * part = _hextable[ch] # <<<<<<<<<<<<<< * if part == -1: * if ch >= 0x20 and ch <= 0x7e: */ __pyx_v_part = ((uint8_t)((int8_t)(__pyx_v_7asyncpg_7pgproto_7pgproto__hextable[__pyx_v_ch]))); /* "asyncpg/pgproto/uuid.pyx":100 * * part = _hextable[ch] * if part == -1: # <<<<<<<<<<<<<< * if ch >= 0x20 and ch <= 0x7e: * raise ValueError( */ __pyx_t_2 = (__pyx_v_part == ((uint8_t)-1L)); if (__pyx_t_2) { /* "asyncpg/pgproto/uuid.pyx":101 * part = _hextable[ch] * if part == -1: * if ch >= 0x20 and ch <= 0x7e: # <<<<<<<<<<<<<< * raise ValueError( * f'invalid UUID {u!r}: unexpected character {chr(ch)!r}') */ __pyx_t_3 = (__pyx_v_ch >= 0x20); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L11_bool_binop_done; } __pyx_t_3 = (__pyx_v_ch <= 0x7e); __pyx_t_2 = __pyx_t_3; __pyx_L11_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/uuid.pyx":103 * if ch >= 0x20 and ch <= 0x7e: * raise ValueError( * f'invalid UUID {u!r}: unexpected character {chr(ch)!r}') # <<<<<<<<<<<<<< * else: * raise ValueError('invalid UUID {u!r}: unexpected character') */ __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = 0; __pyx_t_6 = 127; __Pyx_INCREF(__pyx_kp_u_invalid_UUID); __pyx_t_10 += 13; __Pyx_GIVEREF(__pyx_kp_u_invalid_UUID); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_invalid_UUID); __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_u), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6; __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7); __pyx_t_7 = 0; __Pyx_INCREF(__pyx_kp_u_unexpected_character); __pyx_t_10 += 23; __Pyx_GIVEREF(__pyx_kp_u_unexpected_character); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_unexpected_character); __pyx_t_7 = __Pyx_PyInt_From_unsigned_char(__pyx_v_ch); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_11), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6; __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_4, 4, __pyx_t_10, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/uuid.pyx":102 * if part == -1: * if ch >= 0x20 and ch <= 0x7e: * raise ValueError( # <<<<<<<<<<<<<< * f'invalid UUID {u!r}: unexpected character {chr(ch)!r}') * else: */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 102, __pyx_L1_error) /* "asyncpg/pgproto/uuid.pyx":101 * part = _hextable[ch] * if part == -1: * if ch >= 0x20 and ch <= 0x7e: # <<<<<<<<<<<<<< * raise ValueError( * f'invalid UUID {u!r}: unexpected character {chr(ch)!r}') */ } /* "asyncpg/pgproto/uuid.pyx":105 * f'invalid UUID {u!r}: unexpected character {chr(ch)!r}') * else: * raise ValueError('invalid UUID {u!r}: unexpected character') # <<<<<<<<<<<<<< * * if acc_set: */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 105, __pyx_L1_error) } /* "asyncpg/pgproto/uuid.pyx":100 * * part = _hextable[ch] * if part == -1: # <<<<<<<<<<<<<< * if ch >= 0x20 and ch <= 0x7e: * raise ValueError( */ } /* "asyncpg/pgproto/uuid.pyx":107 * raise ValueError('invalid UUID {u!r}: unexpected character') * * if acc_set: # <<<<<<<<<<<<<< * acc |= part * out[j] = acc */ __pyx_t_2 = (__pyx_v_acc_set != 0); if (__pyx_t_2) { /* "asyncpg/pgproto/uuid.pyx":108 * * if acc_set: * acc |= part # <<<<<<<<<<<<<< * out[j] = acc * acc_set = 0 */ __pyx_v_acc = (__pyx_v_acc | __pyx_v_part); /* "asyncpg/pgproto/uuid.pyx":109 * if acc_set: * acc |= part * out[j] = acc # <<<<<<<<<<<<<< * acc_set = 0 * j += 1 */ (__pyx_v_out[__pyx_v_j]) = ((char)__pyx_v_acc); /* "asyncpg/pgproto/uuid.pyx":110 * acc |= part * out[j] = acc * acc_set = 0 # <<<<<<<<<<<<<< * j += 1 * else: */ __pyx_v_acc_set = 0; /* "asyncpg/pgproto/uuid.pyx":111 * out[j] = acc * acc_set = 0 * j += 1 # <<<<<<<<<<<<<< * else: * acc = (part << 4) */ __pyx_v_j = (__pyx_v_j + 1); /* "asyncpg/pgproto/uuid.pyx":107 * raise ValueError('invalid UUID {u!r}: unexpected character') * * if acc_set: # <<<<<<<<<<<<<< * acc |= part * out[j] = acc */ goto __pyx_L13; } /* "asyncpg/pgproto/uuid.pyx":113 * j += 1 * else: * acc = (part << 4) # <<<<<<<<<<<<<< * acc_set = 1 * */ /*else*/ { __pyx_v_acc = ((uint8_t)(__pyx_v_part << 4)); /* "asyncpg/pgproto/uuid.pyx":114 * else: * acc = (part << 4) * acc_set = 1 # <<<<<<<<<<<<<< * * if j > 16 or (j == 16 and acc_set): */ __pyx_v_acc_set = 1; } __pyx_L13:; /* "asyncpg/pgproto/uuid.pyx":116 * acc_set = 1 * * if j > 16 or (j == 16 and acc_set): # <<<<<<<<<<<<<< * raise ValueError( * f'invalid UUID {u!r}: decodes to more than 16 bytes') */ __pyx_t_3 = (__pyx_v_j > 16); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L15_bool_binop_done; } __pyx_t_3 = (__pyx_v_j == 16); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L15_bool_binop_done; } __pyx_t_3 = (__pyx_v_acc_set != 0); __pyx_t_2 = __pyx_t_3; __pyx_L15_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/uuid.pyx":118 * if j > 16 or (j == 16 and acc_set): * raise ValueError( * f'invalid UUID {u!r}: decodes to more than 16 bytes') # <<<<<<<<<<<<<< * * if j != 16: */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = 0; __pyx_t_6 = 127; __Pyx_INCREF(__pyx_kp_u_invalid_UUID); __pyx_t_10 += 13; __Pyx_GIVEREF(__pyx_kp_u_invalid_UUID); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_invalid_UUID); __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_u), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6; __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7); __pyx_t_7 = 0; __Pyx_INCREF(__pyx_kp_u_decodes_to_more_than_16_bytes); __pyx_t_10 += 31; __Pyx_GIVEREF(__pyx_kp_u_decodes_to_more_than_16_bytes); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_decodes_to_more_than_16_bytes); __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_10, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/uuid.pyx":117 * * if j > 16 or (j == 16 and acc_set): * raise ValueError( # <<<<<<<<<<<<<< * f'invalid UUID {u!r}: decodes to more than 16 bytes') * */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 117, __pyx_L1_error) /* "asyncpg/pgproto/uuid.pyx":116 * acc_set = 1 * * if j > 16 or (j == 16 and acc_set): # <<<<<<<<<<<<<< * raise ValueError( * f'invalid UUID {u!r}: decodes to more than 16 bytes') */ } __pyx_L6_continue:; } /* "asyncpg/pgproto/uuid.pyx":120 * f'invalid UUID {u!r}: decodes to more than 16 bytes') * * if j != 16: # <<<<<<<<<<<<<< * raise ValueError( * f'invalid UUID {u!r}: decodes to less than 16 bytes') */ __pyx_t_2 = (__pyx_v_j != 16); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/uuid.pyx":122 * if j != 16: * raise ValueError( * f'invalid UUID {u!r}: decodes to less than 16 bytes') # <<<<<<<<<<<<<< * * */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = 127; __Pyx_INCREF(__pyx_kp_u_invalid_UUID); __pyx_t_5 += 13; __Pyx_GIVEREF(__pyx_kp_u_invalid_UUID); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_invalid_UUID); __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_u), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6; __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7); __pyx_t_7 = 0; __Pyx_INCREF(__pyx_kp_u_decodes_to_less_than_16_bytes); __pyx_t_5 += 31; __Pyx_GIVEREF(__pyx_kp_u_decodes_to_less_than_16_bytes); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_decodes_to_less_than_16_bytes); __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/uuid.pyx":121 * * if j != 16: * raise ValueError( # <<<<<<<<<<<<<< * f'invalid UUID {u!r}: decodes to less than 16 bytes') * */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 121, __pyx_L1_error) /* "asyncpg/pgproto/uuid.pyx":120 * f'invalid UUID {u!r}: decodes to more than 16 bytes') * * if j != 16: # <<<<<<<<<<<<<< * raise ValueError( * f'invalid UUID {u!r}: decodes to less than 16 bytes') */ } /* "asyncpg/pgproto/uuid.pyx":78 * * * cdef pg_uuid_bytes_from_str(str u, char *out): # <<<<<<<<<<<<<< * cdef: * const char *orig_buf */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.pg_uuid_bytes_from_str", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_15__UUIDReplaceMe_1__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_7pgproto_7pgproto_15__UUIDReplaceMe_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_15__UUIDReplaceMe_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_15__UUIDReplaceMe_1__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_15__UUIDReplaceMe___reduce_cython__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_15__UUIDReplaceMe___reduce_cython__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = () # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __Pyx_INCREF(__pyx_empty_tuple); __pyx_v_state = __pyx_empty_tuple; /* "(tree fragment)":6 * cdef bint use_setstate * state = () * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__dict = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":7 * state = () * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_2 = (__pyx_v__dict != Py_None); if (__pyx_t_2) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(2, 8, __pyx_L1_error); __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = False */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = () * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = False # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle___UUIDReplaceMe, (type(self), 0xe3b0c44, None), state */ /*else*/ { __pyx_v_use_setstate = 0; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = False * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle___UUIDReplaceMe, (type(self), 0xe3b0c44, None), state * else: */ if (__pyx_v_use_setstate) { /* "(tree fragment)":13 * use_setstate = False * if use_setstate: * return __pyx_unpickle___UUIDReplaceMe, (type(self), 0xe3b0c44, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle___UUIDReplaceMe, (type(self), 0xe3b0c44, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle___UUIDReplaceMe); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_int_238750788); __Pyx_GIVEREF(__pyx_int_238750788); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_238750788)) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(2, 13, __pyx_L1_error); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(2, 13, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = False * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle___UUIDReplaceMe, (type(self), 0xe3b0c44, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle___UUIDReplaceMe, (type(self), 0xe3b0c44, None), state * else: * return __pyx_unpickle___UUIDReplaceMe, (type(self), 0xe3b0c44, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle___UUIDReplaceMe__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle___UUIDReplaceMe); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_int_238750788); __Pyx_GIVEREF(__pyx_int_238750788); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_238750788)) __PYX_ERR(2, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(2, 15, __pyx_L1_error); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.__UUIDReplaceMe.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle___UUIDReplaceMe, (type(self), 0xe3b0c44, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle___UUIDReplaceMe__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_15__UUIDReplaceMe_3__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_7pgproto_7pgproto_15__UUIDReplaceMe_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_15__UUIDReplaceMe_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_15__UUIDReplaceMe_3__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 16, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 16, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 16, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.pgproto.pgproto.__UUIDReplaceMe.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_15__UUIDReplaceMe_2__setstate_cython__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_15__UUIDReplaceMe_2__setstate_cython__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":17 * return __pyx_unpickle___UUIDReplaceMe, (type(self), 0xe3b0c44, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle___UUIDReplaceMe__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 17, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto___pyx_unpickle___UUIDReplaceMe__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle___UUIDReplaceMe, (type(self), 0xe3b0c44, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle___UUIDReplaceMe__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.__UUIDReplaceMe.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":129 * * * cdef pg_uuid_from_buf(const char *buf): # <<<<<<<<<<<<<< * cdef: * UUID u = UUID.__new__(UUID) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_pg_uuid_from_buf(char const *__pyx_v_buf) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_u = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pg_uuid_from_buf", 1); /* "asyncpg/pgproto/uuid.pyx":131 * cdef pg_uuid_from_buf(const char *buf): * cdef: * UUID u = UUID.__new__(UUID) # <<<<<<<<<<<<<< * memcpy(u._data, buf, 16) * return u */ __pyx_t_1 = ((PyObject *)__pyx_tp_new_7asyncpg_7pgproto_7pgproto_UUID(((PyTypeObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_1); __pyx_v_u = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/uuid.pyx":132 * cdef: * UUID u = UUID.__new__(UUID) * memcpy(u._data, buf, 16) # <<<<<<<<<<<<<< * return u * */ (void)(memcpy(__pyx_v_u->_data, __pyx_v_buf, 16)); /* "asyncpg/pgproto/uuid.pyx":133 * UUID u = UUID.__new__(UUID) * memcpy(u._data, buf, 16) * return u # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_u); __pyx_r = ((PyObject *)__pyx_v_u); goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":129 * * * cdef pg_uuid_from_buf(const char *buf): # <<<<<<<<<<<<<< * cdef: * UUID u = UUID.__new__(UUID) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.pg_uuid_from_buf", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_u); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":146 * object __weakref__ * * def __cinit__(self): # <<<<<<<<<<<<<< * self._int = None * self._hash = None */ /* Python wrapper */ static int __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID___cinit__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID___cinit__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 1); /* "asyncpg/pgproto/uuid.pyx":147 * * def __cinit__(self): * self._int = None # <<<<<<<<<<<<<< * self._hash = None * */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_int); __Pyx_DECREF(__pyx_v_self->_int); __pyx_v_self->_int = Py_None; /* "asyncpg/pgproto/uuid.pyx":148 * def __cinit__(self): * self._int = None * self._hash = None # <<<<<<<<<<<<<< * * def __init__(self, inp): */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_hash); __Pyx_DECREF(__pyx_v_self->_hash); __pyx_v_self->_hash = Py_None; /* "asyncpg/pgproto/uuid.pyx":146 * object __weakref__ * * def __cinit__(self): # <<<<<<<<<<<<<< * self._int = None * self._hash = None */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":150 * self._hash = None * * def __init__(self, inp): # <<<<<<<<<<<<<< * cdef: * char *buf */ /* Python wrapper */ static int __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_inp = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_inp,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_inp)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 150, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_inp = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 150, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_2__init__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self), __pyx_v_inp); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_2__init__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self, PyObject *__pyx_v_inp) { char *__pyx_v_buf; Py_ssize_t __pyx_v_size; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "asyncpg/pgproto/uuid.pyx":155 * Py_ssize_t size * * if cpython.PyBytes_Check(inp): # <<<<<<<<<<<<<< * cpython.PyBytes_AsStringAndSize(inp, &buf, &size) * if size != 16: */ __pyx_t_1 = PyBytes_Check(__pyx_v_inp); if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":156 * * if cpython.PyBytes_Check(inp): * cpython.PyBytes_AsStringAndSize(inp, &buf, &size) # <<<<<<<<<<<<<< * if size != 16: * raise ValueError(f'16 bytes were expected, got {size}') */ __pyx_t_2 = PyBytes_AsStringAndSize(__pyx_v_inp, (&__pyx_v_buf), (&__pyx_v_size)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 156, __pyx_L1_error) /* "asyncpg/pgproto/uuid.pyx":157 * if cpython.PyBytes_Check(inp): * cpython.PyBytes_AsStringAndSize(inp, &buf, &size) * if size != 16: # <<<<<<<<<<<<<< * raise ValueError(f'16 bytes were expected, got {size}') * memcpy(self._data, buf, 16) */ __pyx_t_1 = (__pyx_v_size != 16); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/uuid.pyx":158 * cpython.PyBytes_AsStringAndSize(inp, &buf, &size) * if size != 16: * raise ValueError(f'16 bytes were expected, got {size}') # <<<<<<<<<<<<<< * memcpy(self._data, buf, 16) * */ __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_16_bytes_were_expected_got, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 158, __pyx_L1_error) /* "asyncpg/pgproto/uuid.pyx":157 * if cpython.PyBytes_Check(inp): * cpython.PyBytes_AsStringAndSize(inp, &buf, &size) * if size != 16: # <<<<<<<<<<<<<< * raise ValueError(f'16 bytes were expected, got {size}') * memcpy(self._data, buf, 16) */ } /* "asyncpg/pgproto/uuid.pyx":159 * if size != 16: * raise ValueError(f'16 bytes were expected, got {size}') * memcpy(self._data, buf, 16) # <<<<<<<<<<<<<< * * elif cpython.PyUnicode_Check(inp): */ (void)(memcpy(__pyx_v_self->_data, __pyx_v_buf, 16)); /* "asyncpg/pgproto/uuid.pyx":155 * Py_ssize_t size * * if cpython.PyBytes_Check(inp): # <<<<<<<<<<<<<< * cpython.PyBytes_AsStringAndSize(inp, &buf, &size) * if size != 16: */ goto __pyx_L3; } /* "asyncpg/pgproto/uuid.pyx":161 * memcpy(self._data, buf, 16) * * elif cpython.PyUnicode_Check(inp): # <<<<<<<<<<<<<< * pg_uuid_bytes_from_str(inp, self._data) * else: */ __pyx_t_1 = PyUnicode_Check(__pyx_v_inp); if (likely(__pyx_t_1)) { /* "asyncpg/pgproto/uuid.pyx":162 * * elif cpython.PyUnicode_Check(inp): * pg_uuid_bytes_from_str(inp, self._data) # <<<<<<<<<<<<<< * else: * raise TypeError(f'a bytes or str object expected, got {inp!r}') */ if (!(likely(PyUnicode_CheckExact(__pyx_v_inp))||((__pyx_v_inp) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_inp))) __PYX_ERR(0, 162, __pyx_L1_error) __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_pg_uuid_bytes_from_str(((PyObject*)__pyx_v_inp), __pyx_v_self->_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/uuid.pyx":161 * memcpy(self._data, buf, 16) * * elif cpython.PyUnicode_Check(inp): # <<<<<<<<<<<<<< * pg_uuid_bytes_from_str(inp, self._data) * else: */ goto __pyx_L3; } /* "asyncpg/pgproto/uuid.pyx":164 * pg_uuid_bytes_from_str(inp, self._data) * else: * raise TypeError(f'a bytes or str object expected, got {inp!r}') # <<<<<<<<<<<<<< * * @property */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_inp), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_a_bytes_or_str_object_expected_g, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 164, __pyx_L1_error) } __pyx_L3:; /* "asyncpg/pgproto/uuid.pyx":150 * self._hash = None * * def __init__(self, inp): # <<<<<<<<<<<<<< * cdef: * char *buf */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":166 * raise TypeError(f'a bytes or str object expected, got {inp!r}') * * @property # <<<<<<<<<<<<<< * def bytes(self): * return cpython.PyBytes_FromStringAndSize(self._data, 16) */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_5bytes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_5bytes_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_5bytes___get__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_5bytes___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "asyncpg/pgproto/uuid.pyx":168 * @property * def bytes(self): * return cpython.PyBytes_FromStringAndSize(self._data, 16) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_self->_data, 16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":166 * raise TypeError(f'a bytes or str object expected, got {inp!r}') * * @property # <<<<<<<<<<<<<< * def bytes(self): * return cpython.PyBytes_FromStringAndSize(self._data, 16) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.bytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":170 * return cpython.PyBytes_FromStringAndSize(self._data, 16) * * @property # <<<<<<<<<<<<<< * def int(self): * if self._int is None: */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_3int_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_3int_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_3int___get__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_3int___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "asyncpg/pgproto/uuid.pyx":172 * @property * def int(self): * if self._int is None: # <<<<<<<<<<<<<< * # The cache is important because `self.int` can be * # used multiple times by __hash__ etc. */ __pyx_t_1 = (__pyx_v_self->_int == Py_None); if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":175 * # The cache is important because `self.int` can be * # used multiple times by __hash__ etc. * self._int = int.from_bytes(self.bytes, 'big') # <<<<<<<<<<<<<< * return self._int * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyInt_Type)), __pyx_n_s_from_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_4, __pyx_n_u_big}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->_int); __Pyx_DECREF(__pyx_v_self->_int); __pyx_v_self->_int = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/pgproto/uuid.pyx":172 * @property * def int(self): * if self._int is None: # <<<<<<<<<<<<<< * # The cache is important because `self.int` can be * # used multiple times by __hash__ etc. */ } /* "asyncpg/pgproto/uuid.pyx":176 * # used multiple times by __hash__ etc. * self._int = int.from_bytes(self.bytes, 'big') * return self._int # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_int); __pyx_r = __pyx_v_self->_int; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":170 * return cpython.PyBytes_FromStringAndSize(self._data, 16) * * @property # <<<<<<<<<<<<<< * def int(self): * if self._int is None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.int.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":178 * return self._int * * @property # <<<<<<<<<<<<<< * def is_safe(self): * return uuid.SafeUUID.unknown */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_7is_safe_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_7is_safe_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_7is_safe___get__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_7is_safe___get__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "asyncpg/pgproto/uuid.pyx":180 * @property * def is_safe(self): * return uuid.SafeUUID.unknown # <<<<<<<<<<<<<< * * def __str__(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_uuid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SafeUUID); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_unknown); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":178 * return self._int * * @property # <<<<<<<<<<<<<< * def is_safe(self): * return uuid.SafeUUID.unknown */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.is_safe.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":182 * return uuid.SafeUUID.unknown * * def __str__(self): # <<<<<<<<<<<<<< * cdef char out[36] * uuid_to_str(self._data, out) */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_5__str__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_5__str__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_4__str__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_4__str__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { char __pyx_v_out[36]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 1); /* "asyncpg/pgproto/uuid.pyx":184 * def __str__(self): * cdef char out[36] * uuid_to_str(self._data, out) # <<<<<<<<<<<<<< * return PyUnicode_FromKindAndData(PyUnicode_1BYTE_KIND, out, 36) * */ uuid_to_str(__pyx_v_self->_data, __pyx_v_out); /* "asyncpg/pgproto/uuid.pyx":185 * cdef char out[36] * uuid_to_str(self._data, out) * return PyUnicode_FromKindAndData(PyUnicode_1BYTE_KIND, out, 36) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyUnicode_FromKindAndData(PyUnicode_1BYTE_KIND, ((void *)__pyx_v_out), 36); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":182 * return uuid.SafeUUID.unknown * * def __str__(self): # <<<<<<<<<<<<<< * cdef char out[36] * uuid_to_str(self._data, out) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":187 * return PyUnicode_FromKindAndData(PyUnicode_1BYTE_KIND, out, 36) * * @property # <<<<<<<<<<<<<< * def hex(self): * cdef char out[32] */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_3hex_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_3hex_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_3hex___get__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_3hex___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { char __pyx_v_out[32]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "asyncpg/pgproto/uuid.pyx":190 * def hex(self): * cdef char out[32] * uuid_to_hex(self._data, out) # <<<<<<<<<<<<<< * return PyUnicode_FromKindAndData(PyUnicode_1BYTE_KIND, out, 32) * */ uuid_to_hex(__pyx_v_self->_data, __pyx_v_out); /* "asyncpg/pgproto/uuid.pyx":191 * cdef char out[32] * uuid_to_hex(self._data, out) * return PyUnicode_FromKindAndData(PyUnicode_1BYTE_KIND, out, 32) # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyUnicode_FromKindAndData(PyUnicode_1BYTE_KIND, ((void *)__pyx_v_out), 32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":187 * return PyUnicode_FromKindAndData(PyUnicode_1BYTE_KIND, out, 36) * * @property # <<<<<<<<<<<<<< * def hex(self): * cdef char out[32] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.hex.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":193 * return PyUnicode_FromKindAndData(PyUnicode_1BYTE_KIND, out, 32) * * def __repr__(self): # <<<<<<<<<<<<<< * return f"UUID('{self}')" * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_7__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_7__repr__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_6__repr__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_6__repr__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_UCS4 __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); /* "asyncpg/pgproto/uuid.pyx":194 * * def __repr__(self): * return f"UUID('{self}')" # <<<<<<<<<<<<<< * * def __reduce__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; __Pyx_INCREF(__pyx_kp_u_UUID); __pyx_t_2 += 6; __Pyx_GIVEREF(__pyx_kp_u_UUID); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_UUID); __pyx_t_4 = __Pyx_PyObject_FormatSimple(((PyObject *)__pyx_v_self), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u__5); __pyx_t_2 += 2; __Pyx_GIVEREF(__pyx_kp_u__5); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__5); __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":193 * return PyUnicode_FromKindAndData(PyUnicode_1BYTE_KIND, out, 32) * * def __repr__(self): # <<<<<<<<<<<<<< * return f"UUID('{self}')" * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":196 * return f"UUID('{self}')" * * def __reduce__(self): # <<<<<<<<<<<<<< * return (type(self), (self.bytes,)) * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_9__reduce__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_7pgproto_7pgproto_4UUID_9__reduce__ = {"__reduce__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_9__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_9__reduce__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce__", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_8__reduce__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_8__reduce__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 1); /* "asyncpg/pgproto/uuid.pyx":197 * * def __reduce__(self): * return (type(self), (self.bytes,)) # <<<<<<<<<<<<<< * * def __eq__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(0, 197, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":196 * return f"UUID('{self}')" * * def __reduce__(self): # <<<<<<<<<<<<<< * return (type(self), (self.bytes,)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":199 * return (type(self), (self.bytes,)) * * def __eq__(self, other): # <<<<<<<<<<<<<< * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) == 0 */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_11__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_11__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_10__eq__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_10__eq__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__eq__", 1); /* "asyncpg/pgproto/uuid.pyx":200 * * def __eq__(self, other): * if type(other) is UUID: # <<<<<<<<<<<<<< * return memcmp(self._data, (other)._data, 16) == 0 * if isinstance(other, std_UUID): */ __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_other)) == ((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID)); if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":201 * def __eq__(self, other): * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) == 0 # <<<<<<<<<<<<<< * if isinstance(other, std_UUID): * return self.int == other.int */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBool_FromLong((memcmp(__pyx_v_self->_data, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_other)->_data, 16) == 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":200 * * def __eq__(self, other): * if type(other) is UUID: # <<<<<<<<<<<<<< * return memcmp(self._data, (other)._data, 16) == 0 * if isinstance(other, std_UUID): */ } /* "asyncpg/pgproto/uuid.pyx":202 * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) == 0 * if isinstance(other, std_UUID): # <<<<<<<<<<<<<< * return self.int == other.int * return NotImplemented */ __pyx_t_2 = __pyx_v_7asyncpg_7pgproto_7pgproto_std_UUID; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = PyObject_IsInstance(__pyx_v_other, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":203 * return memcmp(self._data, (other)._data, 16) == 0 * if isinstance(other, std_UUID): * return self.int == other.int # <<<<<<<<<<<<<< * return NotImplemented * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":202 * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) == 0 * if isinstance(other, std_UUID): # <<<<<<<<<<<<<< * return self.int == other.int * return NotImplemented */ } /* "asyncpg/pgproto/uuid.pyx":204 * if isinstance(other, std_UUID): * return self.int == other.int * return NotImplemented # <<<<<<<<<<<<<< * * def __ne__(self, other): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_builtin_NotImplemented); __pyx_r = __pyx_builtin_NotImplemented; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":199 * return (type(self), (self.bytes,)) * * def __eq__(self, other): # <<<<<<<<<<<<<< * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) == 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":206 * return NotImplemented * * def __ne__(self, other): # <<<<<<<<<<<<<< * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) != 0 */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_13__ne__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_13__ne__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_12__ne__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_12__ne__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__ne__", 1); /* "asyncpg/pgproto/uuid.pyx":207 * * def __ne__(self, other): * if type(other) is UUID: # <<<<<<<<<<<<<< * return memcmp(self._data, (other)._data, 16) != 0 * if isinstance(other, std_UUID): */ __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_other)) == ((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID)); if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":208 * def __ne__(self, other): * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) != 0 # <<<<<<<<<<<<<< * if isinstance(other, std_UUID): * return self.int != other.int */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBool_FromLong((memcmp(__pyx_v_self->_data, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_other)->_data, 16) != 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":207 * * def __ne__(self, other): * if type(other) is UUID: # <<<<<<<<<<<<<< * return memcmp(self._data, (other)._data, 16) != 0 * if isinstance(other, std_UUID): */ } /* "asyncpg/pgproto/uuid.pyx":209 * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) != 0 * if isinstance(other, std_UUID): # <<<<<<<<<<<<<< * return self.int != other.int * return NotImplemented */ __pyx_t_2 = __pyx_v_7asyncpg_7pgproto_7pgproto_std_UUID; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = PyObject_IsInstance(__pyx_v_other, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":210 * return memcmp(self._data, (other)._data, 16) != 0 * if isinstance(other, std_UUID): * return self.int != other.int # <<<<<<<<<<<<<< * return NotImplemented * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":209 * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) != 0 * if isinstance(other, std_UUID): # <<<<<<<<<<<<<< * return self.int != other.int * return NotImplemented */ } /* "asyncpg/pgproto/uuid.pyx":211 * if isinstance(other, std_UUID): * return self.int != other.int * return NotImplemented # <<<<<<<<<<<<<< * * def __lt__(self, other): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_builtin_NotImplemented); __pyx_r = __pyx_builtin_NotImplemented; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":206 * return NotImplemented * * def __ne__(self, other): # <<<<<<<<<<<<<< * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) != 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":213 * return NotImplemented * * def __lt__(self, other): # <<<<<<<<<<<<<< * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) < 0 */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_15__lt__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_15__lt__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__lt__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_14__lt__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_14__lt__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__lt__", 1); /* "asyncpg/pgproto/uuid.pyx":214 * * def __lt__(self, other): * if type(other) is UUID: # <<<<<<<<<<<<<< * return memcmp(self._data, (other)._data, 16) < 0 * if isinstance(other, std_UUID): */ __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_other)) == ((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID)); if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":215 * def __lt__(self, other): * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) < 0 # <<<<<<<<<<<<<< * if isinstance(other, std_UUID): * return self.int < other.int */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBool_FromLong((memcmp(__pyx_v_self->_data, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_other)->_data, 16) < 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":214 * * def __lt__(self, other): * if type(other) is UUID: # <<<<<<<<<<<<<< * return memcmp(self._data, (other)._data, 16) < 0 * if isinstance(other, std_UUID): */ } /* "asyncpg/pgproto/uuid.pyx":216 * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) < 0 * if isinstance(other, std_UUID): # <<<<<<<<<<<<<< * return self.int < other.int * return NotImplemented */ __pyx_t_2 = __pyx_v_7asyncpg_7pgproto_7pgproto_std_UUID; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = PyObject_IsInstance(__pyx_v_other, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":217 * return memcmp(self._data, (other)._data, 16) < 0 * if isinstance(other, std_UUID): * return self.int < other.int # <<<<<<<<<<<<<< * return NotImplemented * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":216 * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) < 0 * if isinstance(other, std_UUID): # <<<<<<<<<<<<<< * return self.int < other.int * return NotImplemented */ } /* "asyncpg/pgproto/uuid.pyx":218 * if isinstance(other, std_UUID): * return self.int < other.int * return NotImplemented # <<<<<<<<<<<<<< * * def __gt__(self, other): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_builtin_NotImplemented); __pyx_r = __pyx_builtin_NotImplemented; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":213 * return NotImplemented * * def __lt__(self, other): # <<<<<<<<<<<<<< * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) < 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.__lt__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":220 * return NotImplemented * * def __gt__(self, other): # <<<<<<<<<<<<<< * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) > 0 */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_17__gt__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_17__gt__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__gt__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_16__gt__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_16__gt__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__gt__", 1); /* "asyncpg/pgproto/uuid.pyx":221 * * def __gt__(self, other): * if type(other) is UUID: # <<<<<<<<<<<<<< * return memcmp(self._data, (other)._data, 16) > 0 * if isinstance(other, std_UUID): */ __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_other)) == ((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID)); if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":222 * def __gt__(self, other): * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) > 0 # <<<<<<<<<<<<<< * if isinstance(other, std_UUID): * return self.int > other.int */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBool_FromLong((memcmp(__pyx_v_self->_data, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_other)->_data, 16) > 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":221 * * def __gt__(self, other): * if type(other) is UUID: # <<<<<<<<<<<<<< * return memcmp(self._data, (other)._data, 16) > 0 * if isinstance(other, std_UUID): */ } /* "asyncpg/pgproto/uuid.pyx":223 * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) > 0 * if isinstance(other, std_UUID): # <<<<<<<<<<<<<< * return self.int > other.int * return NotImplemented */ __pyx_t_2 = __pyx_v_7asyncpg_7pgproto_7pgproto_std_UUID; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = PyObject_IsInstance(__pyx_v_other, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":224 * return memcmp(self._data, (other)._data, 16) > 0 * if isinstance(other, std_UUID): * return self.int > other.int # <<<<<<<<<<<<<< * return NotImplemented * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":223 * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) > 0 * if isinstance(other, std_UUID): # <<<<<<<<<<<<<< * return self.int > other.int * return NotImplemented */ } /* "asyncpg/pgproto/uuid.pyx":225 * if isinstance(other, std_UUID): * return self.int > other.int * return NotImplemented # <<<<<<<<<<<<<< * * def __le__(self, other): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_builtin_NotImplemented); __pyx_r = __pyx_builtin_NotImplemented; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":220 * return NotImplemented * * def __gt__(self, other): # <<<<<<<<<<<<<< * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) > 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.__gt__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":227 * return NotImplemented * * def __le__(self, other): # <<<<<<<<<<<<<< * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) <= 0 */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_19__le__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_19__le__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__le__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_18__le__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_18__le__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__le__", 1); /* "asyncpg/pgproto/uuid.pyx":228 * * def __le__(self, other): * if type(other) is UUID: # <<<<<<<<<<<<<< * return memcmp(self._data, (other)._data, 16) <= 0 * if isinstance(other, std_UUID): */ __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_other)) == ((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID)); if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":229 * def __le__(self, other): * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) <= 0 # <<<<<<<<<<<<<< * if isinstance(other, std_UUID): * return self.int <= other.int */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBool_FromLong((memcmp(__pyx_v_self->_data, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_other)->_data, 16) <= 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":228 * * def __le__(self, other): * if type(other) is UUID: # <<<<<<<<<<<<<< * return memcmp(self._data, (other)._data, 16) <= 0 * if isinstance(other, std_UUID): */ } /* "asyncpg/pgproto/uuid.pyx":230 * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) <= 0 * if isinstance(other, std_UUID): # <<<<<<<<<<<<<< * return self.int <= other.int * return NotImplemented */ __pyx_t_2 = __pyx_v_7asyncpg_7pgproto_7pgproto_std_UUID; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = PyObject_IsInstance(__pyx_v_other, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":231 * return memcmp(self._data, (other)._data, 16) <= 0 * if isinstance(other, std_UUID): * return self.int <= other.int # <<<<<<<<<<<<<< * return NotImplemented * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":230 * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) <= 0 * if isinstance(other, std_UUID): # <<<<<<<<<<<<<< * return self.int <= other.int * return NotImplemented */ } /* "asyncpg/pgproto/uuid.pyx":232 * if isinstance(other, std_UUID): * return self.int <= other.int * return NotImplemented # <<<<<<<<<<<<<< * * def __ge__(self, other): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_builtin_NotImplemented); __pyx_r = __pyx_builtin_NotImplemented; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":227 * return NotImplemented * * def __le__(self, other): # <<<<<<<<<<<<<< * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) <= 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.__le__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":234 * return NotImplemented * * def __ge__(self, other): # <<<<<<<<<<<<<< * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) >= 0 */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_21__ge__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_21__ge__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__ge__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_20__ge__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_20__ge__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__ge__", 1); /* "asyncpg/pgproto/uuid.pyx":235 * * def __ge__(self, other): * if type(other) is UUID: # <<<<<<<<<<<<<< * return memcmp(self._data, (other)._data, 16) >= 0 * if isinstance(other, std_UUID): */ __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_other)) == ((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID)); if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":236 * def __ge__(self, other): * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) >= 0 # <<<<<<<<<<<<<< * if isinstance(other, std_UUID): * return self.int >= other.int */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBool_FromLong((memcmp(__pyx_v_self->_data, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_other)->_data, 16) >= 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":235 * * def __ge__(self, other): * if type(other) is UUID: # <<<<<<<<<<<<<< * return memcmp(self._data, (other)._data, 16) >= 0 * if isinstance(other, std_UUID): */ } /* "asyncpg/pgproto/uuid.pyx":237 * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) >= 0 * if isinstance(other, std_UUID): # <<<<<<<<<<<<<< * return self.int >= other.int * return NotImplemented */ __pyx_t_2 = __pyx_v_7asyncpg_7pgproto_7pgproto_std_UUID; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = PyObject_IsInstance(__pyx_v_other, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":238 * return memcmp(self._data, (other)._data, 16) >= 0 * if isinstance(other, std_UUID): * return self.int >= other.int # <<<<<<<<<<<<<< * return NotImplemented * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":237 * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) >= 0 * if isinstance(other, std_UUID): # <<<<<<<<<<<<<< * return self.int >= other.int * return NotImplemented */ } /* "asyncpg/pgproto/uuid.pyx":239 * if isinstance(other, std_UUID): * return self.int >= other.int * return NotImplemented # <<<<<<<<<<<<<< * * def __hash__(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_builtin_NotImplemented); __pyx_r = __pyx_builtin_NotImplemented; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":234 * return NotImplemented * * def __ge__(self, other): # <<<<<<<<<<<<<< * if type(other) is UUID: * return memcmp(self._data, (other)._data, 16) >= 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.__ge__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":241 * return NotImplemented * * def __hash__(self): # <<<<<<<<<<<<<< * # In EdgeDB every schema object has a uuid and there are * # huge hash-maps of them. We want UUID.__hash__ to be */ /* Python wrapper */ static Py_hash_t __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_23__hash__(PyObject *__pyx_v_self); /*proto*/ static Py_hash_t __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_23__hash__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; Py_hash_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_22__hash__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_hash_t __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_22__hash__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { Py_hash_t __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_hash_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__hash__", 1); /* "asyncpg/pgproto/uuid.pyx":245 * # huge hash-maps of them. We want UUID.__hash__ to be * # as fast as possible. * if self._hash is not None: # <<<<<<<<<<<<<< * return self._hash * */ __pyx_t_1 = (__pyx_v_self->_hash != Py_None); if (__pyx_t_1) { /* "asyncpg/pgproto/uuid.pyx":246 * # as fast as possible. * if self._hash is not None: * return self._hash # <<<<<<<<<<<<<< * * self._hash = hash(self.int) */ __pyx_t_2 = __Pyx_PyInt_AsHash_t(__pyx_v_self->_hash); if (unlikely((__pyx_t_2 == (Py_hash_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L1_error) __pyx_r = __pyx_t_2; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":245 * # huge hash-maps of them. We want UUID.__hash__ to be * # as fast as possible. * if self._hash is not None: # <<<<<<<<<<<<<< * return self._hash * */ } /* "asyncpg/pgproto/uuid.pyx":248 * return self._hash * * self._hash = hash(self.int) # <<<<<<<<<<<<<< * return self._hash * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_Hash(__pyx_t_3); if (unlikely(__pyx_t_2 == ((Py_hash_t)-1))) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_FromHash_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_hash); __Pyx_DECREF(__pyx_v_self->_hash); __pyx_v_self->_hash = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/pgproto/uuid.pyx":249 * * self._hash = hash(self.int) * return self._hash # <<<<<<<<<<<<<< * * def __int__(self): */ __pyx_t_2 = __Pyx_PyInt_AsHash_t(__pyx_v_self->_hash); if (unlikely((__pyx_t_2 == (Py_hash_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 249, __pyx_L1_error) __pyx_r = __pyx_t_2; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":241 * return NotImplemented * * def __hash__(self): # <<<<<<<<<<<<<< * # In EdgeDB every schema object has a uuid and there are * # huge hash-maps of them. We want UUID.__hash__ to be */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":251 * return self._hash * * def __int__(self): # <<<<<<<<<<<<<< * return self.int * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_25__int__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_25__int__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__int__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_24__int__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_24__int__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__int__", 1); /* "asyncpg/pgproto/uuid.pyx":252 * * def __int__(self): * return self.int # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":251 * return self._hash * * def __int__(self): # <<<<<<<<<<<<<< * return self.int * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.__int__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":254 * return self.int * * @property # <<<<<<<<<<<<<< * def bytes_le(self): * bytes = self.bytes */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_8bytes_le_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_8bytes_le_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_8bytes_le___get__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_8bytes_le___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { PyObject *__pyx_v_bytes = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "asyncpg/pgproto/uuid.pyx":256 * @property * def bytes_le(self): * bytes = self.bytes # <<<<<<<<<<<<<< * return (bytes[4-1::-1] + bytes[6-1:4-1:-1] + bytes[8-1:6-1:-1] + * bytes[8:]) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytes = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/pgproto/uuid.pyx":257 * def bytes_le(self): * bytes = self.bytes * return (bytes[4-1::-1] + bytes[6-1:4-1:-1] + bytes[8-1:6-1:-1] + # <<<<<<<<<<<<<< * bytes[8:]) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_bytes, __pyx_slice__6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_bytes, __pyx_slice__7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_bytes, __pyx_slice__8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/uuid.pyx":258 * bytes = self.bytes * return (bytes[4-1::-1] + bytes[6-1:4-1:-1] + bytes[8-1:6-1:-1] + * bytes[8:]) # <<<<<<<<<<<<<< * * @property */ __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_bytes, 8, 0, NULL, NULL, &__pyx_slice__9, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/pgproto/uuid.pyx":257 * def bytes_le(self): * bytes = self.bytes * return (bytes[4-1::-1] + bytes[6-1:4-1:-1] + bytes[8-1:6-1:-1] + # <<<<<<<<<<<<<< * bytes[8:]) * */ __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":254 * return self.int * * @property # <<<<<<<<<<<<<< * def bytes_le(self): * bytes = self.bytes */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.bytes_le.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_bytes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":260 * bytes[8:]) * * @property # <<<<<<<<<<<<<< * def fields(self): * return (self.time_low, self.time_mid, self.time_hi_version, */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_6fields_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_6fields_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_6fields___get__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_6fields___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "asyncpg/pgproto/uuid.pyx":262 * @property * def fields(self): * return (self.time_low, self.time_mid, self.time_hi_version, # <<<<<<<<<<<<<< * self.clock_seq_hi_variant, self.clock_seq_low, self.node) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_time_low); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_time_mid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_time_hi_version); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/pgproto/uuid.pyx":263 * def fields(self): * return (self.time_low, self.time_mid, self.time_hi_version, * self.clock_seq_hi_variant, self.clock_seq_low, self.node) # <<<<<<<<<<<<<< * * @property */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clock_seq_hi_variant); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clock_seq_low); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_node); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "asyncpg/pgproto/uuid.pyx":262 * @property * def fields(self): * return (self.time_low, self.time_mid, self.time_hi_version, # <<<<<<<<<<<<<< * self.clock_seq_hi_variant, self.clock_seq_low, self.node) * */ __pyx_t_7 = PyTuple_New(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_4)) __PYX_ERR(0, 262, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_6)) __PYX_ERR(0, 262, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":260 * bytes[8:]) * * @property # <<<<<<<<<<<<<< * def fields(self): * return (self.time_low, self.time_mid, self.time_hi_version, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.fields.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":265 * self.clock_seq_hi_variant, self.clock_seq_low, self.node) * * @property # <<<<<<<<<<<<<< * def time_low(self): * return self.int >> 96 */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_8time_low_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_8time_low_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_8time_low___get__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_8time_low___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "asyncpg/pgproto/uuid.pyx":267 * @property * def time_low(self): * return self.int >> 96 # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Rshift(__pyx_t_1, __pyx_int_96); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":265 * self.clock_seq_hi_variant, self.clock_seq_low, self.node) * * @property # <<<<<<<<<<<<<< * def time_low(self): * return self.int >> 96 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.time_low.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":269 * return self.int >> 96 * * @property # <<<<<<<<<<<<<< * def time_mid(self): * return (self.int >> 80) & 0xffff */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_8time_mid_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_8time_mid_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_8time_mid___get__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_8time_mid___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "asyncpg/pgproto/uuid.pyx":271 * @property * def time_mid(self): * return (self.int >> 80) & 0xffff # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Rshift(__pyx_t_1, __pyx_int_80); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_AndObjC(__pyx_t_2, __pyx_int_65535, 0xffff, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":269 * return self.int >> 96 * * @property # <<<<<<<<<<<<<< * def time_mid(self): * return (self.int >> 80) & 0xffff */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.time_mid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":273 * return (self.int >> 80) & 0xffff * * @property # <<<<<<<<<<<<<< * def time_hi_version(self): * return (self.int >> 64) & 0xffff */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_15time_hi_version_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_15time_hi_version_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_15time_hi_version___get__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_15time_hi_version___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "asyncpg/pgproto/uuid.pyx":275 * @property * def time_hi_version(self): * return (self.int >> 64) & 0xffff # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Rshift(__pyx_t_1, __pyx_int_64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_AndObjC(__pyx_t_2, __pyx_int_65535, 0xffff, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":273 * return (self.int >> 80) & 0xffff * * @property # <<<<<<<<<<<<<< * def time_hi_version(self): * return (self.int >> 64) & 0xffff */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.time_hi_version.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":277 * return (self.int >> 64) & 0xffff * * @property # <<<<<<<<<<<<<< * def clock_seq_hi_variant(self): * return (self.int >> 56) & 0xff */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_20clock_seq_hi_variant_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_20clock_seq_hi_variant_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_20clock_seq_hi_variant___get__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_20clock_seq_hi_variant___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "asyncpg/pgproto/uuid.pyx":279 * @property * def clock_seq_hi_variant(self): * return (self.int >> 56) & 0xff # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_RshiftObjC(__pyx_t_1, __pyx_int_56, 56, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_AndObjC(__pyx_t_2, __pyx_int_255, 0xff, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":277 * return (self.int >> 64) & 0xffff * * @property # <<<<<<<<<<<<<< * def clock_seq_hi_variant(self): * return (self.int >> 56) & 0xff */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.clock_seq_hi_variant.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":281 * return (self.int >> 56) & 0xff * * @property # <<<<<<<<<<<<<< * def clock_seq_low(self): * return (self.int >> 48) & 0xff */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_13clock_seq_low_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_13clock_seq_low_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_13clock_seq_low___get__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_13clock_seq_low___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "asyncpg/pgproto/uuid.pyx":283 * @property * def clock_seq_low(self): * return (self.int >> 48) & 0xff # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_RshiftObjC(__pyx_t_1, __pyx_int_48, 48, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_AndObjC(__pyx_t_2, __pyx_int_255, 0xff, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":281 * return (self.int >> 56) & 0xff * * @property # <<<<<<<<<<<<<< * def clock_seq_low(self): * return (self.int >> 48) & 0xff */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.clock_seq_low.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":285 * return (self.int >> 48) & 0xff * * @property # <<<<<<<<<<<<<< * def time(self): * return (((self.time_hi_version & 0x0fff) << 48) | */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_4time_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_4time_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_4time___get__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_4time___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "asyncpg/pgproto/uuid.pyx":287 * @property * def time(self): * return (((self.time_hi_version & 0x0fff) << 48) | # <<<<<<<<<<<<<< * (self.time_mid << 32) | self.time_low) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_time_hi_version); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_AndObjC(__pyx_t_1, __pyx_int_4095, 0x0fff, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_LshiftObjC(__pyx_t_2, __pyx_int_48, 48, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/uuid.pyx":288 * def time(self): * return (((self.time_hi_version & 0x0fff) << 48) | * (self.time_mid << 32) | self.time_low) # <<<<<<<<<<<<<< * * @property */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_time_mid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_LshiftObjC(__pyx_t_2, __pyx_int_32, 32, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/uuid.pyx":287 * @property * def time(self): * return (((self.time_hi_version & 0x0fff) << 48) | # <<<<<<<<<<<<<< * (self.time_mid << 32) | self.time_low) * */ __pyx_t_2 = PyNumber_Or(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/uuid.pyx":288 * def time(self): * return (((self.time_hi_version & 0x0fff) << 48) | * (self.time_mid << 32) | self.time_low) # <<<<<<<<<<<<<< * * @property */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_time_low); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_Or(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":285 * return (self.int >> 48) & 0xff * * @property # <<<<<<<<<<<<<< * def time(self): * return (((self.time_hi_version & 0x0fff) << 48) | */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.time.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":290 * (self.time_mid << 32) | self.time_low) * * @property # <<<<<<<<<<<<<< * def clock_seq(self): * return (((self.clock_seq_hi_variant & 0x3f) << 8) | */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_9clock_seq_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_9clock_seq_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_9clock_seq___get__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_9clock_seq___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "asyncpg/pgproto/uuid.pyx":292 * @property * def clock_seq(self): * return (((self.clock_seq_hi_variant & 0x3f) << 8) | # <<<<<<<<<<<<<< * self.clock_seq_low) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clock_seq_hi_variant); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_AndObjC(__pyx_t_1, __pyx_int_63, 0x3f, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_LshiftObjC(__pyx_t_2, __pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/uuid.pyx":293 * def clock_seq(self): * return (((self.clock_seq_hi_variant & 0x3f) << 8) | * self.clock_seq_low) # <<<<<<<<<<<<<< * * @property */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clock_seq_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/pgproto/uuid.pyx":292 * @property * def clock_seq(self): * return (((self.clock_seq_hi_variant & 0x3f) << 8) | # <<<<<<<<<<<<<< * self.clock_seq_low) * */ __pyx_t_3 = PyNumber_Or(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":290 * (self.time_mid << 32) | self.time_low) * * @property # <<<<<<<<<<<<<< * def clock_seq(self): * return (((self.clock_seq_hi_variant & 0x3f) << 8) | */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.clock_seq.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":295 * self.clock_seq_low) * * @property # <<<<<<<<<<<<<< * def node(self): * return self.int & 0xffffffffffff */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_4node_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_4node_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_4node___get__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_4node___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "asyncpg/pgproto/uuid.pyx":297 * @property * def node(self): * return self.int & 0xffffffffffff # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_int_0xffffffffffff); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":295 * self.clock_seq_low) * * @property # <<<<<<<<<<<<<< * def node(self): * return self.int & 0xffffffffffff */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.node.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":299 * return self.int & 0xffffffffffff * * @property # <<<<<<<<<<<<<< * def urn(self): * return 'urn:uuid:' + str(self) */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_3urn_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_3urn_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_3urn___get__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_3urn___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "asyncpg/pgproto/uuid.pyx":301 * @property * def urn(self): * return 'urn:uuid:' + str(self) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_Unicode(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_urn_uuid, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":299 * return self.int & 0xffffffffffff * * @property # <<<<<<<<<<<<<< * def urn(self): * return 'urn:uuid:' + str(self) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.urn.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":303 * return 'urn:uuid:' + str(self) * * @property # <<<<<<<<<<<<<< * def variant(self): * if not self.int & (0x8000 << 48): */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_7variant_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_7variant_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_7variant___get__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_7variant___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "asyncpg/pgproto/uuid.pyx":305 * @property * def variant(self): * if not self.int & (0x8000 << 48): # <<<<<<<<<<<<<< * return uuid.RESERVED_NCS * elif not self.int & (0x4000 << 48): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_int_0x8000000000000000); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (!__pyx_t_3); if (__pyx_t_4) { /* "asyncpg/pgproto/uuid.pyx":306 * def variant(self): * if not self.int & (0x8000 << 48): * return uuid.RESERVED_NCS # <<<<<<<<<<<<<< * elif not self.int & (0x4000 << 48): * return uuid.RFC_4122 */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_uuid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_RESERVED_NCS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":305 * @property * def variant(self): * if not self.int & (0x8000 << 48): # <<<<<<<<<<<<<< * return uuid.RESERVED_NCS * elif not self.int & (0x4000 << 48): */ } /* "asyncpg/pgproto/uuid.pyx":307 * if not self.int & (0x8000 << 48): * return uuid.RESERVED_NCS * elif not self.int & (0x4000 << 48): # <<<<<<<<<<<<<< * return uuid.RFC_4122 * elif not self.int & (0x2000 << 48): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_int_0x4000000000000000); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = (!__pyx_t_4); if (__pyx_t_3) { /* "asyncpg/pgproto/uuid.pyx":308 * return uuid.RESERVED_NCS * elif not self.int & (0x4000 << 48): * return uuid.RFC_4122 # <<<<<<<<<<<<<< * elif not self.int & (0x2000 << 48): * return uuid.RESERVED_MICROSOFT */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_uuid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_RFC_4122); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":307 * if not self.int & (0x8000 << 48): * return uuid.RESERVED_NCS * elif not self.int & (0x4000 << 48): # <<<<<<<<<<<<<< * return uuid.RFC_4122 * elif not self.int & (0x2000 << 48): */ } /* "asyncpg/pgproto/uuid.pyx":309 * elif not self.int & (0x4000 << 48): * return uuid.RFC_4122 * elif not self.int & (0x2000 << 48): # <<<<<<<<<<<<<< * return uuid.RESERVED_MICROSOFT * else: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_And(__pyx_t_1, __pyx_int_0x2000000000000000); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (!__pyx_t_3); if (__pyx_t_4) { /* "asyncpg/pgproto/uuid.pyx":310 * return uuid.RFC_4122 * elif not self.int & (0x2000 << 48): * return uuid.RESERVED_MICROSOFT # <<<<<<<<<<<<<< * else: * return uuid.RESERVED_FUTURE */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_uuid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_RESERVED_MICROSOFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":309 * elif not self.int & (0x4000 << 48): * return uuid.RFC_4122 * elif not self.int & (0x2000 << 48): # <<<<<<<<<<<<<< * return uuid.RESERVED_MICROSOFT * else: */ } /* "asyncpg/pgproto/uuid.pyx":312 * return uuid.RESERVED_MICROSOFT * else: * return uuid.RESERVED_FUTURE # <<<<<<<<<<<<<< * * @property */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_uuid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_RESERVED_FUTURE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "asyncpg/pgproto/uuid.pyx":303 * return 'urn:uuid:' + str(self) * * @property # <<<<<<<<<<<<<< * def variant(self): * if not self.int & (0x8000 << 48): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.variant.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/uuid.pyx":314 * return uuid.RESERVED_FUTURE * * @property # <<<<<<<<<<<<<< * def version(self): * # The version bits are only meaningful for RFC 4122 UUIDs. */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_7version_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_7version_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_7version___get__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_4UUID_7version___get__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "asyncpg/pgproto/uuid.pyx":317 * def version(self): * # The version bits are only meaningful for RFC 4122 UUIDs. * if self.variant == uuid.RFC_4122: # <<<<<<<<<<<<<< * return int((self.int >> 76) & 0xf) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_variant); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_uuid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_RFC_4122); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { /* "asyncpg/pgproto/uuid.pyx":318 * # The version bits are only meaningful for RFC 4122 UUIDs. * if self.variant == uuid.RFC_4122: * return int((self.int >> 76) & 0xf) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Rshift(__pyx_t_2, __pyx_int_76); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_AndObjC(__pyx_t_3, __pyx_int_15, 0xf, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/pgproto/uuid.pyx":317 * def version(self): * # The version bits are only meaningful for RFC 4122 UUIDs. * if self.variant == uuid.RFC_4122: # <<<<<<<<<<<<<< * return int((self.int >> 76) & 0xf) * */ } /* "asyncpg/pgproto/uuid.pyx":314 * return uuid.RESERVED_FUTURE * * @property # <<<<<<<<<<<<<< * def version(self): * # The version bits are only meaningful for RFC 4122 UUIDs. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.UUID.version.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/context.pyx":10 * cdef class CodecContext: * * cpdef get_text_codec(self): # <<<<<<<<<<<<<< * raise NotImplementedError * */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_1get_text_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_12CodecContext_get_text_codec(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_self, int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_text_codec", 1); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_text_codec); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_1get_text_codec)) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "asyncpg/pgproto/codecs/context.pyx":11 * * cpdef get_text_codec(self): * raise NotImplementedError # <<<<<<<<<<<<<< * * cdef is_encoding_utf8(self): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(3, 11, __pyx_L1_error) /* "asyncpg/pgproto/codecs/context.pyx":10 * cdef class CodecContext: * * cpdef get_text_codec(self): # <<<<<<<<<<<<<< * raise NotImplementedError * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.CodecContext.get_text_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_1get_text_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_7pgproto_7pgproto_12CodecContext_1get_text_codec = {"get_text_codec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_1get_text_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_1get_text_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_text_codec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_text_codec", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_text_codec", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_12CodecContext_get_text_codec(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_12CodecContext_get_text_codec(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_text_codec", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_12CodecContext_get_text_codec(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.CodecContext.get_text_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/context.pyx":13 * raise NotImplementedError * * cdef is_encoding_utf8(self): # <<<<<<<<<<<<<< * raise NotImplementedError * */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_12CodecContext_is_encoding_utf8(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_encoding_utf8", 1); /* "asyncpg/pgproto/codecs/context.pyx":14 * * cdef is_encoding_utf8(self): * raise NotImplementedError # <<<<<<<<<<<<<< * * cpdef get_json_decoder(self): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(3, 14, __pyx_L1_error) /* "asyncpg/pgproto/codecs/context.pyx":13 * raise NotImplementedError * * cdef is_encoding_utf8(self): # <<<<<<<<<<<<<< * raise NotImplementedError * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.pgproto.pgproto.CodecContext.is_encoding_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/context.pyx":16 * raise NotImplementedError * * cpdef get_json_decoder(self): # <<<<<<<<<<<<<< * raise NotImplementedError * */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_3get_json_decoder(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_12CodecContext_get_json_decoder(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_self, int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_json_decoder", 1); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_json_decoder); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_3get_json_decoder)) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "asyncpg/pgproto/codecs/context.pyx":17 * * cpdef get_json_decoder(self): * raise NotImplementedError # <<<<<<<<<<<<<< * * cdef is_decoding_json(self): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(3, 17, __pyx_L1_error) /* "asyncpg/pgproto/codecs/context.pyx":16 * raise NotImplementedError * * cpdef get_json_decoder(self): # <<<<<<<<<<<<<< * raise NotImplementedError * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.CodecContext.get_json_decoder", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_3get_json_decoder(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_7pgproto_7pgproto_12CodecContext_3get_json_decoder = {"get_json_decoder", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_3get_json_decoder, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_3get_json_decoder(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_json_decoder (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_json_decoder", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_json_decoder", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_12CodecContext_2get_json_decoder(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_12CodecContext_2get_json_decoder(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_json_decoder", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_12CodecContext_get_json_decoder(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.CodecContext.get_json_decoder", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/context.pyx":19 * raise NotImplementedError * * cdef is_decoding_json(self): # <<<<<<<<<<<<<< * return False * */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_12CodecContext_is_decoding_json(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_decoding_json", 1); /* "asyncpg/pgproto/codecs/context.pyx":20 * * cdef is_decoding_json(self): * return False # <<<<<<<<<<<<<< * * cpdef get_json_encoder(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "asyncpg/pgproto/codecs/context.pyx":19 * raise NotImplementedError * * cdef is_decoding_json(self): # <<<<<<<<<<<<<< * return False * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/context.pyx":22 * return False * * cpdef get_json_encoder(self): # <<<<<<<<<<<<<< * raise NotImplementedError * */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_5get_json_encoder(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_12CodecContext_get_json_encoder(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_self, int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_json_encoder", 1); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_json_encoder); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_5get_json_encoder)) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "asyncpg/pgproto/codecs/context.pyx":23 * * cpdef get_json_encoder(self): * raise NotImplementedError # <<<<<<<<<<<<<< * * cdef is_encoding_json(self): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(3, 23, __pyx_L1_error) /* "asyncpg/pgproto/codecs/context.pyx":22 * return False * * cpdef get_json_encoder(self): # <<<<<<<<<<<<<< * raise NotImplementedError * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.CodecContext.get_json_encoder", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_5get_json_encoder(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_7pgproto_7pgproto_12CodecContext_5get_json_encoder = {"get_json_encoder", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_5get_json_encoder, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_5get_json_encoder(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_json_encoder (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_json_encoder", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_json_encoder", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_12CodecContext_4get_json_encoder(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_12CodecContext_4get_json_encoder(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_json_encoder", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_12CodecContext_get_json_encoder(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.CodecContext.get_json_encoder", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/context.pyx":25 * raise NotImplementedError * * cdef is_encoding_json(self): # <<<<<<<<<<<<<< * return False */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_12CodecContext_is_encoding_json(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_encoding_json", 1); /* "asyncpg/pgproto/codecs/context.pyx":26 * * cdef is_encoding_json(self): * return False # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "asyncpg/pgproto/codecs/context.pyx":25 * raise NotImplementedError * * cdef is_encoding_json(self): # <<<<<<<<<<<<<< * return False */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_7pgproto_7pgproto_12CodecContext_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_12CodecContext_6__reduce_cython__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_12CodecContext_6__reduce_cython__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = () # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __Pyx_INCREF(__pyx_empty_tuple); __pyx_v_state = __pyx_empty_tuple; /* "(tree fragment)":6 * cdef bint use_setstate * state = () * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__dict = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":7 * state = () * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_2 = (__pyx_v__dict != Py_None); if (__pyx_t_2) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(2, 8, __pyx_L1_error); __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = False */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = () * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = False # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_CodecContext, (type(self), 0xe3b0c44, None), state */ /*else*/ { __pyx_v_use_setstate = 0; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = False * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_CodecContext, (type(self), 0xe3b0c44, None), state * else: */ if (__pyx_v_use_setstate) { /* "(tree fragment)":13 * use_setstate = False * if use_setstate: * return __pyx_unpickle_CodecContext, (type(self), 0xe3b0c44, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_CodecContext, (type(self), 0xe3b0c44, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_CodecContext); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_int_238750788); __Pyx_GIVEREF(__pyx_int_238750788); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_238750788)) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(2, 13, __pyx_L1_error); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(2, 13, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = False * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_CodecContext, (type(self), 0xe3b0c44, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle_CodecContext, (type(self), 0xe3b0c44, None), state * else: * return __pyx_unpickle_CodecContext, (type(self), 0xe3b0c44, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_CodecContext__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_CodecContext); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_int_238750788); __Pyx_GIVEREF(__pyx_int_238750788); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_238750788)) __PYX_ERR(2, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(2, 15, __pyx_L1_error); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.CodecContext.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle_CodecContext, (type(self), 0xe3b0c44, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_CodecContext__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_7pgproto_7pgproto_12CodecContext_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 16, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 16, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 16, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.pgproto.pgproto.CodecContext.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_12CodecContext_8__setstate_cython__(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_12CodecContext_8__setstate_cython__(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":17 * return __pyx_unpickle_CodecContext, (type(self), 0xe3b0c44, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_CodecContext__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 17, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto___pyx_unpickle_CodecContext__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle_CodecContext, (type(self), 0xe3b0c44, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_CodecContext__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.CodecContext.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/bytea.pyx":8 * * * cdef bytea_encode(CodecContext settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * cdef: * Py_buffer pybuf */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_wbuf, PyObject *__pyx_v_obj) { Py_buffer __pyx_v_pybuf; int __pyx_v_pybuf_used; char *__pyx_v_buf; Py_ssize_t __pyx_v_len; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bytea_encode", 1); /* "asyncpg/pgproto/codecs/bytea.pyx":11 * cdef: * Py_buffer pybuf * bint pybuf_used = False # <<<<<<<<<<<<<< * char *buf * ssize_t len */ __pyx_v_pybuf_used = 0; /* "asyncpg/pgproto/codecs/bytea.pyx":15 * ssize_t len * * if cpython.PyBytes_CheckExact(obj): # <<<<<<<<<<<<<< * buf = cpython.PyBytes_AS_STRING(obj) * len = cpython.Py_SIZE(obj) */ __pyx_t_1 = PyBytes_CheckExact(__pyx_v_obj); if (__pyx_t_1) { /* "asyncpg/pgproto/codecs/bytea.pyx":16 * * if cpython.PyBytes_CheckExact(obj): * buf = cpython.PyBytes_AS_STRING(obj) # <<<<<<<<<<<<<< * len = cpython.Py_SIZE(obj) * else: */ __pyx_v_buf = PyBytes_AS_STRING(__pyx_v_obj); /* "asyncpg/pgproto/codecs/bytea.pyx":17 * if cpython.PyBytes_CheckExact(obj): * buf = cpython.PyBytes_AS_STRING(obj) * len = cpython.Py_SIZE(obj) # <<<<<<<<<<<<<< * else: * cpython.PyObject_GetBuffer(obj, &pybuf, cpython.PyBUF_SIMPLE) */ __pyx_v_len = Py_SIZE(__pyx_v_obj); /* "asyncpg/pgproto/codecs/bytea.pyx":15 * ssize_t len * * if cpython.PyBytes_CheckExact(obj): # <<<<<<<<<<<<<< * buf = cpython.PyBytes_AS_STRING(obj) * len = cpython.Py_SIZE(obj) */ goto __pyx_L3; } /* "asyncpg/pgproto/codecs/bytea.pyx":19 * len = cpython.Py_SIZE(obj) * else: * cpython.PyObject_GetBuffer(obj, &pybuf, cpython.PyBUF_SIMPLE) # <<<<<<<<<<<<<< * pybuf_used = True * buf = pybuf.buf */ /*else*/ { __pyx_t_2 = PyObject_GetBuffer(__pyx_v_obj, (&__pyx_v_pybuf), PyBUF_SIMPLE); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 19, __pyx_L1_error) /* "asyncpg/pgproto/codecs/bytea.pyx":20 * else: * cpython.PyObject_GetBuffer(obj, &pybuf, cpython.PyBUF_SIMPLE) * pybuf_used = True # <<<<<<<<<<<<<< * buf = pybuf.buf * len = pybuf.len */ __pyx_v_pybuf_used = 1; /* "asyncpg/pgproto/codecs/bytea.pyx":21 * cpython.PyObject_GetBuffer(obj, &pybuf, cpython.PyBUF_SIMPLE) * pybuf_used = True * buf = pybuf.buf # <<<<<<<<<<<<<< * len = pybuf.len * */ __pyx_v_buf = ((char *)__pyx_v_pybuf.buf); /* "asyncpg/pgproto/codecs/bytea.pyx":22 * pybuf_used = True * buf = pybuf.buf * len = pybuf.len # <<<<<<<<<<<<<< * * try: */ __pyx_t_3 = __pyx_v_pybuf.len; __pyx_v_len = __pyx_t_3; } __pyx_L3:; /* "asyncpg/pgproto/codecs/bytea.pyx":24 * len = pybuf.len * * try: # <<<<<<<<<<<<<< * wbuf.write_int32(len) * wbuf.write_cstr(buf, len) */ /*try:*/ { /* "asyncpg/pgproto/codecs/bytea.pyx":25 * * try: * wbuf.write_int32(len) # <<<<<<<<<<<<<< * wbuf.write_cstr(buf, len) * finally: */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_wbuf, ((int32_t)__pyx_v_len)); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 25, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/bytea.pyx":26 * try: * wbuf.write_int32(len) * wbuf.write_cstr(buf, len) # <<<<<<<<<<<<<< * finally: * if pybuf_used: */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_cstr(__pyx_v_wbuf, __pyx_v_buf, __pyx_v_len); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 26, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/pgproto/codecs/bytea.pyx":28 * wbuf.write_cstr(buf, len) * finally: * if pybuf_used: # <<<<<<<<<<<<<< * cpython.PyBuffer_Release(&pybuf) * */ /*finally:*/ { /*normal exit:*/{ if (__pyx_v_pybuf_used) { /* "asyncpg/pgproto/codecs/bytea.pyx":29 * finally: * if pybuf_used: * cpython.PyBuffer_Release(&pybuf) # <<<<<<<<<<<<<< * * */ PyBuffer_Release((&__pyx_v_pybuf)); /* "asyncpg/pgproto/codecs/bytea.pyx":28 * wbuf.write_cstr(buf, len) * finally: * if pybuf_used: # <<<<<<<<<<<<<< * cpython.PyBuffer_Release(&pybuf) * */ } goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __pyx_t_2 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; { if (__pyx_v_pybuf_used) { /* "asyncpg/pgproto/codecs/bytea.pyx":29 * finally: * if pybuf_used: * cpython.PyBuffer_Release(&pybuf) # <<<<<<<<<<<<<< * * */ PyBuffer_Release((&__pyx_v_pybuf)); /* "asyncpg/pgproto/codecs/bytea.pyx":28 * wbuf.write_cstr(buf, len) * finally: * if pybuf_used: # <<<<<<<<<<<<<< * cpython.PyBuffer_Release(&pybuf) * */ } } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; goto __pyx_L1_error; } __pyx_L6:; } /* "asyncpg/pgproto/codecs/bytea.pyx":8 * * * cdef bytea_encode(CodecContext settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * cdef: * Py_buffer pybuf */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.bytea_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/bytea.pyx":32 * * * cdef bytea_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef ssize_t buf_len = buf.len * return cpython.PyBytes_FromStringAndSize(frb_read_all(buf), buf_len) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { Py_ssize_t __pyx_v_buf_len; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; char const *__pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bytea_decode", 1); /* "asyncpg/pgproto/codecs/bytea.pyx":33 * * cdef bytea_decode(CodecContext settings, FRBuffer *buf): * cdef ssize_t buf_len = buf.len # <<<<<<<<<<<<<< * return cpython.PyBytes_FromStringAndSize(frb_read_all(buf), buf_len) */ __pyx_t_1 = __pyx_v_buf->len; __pyx_v_buf_len = __pyx_t_1; /* "asyncpg/pgproto/codecs/bytea.pyx":34 * cdef bytea_decode(CodecContext settings, FRBuffer *buf): * cdef ssize_t buf_len = buf.len * return cpython.PyBytes_FromStringAndSize(frb_read_all(buf), buf_len) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read_all(__pyx_v_buf); if (unlikely(__pyx_t_2 == ((char const *)NULL) && PyErr_Occurred())) __PYX_ERR(11, 34, __pyx_L1_error) __pyx_t_3 = PyBytes_FromStringAndSize(__pyx_t_2, __pyx_v_buf_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/bytea.pyx":32 * * * cdef bytea_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef ssize_t buf_len = buf.len * return cpython.PyBytes_FromStringAndSize(frb_read_all(buf), buf_len) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.bytea_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/text.pyx":8 * * * cdef inline as_pg_string_and_size( # <<<<<<<<<<<<<< * CodecContext settings, obj, char **cstr, ssize_t *size): * */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_as_pg_string_and_size(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, PyObject *__pyx_v_obj, char **__pyx_v_cstr, Py_ssize_t *__pyx_v_size) { PyObject *__pyx_v_encoded = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; char const *__pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("as_pg_string_and_size", 1); /* "asyncpg/pgproto/codecs/text.pyx":11 * CodecContext settings, obj, char **cstr, ssize_t *size): * * if not cpython.PyUnicode_Check(obj): # <<<<<<<<<<<<<< * raise TypeError('expected str, got {}'.format(type(obj).__name__)) * */ __pyx_t_1 = (!PyUnicode_Check(__pyx_v_obj)); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/codecs/text.pyx":12 * * if not cpython.PyUnicode_Check(obj): * raise TypeError('expected str, got {}'.format(type(obj).__name__)) # <<<<<<<<<<<<<< * * if settings.is_encoding_utf8(): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_expected_str_got, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(12, 12, __pyx_L1_error) /* "asyncpg/pgproto/codecs/text.pyx":11 * CodecContext settings, obj, char **cstr, ssize_t *size): * * if not cpython.PyUnicode_Check(obj): # <<<<<<<<<<<<<< * raise TypeError('expected str, got {}'.format(type(obj).__name__)) * */ } /* "asyncpg/pgproto/codecs/text.pyx":14 * raise TypeError('expected str, got {}'.format(type(obj).__name__)) * * if settings.is_encoding_utf8(): # <<<<<<<<<<<<<< * cstr[0] = cpythonx.PyUnicode_AsUTF8AndSize(obj, size) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings->__pyx_vtab)->is_encoding_utf8(__pyx_v_settings); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(12, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { /* "asyncpg/pgproto/codecs/text.pyx":15 * * if settings.is_encoding_utf8(): * cstr[0] = cpythonx.PyUnicode_AsUTF8AndSize(obj, size) # <<<<<<<<<<<<<< * else: * encoded = settings.get_text_codec().encode(obj)[0] */ __pyx_t_7 = PyUnicode_AsUTF8AndSize(__pyx_v_obj, __pyx_v_size); if (unlikely(__pyx_t_7 == ((char const *)NULL))) __PYX_ERR(12, 15, __pyx_L1_error) (__pyx_v_cstr[0]) = ((char *)__pyx_t_7); /* "asyncpg/pgproto/codecs/text.pyx":14 * raise TypeError('expected str, got {}'.format(type(obj).__name__)) * * if settings.is_encoding_utf8(): # <<<<<<<<<<<<<< * cstr[0] = cpythonx.PyUnicode_AsUTF8AndSize(obj, size) * else: */ goto __pyx_L4; } /* "asyncpg/pgproto/codecs/text.pyx":17 * cstr[0] = cpythonx.PyUnicode_AsUTF8AndSize(obj, size) * else: * encoded = settings.get_text_codec().encode(obj)[0] # <<<<<<<<<<<<<< * cpython.PyBytes_AsStringAndSize(encoded, cstr, size) * */ /*else*/ { __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings->__pyx_vtab)->get_text_codec(__pyx_v_settings, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_obj}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_encoded = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/text.pyx":18 * else: * encoded = settings.get_text_codec().encode(obj)[0] * cpython.PyBytes_AsStringAndSize(encoded, cstr, size) # <<<<<<<<<<<<<< * * if size[0] > 0x7fffffff: */ __pyx_t_8 = PyBytes_AsStringAndSize(__pyx_v_encoded, __pyx_v_cstr, ((Py_ssize_t *)__pyx_v_size)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(12, 18, __pyx_L1_error) } __pyx_L4:; /* "asyncpg/pgproto/codecs/text.pyx":20 * cpython.PyBytes_AsStringAndSize(encoded, cstr, size) * * if size[0] > 0x7fffffff: # <<<<<<<<<<<<<< * raise ValueError('string too long') * */ __pyx_t_1 = ((__pyx_v_size[0]) > 0x7fffffff); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/codecs/text.pyx":21 * * if size[0] > 0x7fffffff: * raise ValueError('string too long') # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(12, 21, __pyx_L1_error) /* "asyncpg/pgproto/codecs/text.pyx":20 * cpython.PyBytes_AsStringAndSize(encoded, cstr, size) * * if size[0] > 0x7fffffff: # <<<<<<<<<<<<<< * raise ValueError('string too long') * */ } /* "asyncpg/pgproto/codecs/text.pyx":8 * * * cdef inline as_pg_string_and_size( # <<<<<<<<<<<<<< * CodecContext settings, obj, char **cstr, ssize_t *size): * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.as_pg_string_and_size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_encoded); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/text.pyx":24 * * * cdef text_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * char *str */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { char *__pyx_v_str; Py_ssize_t __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("text_encode", 1); /* "asyncpg/pgproto/codecs/text.pyx":29 * ssize_t size * * as_pg_string_and_size(settings, obj, &str, &size) # <<<<<<<<<<<<<< * * buf.write_int32(size) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_as_pg_string_and_size(__pyx_v_settings, __pyx_v_obj, (&__pyx_v_str), (&__pyx_v_size)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/text.pyx":31 * as_pg_string_and_size(settings, obj, &str, &size) * * buf.write_int32(size) # <<<<<<<<<<<<<< * buf.write_cstr(str, size) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, ((int32_t)__pyx_v_size)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/text.pyx":32 * * buf.write_int32(size) * buf.write_cstr(str, size) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_cstr(__pyx_v_buf, __pyx_v_str, __pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/text.pyx":24 * * * cdef text_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * char *str */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.text_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/text.pyx":35 * * * cdef inline decode_pg_string(CodecContext settings, const char* data, # <<<<<<<<<<<<<< * ssize_t len): * */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_decode_pg_string(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, char const *__pyx_v_data, Py_ssize_t __pyx_v_len) { PyObject *__pyx_v_bytes = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decode_pg_string", 1); /* "asyncpg/pgproto/codecs/text.pyx":38 * ssize_t len): * * if settings.is_encoding_utf8(): # <<<<<<<<<<<<<< * # decode UTF-8 in strict mode * return cpython.PyUnicode_DecodeUTF8(data, len, NULL) */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings->__pyx_vtab)->is_encoding_utf8(__pyx_v_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(12, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "asyncpg/pgproto/codecs/text.pyx":40 * if settings.is_encoding_utf8(): * # decode UTF-8 in strict mode * return cpython.PyUnicode_DecodeUTF8(data, len, NULL) # <<<<<<<<<<<<<< * else: * bytes = cpython.PyBytes_FromStringAndSize(data, len) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyUnicode_DecodeUTF8(__pyx_v_data, __pyx_v_len, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/text.pyx":38 * ssize_t len): * * if settings.is_encoding_utf8(): # <<<<<<<<<<<<<< * # decode UTF-8 in strict mode * return cpython.PyUnicode_DecodeUTF8(data, len, NULL) */ } /* "asyncpg/pgproto/codecs/text.pyx":42 * return cpython.PyUnicode_DecodeUTF8(data, len, NULL) * else: * bytes = cpython.PyBytes_FromStringAndSize(data, len) # <<<<<<<<<<<<<< * return settings.get_text_codec().decode(bytes)[0] * */ /*else*/ { __pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_data, __pyx_v_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/text.pyx":43 * else: * bytes = cpython.PyBytes_FromStringAndSize(data, len) * return settings.get_text_codec().decode(bytes)[0] # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings->__pyx_vtab)->get_text_codec(__pyx_v_settings, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_bytes}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "asyncpg/pgproto/codecs/text.pyx":35 * * * cdef inline decode_pg_string(CodecContext settings, const char* data, # <<<<<<<<<<<<<< * ssize_t len): * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.decode_pg_string", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_bytes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/text.pyx":46 * * * cdef text_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef ssize_t buf_len = buf.len * return decode_pg_string(settings, frb_read_all(buf), buf_len) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { Py_ssize_t __pyx_v_buf_len; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; char const *__pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("text_decode", 1); /* "asyncpg/pgproto/codecs/text.pyx":47 * * cdef text_decode(CodecContext settings, FRBuffer *buf): * cdef ssize_t buf_len = buf.len # <<<<<<<<<<<<<< * return decode_pg_string(settings, frb_read_all(buf), buf_len) */ __pyx_t_1 = __pyx_v_buf->len; __pyx_v_buf_len = __pyx_t_1; /* "asyncpg/pgproto/codecs/text.pyx":48 * cdef text_decode(CodecContext settings, FRBuffer *buf): * cdef ssize_t buf_len = buf.len * return decode_pg_string(settings, frb_read_all(buf), buf_len) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read_all(__pyx_v_buf); if (unlikely(__pyx_t_2 == ((char const *)NULL) && PyErr_Occurred())) __PYX_ERR(12, 48, __pyx_L1_error) __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_decode_pg_string(__pyx_v_settings, __pyx_t_2, __pyx_v_buf_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/text.pyx":46 * * * cdef text_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef ssize_t buf_len = buf.len * return decode_pg_string(settings, frb_read_all(buf), buf_len) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.text_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":62 * * * cdef inline _local_timezone(): # <<<<<<<<<<<<<< * d = datetime.datetime.now(datetime.timezone.utc).astimezone() * return datetime.timezone(d.utcoffset()) */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto__local_timezone(void) { PyObject *__pyx_v_d = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_local_timezone", 1); /* "asyncpg/pgproto/codecs/datetime.pyx":63 * * cdef inline _local_timezone(): * d = datetime.datetime.now(datetime.timezone.utc).astimezone() # <<<<<<<<<<<<<< * return datetime.timezone(d.utcoffset()) * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_now); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_timezone); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_utc); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astimezone); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_d = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":64 * cdef inline _local_timezone(): * d = datetime.datetime.now(datetime.timezone.utc).astimezone() * return datetime.timezone(d.utcoffset()) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_utcoffset); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/datetime.pyx":62 * * * cdef inline _local_timezone(): # <<<<<<<<<<<<<< * d = datetime.datetime.now(datetime.timezone.utc).astimezone() * return datetime.timezone(d.utcoffset()) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.pgproto.pgproto._local_timezone", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_d); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":67 * * * cdef inline _encode_time(WriteBuffer buf, int64_t seconds, # <<<<<<<<<<<<<< * int32_t microseconds): * # XXX: add support for double timestamps */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto__encode_time(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, int64_t __pyx_v_seconds, int32_t __pyx_v_microseconds) { int64_t __pyx_v_ts; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_encode_time", 1); /* "asyncpg/pgproto/codecs/datetime.pyx":71 * # XXX: add support for double timestamps * # int64 timestamps, * cdef int64_t ts = seconds * 1000000 + microseconds # <<<<<<<<<<<<<< * * if ts == infinity_datetime_ts: */ __pyx_v_ts = ((__pyx_v_seconds * 0xF4240) + __pyx_v_microseconds); /* "asyncpg/pgproto/codecs/datetime.pyx":73 * cdef int64_t ts = seconds * 1000000 + microseconds * * if ts == infinity_datetime_ts: # <<<<<<<<<<<<<< * buf.write_int64(pg_time64_infinity) * elif ts == negative_infinity_datetime_ts: */ __pyx_t_1 = (__pyx_v_ts == __pyx_v_7asyncpg_7pgproto_7pgproto_infinity_datetime_ts); if (__pyx_t_1) { /* "asyncpg/pgproto/codecs/datetime.pyx":74 * * if ts == infinity_datetime_ts: * buf.write_int64(pg_time64_infinity) # <<<<<<<<<<<<<< * elif ts == negative_infinity_datetime_ts: * buf.write_int64(pg_time64_negative_infinity) */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_7asyncpg_7pgproto_7pgproto_pg_time64_infinity); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":73 * cdef int64_t ts = seconds * 1000000 + microseconds * * if ts == infinity_datetime_ts: # <<<<<<<<<<<<<< * buf.write_int64(pg_time64_infinity) * elif ts == negative_infinity_datetime_ts: */ goto __pyx_L3; } /* "asyncpg/pgproto/codecs/datetime.pyx":75 * if ts == infinity_datetime_ts: * buf.write_int64(pg_time64_infinity) * elif ts == negative_infinity_datetime_ts: # <<<<<<<<<<<<<< * buf.write_int64(pg_time64_negative_infinity) * else: */ __pyx_t_1 = (__pyx_v_ts == __pyx_v_7asyncpg_7pgproto_7pgproto_negative_infinity_datetime_ts); if (__pyx_t_1) { /* "asyncpg/pgproto/codecs/datetime.pyx":76 * buf.write_int64(pg_time64_infinity) * elif ts == negative_infinity_datetime_ts: * buf.write_int64(pg_time64_negative_infinity) # <<<<<<<<<<<<<< * else: * buf.write_int64(ts) */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_7asyncpg_7pgproto_7pgproto_pg_time64_negative_infinity); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":75 * if ts == infinity_datetime_ts: * buf.write_int64(pg_time64_infinity) * elif ts == negative_infinity_datetime_ts: # <<<<<<<<<<<<<< * buf.write_int64(pg_time64_negative_infinity) * else: */ goto __pyx_L3; } /* "asyncpg/pgproto/codecs/datetime.pyx":78 * buf.write_int64(pg_time64_negative_infinity) * else: * buf.write_int64(ts) # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_ts); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L3:; /* "asyncpg/pgproto/codecs/datetime.pyx":67 * * * cdef inline _encode_time(WriteBuffer buf, int64_t seconds, # <<<<<<<<<<<<<< * int32_t microseconds): * # XXX: add support for double timestamps */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto._encode_time", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":81 * * * cdef inline int32_t _decode_time(FRBuffer *buf, int64_t *seconds, # <<<<<<<<<<<<<< * int32_t *microseconds): * cdef int64_t ts = hton.unpack_int64(frb_read(buf, 8)) */ static CYTHON_INLINE int32_t __pyx_f_7asyncpg_7pgproto_7pgproto__decode_time(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf, int64_t *__pyx_v_seconds, int32_t *__pyx_v_microseconds) { int64_t __pyx_v_ts; int32_t __pyx_r; char const *__pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":83 * cdef inline int32_t _decode_time(FRBuffer *buf, int64_t *seconds, * int32_t *microseconds): * cdef int64_t ts = hton.unpack_int64(frb_read(buf, 8)) # <<<<<<<<<<<<<< * * if ts == pg_time64_infinity: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(13, 83, __pyx_L1_error) __pyx_v_ts = unpack_int64(__pyx_t_1); /* "asyncpg/pgproto/codecs/datetime.pyx":85 * cdef int64_t ts = hton.unpack_int64(frb_read(buf, 8)) * * if ts == pg_time64_infinity: # <<<<<<<<<<<<<< * return 1 * elif ts == pg_time64_negative_infinity: */ __pyx_t_2 = (__pyx_v_ts == __pyx_v_7asyncpg_7pgproto_7pgproto_pg_time64_infinity); if (__pyx_t_2) { /* "asyncpg/pgproto/codecs/datetime.pyx":86 * * if ts == pg_time64_infinity: * return 1 # <<<<<<<<<<<<<< * elif ts == pg_time64_negative_infinity: * return -1 */ __pyx_r = 1; goto __pyx_L0; /* "asyncpg/pgproto/codecs/datetime.pyx":85 * cdef int64_t ts = hton.unpack_int64(frb_read(buf, 8)) * * if ts == pg_time64_infinity: # <<<<<<<<<<<<<< * return 1 * elif ts == pg_time64_negative_infinity: */ } /* "asyncpg/pgproto/codecs/datetime.pyx":87 * if ts == pg_time64_infinity: * return 1 * elif ts == pg_time64_negative_infinity: # <<<<<<<<<<<<<< * return -1 * else: */ __pyx_t_2 = (__pyx_v_ts == __pyx_v_7asyncpg_7pgproto_7pgproto_pg_time64_negative_infinity); if (__pyx_t_2) { /* "asyncpg/pgproto/codecs/datetime.pyx":88 * return 1 * elif ts == pg_time64_negative_infinity: * return -1 # <<<<<<<<<<<<<< * else: * seconds[0] = ts // 1000000 */ __pyx_r = -1; goto __pyx_L0; /* "asyncpg/pgproto/codecs/datetime.pyx":87 * if ts == pg_time64_infinity: * return 1 * elif ts == pg_time64_negative_infinity: # <<<<<<<<<<<<<< * return -1 * else: */ } /* "asyncpg/pgproto/codecs/datetime.pyx":90 * return -1 * else: * seconds[0] = ts // 1000000 # <<<<<<<<<<<<<< * microseconds[0] = (ts % 1000000) * return 0 */ /*else*/ { (__pyx_v_seconds[0]) = __Pyx_div_int64_t(__pyx_v_ts, 0xF4240); /* "asyncpg/pgproto/codecs/datetime.pyx":91 * else: * seconds[0] = ts // 1000000 * microseconds[0] = (ts % 1000000) # <<<<<<<<<<<<<< * return 0 * */ (__pyx_v_microseconds[0]) = ((int32_t)__Pyx_mod_int64_t(__pyx_v_ts, 0xF4240)); /* "asyncpg/pgproto/codecs/datetime.pyx":92 * seconds[0] = ts // 1000000 * microseconds[0] = (ts % 1000000) * return 0 # <<<<<<<<<<<<<< * * */ __pyx_r = 0; goto __pyx_L0; } /* "asyncpg/pgproto/codecs/datetime.pyx":81 * * * cdef inline int32_t _decode_time(FRBuffer *buf, int64_t *seconds, # <<<<<<<<<<<<<< * int32_t *microseconds): * cdef int64_t ts = hton.unpack_int64(frb_read(buf, 8)) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.pgproto.pgproto._decode_time", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":95 * * * cdef date_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * int32_t ordinal = cpython.PyLong_AsLong(obj.toordinal()) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_date_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { int32_t __pyx_v_ordinal; int32_t __pyx_v_pg_ordinal; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; long __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("date_encode", 1); /* "asyncpg/pgproto/codecs/datetime.pyx":97 * cdef date_encode(CodecContext settings, WriteBuffer buf, obj): * cdef: * int32_t ordinal = cpython.PyLong_AsLong(obj.toordinal()) # <<<<<<<<<<<<<< * int32_t pg_ordinal * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_5 = PyLong_AsLong(__pyx_t_1); if (unlikely(__pyx_t_5 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ordinal = ((int32_t)__pyx_t_5); /* "asyncpg/pgproto/codecs/datetime.pyx":100 * int32_t pg_ordinal * * if ordinal == infinity_date_ord: # <<<<<<<<<<<<<< * pg_ordinal = pg_date_infinity * elif ordinal == negative_infinity_date_ord: */ __pyx_t_6 = (__pyx_v_ordinal == __pyx_v_7asyncpg_7pgproto_7pgproto_infinity_date_ord); if (__pyx_t_6) { /* "asyncpg/pgproto/codecs/datetime.pyx":101 * * if ordinal == infinity_date_ord: * pg_ordinal = pg_date_infinity # <<<<<<<<<<<<<< * elif ordinal == negative_infinity_date_ord: * pg_ordinal = pg_date_negative_infinity */ __pyx_v_pg_ordinal = __pyx_v_7asyncpg_7pgproto_7pgproto_pg_date_infinity; /* "asyncpg/pgproto/codecs/datetime.pyx":100 * int32_t pg_ordinal * * if ordinal == infinity_date_ord: # <<<<<<<<<<<<<< * pg_ordinal = pg_date_infinity * elif ordinal == negative_infinity_date_ord: */ goto __pyx_L3; } /* "asyncpg/pgproto/codecs/datetime.pyx":102 * if ordinal == infinity_date_ord: * pg_ordinal = pg_date_infinity * elif ordinal == negative_infinity_date_ord: # <<<<<<<<<<<<<< * pg_ordinal = pg_date_negative_infinity * else: */ __pyx_t_6 = (__pyx_v_ordinal == __pyx_v_7asyncpg_7pgproto_7pgproto_negative_infinity_date_ord); if (__pyx_t_6) { /* "asyncpg/pgproto/codecs/datetime.pyx":103 * pg_ordinal = pg_date_infinity * elif ordinal == negative_infinity_date_ord: * pg_ordinal = pg_date_negative_infinity # <<<<<<<<<<<<<< * else: * pg_ordinal = ordinal - pg_date_offset_ord */ __pyx_v_pg_ordinal = __pyx_v_7asyncpg_7pgproto_7pgproto_pg_date_negative_infinity; /* "asyncpg/pgproto/codecs/datetime.pyx":102 * if ordinal == infinity_date_ord: * pg_ordinal = pg_date_infinity * elif ordinal == negative_infinity_date_ord: # <<<<<<<<<<<<<< * pg_ordinal = pg_date_negative_infinity * else: */ goto __pyx_L3; } /* "asyncpg/pgproto/codecs/datetime.pyx":105 * pg_ordinal = pg_date_negative_infinity * else: * pg_ordinal = ordinal - pg_date_offset_ord # <<<<<<<<<<<<<< * * buf.write_int32(4) */ /*else*/ { __pyx_v_pg_ordinal = (__pyx_v_ordinal - __pyx_v_7asyncpg_7pgproto_7pgproto_pg_date_offset_ord); } __pyx_L3:; /* "asyncpg/pgproto/codecs/datetime.pyx":107 * pg_ordinal = ordinal - pg_date_offset_ord * * buf.write_int32(4) # <<<<<<<<<<<<<< * buf.write_int32(pg_ordinal) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":108 * * buf.write_int32(4) * buf.write_int32(pg_ordinal) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_v_pg_ordinal); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":95 * * * cdef date_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * int32_t ordinal = cpython.PyLong_AsLong(obj.toordinal()) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.date_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":111 * * * cdef date_encode_tuple(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * int32_t pg_ordinal */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_date_encode_tuple(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { int32_t __pyx_v_pg_ordinal; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int32_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("date_encode_tuple", 1); /* "asyncpg/pgproto/codecs/datetime.pyx":115 * int32_t pg_ordinal * * if len(obj) != 1: # <<<<<<<<<<<<<< * raise ValueError( * 'date tuple encoder: expecting 1 element ' */ __pyx_t_1 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(13, 115, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 1); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/codecs/datetime.pyx":118 * raise ValueError( * 'date tuple encoder: expecting 1 element ' * 'in tuple, got {}'.format(len(obj))) # <<<<<<<<<<<<<< * * pg_ordinal = obj[0] */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_date_tuple_encoder_expecting_1_e, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(13, 118, __pyx_L1_error) __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/pgproto/codecs/datetime.pyx":116 * * if len(obj) != 1: * raise ValueError( # <<<<<<<<<<<<<< * 'date tuple encoder: expecting 1 element ' * 'in tuple, got {}'.format(len(obj))) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(13, 116, __pyx_L1_error) /* "asyncpg/pgproto/codecs/datetime.pyx":115 * int32_t pg_ordinal * * if len(obj) != 1: # <<<<<<<<<<<<<< * raise ValueError( * 'date tuple encoder: expecting 1 element ' */ } /* "asyncpg/pgproto/codecs/datetime.pyx":120 * 'in tuple, got {}'.format(len(obj))) * * pg_ordinal = obj[0] # <<<<<<<<<<<<<< * buf.write_int32(4) * buf.write_int32(pg_ordinal) */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_t_4); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_pg_ordinal = __pyx_t_8; /* "asyncpg/pgproto/codecs/datetime.pyx":121 * * pg_ordinal = obj[0] * buf.write_int32(4) # <<<<<<<<<<<<<< * buf.write_int32(pg_ordinal) * */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 4); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":122 * pg_ordinal = obj[0] * buf.write_int32(4) * buf.write_int32(pg_ordinal) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_v_pg_ordinal); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":111 * * * cdef date_encode_tuple(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * int32_t pg_ordinal */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.date_encode_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":125 * * * cdef date_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef int32_t pg_ordinal = hton.unpack_int32(frb_read(buf, 4)) * */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_date_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { int32_t __pyx_v_pg_ordinal; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("date_decode", 1); /* "asyncpg/pgproto/codecs/datetime.pyx":126 * * cdef date_decode(CodecContext settings, FRBuffer *buf): * cdef int32_t pg_ordinal = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * * if pg_ordinal == pg_date_infinity: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(13, 126, __pyx_L1_error) __pyx_v_pg_ordinal = unpack_int32(__pyx_t_1); /* "asyncpg/pgproto/codecs/datetime.pyx":128 * cdef int32_t pg_ordinal = hton.unpack_int32(frb_read(buf, 4)) * * if pg_ordinal == pg_date_infinity: # <<<<<<<<<<<<<< * return infinity_date * elif pg_ordinal == pg_date_negative_infinity: */ __pyx_t_2 = (__pyx_v_pg_ordinal == __pyx_v_7asyncpg_7pgproto_7pgproto_pg_date_infinity); if (__pyx_t_2) { /* "asyncpg/pgproto/codecs/datetime.pyx":129 * * if pg_ordinal == pg_date_infinity: * return infinity_date # <<<<<<<<<<<<<< * elif pg_ordinal == pg_date_negative_infinity: * return negative_infinity_date */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_infinity_date); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/datetime.pyx":128 * cdef int32_t pg_ordinal = hton.unpack_int32(frb_read(buf, 4)) * * if pg_ordinal == pg_date_infinity: # <<<<<<<<<<<<<< * return infinity_date * elif pg_ordinal == pg_date_negative_infinity: */ } /* "asyncpg/pgproto/codecs/datetime.pyx":130 * if pg_ordinal == pg_date_infinity: * return infinity_date * elif pg_ordinal == pg_date_negative_infinity: # <<<<<<<<<<<<<< * return negative_infinity_date * else: */ __pyx_t_2 = (__pyx_v_pg_ordinal == __pyx_v_7asyncpg_7pgproto_7pgproto_pg_date_negative_infinity); if (__pyx_t_2) { /* "asyncpg/pgproto/codecs/datetime.pyx":131 * return infinity_date * elif pg_ordinal == pg_date_negative_infinity: * return negative_infinity_date # <<<<<<<<<<<<<< * else: * return date_from_ordinal(pg_ordinal + pg_date_offset_ord) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_negative_infinity_date); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/datetime.pyx":130 * if pg_ordinal == pg_date_infinity: * return infinity_date * elif pg_ordinal == pg_date_negative_infinity: # <<<<<<<<<<<<<< * return negative_infinity_date * else: */ } /* "asyncpg/pgproto/codecs/datetime.pyx":133 * return negative_infinity_date * else: * return date_from_ordinal(pg_ordinal + pg_date_offset_ord) # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_date_from_ordinal); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int32_t((__pyx_v_pg_ordinal + __pyx_v_7asyncpg_7pgproto_7pgproto_pg_date_offset_ord)); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "asyncpg/pgproto/codecs/datetime.pyx":125 * * * cdef date_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef int32_t pg_ordinal = hton.unpack_int32(frb_read(buf, 4)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.date_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":136 * * * cdef date_decode_tuple(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef int32_t pg_ordinal = hton.unpack_int32(frb_read(buf, 4)) * */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_date_decode_tuple(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { int32_t __pyx_v_pg_ordinal; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("date_decode_tuple", 1); /* "asyncpg/pgproto/codecs/datetime.pyx":137 * * cdef date_decode_tuple(CodecContext settings, FRBuffer *buf): * cdef int32_t pg_ordinal = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * * return (pg_ordinal,) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(13, 137, __pyx_L1_error) __pyx_v_pg_ordinal = unpack_int32(__pyx_t_1); /* "asyncpg/pgproto/codecs/datetime.pyx":139 * cdef int32_t pg_ordinal = hton.unpack_int32(frb_read(buf, 4)) * * return (pg_ordinal,) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_pg_ordinal); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(13, 139, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/datetime.pyx":136 * * * cdef date_decode_tuple(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef int32_t pg_ordinal = hton.unpack_int32(frb_read(buf, 4)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.date_decode_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":142 * * * cdef timestamp_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * if not cpython.datetime.PyDateTime_Check(obj): * if cpython.datetime.PyDate_Check(obj): */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { PyObject *__pyx_v_delta = NULL; int64_t __pyx_v_seconds; int32_t __pyx_v_microseconds; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; PY_LONG_LONG __pyx_t_9; long __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("timestamp_encode", 0); __Pyx_INCREF(__pyx_v_obj); /* "asyncpg/pgproto/codecs/datetime.pyx":143 * * cdef timestamp_encode(CodecContext settings, WriteBuffer buf, obj): * if not cpython.datetime.PyDateTime_Check(obj): # <<<<<<<<<<<<<< * if cpython.datetime.PyDate_Check(obj): * obj = datetime.datetime(obj.year, obj.month, obj.day) */ __pyx_t_1 = (!PyDateTime_Check(__pyx_v_obj)); if (__pyx_t_1) { /* "asyncpg/pgproto/codecs/datetime.pyx":144 * cdef timestamp_encode(CodecContext settings, WriteBuffer buf, obj): * if not cpython.datetime.PyDateTime_Check(obj): * if cpython.datetime.PyDate_Check(obj): # <<<<<<<<<<<<<< * obj = datetime.datetime(obj.year, obj.month, obj.day) * else: */ __pyx_t_1 = PyDate_Check(__pyx_v_obj); if (likely(__pyx_t_1)) { /* "asyncpg/pgproto/codecs/datetime.pyx":145 * if not cpython.datetime.PyDateTime_Check(obj): * if cpython.datetime.PyDate_Check(obj): * obj = datetime.datetime(obj.year, obj.month, obj.day) # <<<<<<<<<<<<<< * else: * raise TypeError( */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_year); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_month); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_day); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":144 * cdef timestamp_encode(CodecContext settings, WriteBuffer buf, obj): * if not cpython.datetime.PyDateTime_Check(obj): * if cpython.datetime.PyDate_Check(obj): # <<<<<<<<<<<<<< * obj = datetime.datetime(obj.year, obj.month, obj.day) * else: */ goto __pyx_L4; } /* "asyncpg/pgproto/codecs/datetime.pyx":147 * obj = datetime.datetime(obj.year, obj.month, obj.day) * else: * raise TypeError( # <<<<<<<<<<<<<< * 'expected a datetime.date or datetime.datetime instance, ' * 'got {!r}'.format(type(obj).__name__) */ /*else*/ { /* "asyncpg/pgproto/codecs/datetime.pyx":149 * raise TypeError( * 'expected a datetime.date or datetime.datetime instance, ' * 'got {!r}'.format(type(obj).__name__) # <<<<<<<<<<<<<< * ) * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_expected_a_datetime_date_or_date, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/pgproto/codecs/datetime.pyx":147 * obj = datetime.datetime(obj.year, obj.month, obj.day) * else: * raise TypeError( # <<<<<<<<<<<<<< * 'expected a datetime.date or datetime.datetime instance, ' * 'got {!r}'.format(type(obj).__name__) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(13, 147, __pyx_L1_error) } __pyx_L4:; /* "asyncpg/pgproto/codecs/datetime.pyx":143 * * cdef timestamp_encode(CodecContext settings, WriteBuffer buf, obj): * if not cpython.datetime.PyDateTime_Check(obj): # <<<<<<<<<<<<<< * if cpython.datetime.PyDate_Check(obj): * obj = datetime.datetime(obj.year, obj.month, obj.day) */ } /* "asyncpg/pgproto/codecs/datetime.pyx":152 * ) * * delta = obj - pg_epoch_datetime # <<<<<<<<<<<<<< * cdef: * int64_t seconds = cpython.PyLong_AsLongLong(delta.days) * 86400 + \ */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pg_epoch_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyNumber_Subtract(__pyx_v_obj, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_delta = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":154 * delta = obj - pg_epoch_datetime * cdef: * int64_t seconds = cpython.PyLong_AsLongLong(delta.days) * 86400 + \ # <<<<<<<<<<<<<< * cpython.PyLong_AsLong(delta.seconds) * int32_t microseconds = cpython.PyLong_AsLong( */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_days); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = PyLong_AsLongLong(__pyx_t_2); if (unlikely(__pyx_t_9 == ((PY_LONG_LONG)-1LL) && PyErr_Occurred())) __PYX_ERR(13, 154, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":155 * cdef: * int64_t seconds = cpython.PyLong_AsLongLong(delta.days) * 86400 + \ * cpython.PyLong_AsLong(delta.seconds) # <<<<<<<<<<<<<< * int32_t microseconds = cpython.PyLong_AsLong( * delta.microseconds) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_seconds); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = PyLong_AsLong(__pyx_t_2); if (unlikely(__pyx_t_10 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 155, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":154 * delta = obj - pg_epoch_datetime * cdef: * int64_t seconds = cpython.PyLong_AsLongLong(delta.days) * 86400 + \ # <<<<<<<<<<<<<< * cpython.PyLong_AsLong(delta.seconds) * int32_t microseconds = cpython.PyLong_AsLong( */ __pyx_v_seconds = ((__pyx_t_9 * 0x15180) + __pyx_t_10); /* "asyncpg/pgproto/codecs/datetime.pyx":157 * cpython.PyLong_AsLong(delta.seconds) * int32_t microseconds = cpython.PyLong_AsLong( * delta.microseconds) # <<<<<<<<<<<<<< * * buf.write_int32(8) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_microseconds); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/pgproto/codecs/datetime.pyx":156 * int64_t seconds = cpython.PyLong_AsLongLong(delta.days) * 86400 + \ * cpython.PyLong_AsLong(delta.seconds) * int32_t microseconds = cpython.PyLong_AsLong( # <<<<<<<<<<<<<< * delta.microseconds) * */ __pyx_t_10 = PyLong_AsLong(__pyx_t_2); if (unlikely(__pyx_t_10 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 156, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_microseconds = ((int32_t)__pyx_t_10); /* "asyncpg/pgproto/codecs/datetime.pyx":159 * delta.microseconds) * * buf.write_int32(8) # <<<<<<<<<<<<<< * _encode_time(buf, seconds, microseconds) * */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 8); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":160 * * buf.write_int32(8) * _encode_time(buf, seconds, microseconds) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto__encode_time(__pyx_v_buf, __pyx_v_seconds, __pyx_v_microseconds); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":142 * * * cdef timestamp_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * if not cpython.datetime.PyDateTime_Check(obj): * if cpython.datetime.PyDate_Check(obj): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.timestamp_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_delta); __Pyx_XDECREF(__pyx_v_obj); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":163 * * * cdef timestamp_encode_tuple(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * int64_t microseconds */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_encode_tuple(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { int64_t __pyx_v_microseconds; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int64_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("timestamp_encode_tuple", 1); /* "asyncpg/pgproto/codecs/datetime.pyx":167 * int64_t microseconds * * if len(obj) != 1: # <<<<<<<<<<<<<< * raise ValueError( * 'timestamp tuple encoder: expecting 1 element ' */ __pyx_t_1 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(13, 167, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 1); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/codecs/datetime.pyx":170 * raise ValueError( * 'timestamp tuple encoder: expecting 1 element ' * 'in tuple, got {}'.format(len(obj))) # <<<<<<<<<<<<<< * * microseconds = obj[0] */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_timestamp_tuple_encoder_expectin, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(13, 170, __pyx_L1_error) __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/pgproto/codecs/datetime.pyx":168 * * if len(obj) != 1: * raise ValueError( # <<<<<<<<<<<<<< * 'timestamp tuple encoder: expecting 1 element ' * 'in tuple, got {}'.format(len(obj))) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(13, 168, __pyx_L1_error) /* "asyncpg/pgproto/codecs/datetime.pyx":167 * int64_t microseconds * * if len(obj) != 1: # <<<<<<<<<<<<<< * raise ValueError( * 'timestamp tuple encoder: expecting 1 element ' */ } /* "asyncpg/pgproto/codecs/datetime.pyx":172 * 'in tuple, got {}'.format(len(obj))) * * microseconds = obj[0] # <<<<<<<<<<<<<< * * buf.write_int32(8) */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_t_4); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_microseconds = __pyx_t_8; /* "asyncpg/pgproto/codecs/datetime.pyx":174 * microseconds = obj[0] * * buf.write_int32(8) # <<<<<<<<<<<<<< * buf.write_int64(microseconds) * */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 8); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":175 * * buf.write_int32(8) * buf.write_int64(microseconds) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_microseconds); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":163 * * * cdef timestamp_encode_tuple(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * int64_t microseconds */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.timestamp_encode_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":178 * * * cdef timestamp_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int64_t seconds = 0 */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { int64_t __pyx_v_seconds; int32_t __pyx_v_microseconds; int32_t __pyx_v_inf; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int32_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; unsigned int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("timestamp_decode", 1); /* "asyncpg/pgproto/codecs/datetime.pyx":180 * cdef timestamp_decode(CodecContext settings, FRBuffer *buf): * cdef: * int64_t seconds = 0 # <<<<<<<<<<<<<< * int32_t microseconds = 0 * int32_t inf = _decode_time(buf, &seconds, µseconds) */ __pyx_v_seconds = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":181 * cdef: * int64_t seconds = 0 * int32_t microseconds = 0 # <<<<<<<<<<<<<< * int32_t inf = _decode_time(buf, &seconds, µseconds) * */ __pyx_v_microseconds = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":182 * int64_t seconds = 0 * int32_t microseconds = 0 * int32_t inf = _decode_time(buf, &seconds, µseconds) # <<<<<<<<<<<<<< * * if inf > 0: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto__decode_time(__pyx_v_buf, (&__pyx_v_seconds), (&__pyx_v_microseconds)); if (unlikely(__pyx_t_1 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(13, 182, __pyx_L1_error) __pyx_v_inf = __pyx_t_1; /* "asyncpg/pgproto/codecs/datetime.pyx":184 * int32_t inf = _decode_time(buf, &seconds, µseconds) * * if inf > 0: # <<<<<<<<<<<<<< * # positive infinity * return infinity_datetime */ __pyx_t_2 = (__pyx_v_inf > 0); if (__pyx_t_2) { /* "asyncpg/pgproto/codecs/datetime.pyx":186 * if inf > 0: * # positive infinity * return infinity_datetime # <<<<<<<<<<<<<< * elif inf < 0: * # negative infinity */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_infinity_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/datetime.pyx":184 * int32_t inf = _decode_time(buf, &seconds, µseconds) * * if inf > 0: # <<<<<<<<<<<<<< * # positive infinity * return infinity_datetime */ } /* "asyncpg/pgproto/codecs/datetime.pyx":187 * # positive infinity * return infinity_datetime * elif inf < 0: # <<<<<<<<<<<<<< * # negative infinity * return negative_infinity_datetime */ __pyx_t_2 = (__pyx_v_inf < 0); if (__pyx_t_2) { /* "asyncpg/pgproto/codecs/datetime.pyx":189 * elif inf < 0: * # negative infinity * return negative_infinity_datetime # <<<<<<<<<<<<<< * else: * return pg_epoch_datetime.__add__( */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_negative_infinity_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/datetime.pyx":187 * # positive infinity * return infinity_datetime * elif inf < 0: # <<<<<<<<<<<<<< * # negative infinity * return negative_infinity_datetime */ } /* "asyncpg/pgproto/codecs/datetime.pyx":191 * return negative_infinity_datetime * else: * return pg_epoch_datetime.__add__( # <<<<<<<<<<<<<< * timedelta(0, seconds, microseconds)) * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pg_epoch_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_add); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":192 * else: * return pg_epoch_datetime.__add__( * timedelta(0, seconds, microseconds)) # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_int64_t(__pyx_v_seconds); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_int32_t(__pyx_v_microseconds); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_int_0, __pyx_t_7, __pyx_t_8}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 3+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "asyncpg/pgproto/codecs/datetime.pyx":178 * * * cdef timestamp_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int64_t seconds = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.timestamp_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":195 * * * cdef timestamp_decode_tuple(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int64_t ts = hton.unpack_int64(frb_read(buf, 8)) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_decode_tuple(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { int64_t __pyx_v_ts; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("timestamp_decode_tuple", 1); /* "asyncpg/pgproto/codecs/datetime.pyx":197 * cdef timestamp_decode_tuple(CodecContext settings, FRBuffer *buf): * cdef: * int64_t ts = hton.unpack_int64(frb_read(buf, 8)) # <<<<<<<<<<<<<< * * return (ts,) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(13, 197, __pyx_L1_error) __pyx_v_ts = unpack_int64(__pyx_t_1); /* "asyncpg/pgproto/codecs/datetime.pyx":199 * int64_t ts = hton.unpack_int64(frb_read(buf, 8)) * * return (ts,) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_ts); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(13, 199, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/datetime.pyx":195 * * * cdef timestamp_decode_tuple(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int64_t ts = hton.unpack_int64(frb_read(buf, 8)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.timestamp_decode_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":202 * * * cdef timestamptz_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * if not cpython.datetime.PyDateTime_Check(obj): * if cpython.datetime.PyDate_Check(obj): */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_timestamptz_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { PyObject *__pyx_v_utc_dt = NULL; PyObject *__pyx_v_delta = NULL; int64_t __pyx_v_seconds; int32_t __pyx_v_microseconds; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; PY_LONG_LONG __pyx_t_8; long __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("timestamptz_encode", 0); __Pyx_INCREF(__pyx_v_obj); /* "asyncpg/pgproto/codecs/datetime.pyx":203 * * cdef timestamptz_encode(CodecContext settings, WriteBuffer buf, obj): * if not cpython.datetime.PyDateTime_Check(obj): # <<<<<<<<<<<<<< * if cpython.datetime.PyDate_Check(obj): * obj = datetime.datetime(obj.year, obj.month, obj.day, */ __pyx_t_1 = (!PyDateTime_Check(__pyx_v_obj)); if (__pyx_t_1) { /* "asyncpg/pgproto/codecs/datetime.pyx":204 * cdef timestamptz_encode(CodecContext settings, WriteBuffer buf, obj): * if not cpython.datetime.PyDateTime_Check(obj): * if cpython.datetime.PyDate_Check(obj): # <<<<<<<<<<<<<< * obj = datetime.datetime(obj.year, obj.month, obj.day, * tzinfo=_local_timezone()) */ __pyx_t_1 = PyDate_Check(__pyx_v_obj); if (likely(__pyx_t_1)) { /* "asyncpg/pgproto/codecs/datetime.pyx":205 * if not cpython.datetime.PyDateTime_Check(obj): * if cpython.datetime.PyDate_Check(obj): * obj = datetime.datetime(obj.year, obj.month, obj.day, # <<<<<<<<<<<<<< * tzinfo=_local_timezone()) * else: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_year); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_month); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_day); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(13, 205, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(13, 205, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5)) __PYX_ERR(13, 205, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":206 * if cpython.datetime.PyDate_Check(obj): * obj = datetime.datetime(obj.year, obj.month, obj.day, * tzinfo=_local_timezone()) # <<<<<<<<<<<<<< * else: * raise TypeError( */ __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto__local_timezone(); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_tzinfo, __pyx_t_4) < 0) __PYX_ERR(13, 206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":205 * if not cpython.datetime.PyDateTime_Check(obj): * if cpython.datetime.PyDate_Check(obj): * obj = datetime.datetime(obj.year, obj.month, obj.day, # <<<<<<<<<<<<<< * tzinfo=_local_timezone()) * else: */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":204 * cdef timestamptz_encode(CodecContext settings, WriteBuffer buf, obj): * if not cpython.datetime.PyDateTime_Check(obj): * if cpython.datetime.PyDate_Check(obj): # <<<<<<<<<<<<<< * obj = datetime.datetime(obj.year, obj.month, obj.day, * tzinfo=_local_timezone()) */ goto __pyx_L4; } /* "asyncpg/pgproto/codecs/datetime.pyx":208 * tzinfo=_local_timezone()) * else: * raise TypeError( # <<<<<<<<<<<<<< * 'expected a datetime.date or datetime.datetime instance, ' * 'got {!r}'.format(type(obj).__name__) */ /*else*/ { /* "asyncpg/pgproto/codecs/datetime.pyx":210 * raise TypeError( * 'expected a datetime.date or datetime.datetime instance, ' * 'got {!r}'.format(type(obj).__name__) # <<<<<<<<<<<<<< * ) * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_expected_a_datetime_date_or_date, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* "asyncpg/pgproto/codecs/datetime.pyx":208 * tzinfo=_local_timezone()) * else: * raise TypeError( # <<<<<<<<<<<<<< * 'expected a datetime.date or datetime.datetime instance, ' * 'got {!r}'.format(type(obj).__name__) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(13, 208, __pyx_L1_error) } __pyx_L4:; /* "asyncpg/pgproto/codecs/datetime.pyx":203 * * cdef timestamptz_encode(CodecContext settings, WriteBuffer buf, obj): * if not cpython.datetime.PyDateTime_Check(obj): # <<<<<<<<<<<<<< * if cpython.datetime.PyDate_Check(obj): * obj = datetime.datetime(obj.year, obj.month, obj.day, */ } /* "asyncpg/pgproto/codecs/datetime.pyx":213 * ) * * buf.write_int32(8) # <<<<<<<<<<<<<< * * if obj == infinity_datetime: */ __pyx_t_5 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 8); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":215 * buf.write_int32(8) * * if obj == infinity_datetime: # <<<<<<<<<<<<<< * buf.write_int64(pg_time64_infinity) * return */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_infinity_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyObject_RichCompare(__pyx_v_obj, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(13, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "asyncpg/pgproto/codecs/datetime.pyx":216 * * if obj == infinity_datetime: * buf.write_int64(pg_time64_infinity) # <<<<<<<<<<<<<< * return * elif obj == negative_infinity_datetime: */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_7asyncpg_7pgproto_7pgproto_pg_time64_infinity); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":217 * if obj == infinity_datetime: * buf.write_int64(pg_time64_infinity) * return # <<<<<<<<<<<<<< * elif obj == negative_infinity_datetime: * buf.write_int64(pg_time64_negative_infinity) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/pgproto/codecs/datetime.pyx":215 * buf.write_int32(8) * * if obj == infinity_datetime: # <<<<<<<<<<<<<< * buf.write_int64(pg_time64_infinity) * return */ } /* "asyncpg/pgproto/codecs/datetime.pyx":218 * buf.write_int64(pg_time64_infinity) * return * elif obj == negative_infinity_datetime: # <<<<<<<<<<<<<< * buf.write_int64(pg_time64_negative_infinity) * return */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_negative_infinity_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_RichCompare(__pyx_v_obj, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 218, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(13, 218, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { /* "asyncpg/pgproto/codecs/datetime.pyx":219 * return * elif obj == negative_infinity_datetime: * buf.write_int64(pg_time64_negative_infinity) # <<<<<<<<<<<<<< * return * */ __pyx_t_5 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_7asyncpg_7pgproto_7pgproto_pg_time64_negative_infinity); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":220 * elif obj == negative_infinity_datetime: * buf.write_int64(pg_time64_negative_infinity) * return # <<<<<<<<<<<<<< * * utc_dt = obj.astimezone(utc) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/pgproto/codecs/datetime.pyx":218 * buf.write_int64(pg_time64_infinity) * return * elif obj == negative_infinity_datetime: # <<<<<<<<<<<<<< * buf.write_int64(pg_time64_negative_infinity) * return */ } /* "asyncpg/pgproto/codecs/datetime.pyx":222 * return * * utc_dt = obj.astimezone(utc) # <<<<<<<<<<<<<< * * delta = utc_dt - pg_epoch_datetime_utc */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_astimezone); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_utc); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_utc_dt = __pyx_t_5; __pyx_t_5 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":224 * utc_dt = obj.astimezone(utc) * * delta = utc_dt - pg_epoch_datetime_utc # <<<<<<<<<<<<<< * cdef: * int64_t seconds = cpython.PyLong_AsLongLong(delta.days) * 86400 + \ */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pg_epoch_datetime_utc); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyNumber_Subtract(__pyx_v_utc_dt, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_delta = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":226 * delta = utc_dt - pg_epoch_datetime_utc * cdef: * int64_t seconds = cpython.PyLong_AsLongLong(delta.days) * 86400 + \ # <<<<<<<<<<<<<< * cpython.PyLong_AsLong(delta.seconds) * int32_t microseconds = cpython.PyLong_AsLong( */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_days); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = PyLong_AsLongLong(__pyx_t_4); if (unlikely(__pyx_t_8 == ((PY_LONG_LONG)-1LL) && PyErr_Occurred())) __PYX_ERR(13, 226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":227 * cdef: * int64_t seconds = cpython.PyLong_AsLongLong(delta.days) * 86400 + \ * cpython.PyLong_AsLong(delta.seconds) # <<<<<<<<<<<<<< * int32_t microseconds = cpython.PyLong_AsLong( * delta.microseconds) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_seconds); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = PyLong_AsLong(__pyx_t_4); if (unlikely(__pyx_t_9 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":226 * delta = utc_dt - pg_epoch_datetime_utc * cdef: * int64_t seconds = cpython.PyLong_AsLongLong(delta.days) * 86400 + \ # <<<<<<<<<<<<<< * cpython.PyLong_AsLong(delta.seconds) * int32_t microseconds = cpython.PyLong_AsLong( */ __pyx_v_seconds = ((__pyx_t_8 * 0x15180) + __pyx_t_9); /* "asyncpg/pgproto/codecs/datetime.pyx":229 * cpython.PyLong_AsLong(delta.seconds) * int32_t microseconds = cpython.PyLong_AsLong( * delta.microseconds) # <<<<<<<<<<<<<< * * _encode_time(buf, seconds, microseconds) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_n_s_microseconds); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/pgproto/codecs/datetime.pyx":228 * int64_t seconds = cpython.PyLong_AsLongLong(delta.days) * 86400 + \ * cpython.PyLong_AsLong(delta.seconds) * int32_t microseconds = cpython.PyLong_AsLong( # <<<<<<<<<<<<<< * delta.microseconds) * */ __pyx_t_9 = PyLong_AsLong(__pyx_t_4); if (unlikely(__pyx_t_9 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 228, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_microseconds = ((int32_t)__pyx_t_9); /* "asyncpg/pgproto/codecs/datetime.pyx":231 * delta.microseconds) * * _encode_time(buf, seconds, microseconds) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto__encode_time(__pyx_v_buf, __pyx_v_seconds, __pyx_v_microseconds); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":202 * * * cdef timestamptz_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * if not cpython.datetime.PyDateTime_Check(obj): * if cpython.datetime.PyDate_Check(obj): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.timestamptz_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_utc_dt); __Pyx_XDECREF(__pyx_v_delta); __Pyx_XDECREF(__pyx_v_obj); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":234 * * * cdef timestamptz_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int64_t seconds = 0 */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_timestamptz_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { int64_t __pyx_v_seconds; int32_t __pyx_v_microseconds; int32_t __pyx_v_inf; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int32_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; unsigned int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("timestamptz_decode", 1); /* "asyncpg/pgproto/codecs/datetime.pyx":236 * cdef timestamptz_decode(CodecContext settings, FRBuffer *buf): * cdef: * int64_t seconds = 0 # <<<<<<<<<<<<<< * int32_t microseconds = 0 * int32_t inf = _decode_time(buf, &seconds, µseconds) */ __pyx_v_seconds = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":237 * cdef: * int64_t seconds = 0 * int32_t microseconds = 0 # <<<<<<<<<<<<<< * int32_t inf = _decode_time(buf, &seconds, µseconds) * */ __pyx_v_microseconds = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":238 * int64_t seconds = 0 * int32_t microseconds = 0 * int32_t inf = _decode_time(buf, &seconds, µseconds) # <<<<<<<<<<<<<< * * if inf > 0: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto__decode_time(__pyx_v_buf, (&__pyx_v_seconds), (&__pyx_v_microseconds)); if (unlikely(__pyx_t_1 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(13, 238, __pyx_L1_error) __pyx_v_inf = __pyx_t_1; /* "asyncpg/pgproto/codecs/datetime.pyx":240 * int32_t inf = _decode_time(buf, &seconds, µseconds) * * if inf > 0: # <<<<<<<<<<<<<< * # positive infinity * return infinity_datetime */ __pyx_t_2 = (__pyx_v_inf > 0); if (__pyx_t_2) { /* "asyncpg/pgproto/codecs/datetime.pyx":242 * if inf > 0: * # positive infinity * return infinity_datetime # <<<<<<<<<<<<<< * elif inf < 0: * # negative infinity */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_infinity_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/datetime.pyx":240 * int32_t inf = _decode_time(buf, &seconds, µseconds) * * if inf > 0: # <<<<<<<<<<<<<< * # positive infinity * return infinity_datetime */ } /* "asyncpg/pgproto/codecs/datetime.pyx":243 * # positive infinity * return infinity_datetime * elif inf < 0: # <<<<<<<<<<<<<< * # negative infinity * return negative_infinity_datetime */ __pyx_t_2 = (__pyx_v_inf < 0); if (__pyx_t_2) { /* "asyncpg/pgproto/codecs/datetime.pyx":245 * elif inf < 0: * # negative infinity * return negative_infinity_datetime # <<<<<<<<<<<<<< * else: * return pg_epoch_datetime_utc.__add__( */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_negative_infinity_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/datetime.pyx":243 * # positive infinity * return infinity_datetime * elif inf < 0: # <<<<<<<<<<<<<< * # negative infinity * return negative_infinity_datetime */ } /* "asyncpg/pgproto/codecs/datetime.pyx":247 * return negative_infinity_datetime * else: * return pg_epoch_datetime_utc.__add__( # <<<<<<<<<<<<<< * timedelta(0, seconds, microseconds)) * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pg_epoch_datetime_utc); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_add); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":248 * else: * return pg_epoch_datetime_utc.__add__( * timedelta(0, seconds, microseconds)) # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_int64_t(__pyx_v_seconds); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_int32_t(__pyx_v_microseconds); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_int_0, __pyx_t_7, __pyx_t_8}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 3+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "asyncpg/pgproto/codecs/datetime.pyx":234 * * * cdef timestamptz_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int64_t seconds = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.timestamptz_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":251 * * * cdef time_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * int64_t seconds = cpython.PyLong_AsLong(obj.hour) * 3600 + \ */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_time_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { int64_t __pyx_v_seconds; int32_t __pyx_v_microseconds; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; long __pyx_t_2; long __pyx_t_3; long __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("time_encode", 1); /* "asyncpg/pgproto/codecs/datetime.pyx":253 * cdef time_encode(CodecContext settings, WriteBuffer buf, obj): * cdef: * int64_t seconds = cpython.PyLong_AsLong(obj.hour) * 3600 + \ # <<<<<<<<<<<<<< * cpython.PyLong_AsLong(obj.minute) * 60 + \ * cpython.PyLong_AsLong(obj.second) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyLong_AsLong(__pyx_t_1); if (unlikely(__pyx_t_2 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 253, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":254 * cdef: * int64_t seconds = cpython.PyLong_AsLong(obj.hour) * 3600 + \ * cpython.PyLong_AsLong(obj.minute) * 60 + \ # <<<<<<<<<<<<<< * cpython.PyLong_AsLong(obj.second) * int32_t microseconds = cpython.PyLong_AsLong(obj.microsecond) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_minute); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyLong_AsLong(__pyx_t_1); if (unlikely(__pyx_t_3 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 254, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":255 * int64_t seconds = cpython.PyLong_AsLong(obj.hour) * 3600 + \ * cpython.PyLong_AsLong(obj.minute) * 60 + \ * cpython.PyLong_AsLong(obj.second) # <<<<<<<<<<<<<< * int32_t microseconds = cpython.PyLong_AsLong(obj.microsecond) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_second); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyLong_AsLong(__pyx_t_1); if (unlikely(__pyx_t_4 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 255, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":254 * cdef: * int64_t seconds = cpython.PyLong_AsLong(obj.hour) * 3600 + \ * cpython.PyLong_AsLong(obj.minute) * 60 + \ # <<<<<<<<<<<<<< * cpython.PyLong_AsLong(obj.second) * int32_t microseconds = cpython.PyLong_AsLong(obj.microsecond) */ __pyx_v_seconds = (((__pyx_t_2 * 0xE10) + (__pyx_t_3 * 60)) + __pyx_t_4); /* "asyncpg/pgproto/codecs/datetime.pyx":256 * cpython.PyLong_AsLong(obj.minute) * 60 + \ * cpython.PyLong_AsLong(obj.second) * int32_t microseconds = cpython.PyLong_AsLong(obj.microsecond) # <<<<<<<<<<<<<< * * buf.write_int32(8) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyLong_AsLong(__pyx_t_1); if (unlikely(__pyx_t_4 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 256, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_microseconds = ((int32_t)__pyx_t_4); /* "asyncpg/pgproto/codecs/datetime.pyx":258 * int32_t microseconds = cpython.PyLong_AsLong(obj.microsecond) * * buf.write_int32(8) # <<<<<<<<<<<<<< * _encode_time(buf, seconds, microseconds) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 8); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":259 * * buf.write_int32(8) * _encode_time(buf, seconds, microseconds) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto__encode_time(__pyx_v_buf, __pyx_v_seconds, __pyx_v_microseconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":251 * * * cdef time_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * int64_t seconds = cpython.PyLong_AsLong(obj.hour) * 3600 + \ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.time_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":262 * * * cdef time_encode_tuple(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * int64_t microseconds */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_time_encode_tuple(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { int64_t __pyx_v_microseconds; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int64_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("time_encode_tuple", 1); /* "asyncpg/pgproto/codecs/datetime.pyx":266 * int64_t microseconds * * if len(obj) != 1: # <<<<<<<<<<<<<< * raise ValueError( * 'time tuple encoder: expecting 1 element ' */ __pyx_t_1 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(13, 266, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 1); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/codecs/datetime.pyx":269 * raise ValueError( * 'time tuple encoder: expecting 1 element ' * 'in tuple, got {}'.format(len(obj))) # <<<<<<<<<<<<<< * * microseconds = obj[0] */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_time_tuple_encoder_expecting_1_e, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(13, 269, __pyx_L1_error) __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/pgproto/codecs/datetime.pyx":267 * * if len(obj) != 1: * raise ValueError( # <<<<<<<<<<<<<< * 'time tuple encoder: expecting 1 element ' * 'in tuple, got {}'.format(len(obj))) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(13, 267, __pyx_L1_error) /* "asyncpg/pgproto/codecs/datetime.pyx":266 * int64_t microseconds * * if len(obj) != 1: # <<<<<<<<<<<<<< * raise ValueError( * 'time tuple encoder: expecting 1 element ' */ } /* "asyncpg/pgproto/codecs/datetime.pyx":271 * 'in tuple, got {}'.format(len(obj))) * * microseconds = obj[0] # <<<<<<<<<<<<<< * * buf.write_int32(8) */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_t_4); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 271, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_microseconds = __pyx_t_8; /* "asyncpg/pgproto/codecs/datetime.pyx":273 * microseconds = obj[0] * * buf.write_int32(8) # <<<<<<<<<<<<<< * buf.write_int64(microseconds) * */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 8); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":274 * * buf.write_int32(8) * buf.write_int64(microseconds) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_microseconds); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":262 * * * cdef time_encode_tuple(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * int64_t microseconds */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.time_encode_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":277 * * * cdef time_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int64_t seconds = 0 */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_time_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { int64_t __pyx_v_seconds; int32_t __pyx_v_microseconds; int64_t __pyx_v_minutes; int64_t __pyx_v_sec; int64_t __pyx_v_hours; int64_t __pyx_v_min; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int32_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("time_decode", 1); /* "asyncpg/pgproto/codecs/datetime.pyx":279 * cdef time_decode(CodecContext settings, FRBuffer *buf): * cdef: * int64_t seconds = 0 # <<<<<<<<<<<<<< * int32_t microseconds = 0 * */ __pyx_v_seconds = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":280 * cdef: * int64_t seconds = 0 * int32_t microseconds = 0 # <<<<<<<<<<<<<< * * _decode_time(buf, &seconds, µseconds) */ __pyx_v_microseconds = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":282 * int32_t microseconds = 0 * * _decode_time(buf, &seconds, µseconds) # <<<<<<<<<<<<<< * * cdef: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto__decode_time(__pyx_v_buf, (&__pyx_v_seconds), (&__pyx_v_microseconds)); if (unlikely(__pyx_t_1 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(13, 282, __pyx_L1_error) /* "asyncpg/pgproto/codecs/datetime.pyx":285 * * cdef: * int64_t minutes = (seconds / 60) # <<<<<<<<<<<<<< * int64_t sec = seconds % 60 * int64_t hours = (minutes / 60) */ __pyx_v_minutes = ((int64_t)(((double)__pyx_v_seconds) / 60.0)); /* "asyncpg/pgproto/codecs/datetime.pyx":286 * cdef: * int64_t minutes = (seconds / 60) * int64_t sec = seconds % 60 # <<<<<<<<<<<<<< * int64_t hours = (minutes / 60) * int64_t min = minutes % 60 */ __pyx_v_sec = __Pyx_mod_int64_t(__pyx_v_seconds, 60); /* "asyncpg/pgproto/codecs/datetime.pyx":287 * int64_t minutes = (seconds / 60) * int64_t sec = seconds % 60 * int64_t hours = (minutes / 60) # <<<<<<<<<<<<<< * int64_t min = minutes % 60 * */ __pyx_v_hours = ((int64_t)(((double)__pyx_v_minutes) / 60.0)); /* "asyncpg/pgproto/codecs/datetime.pyx":288 * int64_t sec = seconds % 60 * int64_t hours = (minutes / 60) * int64_t min = minutes % 60 # <<<<<<<<<<<<<< * * return datetime.time(hours, min, sec, microseconds) */ __pyx_v_min = __Pyx_mod_int64_t(__pyx_v_minutes, 60); /* "asyncpg/pgproto/codecs/datetime.pyx":290 * int64_t min = minutes % 60 * * return datetime.time(hours, min, sec, microseconds) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_hours); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_min); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_sec); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_int32_t(__pyx_v_microseconds); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_t_3, __pyx_t_5, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 4+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/datetime.pyx":277 * * * cdef time_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int64_t seconds = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.time_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":293 * * * cdef time_decode_tuple(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int64_t ts = hton.unpack_int64(frb_read(buf, 8)) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_time_decode_tuple(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { int64_t __pyx_v_ts; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("time_decode_tuple", 1); /* "asyncpg/pgproto/codecs/datetime.pyx":295 * cdef time_decode_tuple(CodecContext settings, FRBuffer *buf): * cdef: * int64_t ts = hton.unpack_int64(frb_read(buf, 8)) # <<<<<<<<<<<<<< * * return (ts,) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(13, 295, __pyx_L1_error) __pyx_v_ts = unpack_int64(__pyx_t_1); /* "asyncpg/pgproto/codecs/datetime.pyx":297 * int64_t ts = hton.unpack_int64(frb_read(buf, 8)) * * return (ts,) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_ts); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(13, 297, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/datetime.pyx":293 * * * cdef time_decode_tuple(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int64_t ts = hton.unpack_int64(frb_read(buf, 8)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.time_decode_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":300 * * * cdef timetz_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * offset = obj.tzinfo.utcoffset(None) * */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { PyObject *__pyx_v_offset = NULL; int32_t __pyx_v_offset_sec; int64_t __pyx_v_seconds; int32_t __pyx_v_microseconds; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; long __pyx_t_5; long __pyx_t_6; long __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("timetz_encode", 1); /* "asyncpg/pgproto/codecs/datetime.pyx":301 * * cdef timetz_encode(CodecContext settings, WriteBuffer buf, obj): * offset = obj.tzinfo.utcoffset(None) # <<<<<<<<<<<<<< * * cdef: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_utcoffset); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, Py_None}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_offset = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":305 * cdef: * int32_t offset_sec = \ * cpython.PyLong_AsLong(offset.days) * 24 * 60 * 60 + \ # <<<<<<<<<<<<<< * cpython.PyLong_AsLong(offset.seconds) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_offset, __pyx_n_s_days); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyLong_AsLong(__pyx_t_1); if (unlikely(__pyx_t_5 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 305, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":306 * int32_t offset_sec = \ * cpython.PyLong_AsLong(offset.days) * 24 * 60 * 60 + \ * cpython.PyLong_AsLong(offset.seconds) # <<<<<<<<<<<<<< * * int64_t seconds = cpython.PyLong_AsLong(obj.hour) * 3600 + \ */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_offset, __pyx_n_s_seconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyLong_AsLong(__pyx_t_1); if (unlikely(__pyx_t_6 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 306, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":305 * cdef: * int32_t offset_sec = \ * cpython.PyLong_AsLong(offset.days) * 24 * 60 * 60 + \ # <<<<<<<<<<<<<< * cpython.PyLong_AsLong(offset.seconds) * */ __pyx_v_offset_sec = ((((((int32_t)__pyx_t_5) * 24) * 60) * 60) + ((int32_t)__pyx_t_6)); /* "asyncpg/pgproto/codecs/datetime.pyx":308 * cpython.PyLong_AsLong(offset.seconds) * * int64_t seconds = cpython.PyLong_AsLong(obj.hour) * 3600 + \ # <<<<<<<<<<<<<< * cpython.PyLong_AsLong(obj.minute) * 60 + \ * cpython.PyLong_AsLong(obj.second) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyLong_AsLong(__pyx_t_1); if (unlikely(__pyx_t_6 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 308, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":309 * * int64_t seconds = cpython.PyLong_AsLong(obj.hour) * 3600 + \ * cpython.PyLong_AsLong(obj.minute) * 60 + \ # <<<<<<<<<<<<<< * cpython.PyLong_AsLong(obj.second) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_minute); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyLong_AsLong(__pyx_t_1); if (unlikely(__pyx_t_5 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":310 * int64_t seconds = cpython.PyLong_AsLong(obj.hour) * 3600 + \ * cpython.PyLong_AsLong(obj.minute) * 60 + \ * cpython.PyLong_AsLong(obj.second) # <<<<<<<<<<<<<< * * int32_t microseconds = cpython.PyLong_AsLong(obj.microsecond) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_second); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = PyLong_AsLong(__pyx_t_1); if (unlikely(__pyx_t_7 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 310, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":309 * * int64_t seconds = cpython.PyLong_AsLong(obj.hour) * 3600 + \ * cpython.PyLong_AsLong(obj.minute) * 60 + \ # <<<<<<<<<<<<<< * cpython.PyLong_AsLong(obj.second) * */ __pyx_v_seconds = (((__pyx_t_6 * 0xE10) + (__pyx_t_5 * 60)) + __pyx_t_7); /* "asyncpg/pgproto/codecs/datetime.pyx":312 * cpython.PyLong_AsLong(obj.second) * * int32_t microseconds = cpython.PyLong_AsLong(obj.microsecond) # <<<<<<<<<<<<<< * * buf.write_int32(12) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = PyLong_AsLong(__pyx_t_1); if (unlikely(__pyx_t_7 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_microseconds = ((int32_t)__pyx_t_7); /* "asyncpg/pgproto/codecs/datetime.pyx":314 * int32_t microseconds = cpython.PyLong_AsLong(obj.microsecond) * * buf.write_int32(12) # <<<<<<<<<<<<<< * _encode_time(buf, seconds, microseconds) * # In Python utcoffset() is the difference between the local time */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 12); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":315 * * buf.write_int32(12) * _encode_time(buf, seconds, microseconds) # <<<<<<<<<<<<<< * # In Python utcoffset() is the difference between the local time * # and the UTC, whereas in PostgreSQL it's the opposite, */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto__encode_time(__pyx_v_buf, __pyx_v_seconds, __pyx_v_microseconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":319 * # and the UTC, whereas in PostgreSQL it's the opposite, * # so we need to flip the sign. * buf.write_int32(-offset_sec) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, (-__pyx_v_offset_sec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":300 * * * cdef timetz_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * offset = obj.tzinfo.utcoffset(None) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.timetz_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_offset); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":322 * * * cdef timetz_encode_tuple(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * int64_t microseconds */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_encode_tuple(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { int64_t __pyx_v_microseconds; int32_t __pyx_v_offset_sec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int64_t __pyx_t_8; int32_t __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("timetz_encode_tuple", 1); /* "asyncpg/pgproto/codecs/datetime.pyx":327 * int32_t offset_sec * * if len(obj) != 2: # <<<<<<<<<<<<<< * raise ValueError( * 'time tuple encoder: expecting 2 elements2 ' */ __pyx_t_1 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(13, 327, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 2); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/codecs/datetime.pyx":330 * raise ValueError( * 'time tuple encoder: expecting 2 elements2 ' * 'in tuple, got {}'.format(len(obj))) # <<<<<<<<<<<<<< * * microseconds = obj[0] */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_time_tuple_encoder_expecting_2_e, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(13, 330, __pyx_L1_error) __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/pgproto/codecs/datetime.pyx":328 * * if len(obj) != 2: * raise ValueError( # <<<<<<<<<<<<<< * 'time tuple encoder: expecting 2 elements2 ' * 'in tuple, got {}'.format(len(obj))) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(13, 328, __pyx_L1_error) /* "asyncpg/pgproto/codecs/datetime.pyx":327 * int32_t offset_sec * * if len(obj) != 2: # <<<<<<<<<<<<<< * raise ValueError( * 'time tuple encoder: expecting 2 elements2 ' */ } /* "asyncpg/pgproto/codecs/datetime.pyx":332 * 'in tuple, got {}'.format(len(obj))) * * microseconds = obj[0] # <<<<<<<<<<<<<< * offset_sec = obj[1] * */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_t_4); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_microseconds = __pyx_t_8; /* "asyncpg/pgproto/codecs/datetime.pyx":333 * * microseconds = obj[0] * offset_sec = obj[1] # <<<<<<<<<<<<<< * * buf.write_int32(12) */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_obj, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyInt_As_int32_t(__pyx_t_4); if (unlikely((__pyx_t_9 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 333, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_offset_sec = __pyx_t_9; /* "asyncpg/pgproto/codecs/datetime.pyx":335 * offset_sec = obj[1] * * buf.write_int32(12) # <<<<<<<<<<<<<< * buf.write_int64(microseconds) * buf.write_int32(offset_sec) */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 12); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":336 * * buf.write_int32(12) * buf.write_int64(microseconds) # <<<<<<<<<<<<<< * buf.write_int32(offset_sec) * */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_microseconds); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":337 * buf.write_int32(12) * buf.write_int64(microseconds) * buf.write_int32(offset_sec) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_v_offset_sec); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":322 * * * cdef timetz_encode_tuple(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * int64_t microseconds */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.timetz_encode_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":340 * * * cdef timetz_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * time = time_decode(settings, buf) * cdef int32_t offset = (hton.unpack_int32(frb_read(buf, 4)) / 60) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_decode(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_v_time = NULL; int32_t __pyx_v_offset; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("timetz_decode", 1); /* "asyncpg/pgproto/codecs/datetime.pyx":341 * * cdef timetz_decode(CodecContext settings, FRBuffer *buf): * time = time_decode(settings, buf) # <<<<<<<<<<<<<< * cdef int32_t offset = (hton.unpack_int32(frb_read(buf, 4)) / 60) * # See the comment in the `timetz_encode` method. */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_time_decode(__pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_time = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":342 * cdef timetz_decode(CodecContext settings, FRBuffer *buf): * time = time_decode(settings, buf) * cdef int32_t offset = (hton.unpack_int32(frb_read(buf, 4)) / 60) # <<<<<<<<<<<<<< * # See the comment in the `timetz_encode` method. * return time.replace(tzinfo=datetime.timezone(timedelta(minutes=-offset))) */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(13, 342, __pyx_L1_error) __pyx_v_offset = ((int32_t)(((double)unpack_int32(__pyx_t_2)) / 60.0)); /* "asyncpg/pgproto/codecs/datetime.pyx":344 * cdef int32_t offset = (hton.unpack_int32(frb_read(buf, 4)) / 60) * # See the comment in the `timetz_encode` method. * return time.replace(tzinfo=datetime.timezone(timedelta(minutes=-offset))) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_time, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_timezone); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_int32_t((-__pyx_v_offset)); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_minutes, __pyx_t_8) < 0) __PYX_ERR(13, 344, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tzinfo, __pyx_t_4) < 0) __PYX_ERR(13, 344, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/datetime.pyx":340 * * * cdef timetz_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * time = time_decode(settings, buf) * cdef int32_t offset = (hton.unpack_int32(frb_read(buf, 4)) / 60) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.timetz_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_time); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":347 * * * cdef timetz_decode_tuple(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int64_t microseconds = hton.unpack_int64(frb_read(buf, 8)) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_decode_tuple(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { int64_t __pyx_v_microseconds; int32_t __pyx_v_offset_sec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("timetz_decode_tuple", 1); /* "asyncpg/pgproto/codecs/datetime.pyx":349 * cdef timetz_decode_tuple(CodecContext settings, FRBuffer *buf): * cdef: * int64_t microseconds = hton.unpack_int64(frb_read(buf, 8)) # <<<<<<<<<<<<<< * int32_t offset_sec = hton.unpack_int32(frb_read(buf, 4)) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(13, 349, __pyx_L1_error) __pyx_v_microseconds = unpack_int64(__pyx_t_1); /* "asyncpg/pgproto/codecs/datetime.pyx":350 * cdef: * int64_t microseconds = hton.unpack_int64(frb_read(buf, 8)) * int32_t offset_sec = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * * return (microseconds, offset_sec) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(13, 350, __pyx_L1_error) __pyx_v_offset_sec = unpack_int32(__pyx_t_1); /* "asyncpg/pgproto/codecs/datetime.pyx":352 * int32_t offset_sec = hton.unpack_int32(frb_read(buf, 4)) * * return (microseconds, offset_sec) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_microseconds); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_offset_sec); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(13, 352, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(13, 352, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/datetime.pyx":347 * * * cdef timetz_decode_tuple(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int64_t microseconds = hton.unpack_int64(frb_read(buf, 8)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.timetz_decode_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":355 * * * cdef interval_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * int32_t days = cpython.PyLong_AsLong(obj.days) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_interval_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { int32_t __pyx_v_days; int64_t __pyx_v_seconds; int32_t __pyx_v_microseconds; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; long __pyx_t_2; PY_LONG_LONG __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("interval_encode", 1); /* "asyncpg/pgproto/codecs/datetime.pyx":357 * cdef interval_encode(CodecContext settings, WriteBuffer buf, obj): * cdef: * int32_t days = cpython.PyLong_AsLong(obj.days) # <<<<<<<<<<<<<< * int64_t seconds = cpython.PyLong_AsLongLong(obj.seconds) * int32_t microseconds = cpython.PyLong_AsLong(obj.microseconds) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_days); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyLong_AsLong(__pyx_t_1); if (unlikely(__pyx_t_2 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 357, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_days = ((int32_t)__pyx_t_2); /* "asyncpg/pgproto/codecs/datetime.pyx":358 * cdef: * int32_t days = cpython.PyLong_AsLong(obj.days) * int64_t seconds = cpython.PyLong_AsLongLong(obj.seconds) # <<<<<<<<<<<<<< * int32_t microseconds = cpython.PyLong_AsLong(obj.microseconds) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_seconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyLong_AsLongLong(__pyx_t_1); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1LL) && PyErr_Occurred())) __PYX_ERR(13, 358, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_seconds = __pyx_t_3; /* "asyncpg/pgproto/codecs/datetime.pyx":359 * int32_t days = cpython.PyLong_AsLong(obj.days) * int64_t seconds = cpython.PyLong_AsLongLong(obj.seconds) * int32_t microseconds = cpython.PyLong_AsLong(obj.microseconds) # <<<<<<<<<<<<<< * * buf.write_int32(16) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_microseconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyLong_AsLong(__pyx_t_1); if (unlikely(__pyx_t_2 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 359, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_microseconds = ((int32_t)__pyx_t_2); /* "asyncpg/pgproto/codecs/datetime.pyx":361 * int32_t microseconds = cpython.PyLong_AsLong(obj.microseconds) * * buf.write_int32(16) # <<<<<<<<<<<<<< * _encode_time(buf, seconds, microseconds) * buf.write_int32(days) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 16); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":362 * * buf.write_int32(16) * _encode_time(buf, seconds, microseconds) # <<<<<<<<<<<<<< * buf.write_int32(days) * buf.write_int32(0) # Months */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto__encode_time(__pyx_v_buf, __pyx_v_seconds, __pyx_v_microseconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":363 * buf.write_int32(16) * _encode_time(buf, seconds, microseconds) * buf.write_int32(days) # <<<<<<<<<<<<<< * buf.write_int32(0) # Months * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_v_days); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":364 * _encode_time(buf, seconds, microseconds) * buf.write_int32(days) * buf.write_int32(0) # Months # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":355 * * * cdef interval_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * int32_t days = cpython.PyLong_AsLong(obj.days) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.interval_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":367 * * * cdef interval_encode_tuple(CodecContext settings, WriteBuffer buf, # <<<<<<<<<<<<<< * tuple obj): * cdef: */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_interval_encode_tuple(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { int32_t __pyx_v_months; int32_t __pyx_v_days; int64_t __pyx_v_microseconds; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int32_t __pyx_t_8; int64_t __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("interval_encode_tuple", 1); /* "asyncpg/pgproto/codecs/datetime.pyx":374 * int64_t microseconds * * if len(obj) != 3: # <<<<<<<<<<<<<< * raise ValueError( * 'interval tuple encoder: expecting 3 elements ' */ if (unlikely(__pyx_v_obj == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(13, 374, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(13, 374, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 3); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/codecs/datetime.pyx":377 * raise ValueError( * 'interval tuple encoder: expecting 3 elements ' * 'in tuple, got {}'.format(len(obj))) # <<<<<<<<<<<<<< * * months = obj[0] */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_interval_tuple_encoder_expecting, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__pyx_v_obj == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(13, 377, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(13, 377, __pyx_L1_error) __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/pgproto/codecs/datetime.pyx":375 * * if len(obj) != 3: * raise ValueError( # <<<<<<<<<<<<<< * 'interval tuple encoder: expecting 3 elements ' * 'in tuple, got {}'.format(len(obj))) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(13, 375, __pyx_L1_error) /* "asyncpg/pgproto/codecs/datetime.pyx":374 * int64_t microseconds * * if len(obj) != 3: # <<<<<<<<<<<<<< * raise ValueError( * 'interval tuple encoder: expecting 3 elements ' */ } /* "asyncpg/pgproto/codecs/datetime.pyx":379 * 'in tuple, got {}'.format(len(obj))) * * months = obj[0] # <<<<<<<<<<<<<< * days = obj[1] * microseconds = obj[2] */ if (unlikely(__pyx_v_obj == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(13, 379, __pyx_L1_error) } __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_t_4); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 379, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_months = __pyx_t_8; /* "asyncpg/pgproto/codecs/datetime.pyx":380 * * months = obj[0] * days = obj[1] # <<<<<<<<<<<<<< * microseconds = obj[2] * */ if (unlikely(__pyx_v_obj == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(13, 380, __pyx_L1_error) } __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_obj, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_t_4); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_days = __pyx_t_8; /* "asyncpg/pgproto/codecs/datetime.pyx":381 * months = obj[0] * days = obj[1] * microseconds = obj[2] # <<<<<<<<<<<<<< * * buf.write_int32(16) */ if (unlikely(__pyx_v_obj == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(13, 381, __pyx_L1_error) } __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_obj, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_t_4); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_microseconds = __pyx_t_9; /* "asyncpg/pgproto/codecs/datetime.pyx":383 * microseconds = obj[2] * * buf.write_int32(16) # <<<<<<<<<<<<<< * buf.write_int64(microseconds) * buf.write_int32(days) */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 16); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":384 * * buf.write_int32(16) * buf.write_int64(microseconds) # <<<<<<<<<<<<<< * buf.write_int32(days) * buf.write_int32(months) */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_buf, __pyx_v_microseconds); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":385 * buf.write_int32(16) * buf.write_int64(microseconds) * buf.write_int32(days) # <<<<<<<<<<<<<< * buf.write_int32(months) * */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_v_days); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":386 * buf.write_int64(microseconds) * buf.write_int32(days) * buf.write_int32(months) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_v_months); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":367 * * * cdef interval_encode_tuple(CodecContext settings, WriteBuffer buf, # <<<<<<<<<<<<<< * tuple obj): * cdef: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.interval_encode_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":389 * * * cdef interval_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int32_t days */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_interval_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { int32_t __pyx_v_days; int32_t __pyx_v_months; int32_t __pyx_v_years; int64_t __pyx_v_seconds; int32_t __pyx_v_microseconds; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int32_t __pyx_t_1; char const *__pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("interval_decode", 1); /* "asyncpg/pgproto/codecs/datetime.pyx":394 * int32_t months * int32_t years * int64_t seconds = 0 # <<<<<<<<<<<<<< * int32_t microseconds = 0 * */ __pyx_v_seconds = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":395 * int32_t years * int64_t seconds = 0 * int32_t microseconds = 0 # <<<<<<<<<<<<<< * * _decode_time(buf, &seconds, µseconds) */ __pyx_v_microseconds = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":397 * int32_t microseconds = 0 * * _decode_time(buf, &seconds, µseconds) # <<<<<<<<<<<<<< * * days = hton.unpack_int32(frb_read(buf, 4)) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto__decode_time(__pyx_v_buf, (&__pyx_v_seconds), (&__pyx_v_microseconds)); if (unlikely(__pyx_t_1 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(13, 397, __pyx_L1_error) /* "asyncpg/pgproto/codecs/datetime.pyx":399 * _decode_time(buf, &seconds, µseconds) * * days = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * months = hton.unpack_int32(frb_read(buf, 4)) * */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(13, 399, __pyx_L1_error) __pyx_v_days = unpack_int32(__pyx_t_2); /* "asyncpg/pgproto/codecs/datetime.pyx":400 * * days = hton.unpack_int32(frb_read(buf, 4)) * months = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * * if months < 0: */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(13, 400, __pyx_L1_error) __pyx_v_months = unpack_int32(__pyx_t_2); /* "asyncpg/pgproto/codecs/datetime.pyx":402 * months = hton.unpack_int32(frb_read(buf, 4)) * * if months < 0: # <<<<<<<<<<<<<< * years = -(-months // 12) * months = -(-months % 12) */ __pyx_t_3 = (__pyx_v_months < 0); if (__pyx_t_3) { /* "asyncpg/pgproto/codecs/datetime.pyx":403 * * if months < 0: * years = -(-months // 12) # <<<<<<<<<<<<<< * months = -(-months % 12) * else: */ __pyx_v_years = (-((int32_t)__Pyx_div_long((-__pyx_v_months), 12))); /* "asyncpg/pgproto/codecs/datetime.pyx":404 * if months < 0: * years = -(-months // 12) * months = -(-months % 12) # <<<<<<<<<<<<<< * else: * years = (months // 12) */ __pyx_v_months = (-((int32_t)__Pyx_mod_long((-__pyx_v_months), 12))); /* "asyncpg/pgproto/codecs/datetime.pyx":402 * months = hton.unpack_int32(frb_read(buf, 4)) * * if months < 0: # <<<<<<<<<<<<<< * years = -(-months // 12) * months = -(-months % 12) */ goto __pyx_L3; } /* "asyncpg/pgproto/codecs/datetime.pyx":406 * months = -(-months % 12) * else: * years = (months // 12) # <<<<<<<<<<<<<< * months = (months % 12) * */ /*else*/ { __pyx_v_years = ((int32_t)__Pyx_div_long(__pyx_v_months, 12)); /* "asyncpg/pgproto/codecs/datetime.pyx":407 * else: * years = (months // 12) * months = (months % 12) # <<<<<<<<<<<<<< * * return datetime.timedelta(days=days + months * 30 + years * 365, */ __pyx_v_months = ((int32_t)__Pyx_mod_long(__pyx_v_months, 12)); } __pyx_L3:; /* "asyncpg/pgproto/codecs/datetime.pyx":409 * months = (months % 12) * * return datetime.timedelta(days=days + months * 30 + years * 365, # <<<<<<<<<<<<<< * seconds=seconds, microseconds=microseconds) * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_From_long(((__pyx_v_days + (__pyx_v_months * 30)) + (__pyx_v_years * 0x16D))); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_days, __pyx_t_6) < 0) __PYX_ERR(13, 409, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":410 * * return datetime.timedelta(days=days + months * 30 + years * 365, * seconds=seconds, microseconds=microseconds) # <<<<<<<<<<<<<< * * */ __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_seconds); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_seconds, __pyx_t_6) < 0) __PYX_ERR(13, 409, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_microseconds); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_microseconds, __pyx_t_6) < 0) __PYX_ERR(13, 409, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":409 * months = (months % 12) * * return datetime.timedelta(days=days + months * 30 + years * 365, # <<<<<<<<<<<<<< * seconds=seconds, microseconds=microseconds) * */ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/datetime.pyx":389 * * * cdef interval_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int32_t days */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.interval_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/datetime.pyx":413 * * * cdef interval_decode_tuple(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int32_t days */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_interval_decode_tuple(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { int32_t __pyx_v_days; int32_t __pyx_v_months; int64_t __pyx_v_microseconds; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("interval_decode_tuple", 1); /* "asyncpg/pgproto/codecs/datetime.pyx":419 * int64_t microseconds * * microseconds = hton.unpack_int64(frb_read(buf, 8)) # <<<<<<<<<<<<<< * days = hton.unpack_int32(frb_read(buf, 4)) * months = hton.unpack_int32(frb_read(buf, 4)) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(13, 419, __pyx_L1_error) __pyx_v_microseconds = unpack_int64(__pyx_t_1); /* "asyncpg/pgproto/codecs/datetime.pyx":420 * * microseconds = hton.unpack_int64(frb_read(buf, 8)) * days = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * months = hton.unpack_int32(frb_read(buf, 4)) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(13, 420, __pyx_L1_error) __pyx_v_days = unpack_int32(__pyx_t_1); /* "asyncpg/pgproto/codecs/datetime.pyx":421 * microseconds = hton.unpack_int64(frb_read(buf, 8)) * days = hton.unpack_int32(frb_read(buf, 4)) * months = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * * return (months, days, microseconds) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(13, 421, __pyx_L1_error) __pyx_v_months = unpack_int32(__pyx_t_1); /* "asyncpg/pgproto/codecs/datetime.pyx":423 * months = hton.unpack_int32(frb_read(buf, 4)) * * return (months, days, microseconds) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_months); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_days); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int64_t(__pyx_v_microseconds); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(13, 423, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(13, 423, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(13, 423, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/datetime.pyx":413 * * * cdef interval_decode_tuple(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int32_t days */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.interval_decode_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/float.pyx":11 * * * cdef float4_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef double dval = cpython.PyFloat_AsDouble(obj) * cdef float fval = dval */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_float4_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { double __pyx_v_dval; float __pyx_v_fval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations double __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("float4_encode", 1); /* "asyncpg/pgproto/codecs/float.pyx":12 * * cdef float4_encode(CodecContext settings, WriteBuffer buf, obj): * cdef double dval = cpython.PyFloat_AsDouble(obj) # <<<<<<<<<<<<<< * cdef float fval = dval * if math.isinf(fval) and not math.isinf(dval): */ __pyx_t_1 = PyFloat_AsDouble(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((double)-1.0) && PyErr_Occurred())) __PYX_ERR(14, 12, __pyx_L1_error) __pyx_v_dval = __pyx_t_1; /* "asyncpg/pgproto/codecs/float.pyx":13 * cdef float4_encode(CodecContext settings, WriteBuffer buf, obj): * cdef double dval = cpython.PyFloat_AsDouble(obj) * cdef float fval = dval # <<<<<<<<<<<<<< * if math.isinf(fval) and not math.isinf(dval): * raise ValueError('value out of float32 range') */ __pyx_v_fval = ((float)__pyx_v_dval); /* "asyncpg/pgproto/codecs/float.pyx":14 * cdef double dval = cpython.PyFloat_AsDouble(obj) * cdef float fval = dval * if math.isinf(fval) and not math.isinf(dval): # <<<<<<<<<<<<<< * raise ValueError('value out of float32 range') * */ __pyx_t_3 = (isinf(__pyx_v_fval) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (!(isinf(__pyx_v_dval) != 0)); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/codecs/float.pyx":15 * cdef float fval = dval * if math.isinf(fval) and not math.isinf(dval): * raise ValueError('value out of float32 range') # <<<<<<<<<<<<<< * * buf.write_int32(4) */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(14, 15, __pyx_L1_error) /* "asyncpg/pgproto/codecs/float.pyx":14 * cdef double dval = cpython.PyFloat_AsDouble(obj) * cdef float fval = dval * if math.isinf(fval) and not math.isinf(dval): # <<<<<<<<<<<<<< * raise ValueError('value out of float32 range') * */ } /* "asyncpg/pgproto/codecs/float.pyx":17 * raise ValueError('value out of float32 range') * * buf.write_int32(4) # <<<<<<<<<<<<<< * buf.write_float(fval) * */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 4); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/float.pyx":18 * * buf.write_int32(4) * buf.write_float(fval) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_float(__pyx_v_buf, __pyx_v_fval); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/float.pyx":11 * * * cdef float4_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef double dval = cpython.PyFloat_AsDouble(obj) * cdef float fval = dval */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.float4_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/float.pyx":21 * * * cdef float4_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef float f = hton.unpack_float(frb_read(buf, 4)) * return cpython.PyFloat_FromDouble(f) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_float4_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { float __pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("float4_decode", 1); /* "asyncpg/pgproto/codecs/float.pyx":22 * * cdef float4_decode(CodecContext settings, FRBuffer *buf): * cdef float f = hton.unpack_float(frb_read(buf, 4)) # <<<<<<<<<<<<<< * return cpython.PyFloat_FromDouble(f) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 22, __pyx_L1_error) __pyx_v_f = unpack_float(__pyx_t_1); /* "asyncpg/pgproto/codecs/float.pyx":23 * cdef float4_decode(CodecContext settings, FRBuffer *buf): * cdef float f = hton.unpack_float(frb_read(buf, 4)) * return cpython.PyFloat_FromDouble(f) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/float.pyx":21 * * * cdef float4_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef float f = hton.unpack_float(frb_read(buf, 4)) * return cpython.PyFloat_FromDouble(f) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.float4_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/float.pyx":26 * * * cdef float8_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef double dval = cpython.PyFloat_AsDouble(obj) * buf.write_int32(8) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_float8_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { double __pyx_v_dval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations double __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("float8_encode", 1); /* "asyncpg/pgproto/codecs/float.pyx":27 * * cdef float8_encode(CodecContext settings, WriteBuffer buf, obj): * cdef double dval = cpython.PyFloat_AsDouble(obj) # <<<<<<<<<<<<<< * buf.write_int32(8) * buf.write_double(dval) */ __pyx_t_1 = PyFloat_AsDouble(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((double)-1.0) && PyErr_Occurred())) __PYX_ERR(14, 27, __pyx_L1_error) __pyx_v_dval = __pyx_t_1; /* "asyncpg/pgproto/codecs/float.pyx":28 * cdef float8_encode(CodecContext settings, WriteBuffer buf, obj): * cdef double dval = cpython.PyFloat_AsDouble(obj) * buf.write_int32(8) # <<<<<<<<<<<<<< * buf.write_double(dval) * */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 8); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/float.pyx":29 * cdef double dval = cpython.PyFloat_AsDouble(obj) * buf.write_int32(8) * buf.write_double(dval) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_double(__pyx_v_buf, __pyx_v_dval); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/float.pyx":26 * * * cdef float8_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef double dval = cpython.PyFloat_AsDouble(obj) * buf.write_int32(8) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.float8_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/float.pyx":32 * * * cdef float8_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef double f = hton.unpack_double(frb_read(buf, 8)) * return cpython.PyFloat_FromDouble(f) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_float8_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { double __pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("float8_decode", 1); /* "asyncpg/pgproto/codecs/float.pyx":33 * * cdef float8_decode(CodecContext settings, FRBuffer *buf): * cdef double f = hton.unpack_double(frb_read(buf, 8)) # <<<<<<<<<<<<<< * return cpython.PyFloat_FromDouble(f) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 33, __pyx_L1_error) __pyx_v_f = unpack_double(__pyx_t_1); /* "asyncpg/pgproto/codecs/float.pyx":34 * cdef float8_decode(CodecContext settings, FRBuffer *buf): * cdef double f = hton.unpack_double(frb_read(buf, 8)) * return cpython.PyFloat_FromDouble(f) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/float.pyx":32 * * * cdef float8_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef double f = hton.unpack_double(frb_read(buf, 8)) * return cpython.PyFloat_FromDouble(f) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.float8_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/int.pyx":8 * * * cdef bool_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * if not cpython.PyBool_Check(obj): * raise TypeError('a boolean is required (got type {})'.format( */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_bool_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; char __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bool_encode", 1); /* "asyncpg/pgproto/codecs/int.pyx":9 * * cdef bool_encode(CodecContext settings, WriteBuffer buf, obj): * if not cpython.PyBool_Check(obj): # <<<<<<<<<<<<<< * raise TypeError('a boolean is required (got type {})'.format( * type(obj).__name__)) */ __pyx_t_1 = (!PyBool_Check(__pyx_v_obj)); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/codecs/int.pyx":10 * cdef bool_encode(CodecContext settings, WriteBuffer buf, obj): * if not cpython.PyBool_Check(obj): * raise TypeError('a boolean is required (got type {})'.format( # <<<<<<<<<<<<<< * type(obj).__name__)) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_a_boolean_is_required_got_type, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/pgproto/codecs/int.pyx":11 * if not cpython.PyBool_Check(obj): * raise TypeError('a boolean is required (got type {})'.format( * type(obj).__name__)) # <<<<<<<<<<<<<< * * buf.write_int32(1) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "asyncpg/pgproto/codecs/int.pyx":10 * cdef bool_encode(CodecContext settings, WriteBuffer buf, obj): * if not cpython.PyBool_Check(obj): * raise TypeError('a boolean is required (got type {})'.format( # <<<<<<<<<<<<<< * type(obj).__name__)) * */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 10, __pyx_L1_error) /* "asyncpg/pgproto/codecs/int.pyx":9 * * cdef bool_encode(CodecContext settings, WriteBuffer buf, obj): * if not cpython.PyBool_Check(obj): # <<<<<<<<<<<<<< * raise TypeError('a boolean is required (got type {})'.format( * type(obj).__name__)) */ } /* "asyncpg/pgproto/codecs/int.pyx":13 * type(obj).__name__)) * * buf.write_int32(1) # <<<<<<<<<<<<<< * buf.write_byte(b'\x01' if obj is True else b'\x00') * */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/int.pyx":14 * * buf.write_int32(1) * buf.write_byte(b'\x01' if obj is True else b'\x00') # <<<<<<<<<<<<<< * * */ __pyx_t_1 = (__pyx_v_obj == Py_True); if (__pyx_t_1) { __pyx_t_7 = '\x01'; } else { __pyx_t_7 = '\x00'; } __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_byte(__pyx_v_buf, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/int.pyx":8 * * * cdef bool_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * if not cpython.PyBool_Check(obj): * raise TypeError('a boolean is required (got type {})'.format( */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.bool_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/int.pyx":17 * * * cdef bool_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return frb_read(buf, 1)[0] is b'\x01' * */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_bool_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bool_decode", 1); /* "asyncpg/pgproto/codecs/int.pyx":18 * * cdef bool_decode(CodecContext settings, FRBuffer *buf): * return frb_read(buf, 1)[0] is b'\x01' # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 1); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(4, 18, __pyx_L1_error) __pyx_t_2 = __Pyx_PyBool_FromLong(((__pyx_t_1[0]) == '\x01')); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/int.pyx":17 * * * cdef bool_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return frb_read(buf, 1)[0] is b'\x01' * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.bool_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/int.pyx":21 * * * cdef int2_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef int overflow = 0 * cdef long val */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_int2_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { int __pyx_v_overflow; long __pyx_v_val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; long __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("int2_encode", 0); __Pyx_INCREF(__pyx_v_obj); /* "asyncpg/pgproto/codecs/int.pyx":22 * * cdef int2_encode(CodecContext settings, WriteBuffer buf, obj): * cdef int overflow = 0 # <<<<<<<<<<<<<< * cdef long val * */ __pyx_v_overflow = 0; /* "asyncpg/pgproto/codecs/int.pyx":25 * cdef long val * * try: # <<<<<<<<<<<<<< * if type(obj) is not int and hasattr(type(obj), '__int__'): * # Silence a Python warning about implicit __int__ */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "asyncpg/pgproto/codecs/int.pyx":26 * * try: * if type(obj) is not int and hasattr(type(obj), '__int__'): # <<<<<<<<<<<<<< * # Silence a Python warning about implicit __int__ * # conversion. */ __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_obj)) != ((PyObject *)(&PyInt_Type))); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L10_bool_binop_done; } __pyx_t_5 = __Pyx_HasAttr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_u_int_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(4, 26, __pyx_L3_error) __pyx_t_4 = __pyx_t_5; __pyx_L10_bool_binop_done:; if (__pyx_t_4) { /* "asyncpg/pgproto/codecs/int.pyx":29 * # Silence a Python warning about implicit __int__ * # conversion. * obj = int(obj) # <<<<<<<<<<<<<< * val = cpython.PyLong_AsLong(obj) * except OverflowError: */ __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_v_obj); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 29, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/int.pyx":26 * * try: * if type(obj) is not int and hasattr(type(obj), '__int__'): # <<<<<<<<<<<<<< * # Silence a Python warning about implicit __int__ * # conversion. */ } /* "asyncpg/pgproto/codecs/int.pyx":30 * # conversion. * obj = int(obj) * val = cpython.PyLong_AsLong(obj) # <<<<<<<<<<<<<< * except OverflowError: * overflow = 1 */ __pyx_t_7 = PyLong_AsLong(__pyx_v_obj); if (unlikely(__pyx_t_7 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(4, 30, __pyx_L3_error) __pyx_v_val = __pyx_t_7; /* "asyncpg/pgproto/codecs/int.pyx":25 * cdef long val * * try: # <<<<<<<<<<<<<< * if type(obj) is not int and hasattr(type(obj), '__int__'): * # Silence a Python warning about implicit __int__ */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/int.pyx":31 * obj = int(obj) * val = cpython.PyLong_AsLong(obj) * except OverflowError: # <<<<<<<<<<<<<< * overflow = 1 * */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OverflowError); if (__pyx_t_8) { __Pyx_AddTraceback("asyncpg.pgproto.pgproto.int2_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(4, 31, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); /* "asyncpg/pgproto/codecs/int.pyx":32 * val = cpython.PyLong_AsLong(obj) * except OverflowError: * overflow = 1 # <<<<<<<<<<<<<< * * if overflow or val < INT16_MIN or val > INT16_MAX: */ __pyx_v_overflow = 1; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; /* "asyncpg/pgproto/codecs/int.pyx":25 * cdef long val * * try: # <<<<<<<<<<<<<< * if type(obj) is not int and hasattr(type(obj), '__int__'): * # Silence a Python warning about implicit __int__ */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L8_try_end:; } /* "asyncpg/pgproto/codecs/int.pyx":34 * overflow = 1 * * if overflow or val < INT16_MIN or val > INT16_MAX: # <<<<<<<<<<<<<< * raise OverflowError('value out of int16 range') * */ __pyx_t_5 = (__pyx_v_overflow != 0); if (!__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L15_bool_binop_done; } __pyx_t_5 = (__pyx_v_val < INT16_MIN); if (!__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L15_bool_binop_done; } __pyx_t_5 = (__pyx_v_val > INT16_MAX); __pyx_t_4 = __pyx_t_5; __pyx_L15_bool_binop_done:; if (unlikely(__pyx_t_4)) { /* "asyncpg/pgproto/codecs/int.pyx":35 * * if overflow or val < INT16_MIN or val > INT16_MAX: * raise OverflowError('value out of int16 range') # <<<<<<<<<<<<<< * * buf.write_int32(2) */ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_OverflowError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __PYX_ERR(4, 35, __pyx_L1_error) /* "asyncpg/pgproto/codecs/int.pyx":34 * overflow = 1 * * if overflow or val < INT16_MIN or val > INT16_MAX: # <<<<<<<<<<<<<< * raise OverflowError('value out of int16 range') * */ } /* "asyncpg/pgproto/codecs/int.pyx":37 * raise OverflowError('value out of int16 range') * * buf.write_int32(2) # <<<<<<<<<<<<<< * buf.write_int16(val) * */ __pyx_t_10 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 2); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/pgproto/codecs/int.pyx":38 * * buf.write_int32(2) * buf.write_int16(val) # <<<<<<<<<<<<<< * * */ __pyx_t_10 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int16(__pyx_v_buf, ((int16_t)__pyx_v_val)); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/pgproto/codecs/int.pyx":21 * * * cdef int2_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef int overflow = 0 * cdef long val */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.int2_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_obj); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/int.pyx":41 * * * cdef int2_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return cpython.PyLong_FromLong(hton.unpack_int16(frb_read(buf, 2))) * */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_int2_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("int2_decode", 1); /* "asyncpg/pgproto/codecs/int.pyx":42 * * cdef int2_decode(CodecContext settings, FRBuffer *buf): * return cpython.PyLong_FromLong(hton.unpack_int16(frb_read(buf, 2))) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(4, 42, __pyx_L1_error) __pyx_t_2 = PyLong_FromLong(unpack_int16(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/int.pyx":41 * * * cdef int2_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return cpython.PyLong_FromLong(hton.unpack_int16(frb_read(buf, 2))) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.int2_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/int.pyx":45 * * * cdef int4_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef int overflow = 0 * cdef long val = 0 */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_int4_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { int __pyx_v_overflow; long __pyx_v_val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; long __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("int4_encode", 0); __Pyx_INCREF(__pyx_v_obj); /* "asyncpg/pgproto/codecs/int.pyx":46 * * cdef int4_encode(CodecContext settings, WriteBuffer buf, obj): * cdef int overflow = 0 # <<<<<<<<<<<<<< * cdef long val = 0 * */ __pyx_v_overflow = 0; /* "asyncpg/pgproto/codecs/int.pyx":47 * cdef int4_encode(CodecContext settings, WriteBuffer buf, obj): * cdef int overflow = 0 * cdef long val = 0 # <<<<<<<<<<<<<< * * try: */ __pyx_v_val = 0; /* "asyncpg/pgproto/codecs/int.pyx":49 * cdef long val = 0 * * try: # <<<<<<<<<<<<<< * if type(obj) is not int and hasattr(type(obj), '__int__'): * # Silence a Python warning about implicit __int__ */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "asyncpg/pgproto/codecs/int.pyx":50 * * try: * if type(obj) is not int and hasattr(type(obj), '__int__'): # <<<<<<<<<<<<<< * # Silence a Python warning about implicit __int__ * # conversion. */ __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_obj)) != ((PyObject *)(&PyInt_Type))); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L10_bool_binop_done; } __pyx_t_5 = __Pyx_HasAttr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_u_int_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(4, 50, __pyx_L3_error) __pyx_t_4 = __pyx_t_5; __pyx_L10_bool_binop_done:; if (__pyx_t_4) { /* "asyncpg/pgproto/codecs/int.pyx":53 * # Silence a Python warning about implicit __int__ * # conversion. * obj = int(obj) # <<<<<<<<<<<<<< * val = cpython.PyLong_AsLong(obj) * except OverflowError: */ __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_v_obj); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 53, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/int.pyx":50 * * try: * if type(obj) is not int and hasattr(type(obj), '__int__'): # <<<<<<<<<<<<<< * # Silence a Python warning about implicit __int__ * # conversion. */ } /* "asyncpg/pgproto/codecs/int.pyx":54 * # conversion. * obj = int(obj) * val = cpython.PyLong_AsLong(obj) # <<<<<<<<<<<<<< * except OverflowError: * overflow = 1 */ __pyx_t_7 = PyLong_AsLong(__pyx_v_obj); if (unlikely(__pyx_t_7 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(4, 54, __pyx_L3_error) __pyx_v_val = __pyx_t_7; /* "asyncpg/pgproto/codecs/int.pyx":49 * cdef long val = 0 * * try: # <<<<<<<<<<<<<< * if type(obj) is not int and hasattr(type(obj), '__int__'): * # Silence a Python warning about implicit __int__ */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/int.pyx":55 * obj = int(obj) * val = cpython.PyLong_AsLong(obj) * except OverflowError: # <<<<<<<<<<<<<< * overflow = 1 * */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OverflowError); if (__pyx_t_8) { __Pyx_AddTraceback("asyncpg.pgproto.pgproto.int4_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(4, 55, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); /* "asyncpg/pgproto/codecs/int.pyx":56 * val = cpython.PyLong_AsLong(obj) * except OverflowError: * overflow = 1 # <<<<<<<<<<<<<< * * # "long" and "long long" have the same size for x86_64, need an extra check */ __pyx_v_overflow = 1; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; /* "asyncpg/pgproto/codecs/int.pyx":49 * cdef long val = 0 * * try: # <<<<<<<<<<<<<< * if type(obj) is not int and hasattr(type(obj), '__int__'): * # Silence a Python warning about implicit __int__ */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L8_try_end:; } /* "asyncpg/pgproto/codecs/int.pyx":59 * * # "long" and "long long" have the same size for x86_64, need an extra check * if overflow or (sizeof(val) > 4 and (val < INT32_MIN or val > INT32_MAX)): # <<<<<<<<<<<<<< * raise OverflowError('value out of int32 range') * */ __pyx_t_5 = (__pyx_v_overflow != 0); if (!__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L15_bool_binop_done; } __pyx_t_5 = ((sizeof(__pyx_v_val)) > 4); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L15_bool_binop_done; } __pyx_t_5 = (__pyx_v_val < INT32_MIN); if (!__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L15_bool_binop_done; } __pyx_t_5 = (__pyx_v_val > INT32_MAX); __pyx_t_4 = __pyx_t_5; __pyx_L15_bool_binop_done:; if (unlikely(__pyx_t_4)) { /* "asyncpg/pgproto/codecs/int.pyx":60 * # "long" and "long long" have the same size for x86_64, need an extra check * if overflow or (sizeof(val) > 4 and (val < INT32_MIN or val > INT32_MAX)): * raise OverflowError('value out of int32 range') # <<<<<<<<<<<<<< * * buf.write_int32(4) */ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_OverflowError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __PYX_ERR(4, 60, __pyx_L1_error) /* "asyncpg/pgproto/codecs/int.pyx":59 * * # "long" and "long long" have the same size for x86_64, need an extra check * if overflow or (sizeof(val) > 4 and (val < INT32_MIN or val > INT32_MAX)): # <<<<<<<<<<<<<< * raise OverflowError('value out of int32 range') * */ } /* "asyncpg/pgproto/codecs/int.pyx":62 * raise OverflowError('value out of int32 range') * * buf.write_int32(4) # <<<<<<<<<<<<<< * buf.write_int32(val) * */ __pyx_t_10 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 4); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/pgproto/codecs/int.pyx":63 * * buf.write_int32(4) * buf.write_int32(val) # <<<<<<<<<<<<<< * * */ __pyx_t_10 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, ((int32_t)__pyx_v_val)); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/pgproto/codecs/int.pyx":45 * * * cdef int4_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef int overflow = 0 * cdef long val = 0 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.int4_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_obj); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/int.pyx":66 * * * cdef int4_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return cpython.PyLong_FromLong(hton.unpack_int32(frb_read(buf, 4))) * */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_int4_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("int4_decode", 1); /* "asyncpg/pgproto/codecs/int.pyx":67 * * cdef int4_decode(CodecContext settings, FRBuffer *buf): * return cpython.PyLong_FromLong(hton.unpack_int32(frb_read(buf, 4))) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(4, 67, __pyx_L1_error) __pyx_t_2 = PyLong_FromLong(unpack_int32(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/int.pyx":66 * * * cdef int4_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return cpython.PyLong_FromLong(hton.unpack_int32(frb_read(buf, 4))) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.int4_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/int.pyx":70 * * * cdef uint4_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef int overflow = 0 * cdef unsigned long val = 0 */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_uint4_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { int __pyx_v_overflow; unsigned long __pyx_v_val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; unsigned long __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("uint4_encode", 0); __Pyx_INCREF(__pyx_v_obj); /* "asyncpg/pgproto/codecs/int.pyx":71 * * cdef uint4_encode(CodecContext settings, WriteBuffer buf, obj): * cdef int overflow = 0 # <<<<<<<<<<<<<< * cdef unsigned long val = 0 * */ __pyx_v_overflow = 0; /* "asyncpg/pgproto/codecs/int.pyx":72 * cdef uint4_encode(CodecContext settings, WriteBuffer buf, obj): * cdef int overflow = 0 * cdef unsigned long val = 0 # <<<<<<<<<<<<<< * * try: */ __pyx_v_val = 0; /* "asyncpg/pgproto/codecs/int.pyx":74 * cdef unsigned long val = 0 * * try: # <<<<<<<<<<<<<< * if type(obj) is not int and hasattr(type(obj), '__int__'): * # Silence a Python warning about implicit __int__ */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "asyncpg/pgproto/codecs/int.pyx":75 * * try: * if type(obj) is not int and hasattr(type(obj), '__int__'): # <<<<<<<<<<<<<< * # Silence a Python warning about implicit __int__ * # conversion. */ __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_obj)) != ((PyObject *)(&PyInt_Type))); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L10_bool_binop_done; } __pyx_t_5 = __Pyx_HasAttr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_u_int_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(4, 75, __pyx_L3_error) __pyx_t_4 = __pyx_t_5; __pyx_L10_bool_binop_done:; if (__pyx_t_4) { /* "asyncpg/pgproto/codecs/int.pyx":78 * # Silence a Python warning about implicit __int__ * # conversion. * obj = int(obj) # <<<<<<<<<<<<<< * val = cpython.PyLong_AsUnsignedLong(obj) * except OverflowError: */ __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_v_obj); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 78, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/int.pyx":75 * * try: * if type(obj) is not int and hasattr(type(obj), '__int__'): # <<<<<<<<<<<<<< * # Silence a Python warning about implicit __int__ * # conversion. */ } /* "asyncpg/pgproto/codecs/int.pyx":79 * # conversion. * obj = int(obj) * val = cpython.PyLong_AsUnsignedLong(obj) # <<<<<<<<<<<<<< * except OverflowError: * overflow = 1 */ __pyx_t_7 = PyLong_AsUnsignedLong(__pyx_v_obj); if (unlikely(__pyx_t_7 == ((unsigned long)-1L) && PyErr_Occurred())) __PYX_ERR(4, 79, __pyx_L3_error) __pyx_v_val = __pyx_t_7; /* "asyncpg/pgproto/codecs/int.pyx":74 * cdef unsigned long val = 0 * * try: # <<<<<<<<<<<<<< * if type(obj) is not int and hasattr(type(obj), '__int__'): * # Silence a Python warning about implicit __int__ */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/int.pyx":80 * obj = int(obj) * val = cpython.PyLong_AsUnsignedLong(obj) * except OverflowError: # <<<<<<<<<<<<<< * overflow = 1 * */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OverflowError); if (__pyx_t_8) { __Pyx_AddTraceback("asyncpg.pgproto.pgproto.uint4_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(4, 80, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); /* "asyncpg/pgproto/codecs/int.pyx":81 * val = cpython.PyLong_AsUnsignedLong(obj) * except OverflowError: * overflow = 1 # <<<<<<<<<<<<<< * * # "long" and "long long" have the same size for x86_64, need an extra check */ __pyx_v_overflow = 1; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; /* "asyncpg/pgproto/codecs/int.pyx":74 * cdef unsigned long val = 0 * * try: # <<<<<<<<<<<<<< * if type(obj) is not int and hasattr(type(obj), '__int__'): * # Silence a Python warning about implicit __int__ */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L8_try_end:; } /* "asyncpg/pgproto/codecs/int.pyx":84 * * # "long" and "long long" have the same size for x86_64, need an extra check * if overflow or (sizeof(val) > 4 and val > UINT32_MAX): # <<<<<<<<<<<<<< * raise OverflowError('value out of uint32 range') * */ __pyx_t_5 = (__pyx_v_overflow != 0); if (!__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L15_bool_binop_done; } __pyx_t_5 = ((sizeof(__pyx_v_val)) > 4); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L15_bool_binop_done; } __pyx_t_5 = (__pyx_v_val > UINT32_MAX); __pyx_t_4 = __pyx_t_5; __pyx_L15_bool_binop_done:; if (unlikely(__pyx_t_4)) { /* "asyncpg/pgproto/codecs/int.pyx":85 * # "long" and "long long" have the same size for x86_64, need an extra check * if overflow or (sizeof(val) > 4 and val > UINT32_MAX): * raise OverflowError('value out of uint32 range') # <<<<<<<<<<<<<< * * buf.write_int32(4) */ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_OverflowError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __PYX_ERR(4, 85, __pyx_L1_error) /* "asyncpg/pgproto/codecs/int.pyx":84 * * # "long" and "long long" have the same size for x86_64, need an extra check * if overflow or (sizeof(val) > 4 and val > UINT32_MAX): # <<<<<<<<<<<<<< * raise OverflowError('value out of uint32 range') * */ } /* "asyncpg/pgproto/codecs/int.pyx":87 * raise OverflowError('value out of uint32 range') * * buf.write_int32(4) # <<<<<<<<<<<<<< * buf.write_int32(val) * */ __pyx_t_10 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 4); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/pgproto/codecs/int.pyx":88 * * buf.write_int32(4) * buf.write_int32(val) # <<<<<<<<<<<<<< * * */ __pyx_t_10 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, ((int32_t)__pyx_v_val)); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/pgproto/codecs/int.pyx":70 * * * cdef uint4_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef int overflow = 0 * cdef unsigned long val = 0 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.uint4_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_obj); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/int.pyx":91 * * * cdef uint4_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return cpython.PyLong_FromUnsignedLong( * hton.unpack_int32(frb_read(buf, 4))) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_uint4_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("uint4_decode", 1); /* "asyncpg/pgproto/codecs/int.pyx":92 * * cdef uint4_decode(CodecContext settings, FRBuffer *buf): * return cpython.PyLong_FromUnsignedLong( # <<<<<<<<<<<<<< * hton.unpack_int32(frb_read(buf, 4))) * */ __Pyx_XDECREF(__pyx_r); /* "asyncpg/pgproto/codecs/int.pyx":93 * cdef uint4_decode(CodecContext settings, FRBuffer *buf): * return cpython.PyLong_FromUnsignedLong( * hton.unpack_int32(frb_read(buf, 4))) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(4, 93, __pyx_L1_error) /* "asyncpg/pgproto/codecs/int.pyx":92 * * cdef uint4_decode(CodecContext settings, FRBuffer *buf): * return cpython.PyLong_FromUnsignedLong( # <<<<<<<<<<<<<< * hton.unpack_int32(frb_read(buf, 4))) * */ __pyx_t_2 = PyLong_FromUnsignedLong(((uint32_t)unpack_int32(__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/int.pyx":91 * * * cdef uint4_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return cpython.PyLong_FromUnsignedLong( * hton.unpack_int32(frb_read(buf, 4))) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.uint4_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/int.pyx":96 * * * cdef int8_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef int overflow = 0 * cdef long long val */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_int8_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { int __pyx_v_overflow; PY_LONG_LONG __pyx_v_val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PY_LONG_LONG __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("int8_encode", 0); __Pyx_INCREF(__pyx_v_obj); /* "asyncpg/pgproto/codecs/int.pyx":97 * * cdef int8_encode(CodecContext settings, WriteBuffer buf, obj): * cdef int overflow = 0 # <<<<<<<<<<<<<< * cdef long long val * */ __pyx_v_overflow = 0; /* "asyncpg/pgproto/codecs/int.pyx":100 * cdef long long val * * try: # <<<<<<<<<<<<<< * if type(obj) is not int and hasattr(type(obj), '__int__'): * # Silence a Python warning about implicit __int__ */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "asyncpg/pgproto/codecs/int.pyx":101 * * try: * if type(obj) is not int and hasattr(type(obj), '__int__'): # <<<<<<<<<<<<<< * # Silence a Python warning about implicit __int__ * # conversion. */ __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_obj)) != ((PyObject *)(&PyInt_Type))); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L10_bool_binop_done; } __pyx_t_5 = __Pyx_HasAttr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_u_int_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(4, 101, __pyx_L3_error) __pyx_t_4 = __pyx_t_5; __pyx_L10_bool_binop_done:; if (__pyx_t_4) { /* "asyncpg/pgproto/codecs/int.pyx":104 * # Silence a Python warning about implicit __int__ * # conversion. * obj = int(obj) # <<<<<<<<<<<<<< * val = cpython.PyLong_AsLongLong(obj) * except OverflowError: */ __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_v_obj); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 104, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/int.pyx":101 * * try: * if type(obj) is not int and hasattr(type(obj), '__int__'): # <<<<<<<<<<<<<< * # Silence a Python warning about implicit __int__ * # conversion. */ } /* "asyncpg/pgproto/codecs/int.pyx":105 * # conversion. * obj = int(obj) * val = cpython.PyLong_AsLongLong(obj) # <<<<<<<<<<<<<< * except OverflowError: * overflow = 1 */ __pyx_t_7 = PyLong_AsLongLong(__pyx_v_obj); if (unlikely(__pyx_t_7 == ((PY_LONG_LONG)-1LL) && PyErr_Occurred())) __PYX_ERR(4, 105, __pyx_L3_error) __pyx_v_val = __pyx_t_7; /* "asyncpg/pgproto/codecs/int.pyx":100 * cdef long long val * * try: # <<<<<<<<<<<<<< * if type(obj) is not int and hasattr(type(obj), '__int__'): * # Silence a Python warning about implicit __int__ */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/int.pyx":106 * obj = int(obj) * val = cpython.PyLong_AsLongLong(obj) * except OverflowError: # <<<<<<<<<<<<<< * overflow = 1 * */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OverflowError); if (__pyx_t_8) { __Pyx_AddTraceback("asyncpg.pgproto.pgproto.int8_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(4, 106, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); /* "asyncpg/pgproto/codecs/int.pyx":107 * val = cpython.PyLong_AsLongLong(obj) * except OverflowError: * overflow = 1 # <<<<<<<<<<<<<< * * # Just in case for systems with "long long" bigger than 8 bytes */ __pyx_v_overflow = 1; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; /* "asyncpg/pgproto/codecs/int.pyx":100 * cdef long long val * * try: # <<<<<<<<<<<<<< * if type(obj) is not int and hasattr(type(obj), '__int__'): * # Silence a Python warning about implicit __int__ */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L8_try_end:; } /* "asyncpg/pgproto/codecs/int.pyx":110 * * # Just in case for systems with "long long" bigger than 8 bytes * if overflow or (sizeof(val) > 8 and (val < INT64_MIN or val > INT64_MAX)): # <<<<<<<<<<<<<< * raise OverflowError('value out of int64 range') * */ __pyx_t_5 = (__pyx_v_overflow != 0); if (!__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L15_bool_binop_done; } __pyx_t_5 = ((sizeof(__pyx_v_val)) > 8); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L15_bool_binop_done; } __pyx_t_5 = (__pyx_v_val < INT64_MIN); if (!__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L15_bool_binop_done; } __pyx_t_5 = (__pyx_v_val > INT64_MAX); __pyx_t_4 = __pyx_t_5; __pyx_L15_bool_binop_done:; if (unlikely(__pyx_t_4)) { /* "asyncpg/pgproto/codecs/int.pyx":111 * # Just in case for systems with "long long" bigger than 8 bytes * if overflow or (sizeof(val) > 8 and (val < INT64_MIN or val > INT64_MAX)): * raise OverflowError('value out of int64 range') # <<<<<<<<<<<<<< * * buf.write_int32(8) */ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_OverflowError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __PYX_ERR(4, 111, __pyx_L1_error) /* "asyncpg/pgproto/codecs/int.pyx":110 * * # Just in case for systems with "long long" bigger than 8 bytes * if overflow or (sizeof(val) > 8 and (val < INT64_MIN or val > INT64_MAX)): # <<<<<<<<<<<<<< * raise OverflowError('value out of int64 range') * */ } /* "asyncpg/pgproto/codecs/int.pyx":113 * raise OverflowError('value out of int64 range') * * buf.write_int32(8) # <<<<<<<<<<<<<< * buf.write_int64(val) * */ __pyx_t_10 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 8); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/pgproto/codecs/int.pyx":114 * * buf.write_int32(8) * buf.write_int64(val) # <<<<<<<<<<<<<< * * */ __pyx_t_10 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_buf, ((int64_t)__pyx_v_val)); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/pgproto/codecs/int.pyx":96 * * * cdef int8_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef int overflow = 0 * cdef long long val */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.int8_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_obj); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/int.pyx":117 * * * cdef int8_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return cpython.PyLong_FromLongLong(hton.unpack_int64(frb_read(buf, 8))) * */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_int8_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("int8_decode", 1); /* "asyncpg/pgproto/codecs/int.pyx":118 * * cdef int8_decode(CodecContext settings, FRBuffer *buf): * return cpython.PyLong_FromLongLong(hton.unpack_int64(frb_read(buf, 8))) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(4, 118, __pyx_L1_error) __pyx_t_2 = PyLong_FromLongLong(unpack_int64(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/int.pyx":117 * * * cdef int8_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return cpython.PyLong_FromLongLong(hton.unpack_int64(frb_read(buf, 8))) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.int8_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/int.pyx":121 * * * cdef uint8_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef int overflow = 0 * cdef unsigned long long val = 0 */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_uint8_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { int __pyx_v_overflow; unsigned PY_LONG_LONG __pyx_v_val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; unsigned PY_LONG_LONG __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("uint8_encode", 0); __Pyx_INCREF(__pyx_v_obj); /* "asyncpg/pgproto/codecs/int.pyx":122 * * cdef uint8_encode(CodecContext settings, WriteBuffer buf, obj): * cdef int overflow = 0 # <<<<<<<<<<<<<< * cdef unsigned long long val = 0 * */ __pyx_v_overflow = 0; /* "asyncpg/pgproto/codecs/int.pyx":123 * cdef uint8_encode(CodecContext settings, WriteBuffer buf, obj): * cdef int overflow = 0 * cdef unsigned long long val = 0 # <<<<<<<<<<<<<< * * try: */ __pyx_v_val = 0; /* "asyncpg/pgproto/codecs/int.pyx":125 * cdef unsigned long long val = 0 * * try: # <<<<<<<<<<<<<< * if type(obj) is not int and hasattr(type(obj), '__int__'): * # Silence a Python warning about implicit __int__ */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "asyncpg/pgproto/codecs/int.pyx":126 * * try: * if type(obj) is not int and hasattr(type(obj), '__int__'): # <<<<<<<<<<<<<< * # Silence a Python warning about implicit __int__ * # conversion. */ __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_obj)) != ((PyObject *)(&PyInt_Type))); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L10_bool_binop_done; } __pyx_t_5 = __Pyx_HasAttr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_u_int_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(4, 126, __pyx_L3_error) __pyx_t_4 = __pyx_t_5; __pyx_L10_bool_binop_done:; if (__pyx_t_4) { /* "asyncpg/pgproto/codecs/int.pyx":129 * # Silence a Python warning about implicit __int__ * # conversion. * obj = int(obj) # <<<<<<<<<<<<<< * val = cpython.PyLong_AsUnsignedLongLong(obj) * except OverflowError: */ __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_v_obj); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 129, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/int.pyx":126 * * try: * if type(obj) is not int and hasattr(type(obj), '__int__'): # <<<<<<<<<<<<<< * # Silence a Python warning about implicit __int__ * # conversion. */ } /* "asyncpg/pgproto/codecs/int.pyx":130 * # conversion. * obj = int(obj) * val = cpython.PyLong_AsUnsignedLongLong(obj) # <<<<<<<<<<<<<< * except OverflowError: * overflow = 1 */ __pyx_t_7 = PyLong_AsUnsignedLongLong(__pyx_v_obj); if (unlikely(__pyx_t_7 == ((unsigned PY_LONG_LONG)-1LL) && PyErr_Occurred())) __PYX_ERR(4, 130, __pyx_L3_error) __pyx_v_val = __pyx_t_7; /* "asyncpg/pgproto/codecs/int.pyx":125 * cdef unsigned long long val = 0 * * try: # <<<<<<<<<<<<<< * if type(obj) is not int and hasattr(type(obj), '__int__'): * # Silence a Python warning about implicit __int__ */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/int.pyx":131 * obj = int(obj) * val = cpython.PyLong_AsUnsignedLongLong(obj) * except OverflowError: # <<<<<<<<<<<<<< * overflow = 1 * */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OverflowError); if (__pyx_t_8) { __Pyx_AddTraceback("asyncpg.pgproto.pgproto.uint8_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(4, 131, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); /* "asyncpg/pgproto/codecs/int.pyx":132 * val = cpython.PyLong_AsUnsignedLongLong(obj) * except OverflowError: * overflow = 1 # <<<<<<<<<<<<<< * * # Just in case for systems with "long long" bigger than 8 bytes */ __pyx_v_overflow = 1; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; /* "asyncpg/pgproto/codecs/int.pyx":125 * cdef unsigned long long val = 0 * * try: # <<<<<<<<<<<<<< * if type(obj) is not int and hasattr(type(obj), '__int__'): * # Silence a Python warning about implicit __int__ */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L8_try_end:; } /* "asyncpg/pgproto/codecs/int.pyx":135 * * # Just in case for systems with "long long" bigger than 8 bytes * if overflow or (sizeof(val) > 8 and val > UINT64_MAX): # <<<<<<<<<<<<<< * raise OverflowError('value out of uint64 range') * */ __pyx_t_5 = (__pyx_v_overflow != 0); if (!__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L15_bool_binop_done; } __pyx_t_5 = ((sizeof(__pyx_v_val)) > 8); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L15_bool_binop_done; } __pyx_t_5 = (__pyx_v_val > UINT64_MAX); __pyx_t_4 = __pyx_t_5; __pyx_L15_bool_binop_done:; if (unlikely(__pyx_t_4)) { /* "asyncpg/pgproto/codecs/int.pyx":136 * # Just in case for systems with "long long" bigger than 8 bytes * if overflow or (sizeof(val) > 8 and val > UINT64_MAX): * raise OverflowError('value out of uint64 range') # <<<<<<<<<<<<<< * * buf.write_int32(8) */ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_OverflowError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __PYX_ERR(4, 136, __pyx_L1_error) /* "asyncpg/pgproto/codecs/int.pyx":135 * * # Just in case for systems with "long long" bigger than 8 bytes * if overflow or (sizeof(val) > 8 and val > UINT64_MAX): # <<<<<<<<<<<<<< * raise OverflowError('value out of uint64 range') * */ } /* "asyncpg/pgproto/codecs/int.pyx":138 * raise OverflowError('value out of uint64 range') * * buf.write_int32(8) # <<<<<<<<<<<<<< * buf.write_int64(val) * */ __pyx_t_10 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 8); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/pgproto/codecs/int.pyx":139 * * buf.write_int32(8) * buf.write_int64(val) # <<<<<<<<<<<<<< * * */ __pyx_t_10 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_buf, ((int64_t)__pyx_v_val)); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/pgproto/codecs/int.pyx":121 * * * cdef uint8_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef int overflow = 0 * cdef unsigned long long val = 0 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.uint8_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_obj); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/int.pyx":142 * * * cdef uint8_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return cpython.PyLong_FromUnsignedLongLong( * hton.unpack_int64(frb_read(buf, 8))) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_uint8_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("uint8_decode", 1); /* "asyncpg/pgproto/codecs/int.pyx":143 * * cdef uint8_decode(CodecContext settings, FRBuffer *buf): * return cpython.PyLong_FromUnsignedLongLong( # <<<<<<<<<<<<<< * hton.unpack_int64(frb_read(buf, 8))) */ __Pyx_XDECREF(__pyx_r); /* "asyncpg/pgproto/codecs/int.pyx":144 * cdef uint8_decode(CodecContext settings, FRBuffer *buf): * return cpython.PyLong_FromUnsignedLongLong( * hton.unpack_int64(frb_read(buf, 8))) # <<<<<<<<<<<<<< */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(4, 144, __pyx_L1_error) /* "asyncpg/pgproto/codecs/int.pyx":143 * * cdef uint8_decode(CodecContext settings, FRBuffer *buf): * return cpython.PyLong_FromUnsignedLongLong( # <<<<<<<<<<<<<< * hton.unpack_int64(frb_read(buf, 8))) */ __pyx_t_2 = PyLong_FromUnsignedLongLong(((uint64_t)unpack_int64(__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/int.pyx":142 * * * cdef uint8_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return cpython.PyLong_FromUnsignedLongLong( * hton.unpack_int64(frb_read(buf, 8))) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.uint8_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/json.pyx":8 * * * cdef jsonb_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * char *str */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_jsonb_encode(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { char *__pyx_v_str; Py_ssize_t __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("jsonb_encode", 0); __Pyx_INCREF(__pyx_v_obj); /* "asyncpg/pgproto/codecs/json.pyx":13 * ssize_t size * * if settings.is_encoding_json(): # <<<<<<<<<<<<<< * obj = settings.get_json_encoder().encode(obj) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings->__pyx_vtab)->is_encoding_json(__pyx_v_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(15, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "asyncpg/pgproto/codecs/json.pyx":14 * * if settings.is_encoding_json(): * obj = settings.get_json_encoder().encode(obj) # <<<<<<<<<<<<<< * * as_pg_string_and_size(settings, obj, &str, &size) */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings->__pyx_vtab)->get_json_encoder(__pyx_v_settings, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_obj}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/json.pyx":13 * ssize_t size * * if settings.is_encoding_json(): # <<<<<<<<<<<<<< * obj = settings.get_json_encoder().encode(obj) * */ } /* "asyncpg/pgproto/codecs/json.pyx":16 * obj = settings.get_json_encoder().encode(obj) * * as_pg_string_and_size(settings, obj, &str, &size) # <<<<<<<<<<<<<< * * if size > 0x7fffffff - 1: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_as_pg_string_and_size(__pyx_v_settings, __pyx_v_obj, (&__pyx_v_str), (&__pyx_v_size)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/json.pyx":18 * as_pg_string_and_size(settings, obj, &str, &size) * * if size > 0x7fffffff - 1: # <<<<<<<<<<<<<< * raise ValueError('string too long') * */ __pyx_t_2 = (__pyx_v_size > 0x7ffffffe); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/codecs/json.pyx":19 * * if size > 0x7fffffff - 1: * raise ValueError('string too long') # <<<<<<<<<<<<<< * * buf.write_int32(size + 1) */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(15, 19, __pyx_L1_error) /* "asyncpg/pgproto/codecs/json.pyx":18 * as_pg_string_and_size(settings, obj, &str, &size) * * if size > 0x7fffffff - 1: # <<<<<<<<<<<<<< * raise ValueError('string too long') * */ } /* "asyncpg/pgproto/codecs/json.pyx":21 * raise ValueError('string too long') * * buf.write_int32(size + 1) # <<<<<<<<<<<<<< * buf.write_byte(1) # JSONB format version * buf.write_cstr(str, size) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, (((int32_t)__pyx_v_size) + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/json.pyx":22 * * buf.write_int32(size + 1) * buf.write_byte(1) # JSONB format version # <<<<<<<<<<<<<< * buf.write_cstr(str, size) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_byte(__pyx_v_buf, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/json.pyx":23 * buf.write_int32(size + 1) * buf.write_byte(1) # JSONB format version * buf.write_cstr(str, size) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_cstr(__pyx_v_buf, __pyx_v_str, __pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/json.pyx":8 * * * cdef jsonb_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * char *str */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.jsonb_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_obj); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/json.pyx":26 * * * cdef jsonb_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef uint8_t format = (frb_read(buf, 1)[0]) * */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_jsonb_decode(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { uint8_t __pyx_v_format; PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("jsonb_decode", 1); /* "asyncpg/pgproto/codecs/json.pyx":27 * * cdef jsonb_decode(CodecContext settings, FRBuffer *buf): * cdef uint8_t format = (frb_read(buf, 1)[0]) # <<<<<<<<<<<<<< * * if format != 1: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 1); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(15, 27, __pyx_L1_error) __pyx_v_format = ((uint8_t)(__pyx_t_1[0])); /* "asyncpg/pgproto/codecs/json.pyx":29 * cdef uint8_t format = (frb_read(buf, 1)[0]) * * if format != 1: # <<<<<<<<<<<<<< * raise ValueError('unexpected JSONB format: {}'.format(format)) * */ __pyx_t_2 = (__pyx_v_format != 1); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/codecs/json.pyx":30 * * if format != 1: * raise ValueError('unexpected JSONB format: {}'.format(format)) # <<<<<<<<<<<<<< * * rv = text_decode(settings, buf) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_JSONB_format, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(15, 30, __pyx_L1_error) /* "asyncpg/pgproto/codecs/json.pyx":29 * cdef uint8_t format = (frb_read(buf, 1)[0]) * * if format != 1: # <<<<<<<<<<<<<< * raise ValueError('unexpected JSONB format: {}'.format(format)) * */ } /* "asyncpg/pgproto/codecs/json.pyx":32 * raise ValueError('unexpected JSONB format: {}'.format(format)) * * rv = text_decode(settings, buf) # <<<<<<<<<<<<<< * * if settings.is_decoding_json(): */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_text_decode(__pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_rv = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/json.pyx":34 * rv = text_decode(settings, buf) * * if settings.is_decoding_json(): # <<<<<<<<<<<<<< * rv = settings.get_json_decoder().decode(rv) * */ __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings->__pyx_vtab)->is_decoding_json(__pyx_v_settings); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(15, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "asyncpg/pgproto/codecs/json.pyx":35 * * if settings.is_decoding_json(): * rv = settings.get_json_decoder().decode(rv) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings->__pyx_vtab)->get_json_decoder(__pyx_v_settings, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_rv}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/json.pyx":34 * rv = text_decode(settings, buf) * * if settings.is_decoding_json(): # <<<<<<<<<<<<<< * rv = settings.get_json_decoder().decode(rv) * */ } /* "asyncpg/pgproto/codecs/json.pyx":37 * rv = settings.get_json_decoder().decode(rv) * * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "asyncpg/pgproto/codecs/json.pyx":26 * * * cdef jsonb_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef uint8_t format = (frb_read(buf, 1)[0]) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.jsonb_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/json.pyx":40 * * * cdef json_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * char *str */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_json_encode(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("json_encode", 0); __Pyx_INCREF(__pyx_v_obj); /* "asyncpg/pgproto/codecs/json.pyx":45 * ssize_t size * * if settings.is_encoding_json(): # <<<<<<<<<<<<<< * obj = settings.get_json_encoder().encode(obj) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings->__pyx_vtab)->is_encoding_json(__pyx_v_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(15, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "asyncpg/pgproto/codecs/json.pyx":46 * * if settings.is_encoding_json(): * obj = settings.get_json_encoder().encode(obj) # <<<<<<<<<<<<<< * * text_encode(settings, buf, obj) */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings->__pyx_vtab)->get_json_encoder(__pyx_v_settings, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_obj}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/json.pyx":45 * ssize_t size * * if settings.is_encoding_json(): # <<<<<<<<<<<<<< * obj = settings.get_json_encoder().encode(obj) * */ } /* "asyncpg/pgproto/codecs/json.pyx":48 * obj = settings.get_json_encoder().encode(obj) * * text_encode(settings, buf, obj) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_text_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/json.pyx":40 * * * cdef json_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * char *str */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.json_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_obj); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/json.pyx":51 * * * cdef json_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * rv = text_decode(settings, buf) * */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_json_decode(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_v_rv = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("json_decode", 1); /* "asyncpg/pgproto/codecs/json.pyx":52 * * cdef json_decode(CodecContext settings, FRBuffer *buf): * rv = text_decode(settings, buf) # <<<<<<<<<<<<<< * * if settings.is_decoding_json(): */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_text_decode(__pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/json.pyx":54 * rv = text_decode(settings, buf) * * if settings.is_decoding_json(): # <<<<<<<<<<<<<< * rv = settings.get_json_decoder().decode(rv) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings->__pyx_vtab)->is_decoding_json(__pyx_v_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(15, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "asyncpg/pgproto/codecs/json.pyx":55 * * if settings.is_decoding_json(): * rv = settings.get_json_decoder().decode(rv) # <<<<<<<<<<<<<< * * return rv */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings->__pyx_vtab)->get_json_decoder(__pyx_v_settings, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_rv}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/json.pyx":54 * rv = text_decode(settings, buf) * * if settings.is_decoding_json(): # <<<<<<<<<<<<<< * rv = settings.get_json_decoder().decode(rv) * */ } /* "asyncpg/pgproto/codecs/json.pyx":57 * rv = settings.get_json_decoder().decode(rv) * * return rv # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "asyncpg/pgproto/codecs/json.pyx":51 * * * cdef json_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * rv = text_decode(settings, buf) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.json_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/jsonpath.pyx":8 * * * cdef jsonpath_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * char *str */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_jsonpath_encode(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { char *__pyx_v_str; Py_ssize_t __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("jsonpath_encode", 1); /* "asyncpg/pgproto/codecs/jsonpath.pyx":13 * ssize_t size * * as_pg_string_and_size(settings, obj, &str, &size) # <<<<<<<<<<<<<< * * if size > 0x7fffffff - 1: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_as_pg_string_and_size(__pyx_v_settings, __pyx_v_obj, (&__pyx_v_str), (&__pyx_v_size)); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/jsonpath.pyx":15 * as_pg_string_and_size(settings, obj, &str, &size) * * if size > 0x7fffffff - 1: # <<<<<<<<<<<<<< * raise ValueError('string too long') * */ __pyx_t_2 = (__pyx_v_size > 0x7ffffffe); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/codecs/jsonpath.pyx":16 * * if size > 0x7fffffff - 1: * raise ValueError('string too long') # <<<<<<<<<<<<<< * * buf.write_int32(size + 1) */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(16, 16, __pyx_L1_error) /* "asyncpg/pgproto/codecs/jsonpath.pyx":15 * as_pg_string_and_size(settings, obj, &str, &size) * * if size > 0x7fffffff - 1: # <<<<<<<<<<<<<< * raise ValueError('string too long') * */ } /* "asyncpg/pgproto/codecs/jsonpath.pyx":18 * raise ValueError('string too long') * * buf.write_int32(size + 1) # <<<<<<<<<<<<<< * buf.write_byte(1) # jsonpath format version * buf.write_cstr(str, size) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, (((int32_t)__pyx_v_size) + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/jsonpath.pyx":19 * * buf.write_int32(size + 1) * buf.write_byte(1) # jsonpath format version # <<<<<<<<<<<<<< * buf.write_cstr(str, size) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_byte(__pyx_v_buf, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/jsonpath.pyx":20 * buf.write_int32(size + 1) * buf.write_byte(1) # jsonpath format version * buf.write_cstr(str, size) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_cstr(__pyx_v_buf, __pyx_v_str, __pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/jsonpath.pyx":8 * * * cdef jsonpath_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * char *str */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.jsonpath_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/jsonpath.pyx":23 * * * cdef jsonpath_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef uint8_t format = (frb_read(buf, 1)[0]) * */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_jsonpath_decode(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { uint8_t __pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("jsonpath_decode", 1); /* "asyncpg/pgproto/codecs/jsonpath.pyx":24 * * cdef jsonpath_decode(CodecContext settings, FRBuffer *buf): * cdef uint8_t format = (frb_read(buf, 1)[0]) # <<<<<<<<<<<<<< * * if format != 1: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 1); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(16, 24, __pyx_L1_error) __pyx_v_format = ((uint8_t)(__pyx_t_1[0])); /* "asyncpg/pgproto/codecs/jsonpath.pyx":26 * cdef uint8_t format = (frb_read(buf, 1)[0]) * * if format != 1: # <<<<<<<<<<<<<< * raise ValueError('unexpected jsonpath format: {}'.format(format)) * */ __pyx_t_2 = (__pyx_v_format != 1); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/codecs/jsonpath.pyx":27 * * if format != 1: * raise ValueError('unexpected jsonpath format: {}'.format(format)) # <<<<<<<<<<<<<< * * return text_decode(settings, buf) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_jsonpath_format, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(16, 27, __pyx_L1_error) /* "asyncpg/pgproto/codecs/jsonpath.pyx":26 * cdef uint8_t format = (frb_read(buf, 1)[0]) * * if format != 1: # <<<<<<<<<<<<<< * raise ValueError('unexpected jsonpath format: {}'.format(format)) * */ } /* "asyncpg/pgproto/codecs/jsonpath.pyx":29 * raise ValueError('unexpected jsonpath format: {}'.format(format)) * * return text_decode(settings, buf) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_text_decode(__pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/jsonpath.pyx":23 * * * cdef jsonpath_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef uint8_t format = (frb_read(buf, 1)[0]) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.jsonpath_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/uuid.pyx":8 * * * cdef uuid_encode(CodecContext settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * cdef: * char buf[16] */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_uuid_encode(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_wbuf, PyObject *__pyx_v_obj) { char __pyx_v_buf[16]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("uuid_encode", 1); /* "asyncpg/pgproto/codecs/uuid.pyx":12 * char buf[16] * * if type(obj) is pg_UUID: # <<<<<<<<<<<<<< * wbuf.write_int32(16) * wbuf.write_cstr((obj)._data, 16) */ __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_obj)) == __pyx_v_7asyncpg_7pgproto_7pgproto_pg_UUID); if (__pyx_t_1) { /* "asyncpg/pgproto/codecs/uuid.pyx":13 * * if type(obj) is pg_UUID: * wbuf.write_int32(16) # <<<<<<<<<<<<<< * wbuf.write_cstr((obj)._data, 16) * elif cpython.PyUnicode_Check(obj): */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_wbuf, ((int32_t)16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/uuid.pyx":14 * if type(obj) is pg_UUID: * wbuf.write_int32(16) * wbuf.write_cstr((obj)._data, 16) # <<<<<<<<<<<<<< * elif cpython.PyUnicode_Check(obj): * pg_uuid_bytes_from_str(obj, buf) */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_cstr(__pyx_v_wbuf, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)__pyx_v_obj)->_data, 16); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/uuid.pyx":12 * char buf[16] * * if type(obj) is pg_UUID: # <<<<<<<<<<<<<< * wbuf.write_int32(16) * wbuf.write_cstr((obj)._data, 16) */ goto __pyx_L3; } /* "asyncpg/pgproto/codecs/uuid.pyx":15 * wbuf.write_int32(16) * wbuf.write_cstr((obj)._data, 16) * elif cpython.PyUnicode_Check(obj): # <<<<<<<<<<<<<< * pg_uuid_bytes_from_str(obj, buf) * wbuf.write_int32(16) */ __pyx_t_1 = PyUnicode_Check(__pyx_v_obj); if (__pyx_t_1) { /* "asyncpg/pgproto/codecs/uuid.pyx":16 * wbuf.write_cstr((obj)._data, 16) * elif cpython.PyUnicode_Check(obj): * pg_uuid_bytes_from_str(obj, buf) # <<<<<<<<<<<<<< * wbuf.write_int32(16) * wbuf.write_cstr(buf, 16) */ if (!(likely(PyUnicode_CheckExact(__pyx_v_obj))||((__pyx_v_obj) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_obj))) __PYX_ERR(17, 16, __pyx_L1_error) __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_pg_uuid_bytes_from_str(((PyObject*)__pyx_v_obj), __pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/uuid.pyx":17 * elif cpython.PyUnicode_Check(obj): * pg_uuid_bytes_from_str(obj, buf) * wbuf.write_int32(16) # <<<<<<<<<<<<<< * wbuf.write_cstr(buf, 16) * else: */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_wbuf, ((int32_t)16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/uuid.pyx":18 * pg_uuid_bytes_from_str(obj, buf) * wbuf.write_int32(16) * wbuf.write_cstr(buf, 16) # <<<<<<<<<<<<<< * else: * bytea_encode(settings, wbuf, obj.bytes) */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_cstr(__pyx_v_wbuf, __pyx_v_buf, 16); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/uuid.pyx":15 * wbuf.write_int32(16) * wbuf.write_cstr((obj)._data, 16) * elif cpython.PyUnicode_Check(obj): # <<<<<<<<<<<<<< * pg_uuid_bytes_from_str(obj, buf) * wbuf.write_int32(16) */ goto __pyx_L3; } /* "asyncpg/pgproto/codecs/uuid.pyx":20 * wbuf.write_cstr(buf, 16) * else: * bytea_encode(settings, wbuf, obj.bytes) # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_bytea_encode(__pyx_v_settings, __pyx_v_wbuf, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; /* "asyncpg/pgproto/codecs/uuid.pyx":8 * * * cdef uuid_encode(CodecContext settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * cdef: * char buf[16] */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.uuid_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/uuid.pyx":23 * * * cdef uuid_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * if buf.len != 16: * raise TypeError( */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_uuid_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; char const *__pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("uuid_decode", 1); /* "asyncpg/pgproto/codecs/uuid.pyx":24 * * cdef uuid_decode(CodecContext settings, FRBuffer *buf): * if buf.len != 16: # <<<<<<<<<<<<<< * raise TypeError( * f'cannot decode UUID, expected 16 bytes, got {buf.len}') */ __pyx_t_1 = (__pyx_v_buf->len != 16); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/codecs/uuid.pyx":26 * if buf.len != 16: * raise TypeError( * f'cannot decode UUID, expected 16 bytes, got {buf.len}') # <<<<<<<<<<<<<< * return pg_uuid_from_buf(frb_read_all(buf)) */ __pyx_t_2 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_buf->len, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_cannot_decode_UUID_expected_16_b, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/uuid.pyx":25 * cdef uuid_decode(CodecContext settings, FRBuffer *buf): * if buf.len != 16: * raise TypeError( # <<<<<<<<<<<<<< * f'cannot decode UUID, expected 16 bytes, got {buf.len}') * return pg_uuid_from_buf(frb_read_all(buf)) */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(17, 25, __pyx_L1_error) /* "asyncpg/pgproto/codecs/uuid.pyx":24 * * cdef uuid_decode(CodecContext settings, FRBuffer *buf): * if buf.len != 16: # <<<<<<<<<<<<<< * raise TypeError( * f'cannot decode UUID, expected 16 bytes, got {buf.len}') */ } /* "asyncpg/pgproto/codecs/uuid.pyx":27 * raise TypeError( * f'cannot decode UUID, expected 16 bytes, got {buf.len}') * return pg_uuid_from_buf(frb_read_all(buf)) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read_all(__pyx_v_buf); if (unlikely(__pyx_t_4 == ((char const *)NULL) && PyErr_Occurred())) __PYX_ERR(17, 27, __pyx_L1_error) __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_pg_uuid_from_buf(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/uuid.pyx":23 * * * cdef uuid_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * if buf.len != 16: * raise TypeError( */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.uuid_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/numeric.pyx":25 * * * cdef numeric_encode_text(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * text_encode(settings, buf, str(obj)) * */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_encode_text(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("numeric_encode_text", 1); /* "asyncpg/pgproto/codecs/numeric.pyx":26 * * cdef numeric_encode_text(CodecContext settings, WriteBuffer buf, obj): * text_encode(settings, buf, str(obj)) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_text_encode(__pyx_v_settings, __pyx_v_buf, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":25 * * * cdef numeric_encode_text(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * text_encode(settings, buf, str(obj)) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.numeric_encode_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/numeric.pyx":29 * * * cdef numeric_decode_text(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return _Dec(text_decode(settings, buf)) * */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_text(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("numeric_decode_text", 1); /* "asyncpg/pgproto/codecs/numeric.pyx":30 * * cdef numeric_decode_text(CodecContext settings, FRBuffer *buf): * return _Dec(text_decode(settings, buf)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Dec); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_text_decode(__pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/numeric.pyx":29 * * * cdef numeric_decode_text(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return _Dec(text_decode(settings, buf)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.numeric_decode_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/numeric.pyx":33 * * * cdef numeric_encode_binary(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * object dec */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_encode_binary(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { PyObject *__pyx_v_dec = 0; PyObject *__pyx_v_dt = 0; int64_t __pyx_v_exponent; CYTHON_UNUSED int64_t __pyx_v_i; int64_t __pyx_v_j; PyObject *__pyx_v_pydigits = 0; int64_t __pyx_v_num_pydigits; int16_t __pyx_v_pgdigit; int64_t __pyx_v_num_pgdigits; int16_t __pyx_v_dscale; int64_t __pyx_v_dweight; int64_t __pyx_v_weight; uint16_t __pyx_v_sign; int64_t __pyx_v_padding_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int64_t __pyx_t_7; Py_ssize_t __pyx_t_8; int64_t __pyx_t_9; int64_t __pyx_t_10; int64_t __pyx_t_11; int16_t __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("numeric_encode_binary", 1); /* "asyncpg/pgproto/codecs/numeric.pyx":48 * int64_t weight * uint16_t sign * int64_t padding_size = 0 # <<<<<<<<<<<<<< * * if isinstance(obj, _Dec): */ __pyx_v_padding_size = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":50 * int64_t padding_size = 0 * * if isinstance(obj, _Dec): # <<<<<<<<<<<<<< * dec = obj * else: */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Dec); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(18, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "asyncpg/pgproto/codecs/numeric.pyx":51 * * if isinstance(obj, _Dec): * dec = obj # <<<<<<<<<<<<<< * else: * dec = _Dec(obj) */ __Pyx_INCREF(__pyx_v_obj); __pyx_v_dec = __pyx_v_obj; /* "asyncpg/pgproto/codecs/numeric.pyx":50 * int64_t padding_size = 0 * * if isinstance(obj, _Dec): # <<<<<<<<<<<<<< * dec = obj * else: */ goto __pyx_L3; } /* "asyncpg/pgproto/codecs/numeric.pyx":53 * dec = obj * else: * dec = _Dec(obj) # <<<<<<<<<<<<<< * * dt = dec.as_tuple() */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Dec); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_obj}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_dec = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L3:; /* "asyncpg/pgproto/codecs/numeric.pyx":55 * dec = _Dec(obj) * * dt = dec.as_tuple() # <<<<<<<<<<<<<< * * if dt.exponent == 'n' or dt.exponent == 'N': */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dec, __pyx_n_s_as_tuple); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_dt = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":57 * dt = dec.as_tuple() * * if dt.exponent == 'n' or dt.exponent == 'N': # <<<<<<<<<<<<<< * # NaN * sign = NUMERIC_NAN */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_exponent); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_n, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(18, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_6) { } else { __pyx_t_2 = __pyx_t_6; goto __pyx_L5_bool_binop_done; } __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_exponent); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_N, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(18, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __pyx_t_6; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { /* "asyncpg/pgproto/codecs/numeric.pyx":59 * if dt.exponent == 'n' or dt.exponent == 'N': * # NaN * sign = NUMERIC_NAN # <<<<<<<<<<<<<< * num_pgdigits = 0 * weight = 0 */ __pyx_v_sign = 0xC000; /* "asyncpg/pgproto/codecs/numeric.pyx":60 * # NaN * sign = NUMERIC_NAN * num_pgdigits = 0 # <<<<<<<<<<<<<< * weight = 0 * dscale = 0 */ __pyx_v_num_pgdigits = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":61 * sign = NUMERIC_NAN * num_pgdigits = 0 * weight = 0 # <<<<<<<<<<<<<< * dscale = 0 * elif dt.exponent == 'F': */ __pyx_v_weight = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":62 * num_pgdigits = 0 * weight = 0 * dscale = 0 # <<<<<<<<<<<<<< * elif dt.exponent == 'F': * # Infinity */ __pyx_v_dscale = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":57 * dt = dec.as_tuple() * * if dt.exponent == 'n' or dt.exponent == 'N': # <<<<<<<<<<<<<< * # NaN * sign = NUMERIC_NAN */ goto __pyx_L4; } /* "asyncpg/pgproto/codecs/numeric.pyx":63 * weight = 0 * dscale = 0 * elif dt.exponent == 'F': # <<<<<<<<<<<<<< * # Infinity * if dt.sign: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_exponent); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_F, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(18, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "asyncpg/pgproto/codecs/numeric.pyx":65 * elif dt.exponent == 'F': * # Infinity * if dt.sign: # <<<<<<<<<<<<<< * sign = NUMERIC_NINF * else: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_sign); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(18, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "asyncpg/pgproto/codecs/numeric.pyx":66 * # Infinity * if dt.sign: * sign = NUMERIC_NINF # <<<<<<<<<<<<<< * else: * sign = NUMERIC_PINF */ __pyx_v_sign = 0xF000; /* "asyncpg/pgproto/codecs/numeric.pyx":65 * elif dt.exponent == 'F': * # Infinity * if dt.sign: # <<<<<<<<<<<<<< * sign = NUMERIC_NINF * else: */ goto __pyx_L7; } /* "asyncpg/pgproto/codecs/numeric.pyx":68 * sign = NUMERIC_NINF * else: * sign = NUMERIC_PINF # <<<<<<<<<<<<<< * num_pgdigits = 0 * weight = 0 */ /*else*/ { __pyx_v_sign = 0xD000; } __pyx_L7:; /* "asyncpg/pgproto/codecs/numeric.pyx":69 * else: * sign = NUMERIC_PINF * num_pgdigits = 0 # <<<<<<<<<<<<<< * weight = 0 * dscale = 0 */ __pyx_v_num_pgdigits = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":70 * sign = NUMERIC_PINF * num_pgdigits = 0 * weight = 0 # <<<<<<<<<<<<<< * dscale = 0 * else: */ __pyx_v_weight = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":71 * num_pgdigits = 0 * weight = 0 * dscale = 0 # <<<<<<<<<<<<<< * else: * exponent = dt.exponent */ __pyx_v_dscale = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":63 * weight = 0 * dscale = 0 * elif dt.exponent == 'F': # <<<<<<<<<<<<<< * # Infinity * if dt.sign: */ goto __pyx_L4; } /* "asyncpg/pgproto/codecs/numeric.pyx":73 * dscale = 0 * else: * exponent = dt.exponent # <<<<<<<<<<<<<< * if exponent < 0 and -exponent > MAX_DSCALE: * raise ValueError( */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_exponent); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(18, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_exponent = __pyx_t_7; /* "asyncpg/pgproto/codecs/numeric.pyx":74 * else: * exponent = dt.exponent * if exponent < 0 and -exponent > MAX_DSCALE: # <<<<<<<<<<<<<< * raise ValueError( * 'cannot encode Decimal value into numeric: ' */ __pyx_t_6 = (__pyx_v_exponent < 0); if (__pyx_t_6) { } else { __pyx_t_2 = __pyx_t_6; goto __pyx_L9_bool_binop_done; } __pyx_t_6 = ((-__pyx_v_exponent) > 0x3FFF); __pyx_t_2 = __pyx_t_6; __pyx_L9_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/codecs/numeric.pyx":75 * exponent = dt.exponent * if exponent < 0 and -exponent > MAX_DSCALE: * raise ValueError( # <<<<<<<<<<<<<< * 'cannot encode Decimal value into numeric: ' * 'exponent is too small') */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(18, 75, __pyx_L1_error) /* "asyncpg/pgproto/codecs/numeric.pyx":74 * else: * exponent = dt.exponent * if exponent < 0 and -exponent > MAX_DSCALE: # <<<<<<<<<<<<<< * raise ValueError( * 'cannot encode Decimal value into numeric: ' */ } /* "asyncpg/pgproto/codecs/numeric.pyx":79 * 'exponent is too small') * * if dt.sign: # <<<<<<<<<<<<<< * sign = NUMERIC_NEG * else: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_sign); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(18, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "asyncpg/pgproto/codecs/numeric.pyx":80 * * if dt.sign: * sign = NUMERIC_NEG # <<<<<<<<<<<<<< * else: * sign = NUMERIC_POS */ __pyx_v_sign = 0x4000; /* "asyncpg/pgproto/codecs/numeric.pyx":79 * 'exponent is too small') * * if dt.sign: # <<<<<<<<<<<<<< * sign = NUMERIC_NEG * else: */ goto __pyx_L11; } /* "asyncpg/pgproto/codecs/numeric.pyx":82 * sign = NUMERIC_NEG * else: * sign = NUMERIC_POS # <<<<<<<<<<<<<< * * pydigits = dt.digits */ /*else*/ { __pyx_v_sign = 0; } __pyx_L11:; /* "asyncpg/pgproto/codecs/numeric.pyx":84 * sign = NUMERIC_POS * * pydigits = dt.digits # <<<<<<<<<<<<<< * num_pydigits = len(pydigits) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_digits); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(18, 84, __pyx_L1_error) __pyx_v_pydigits = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":85 * * pydigits = dt.digits * num_pydigits = len(pydigits) # <<<<<<<<<<<<<< * * dweight = num_pydigits + exponent - 1 */ if (unlikely(__pyx_v_pydigits == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(18, 85, __pyx_L1_error) } __pyx_t_8 = __Pyx_PyTuple_GET_SIZE(__pyx_v_pydigits); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(18, 85, __pyx_L1_error) __pyx_v_num_pydigits = __pyx_t_8; /* "asyncpg/pgproto/codecs/numeric.pyx":87 * num_pydigits = len(pydigits) * * dweight = num_pydigits + exponent - 1 # <<<<<<<<<<<<<< * if dweight >= 0: * weight = (dweight + DEC_DIGITS) // DEC_DIGITS - 1 */ __pyx_v_dweight = ((__pyx_v_num_pydigits + __pyx_v_exponent) - 1); /* "asyncpg/pgproto/codecs/numeric.pyx":88 * * dweight = num_pydigits + exponent - 1 * if dweight >= 0: # <<<<<<<<<<<<<< * weight = (dweight + DEC_DIGITS) // DEC_DIGITS - 1 * else: */ __pyx_t_2 = (__pyx_v_dweight >= 0); if (__pyx_t_2) { /* "asyncpg/pgproto/codecs/numeric.pyx":89 * dweight = num_pydigits + exponent - 1 * if dweight >= 0: * weight = (dweight + DEC_DIGITS) // DEC_DIGITS - 1 # <<<<<<<<<<<<<< * else: * weight = -((-dweight - 1) // DEC_DIGITS + 1) */ __pyx_v_weight = (__Pyx_div_int64_t((__pyx_v_dweight + 4), 4) - 1); /* "asyncpg/pgproto/codecs/numeric.pyx":88 * * dweight = num_pydigits + exponent - 1 * if dweight >= 0: # <<<<<<<<<<<<<< * weight = (dweight + DEC_DIGITS) // DEC_DIGITS - 1 * else: */ goto __pyx_L12; } /* "asyncpg/pgproto/codecs/numeric.pyx":91 * weight = (dweight + DEC_DIGITS) // DEC_DIGITS - 1 * else: * weight = -((-dweight - 1) // DEC_DIGITS + 1) # <<<<<<<<<<<<<< * * if weight > 2 ** 16 - 1: */ /*else*/ { __pyx_v_weight = (-(__Pyx_div_int64_t(((-__pyx_v_dweight) - 1), 4) + 1)); } __pyx_L12:; /* "asyncpg/pgproto/codecs/numeric.pyx":93 * weight = -((-dweight - 1) // DEC_DIGITS + 1) * * if weight > 2 ** 16 - 1: # <<<<<<<<<<<<<< * raise ValueError( * 'cannot encode Decimal value into numeric: ' */ __pyx_t_2 = (__pyx_v_weight > 0xffff); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/codecs/numeric.pyx":94 * * if weight > 2 ** 16 - 1: * raise ValueError( # <<<<<<<<<<<<<< * 'cannot encode Decimal value into numeric: ' * 'exponent is too large') */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(18, 94, __pyx_L1_error) /* "asyncpg/pgproto/codecs/numeric.pyx":93 * weight = -((-dweight - 1) // DEC_DIGITS + 1) * * if weight > 2 ** 16 - 1: # <<<<<<<<<<<<<< * raise ValueError( * 'cannot encode Decimal value into numeric: ' */ } /* "asyncpg/pgproto/codecs/numeric.pyx":99 * * padding_size = \ * (weight + 1) * DEC_DIGITS - (dweight + 1) # <<<<<<<<<<<<<< * num_pgdigits = \ * (num_pydigits + padding_size + DEC_DIGITS - 1) // DEC_DIGITS */ __pyx_v_padding_size = (((__pyx_v_weight + 1) * 4) - (__pyx_v_dweight + 1)); /* "asyncpg/pgproto/codecs/numeric.pyx":101 * (weight + 1) * DEC_DIGITS - (dweight + 1) * num_pgdigits = \ * (num_pydigits + padding_size + DEC_DIGITS - 1) // DEC_DIGITS # <<<<<<<<<<<<<< * * if num_pgdigits > 2 ** 16 - 1: */ __pyx_v_num_pgdigits = __Pyx_div_int64_t((((__pyx_v_num_pydigits + __pyx_v_padding_size) + 4) - 1), 4); /* "asyncpg/pgproto/codecs/numeric.pyx":103 * (num_pydigits + padding_size + DEC_DIGITS - 1) // DEC_DIGITS * * if num_pgdigits > 2 ** 16 - 1: # <<<<<<<<<<<<<< * raise ValueError( * 'cannot encode Decimal value into numeric: ' */ __pyx_t_2 = (__pyx_v_num_pgdigits > 0xffff); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/codecs/numeric.pyx":104 * * if num_pgdigits > 2 ** 16 - 1: * raise ValueError( # <<<<<<<<<<<<<< * 'cannot encode Decimal value into numeric: ' * 'number of digits is too large') */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(18, 104, __pyx_L1_error) /* "asyncpg/pgproto/codecs/numeric.pyx":103 * (num_pydigits + padding_size + DEC_DIGITS - 1) // DEC_DIGITS * * if num_pgdigits > 2 ** 16 - 1: # <<<<<<<<<<<<<< * raise ValueError( * 'cannot encode Decimal value into numeric: ' */ } /* "asyncpg/pgproto/codecs/numeric.pyx":110 * # Pad decimal digits to provide room for correct Postgres * # digit alignment in the digit computation loop. * pydigits = (0,) * DEC_DIGITS + pydigits + (0,) * DEC_DIGITS # <<<<<<<<<<<<<< * * if exponent < 0: */ __pyx_t_1 = PyNumber_Add(__pyx_tuple__20, __pyx_v_pydigits); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_tuple__20); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_pydigits, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":112 * pydigits = (0,) * DEC_DIGITS + pydigits + (0,) * DEC_DIGITS * * if exponent < 0: # <<<<<<<<<<<<<< * if -exponent > MAX_DSCALE: * raise ValueError( */ __pyx_t_2 = (__pyx_v_exponent < 0); if (__pyx_t_2) { /* "asyncpg/pgproto/codecs/numeric.pyx":113 * * if exponent < 0: * if -exponent > MAX_DSCALE: # <<<<<<<<<<<<<< * raise ValueError( * 'cannot encode Decimal value into numeric: ' */ __pyx_t_2 = ((-__pyx_v_exponent) > 0x3FFF); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/codecs/numeric.pyx":114 * if exponent < 0: * if -exponent > MAX_DSCALE: * raise ValueError( # <<<<<<<<<<<<<< * 'cannot encode Decimal value into numeric: ' * 'exponent is too small') */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(18, 114, __pyx_L1_error) /* "asyncpg/pgproto/codecs/numeric.pyx":113 * * if exponent < 0: * if -exponent > MAX_DSCALE: # <<<<<<<<<<<<<< * raise ValueError( * 'cannot encode Decimal value into numeric: ' */ } /* "asyncpg/pgproto/codecs/numeric.pyx":117 * 'cannot encode Decimal value into numeric: ' * 'exponent is too small') * dscale = -exponent # <<<<<<<<<<<<<< * else: * dscale = 0 */ __pyx_v_dscale = ((int16_t)(-__pyx_v_exponent)); /* "asyncpg/pgproto/codecs/numeric.pyx":112 * pydigits = (0,) * DEC_DIGITS + pydigits + (0,) * DEC_DIGITS * * if exponent < 0: # <<<<<<<<<<<<<< * if -exponent > MAX_DSCALE: * raise ValueError( */ goto __pyx_L15; } /* "asyncpg/pgproto/codecs/numeric.pyx":119 * dscale = -exponent * else: * dscale = 0 # <<<<<<<<<<<<<< * * buf.write_int32(2 + 2 + 2 + 2 + 2 * num_pgdigits) */ /*else*/ { __pyx_v_dscale = 0; } __pyx_L15:; } __pyx_L4:; /* "asyncpg/pgproto/codecs/numeric.pyx":121 * dscale = 0 * * buf.write_int32(2 + 2 + 2 + 2 + 2 * num_pgdigits) # <<<<<<<<<<<<<< * buf.write_int16(num_pgdigits) * buf.write_int16(weight) */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, (0x8 + (2 * ((uint16_t)__pyx_v_num_pgdigits)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":122 * * buf.write_int32(2 + 2 + 2 + 2 + 2 * num_pgdigits) * buf.write_int16(num_pgdigits) # <<<<<<<<<<<<<< * buf.write_int16(weight) * buf.write_int16(sign) */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int16(__pyx_v_buf, ((int16_t)__pyx_v_num_pgdigits)); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":123 * buf.write_int32(2 + 2 + 2 + 2 + 2 * num_pgdigits) * buf.write_int16(num_pgdigits) * buf.write_int16(weight) # <<<<<<<<<<<<<< * buf.write_int16(sign) * buf.write_int16(dscale) */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int16(__pyx_v_buf, ((int16_t)__pyx_v_weight)); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":124 * buf.write_int16(num_pgdigits) * buf.write_int16(weight) * buf.write_int16(sign) # <<<<<<<<<<<<<< * buf.write_int16(dscale) * */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int16(__pyx_v_buf, ((int16_t)__pyx_v_sign)); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":125 * buf.write_int16(weight) * buf.write_int16(sign) * buf.write_int16(dscale) # <<<<<<<<<<<<<< * * j = DEC_DIGITS - padding_size */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int16(__pyx_v_buf, __pyx_v_dscale); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":127 * buf.write_int16(dscale) * * j = DEC_DIGITS - padding_size # <<<<<<<<<<<<<< * * for i in range(num_pgdigits): */ __pyx_v_j = (4 - __pyx_v_padding_size); /* "asyncpg/pgproto/codecs/numeric.pyx":129 * j = DEC_DIGITS - padding_size * * for i in range(num_pgdigits): # <<<<<<<<<<<<<< * pgdigit = (pydigits[j] * 1000 + pydigits[j + 1] * 100 + * pydigits[j + 2] * 10 + pydigits[j + 3]) */ __pyx_t_7 = __pyx_v_num_pgdigits; __pyx_t_9 = __pyx_t_7; for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; /* "asyncpg/pgproto/codecs/numeric.pyx":130 * * for i in range(num_pgdigits): * pgdigit = (pydigits[j] * 1000 + pydigits[j + 1] * 100 + # <<<<<<<<<<<<<< * pydigits[j + 2] * 10 + pydigits[j + 3]) * j += DEC_DIGITS */ if (unlikely(!__pyx_v_pydigits)) { __Pyx_RaiseUnboundLocalError("pydigits"); __PYX_ERR(18, 130, __pyx_L1_error) } __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_pydigits, __pyx_v_j, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyInt_MultiplyObjC(__pyx_t_3, __pyx_int_1000, 0x3E8, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_v_pydigits)) { __Pyx_RaiseUnboundLocalError("pydigits"); __PYX_ERR(18, 130, __pyx_L1_error) } __pyx_t_11 = (__pyx_v_j + 1); __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_pydigits, __pyx_t_11, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_MultiplyObjC(__pyx_t_3, __pyx_int_100, 0x64, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":131 * for i in range(num_pgdigits): * pgdigit = (pydigits[j] * 1000 + pydigits[j + 1] * 100 + * pydigits[j + 2] * 10 + pydigits[j + 3]) # <<<<<<<<<<<<<< * j += DEC_DIGITS * buf.write_int16(pgdigit) */ if (unlikely(!__pyx_v_pydigits)) { __Pyx_RaiseUnboundLocalError("pydigits"); __PYX_ERR(18, 131, __pyx_L1_error) } __pyx_t_11 = (__pyx_v_j + 2); __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_pydigits, __pyx_t_11, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyInt_MultiplyObjC(__pyx_t_4, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":130 * * for i in range(num_pgdigits): * pgdigit = (pydigits[j] * 1000 + pydigits[j + 1] * 100 + # <<<<<<<<<<<<<< * pydigits[j + 2] * 10 + pydigits[j + 3]) * j += DEC_DIGITS */ __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":131 * for i in range(num_pgdigits): * pgdigit = (pydigits[j] * 1000 + pydigits[j + 1] * 100 + * pydigits[j + 2] * 10 + pydigits[j + 3]) # <<<<<<<<<<<<<< * j += DEC_DIGITS * buf.write_int16(pgdigit) */ if (unlikely(!__pyx_v_pydigits)) { __Pyx_RaiseUnboundLocalError("pydigits"); __PYX_ERR(18, 131, __pyx_L1_error) } __pyx_t_11 = (__pyx_v_j + 3); __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_pydigits, __pyx_t_11, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_12 = __Pyx_PyInt_As_int16_t(__pyx_t_3); if (unlikely((__pyx_t_12 == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(18, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_pgdigit = __pyx_t_12; /* "asyncpg/pgproto/codecs/numeric.pyx":132 * pgdigit = (pydigits[j] * 1000 + pydigits[j + 1] * 100 + * pydigits[j + 2] * 10 + pydigits[j + 3]) * j += DEC_DIGITS # <<<<<<<<<<<<<< * buf.write_int16(pgdigit) * */ __pyx_v_j = (__pyx_v_j + 4); /* "asyncpg/pgproto/codecs/numeric.pyx":133 * pydigits[j + 2] * 10 + pydigits[j + 3]) * j += DEC_DIGITS * buf.write_int16(pgdigit) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int16(__pyx_v_buf, __pyx_v_pgdigit); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "asyncpg/pgproto/codecs/numeric.pyx":33 * * * cdef numeric_encode_binary(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * object dec */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.numeric_encode_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dec); __Pyx_XDECREF(__pyx_v_dt); __Pyx_XDECREF(__pyx_v_pydigits); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/numeric.pyx":141 * # than the simple text decoder above. That said, we need the binary * # decoder to support binary COPY with numeric values. * cdef numeric_decode_binary_ex( # <<<<<<<<<<<<<< * CodecContext settings, * FRBuffer *buf, */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_binary_ex(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf, int __pyx_v_trail_fract_zero) { uint16_t __pyx_v_num_pgdigits; int16_t __pyx_v_weight; uint16_t __pyx_v_sign; uint16_t __pyx_v_dscale; int16_t __pyx_v_pgdigit0; Py_ssize_t __pyx_v_i; int16_t __pyx_v_pgdigit; PyObject *__pyx_v_pydigits = 0; Py_ssize_t __pyx_v_num_pydigits; Py_ssize_t __pyx_v_actual_num_pydigits; Py_ssize_t __pyx_v_buf_size; int64_t __pyx_v_exponent; int64_t __pyx_v_abs_exponent; Py_ssize_t __pyx_v_exponent_chars; Py_ssize_t __pyx_v_front_padding; Py_ssize_t __pyx_v_num_fract_digits; Py_ssize_t __pyx_v_trailing_fract_zeros_adj; char __pyx_v_smallbuf[0x100]; char *__pyx_v_charbuf; char *__pyx_v_bufptr; int __pyx_v_buf_allocated; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int64_t __pyx_t_8; char *__pyx_t_9; uint16_t __pyx_t_10; uint16_t __pyx_t_11; Py_ssize_t __pyx_t_12; Py_ssize_t __pyx_t_13; Py_ssize_t __pyx_t_14; int __pyx_t_15; int __pyx_t_16; char const *__pyx_t_17; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("numeric_decode_binary_ex", 1); /* "asyncpg/pgproto/codecs/numeric.pyx":147 * ): * cdef: * uint16_t num_pgdigits = hton.unpack_int16(frb_read(buf, 2)) # <<<<<<<<<<<<<< * int16_t weight = hton.unpack_int16(frb_read(buf, 2)) * uint16_t sign = hton.unpack_int16(frb_read(buf, 2)) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(18, 147, __pyx_L1_error) __pyx_v_num_pgdigits = ((uint16_t)unpack_int16(__pyx_t_1)); /* "asyncpg/pgproto/codecs/numeric.pyx":148 * cdef: * uint16_t num_pgdigits = hton.unpack_int16(frb_read(buf, 2)) * int16_t weight = hton.unpack_int16(frb_read(buf, 2)) # <<<<<<<<<<<<<< * uint16_t sign = hton.unpack_int16(frb_read(buf, 2)) * uint16_t dscale = hton.unpack_int16(frb_read(buf, 2)) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(18, 148, __pyx_L1_error) __pyx_v_weight = unpack_int16(__pyx_t_1); /* "asyncpg/pgproto/codecs/numeric.pyx":149 * uint16_t num_pgdigits = hton.unpack_int16(frb_read(buf, 2)) * int16_t weight = hton.unpack_int16(frb_read(buf, 2)) * uint16_t sign = hton.unpack_int16(frb_read(buf, 2)) # <<<<<<<<<<<<<< * uint16_t dscale = hton.unpack_int16(frb_read(buf, 2)) * int16_t pgdigit0 */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(18, 149, __pyx_L1_error) __pyx_v_sign = ((uint16_t)unpack_int16(__pyx_t_1)); /* "asyncpg/pgproto/codecs/numeric.pyx":150 * int16_t weight = hton.unpack_int16(frb_read(buf, 2)) * uint16_t sign = hton.unpack_int16(frb_read(buf, 2)) * uint16_t dscale = hton.unpack_int16(frb_read(buf, 2)) # <<<<<<<<<<<<<< * int16_t pgdigit0 * ssize_t i */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(18, 150, __pyx_L1_error) __pyx_v_dscale = ((uint16_t)unpack_int16(__pyx_t_1)); /* "asyncpg/pgproto/codecs/numeric.pyx":161 * int64_t abs_exponent * ssize_t exponent_chars * ssize_t front_padding = 0 # <<<<<<<<<<<<<< * ssize_t num_fract_digits * ssize_t trailing_fract_zeros_adj */ __pyx_v_front_padding = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":167 * char *charbuf * char *bufptr * bint buf_allocated = False # <<<<<<<<<<<<<< * * if sign == NUMERIC_NAN: */ __pyx_v_buf_allocated = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":169 * bint buf_allocated = False * * if sign == NUMERIC_NAN: # <<<<<<<<<<<<<< * # Not-a-number * return _Dec('NaN') */ switch (__pyx_v_sign) { case 0xC000: /* "asyncpg/pgproto/codecs/numeric.pyx":171 * if sign == NUMERIC_NAN: * # Not-a-number * return _Dec('NaN') # <<<<<<<<<<<<<< * elif sign == NUMERIC_PINF: * # +Infinity */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Dec); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_n_u_NaN}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/numeric.pyx":169 * bint buf_allocated = False * * if sign == NUMERIC_NAN: # <<<<<<<<<<<<<< * # Not-a-number * return _Dec('NaN') */ break; case 0xD000: /* "asyncpg/pgproto/codecs/numeric.pyx":174 * elif sign == NUMERIC_PINF: * # +Infinity * return _Dec('Infinity') # <<<<<<<<<<<<<< * elif sign == NUMERIC_NINF: * # -Infinity */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Dec); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_n_u_Infinity}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/numeric.pyx":172 * # Not-a-number * return _Dec('NaN') * elif sign == NUMERIC_PINF: # <<<<<<<<<<<<<< * # +Infinity * return _Dec('Infinity') */ break; case 0xF000: /* "asyncpg/pgproto/codecs/numeric.pyx":177 * elif sign == NUMERIC_NINF: * # -Infinity * return _Dec('-Infinity') # <<<<<<<<<<<<<< * * if num_pgdigits == 0: */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Dec); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_Infinity_2}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/numeric.pyx":175 * # +Infinity * return _Dec('Infinity') * elif sign == NUMERIC_NINF: # <<<<<<<<<<<<<< * # -Infinity * return _Dec('-Infinity') */ break; default: break; } /* "asyncpg/pgproto/codecs/numeric.pyx":179 * return _Dec('-Infinity') * * if num_pgdigits == 0: # <<<<<<<<<<<<<< * # Zero * return _Dec('0e-' + str(dscale)) */ __pyx_t_6 = (__pyx_v_num_pgdigits == 0); if (__pyx_t_6) { /* "asyncpg/pgproto/codecs/numeric.pyx":181 * if num_pgdigits == 0: * # Zero * return _Dec('0e-' + str(dscale)) # <<<<<<<<<<<<<< * * pgdigit0 = hton.unpack_int16(frb_read(buf, 2)) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Dec); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_uint16_t(__pyx_v_dscale); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyObject_Unicode(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_0e, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/numeric.pyx":179 * return _Dec('-Infinity') * * if num_pgdigits == 0: # <<<<<<<<<<<<<< * # Zero * return _Dec('0e-' + str(dscale)) */ } /* "asyncpg/pgproto/codecs/numeric.pyx":183 * return _Dec('0e-' + str(dscale)) * * pgdigit0 = hton.unpack_int16(frb_read(buf, 2)) # <<<<<<<<<<<<<< * if weight >= 0: * if pgdigit0 < 10: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(18, 183, __pyx_L1_error) __pyx_v_pgdigit0 = unpack_int16(__pyx_t_1); /* "asyncpg/pgproto/codecs/numeric.pyx":184 * * pgdigit0 = hton.unpack_int16(frb_read(buf, 2)) * if weight >= 0: # <<<<<<<<<<<<<< * if pgdigit0 < 10: * front_padding = 3 */ __pyx_t_6 = (__pyx_v_weight >= 0); if (__pyx_t_6) { /* "asyncpg/pgproto/codecs/numeric.pyx":185 * pgdigit0 = hton.unpack_int16(frb_read(buf, 2)) * if weight >= 0: * if pgdigit0 < 10: # <<<<<<<<<<<<<< * front_padding = 3 * elif pgdigit0 < 100: */ __pyx_t_6 = (__pyx_v_pgdigit0 < 10); if (__pyx_t_6) { /* "asyncpg/pgproto/codecs/numeric.pyx":186 * if weight >= 0: * if pgdigit0 < 10: * front_padding = 3 # <<<<<<<<<<<<<< * elif pgdigit0 < 100: * front_padding = 2 */ __pyx_v_front_padding = 3; /* "asyncpg/pgproto/codecs/numeric.pyx":185 * pgdigit0 = hton.unpack_int16(frb_read(buf, 2)) * if weight >= 0: * if pgdigit0 < 10: # <<<<<<<<<<<<<< * front_padding = 3 * elif pgdigit0 < 100: */ goto __pyx_L5; } /* "asyncpg/pgproto/codecs/numeric.pyx":187 * if pgdigit0 < 10: * front_padding = 3 * elif pgdigit0 < 100: # <<<<<<<<<<<<<< * front_padding = 2 * elif pgdigit0 < 1000: */ __pyx_t_6 = (__pyx_v_pgdigit0 < 0x64); if (__pyx_t_6) { /* "asyncpg/pgproto/codecs/numeric.pyx":188 * front_padding = 3 * elif pgdigit0 < 100: * front_padding = 2 # <<<<<<<<<<<<<< * elif pgdigit0 < 1000: * front_padding = 1 */ __pyx_v_front_padding = 2; /* "asyncpg/pgproto/codecs/numeric.pyx":187 * if pgdigit0 < 10: * front_padding = 3 * elif pgdigit0 < 100: # <<<<<<<<<<<<<< * front_padding = 2 * elif pgdigit0 < 1000: */ goto __pyx_L5; } /* "asyncpg/pgproto/codecs/numeric.pyx":189 * elif pgdigit0 < 100: * front_padding = 2 * elif pgdigit0 < 1000: # <<<<<<<<<<<<<< * front_padding = 1 * */ __pyx_t_6 = (__pyx_v_pgdigit0 < 0x3E8); if (__pyx_t_6) { /* "asyncpg/pgproto/codecs/numeric.pyx":190 * front_padding = 2 * elif pgdigit0 < 1000: * front_padding = 1 # <<<<<<<<<<<<<< * * # The number of fractional decimal digits actually encoded in */ __pyx_v_front_padding = 1; /* "asyncpg/pgproto/codecs/numeric.pyx":189 * elif pgdigit0 < 100: * front_padding = 2 * elif pgdigit0 < 1000: # <<<<<<<<<<<<<< * front_padding = 1 * */ } __pyx_L5:; /* "asyncpg/pgproto/codecs/numeric.pyx":184 * * pgdigit0 = hton.unpack_int16(frb_read(buf, 2)) * if weight >= 0: # <<<<<<<<<<<<<< * if pgdigit0 < 10: * front_padding = 3 */ } /* "asyncpg/pgproto/codecs/numeric.pyx":194 * # The number of fractional decimal digits actually encoded in * # base-DEC_DEIGITS digits sent by Postgres. * num_fract_digits = (num_pgdigits - weight - 1) * DEC_DIGITS # <<<<<<<<<<<<<< * * # The trailing zero adjustment necessary to obtain exactly */ __pyx_v_num_fract_digits = (((__pyx_v_num_pgdigits - __pyx_v_weight) - 1) * 4); /* "asyncpg/pgproto/codecs/numeric.pyx":200 * # which indicates that trailing zeros in the last input digit * # should be discarded. * trailing_fract_zeros_adj = dscale - num_fract_digits # <<<<<<<<<<<<<< * * # Maximum possible number of decimal digits in base 10. */ __pyx_v_trailing_fract_zeros_adj = (__pyx_v_dscale - __pyx_v_num_fract_digits); /* "asyncpg/pgproto/codecs/numeric.pyx":205 * # The actual number might be up to 3 digits smaller due to * # leading zeros in first input digit. * num_pydigits = num_pgdigits * DEC_DIGITS # <<<<<<<<<<<<<< * if trailing_fract_zeros_adj > 0: * num_pydigits += trailing_fract_zeros_adj */ __pyx_v_num_pydigits = (__pyx_v_num_pgdigits * 4); /* "asyncpg/pgproto/codecs/numeric.pyx":206 * # leading zeros in first input digit. * num_pydigits = num_pgdigits * DEC_DIGITS * if trailing_fract_zeros_adj > 0: # <<<<<<<<<<<<<< * num_pydigits += trailing_fract_zeros_adj * */ __pyx_t_6 = (__pyx_v_trailing_fract_zeros_adj > 0); if (__pyx_t_6) { /* "asyncpg/pgproto/codecs/numeric.pyx":207 * num_pydigits = num_pgdigits * DEC_DIGITS * if trailing_fract_zeros_adj > 0: * num_pydigits += trailing_fract_zeros_adj # <<<<<<<<<<<<<< * * # Exponent. */ __pyx_v_num_pydigits = (__pyx_v_num_pydigits + __pyx_v_trailing_fract_zeros_adj); /* "asyncpg/pgproto/codecs/numeric.pyx":206 * # leading zeros in first input digit. * num_pydigits = num_pgdigits * DEC_DIGITS * if trailing_fract_zeros_adj > 0: # <<<<<<<<<<<<<< * num_pydigits += trailing_fract_zeros_adj * */ } /* "asyncpg/pgproto/codecs/numeric.pyx":210 * * # Exponent. * exponent = (weight + 1) * DEC_DIGITS - front_padding # <<<<<<<<<<<<<< * abs_exponent = abs(exponent) * if abs_exponent != 0: */ __pyx_v_exponent = (((__pyx_v_weight + 1) * 4) - __pyx_v_front_padding); /* "asyncpg/pgproto/codecs/numeric.pyx":211 * # Exponent. * exponent = (weight + 1) * DEC_DIGITS - front_padding * abs_exponent = abs(exponent) # <<<<<<<<<<<<<< * if abs_exponent != 0: * # Number of characters required to render absolute exponent value */ __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_exponent); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(18, 211, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_abs_exponent = __pyx_t_8; /* "asyncpg/pgproto/codecs/numeric.pyx":212 * exponent = (weight + 1) * DEC_DIGITS - front_padding * abs_exponent = abs(exponent) * if abs_exponent != 0: # <<<<<<<<<<<<<< * # Number of characters required to render absolute exponent value * # in decimal. */ __pyx_t_6 = (__pyx_v_abs_exponent != 0); if (__pyx_t_6) { /* "asyncpg/pgproto/codecs/numeric.pyx":215 * # Number of characters required to render absolute exponent value * # in decimal. * exponent_chars = log10(abs_exponent) + 1 # <<<<<<<<<<<<<< * else: * exponent_chars = 0 */ __pyx_v_exponent_chars = (((Py_ssize_t)log10(((double)__pyx_v_abs_exponent))) + 1); /* "asyncpg/pgproto/codecs/numeric.pyx":212 * exponent = (weight + 1) * DEC_DIGITS - front_padding * abs_exponent = abs(exponent) * if abs_exponent != 0: # <<<<<<<<<<<<<< * # Number of characters required to render absolute exponent value * # in decimal. */ goto __pyx_L7; } /* "asyncpg/pgproto/codecs/numeric.pyx":217 * exponent_chars = log10(abs_exponent) + 1 * else: * exponent_chars = 0 # <<<<<<<<<<<<<< * * # Output buffer size. */ /*else*/ { __pyx_v_exponent_chars = 0; } __pyx_L7:; /* "asyncpg/pgproto/codecs/numeric.pyx":227 * 1 + # possible trailing zero padding * 2 + # exponent indicator (E-,E+) * exponent_chars + # exponent # <<<<<<<<<<<<<< * 1 # null terminator char * ) */ __pyx_v_buf_size = (((((0x3 + __pyx_v_num_pydigits) + 1) + 2) + __pyx_v_exponent_chars) + 1); /* "asyncpg/pgproto/codecs/numeric.pyx":231 * ) * * if buf_size > _NUMERIC_DECODER_SMALLBUF_SIZE: # <<<<<<<<<<<<<< * charbuf = cpython.PyMem_Malloc(buf_size) * buf_allocated = True */ __pyx_t_6 = (__pyx_v_buf_size > 0x100); if (__pyx_t_6) { /* "asyncpg/pgproto/codecs/numeric.pyx":232 * * if buf_size > _NUMERIC_DECODER_SMALLBUF_SIZE: * charbuf = cpython.PyMem_Malloc(buf_size) # <<<<<<<<<<<<<< * buf_allocated = True * else: */ __pyx_v_charbuf = ((char *)PyMem_Malloc(((size_t)__pyx_v_buf_size))); /* "asyncpg/pgproto/codecs/numeric.pyx":233 * if buf_size > _NUMERIC_DECODER_SMALLBUF_SIZE: * charbuf = cpython.PyMem_Malloc(buf_size) * buf_allocated = True # <<<<<<<<<<<<<< * else: * charbuf = smallbuf */ __pyx_v_buf_allocated = 1; /* "asyncpg/pgproto/codecs/numeric.pyx":231 * ) * * if buf_size > _NUMERIC_DECODER_SMALLBUF_SIZE: # <<<<<<<<<<<<<< * charbuf = cpython.PyMem_Malloc(buf_size) * buf_allocated = True */ goto __pyx_L8; } /* "asyncpg/pgproto/codecs/numeric.pyx":235 * buf_allocated = True * else: * charbuf = smallbuf # <<<<<<<<<<<<<< * * try: */ /*else*/ { __pyx_v_charbuf = __pyx_v_smallbuf; } __pyx_L8:; /* "asyncpg/pgproto/codecs/numeric.pyx":237 * charbuf = smallbuf * * try: # <<<<<<<<<<<<<< * bufptr = charbuf * */ /*try:*/ { /* "asyncpg/pgproto/codecs/numeric.pyx":238 * * try: * bufptr = charbuf # <<<<<<<<<<<<<< * * if sign == NUMERIC_NEG: */ __pyx_v_bufptr = __pyx_v_charbuf; /* "asyncpg/pgproto/codecs/numeric.pyx":240 * bufptr = charbuf * * if sign == NUMERIC_NEG: # <<<<<<<<<<<<<< * bufptr[0] = b'-' * bufptr += 1 */ __pyx_t_6 = (__pyx_v_sign == 0x4000); if (__pyx_t_6) { /* "asyncpg/pgproto/codecs/numeric.pyx":241 * * if sign == NUMERIC_NEG: * bufptr[0] = b'-' # <<<<<<<<<<<<<< * bufptr += 1 * */ (__pyx_v_bufptr[0]) = '-'; /* "asyncpg/pgproto/codecs/numeric.pyx":242 * if sign == NUMERIC_NEG: * bufptr[0] = b'-' * bufptr += 1 # <<<<<<<<<<<<<< * * bufptr[0] = b'0' */ __pyx_v_bufptr = (__pyx_v_bufptr + 1); /* "asyncpg/pgproto/codecs/numeric.pyx":240 * bufptr = charbuf * * if sign == NUMERIC_NEG: # <<<<<<<<<<<<<< * bufptr[0] = b'-' * bufptr += 1 */ } /* "asyncpg/pgproto/codecs/numeric.pyx":244 * bufptr += 1 * * bufptr[0] = b'0' # <<<<<<<<<<<<<< * bufptr[1] = b'.' * bufptr += 2 */ (__pyx_v_bufptr[0]) = '0'; /* "asyncpg/pgproto/codecs/numeric.pyx":245 * * bufptr[0] = b'0' * bufptr[1] = b'.' # <<<<<<<<<<<<<< * bufptr += 2 * */ (__pyx_v_bufptr[1]) = '.'; /* "asyncpg/pgproto/codecs/numeric.pyx":246 * bufptr[0] = b'0' * bufptr[1] = b'.' * bufptr += 2 # <<<<<<<<<<<<<< * * if weight >= 0: */ __pyx_v_bufptr = (__pyx_v_bufptr + 2); /* "asyncpg/pgproto/codecs/numeric.pyx":248 * bufptr += 2 * * if weight >= 0: # <<<<<<<<<<<<<< * bufptr = _unpack_digit_stripping_lzeros(bufptr, pgdigit0) * else: */ __pyx_t_6 = (__pyx_v_weight >= 0); if (__pyx_t_6) { /* "asyncpg/pgproto/codecs/numeric.pyx":249 * * if weight >= 0: * bufptr = _unpack_digit_stripping_lzeros(bufptr, pgdigit0) # <<<<<<<<<<<<<< * else: * bufptr = _unpack_digit(bufptr, pgdigit0) */ __pyx_t_9 = __pyx_f_7asyncpg_7pgproto_7pgproto__unpack_digit_stripping_lzeros(__pyx_v_bufptr, __pyx_v_pgdigit0); if (unlikely(__pyx_t_9 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(18, 249, __pyx_L10_error) __pyx_v_bufptr = __pyx_t_9; /* "asyncpg/pgproto/codecs/numeric.pyx":248 * bufptr += 2 * * if weight >= 0: # <<<<<<<<<<<<<< * bufptr = _unpack_digit_stripping_lzeros(bufptr, pgdigit0) * else: */ goto __pyx_L13; } /* "asyncpg/pgproto/codecs/numeric.pyx":251 * bufptr = _unpack_digit_stripping_lzeros(bufptr, pgdigit0) * else: * bufptr = _unpack_digit(bufptr, pgdigit0) # <<<<<<<<<<<<<< * * for i in range(1, num_pgdigits): */ /*else*/ { __pyx_t_9 = __pyx_f_7asyncpg_7pgproto_7pgproto__unpack_digit(__pyx_v_bufptr, __pyx_v_pgdigit0); if (unlikely(__pyx_t_9 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(18, 251, __pyx_L10_error) __pyx_v_bufptr = __pyx_t_9; } __pyx_L13:; /* "asyncpg/pgproto/codecs/numeric.pyx":253 * bufptr = _unpack_digit(bufptr, pgdigit0) * * for i in range(1, num_pgdigits): # <<<<<<<<<<<<<< * pgdigit = hton.unpack_int16(frb_read(buf, 2)) * bufptr = _unpack_digit(bufptr, pgdigit) */ __pyx_t_10 = __pyx_v_num_pgdigits; __pyx_t_11 = __pyx_t_10; for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; /* "asyncpg/pgproto/codecs/numeric.pyx":254 * * for i in range(1, num_pgdigits): * pgdigit = hton.unpack_int16(frb_read(buf, 2)) # <<<<<<<<<<<<<< * bufptr = _unpack_digit(bufptr, pgdigit) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(18, 254, __pyx_L10_error) __pyx_v_pgdigit = unpack_int16(__pyx_t_1); /* "asyncpg/pgproto/codecs/numeric.pyx":255 * for i in range(1, num_pgdigits): * pgdigit = hton.unpack_int16(frb_read(buf, 2)) * bufptr = _unpack_digit(bufptr, pgdigit) # <<<<<<<<<<<<<< * * if dscale: */ __pyx_t_9 = __pyx_f_7asyncpg_7pgproto_7pgproto__unpack_digit(__pyx_v_bufptr, __pyx_v_pgdigit); if (unlikely(__pyx_t_9 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(18, 255, __pyx_L10_error) __pyx_v_bufptr = __pyx_t_9; } /* "asyncpg/pgproto/codecs/numeric.pyx":257 * bufptr = _unpack_digit(bufptr, pgdigit) * * if dscale: # <<<<<<<<<<<<<< * if trailing_fract_zeros_adj > 0: * for i in range(trailing_fract_zeros_adj): */ __pyx_t_6 = (__pyx_v_dscale != 0); if (__pyx_t_6) { /* "asyncpg/pgproto/codecs/numeric.pyx":258 * * if dscale: * if trailing_fract_zeros_adj > 0: # <<<<<<<<<<<<<< * for i in range(trailing_fract_zeros_adj): * bufptr[i] = b'0' */ __pyx_t_6 = (__pyx_v_trailing_fract_zeros_adj > 0); if (__pyx_t_6) { /* "asyncpg/pgproto/codecs/numeric.pyx":259 * if dscale: * if trailing_fract_zeros_adj > 0: * for i in range(trailing_fract_zeros_adj): # <<<<<<<<<<<<<< * bufptr[i] = b'0' * */ __pyx_t_12 = __pyx_v_trailing_fract_zeros_adj; __pyx_t_13 = __pyx_t_12; for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_i = __pyx_t_14; /* "asyncpg/pgproto/codecs/numeric.pyx":260 * if trailing_fract_zeros_adj > 0: * for i in range(trailing_fract_zeros_adj): * bufptr[i] = b'0' # <<<<<<<<<<<<<< * * # If display scale is _less_ than the number of rendered digits, */ (__pyx_v_bufptr[__pyx_v_i]) = ((char)'0'); } /* "asyncpg/pgproto/codecs/numeric.pyx":258 * * if dscale: * if trailing_fract_zeros_adj > 0: # <<<<<<<<<<<<<< * for i in range(trailing_fract_zeros_adj): * bufptr[i] = b'0' */ } /* "asyncpg/pgproto/codecs/numeric.pyx":265 * # trailing_fract_zeros_adj will be negative and this will strip * # the excess trailing zeros. * bufptr += trailing_fract_zeros_adj # <<<<<<<<<<<<<< * * if trail_fract_zero: */ __pyx_v_bufptr = (__pyx_v_bufptr + __pyx_v_trailing_fract_zeros_adj); /* "asyncpg/pgproto/codecs/numeric.pyx":257 * bufptr = _unpack_digit(bufptr, pgdigit) * * if dscale: # <<<<<<<<<<<<<< * if trailing_fract_zeros_adj > 0: * for i in range(trailing_fract_zeros_adj): */ } /* "asyncpg/pgproto/codecs/numeric.pyx":267 * bufptr += trailing_fract_zeros_adj * * if trail_fract_zero: # <<<<<<<<<<<<<< * # Check if the number of rendered digits matches the exponent, * # and if so, add another trailing zero, so the result always */ if (__pyx_v_trail_fract_zero) { /* "asyncpg/pgproto/codecs/numeric.pyx":271 * # and if so, add another trailing zero, so the result always * # appears with a decimal point. * actual_num_pydigits = bufptr - charbuf - 2 # <<<<<<<<<<<<<< * if sign == NUMERIC_NEG: * actual_num_pydigits -= 1 */ __pyx_v_actual_num_pydigits = ((__pyx_v_bufptr - __pyx_v_charbuf) - 2); /* "asyncpg/pgproto/codecs/numeric.pyx":272 * # appears with a decimal point. * actual_num_pydigits = bufptr - charbuf - 2 * if sign == NUMERIC_NEG: # <<<<<<<<<<<<<< * actual_num_pydigits -= 1 * */ __pyx_t_6 = (__pyx_v_sign == 0x4000); if (__pyx_t_6) { /* "asyncpg/pgproto/codecs/numeric.pyx":273 * actual_num_pydigits = bufptr - charbuf - 2 * if sign == NUMERIC_NEG: * actual_num_pydigits -= 1 # <<<<<<<<<<<<<< * * if actual_num_pydigits == abs_exponent: */ __pyx_v_actual_num_pydigits = (__pyx_v_actual_num_pydigits - 1); /* "asyncpg/pgproto/codecs/numeric.pyx":272 * # appears with a decimal point. * actual_num_pydigits = bufptr - charbuf - 2 * if sign == NUMERIC_NEG: # <<<<<<<<<<<<<< * actual_num_pydigits -= 1 * */ } /* "asyncpg/pgproto/codecs/numeric.pyx":275 * actual_num_pydigits -= 1 * * if actual_num_pydigits == abs_exponent: # <<<<<<<<<<<<<< * bufptr[0] = b'0' * bufptr += 1 */ __pyx_t_6 = (__pyx_v_actual_num_pydigits == __pyx_v_abs_exponent); if (__pyx_t_6) { /* "asyncpg/pgproto/codecs/numeric.pyx":276 * * if actual_num_pydigits == abs_exponent: * bufptr[0] = b'0' # <<<<<<<<<<<<<< * bufptr += 1 * */ (__pyx_v_bufptr[0]) = ((char)'0'); /* "asyncpg/pgproto/codecs/numeric.pyx":277 * if actual_num_pydigits == abs_exponent: * bufptr[0] = b'0' * bufptr += 1 # <<<<<<<<<<<<<< * * if exponent != 0: */ __pyx_v_bufptr = (__pyx_v_bufptr + 1); /* "asyncpg/pgproto/codecs/numeric.pyx":275 * actual_num_pydigits -= 1 * * if actual_num_pydigits == abs_exponent: # <<<<<<<<<<<<<< * bufptr[0] = b'0' * bufptr += 1 */ } /* "asyncpg/pgproto/codecs/numeric.pyx":267 * bufptr += trailing_fract_zeros_adj * * if trail_fract_zero: # <<<<<<<<<<<<<< * # Check if the number of rendered digits matches the exponent, * # and if so, add another trailing zero, so the result always */ } /* "asyncpg/pgproto/codecs/numeric.pyx":279 * bufptr += 1 * * if exponent != 0: # <<<<<<<<<<<<<< * bufptr[0] = b'E' * if exponent < 0: */ __pyx_t_6 = (__pyx_v_exponent != 0); if (__pyx_t_6) { /* "asyncpg/pgproto/codecs/numeric.pyx":280 * * if exponent != 0: * bufptr[0] = b'E' # <<<<<<<<<<<<<< * if exponent < 0: * bufptr[1] = b'-' */ (__pyx_v_bufptr[0]) = 'E'; /* "asyncpg/pgproto/codecs/numeric.pyx":281 * if exponent != 0: * bufptr[0] = b'E' * if exponent < 0: # <<<<<<<<<<<<<< * bufptr[1] = b'-' * else: */ __pyx_t_6 = (__pyx_v_exponent < 0); if (__pyx_t_6) { /* "asyncpg/pgproto/codecs/numeric.pyx":282 * bufptr[0] = b'E' * if exponent < 0: * bufptr[1] = b'-' # <<<<<<<<<<<<<< * else: * bufptr[1] = b'+' */ (__pyx_v_bufptr[1]) = '-'; /* "asyncpg/pgproto/codecs/numeric.pyx":281 * if exponent != 0: * bufptr[0] = b'E' * if exponent < 0: # <<<<<<<<<<<<<< * bufptr[1] = b'-' * else: */ goto __pyx_L24; } /* "asyncpg/pgproto/codecs/numeric.pyx":284 * bufptr[1] = b'-' * else: * bufptr[1] = b'+' # <<<<<<<<<<<<<< * bufptr += 2 * snprintf(bufptr, exponent_chars + 1, '%d', */ /*else*/ { (__pyx_v_bufptr[1]) = '+'; } __pyx_L24:; /* "asyncpg/pgproto/codecs/numeric.pyx":285 * else: * bufptr[1] = b'+' * bufptr += 2 # <<<<<<<<<<<<<< * snprintf(bufptr, exponent_chars + 1, '%d', * abs_exponent) */ __pyx_v_bufptr = (__pyx_v_bufptr + 2); /* "asyncpg/pgproto/codecs/numeric.pyx":286 * bufptr[1] = b'+' * bufptr += 2 * snprintf(bufptr, exponent_chars + 1, '%d', # <<<<<<<<<<<<<< * abs_exponent) * bufptr += exponent_chars */ (void)(snprintf(__pyx_v_bufptr, (((size_t)__pyx_v_exponent_chars) + 1), ((char const *)"%d"), ((int)__pyx_v_abs_exponent))); /* "asyncpg/pgproto/codecs/numeric.pyx":288 * snprintf(bufptr, exponent_chars + 1, '%d', * abs_exponent) * bufptr += exponent_chars # <<<<<<<<<<<<<< * * bufptr[0] = 0 */ __pyx_v_bufptr = (__pyx_v_bufptr + __pyx_v_exponent_chars); /* "asyncpg/pgproto/codecs/numeric.pyx":279 * bufptr += 1 * * if exponent != 0: # <<<<<<<<<<<<<< * bufptr[0] = b'E' * if exponent < 0: */ } /* "asyncpg/pgproto/codecs/numeric.pyx":290 * bufptr += exponent_chars * * bufptr[0] = 0 # <<<<<<<<<<<<<< * * pydigits = cpythonx.PyUnicode_FromString(charbuf) */ (__pyx_v_bufptr[0]) = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":292 * bufptr[0] = 0 * * pydigits = cpythonx.PyUnicode_FromString(charbuf) # <<<<<<<<<<<<<< * * return _Dec(pydigits) */ __pyx_t_3 = PyUnicode_FromString(__pyx_v_charbuf); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 292, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_pydigits = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":294 * pydigits = cpythonx.PyUnicode_FromString(charbuf) * * return _Dec(pydigits) # <<<<<<<<<<<<<< * * finally: */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Dec); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 294, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_pydigits}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 294, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L9_return; } /* "asyncpg/pgproto/codecs/numeric.pyx":297 * * finally: * if buf_allocated: # <<<<<<<<<<<<<< * cpython.PyMem_Free(charbuf) * */ /*finally:*/ { __pyx_L10_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __pyx_t_15 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename; { if (__pyx_v_buf_allocated) { /* "asyncpg/pgproto/codecs/numeric.pyx":298 * finally: * if buf_allocated: * cpython.PyMem_Free(charbuf) # <<<<<<<<<<<<<< * * */ PyMem_Free(__pyx_v_charbuf); /* "asyncpg/pgproto/codecs/numeric.pyx":297 * * finally: * if buf_allocated: # <<<<<<<<<<<<<< * cpython.PyMem_Free(charbuf) * */ } } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23); } __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ErrRestore(__pyx_t_18, __pyx_t_19, __pyx_t_20); __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17; goto __pyx_L1_error; } __pyx_L9_return: { __pyx_t_23 = __pyx_r; __pyx_r = 0; if (__pyx_v_buf_allocated) { /* "asyncpg/pgproto/codecs/numeric.pyx":298 * finally: * if buf_allocated: * cpython.PyMem_Free(charbuf) # <<<<<<<<<<<<<< * * */ PyMem_Free(__pyx_v_charbuf); /* "asyncpg/pgproto/codecs/numeric.pyx":297 * * finally: * if buf_allocated: # <<<<<<<<<<<<<< * cpython.PyMem_Free(charbuf) * */ } __pyx_r = __pyx_t_23; __pyx_t_23 = 0; goto __pyx_L0; } } /* "asyncpg/pgproto/codecs/numeric.pyx":141 * # than the simple text decoder above. That said, we need the binary * # decoder to support binary COPY with numeric values. * cdef numeric_decode_binary_ex( # <<<<<<<<<<<<<< * CodecContext settings, * FRBuffer *buf, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.numeric_decode_binary_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_pydigits); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/numeric.pyx":301 * * * cdef numeric_decode_binary(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return numeric_decode_binary_ex(settings, buf, False) * */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_binary(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("numeric_decode_binary", 1); /* "asyncpg/pgproto/codecs/numeric.pyx":302 * * cdef numeric_decode_binary(CodecContext settings, FRBuffer *buf): * return numeric_decode_binary_ex(settings, buf, False) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_binary_ex(__pyx_v_settings, __pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/numeric.pyx":301 * * * cdef numeric_decode_binary(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return numeric_decode_binary_ex(settings, buf, False) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.numeric_decode_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/numeric.pyx":305 * * * cdef inline char *_unpack_digit_stripping_lzeros(char *buf, int64_t pgdigit): # <<<<<<<<<<<<<< * cdef: * int64_t d */ static CYTHON_INLINE char *__pyx_f_7asyncpg_7pgproto_7pgproto__unpack_digit_stripping_lzeros(char *__pyx_v_buf, int64_t __pyx_v_pgdigit) { int64_t __pyx_v_d; int __pyx_v_significant; char *__pyx_r; /* "asyncpg/pgproto/codecs/numeric.pyx":310 * bint significant * * d = pgdigit // 1000 # <<<<<<<<<<<<<< * significant = (d > 0) * if significant: */ __pyx_v_d = __Pyx_div_int64_t(__pyx_v_pgdigit, 0x3E8); /* "asyncpg/pgproto/codecs/numeric.pyx":311 * * d = pgdigit // 1000 * significant = (d > 0) # <<<<<<<<<<<<<< * if significant: * pgdigit -= d * 1000 */ __pyx_v_significant = (__pyx_v_d > 0); /* "asyncpg/pgproto/codecs/numeric.pyx":312 * d = pgdigit // 1000 * significant = (d > 0) * if significant: # <<<<<<<<<<<<<< * pgdigit -= d * 1000 * buf[0] = (d + b'0') */ if (__pyx_v_significant) { /* "asyncpg/pgproto/codecs/numeric.pyx":313 * significant = (d > 0) * if significant: * pgdigit -= d * 1000 # <<<<<<<<<<<<<< * buf[0] = (d + b'0') * buf += 1 */ __pyx_v_pgdigit = (__pyx_v_pgdigit - (__pyx_v_d * 0x3E8)); /* "asyncpg/pgproto/codecs/numeric.pyx":314 * if significant: * pgdigit -= d * 1000 * buf[0] = (d + b'0') # <<<<<<<<<<<<<< * buf += 1 * */ (__pyx_v_buf[0]) = ((char)(__pyx_v_d + ((int32_t)'0'))); /* "asyncpg/pgproto/codecs/numeric.pyx":315 * pgdigit -= d * 1000 * buf[0] = (d + b'0') * buf += 1 # <<<<<<<<<<<<<< * * d = pgdigit // 100 */ __pyx_v_buf = (__pyx_v_buf + 1); /* "asyncpg/pgproto/codecs/numeric.pyx":312 * d = pgdigit // 1000 * significant = (d > 0) * if significant: # <<<<<<<<<<<<<< * pgdigit -= d * 1000 * buf[0] = (d + b'0') */ } /* "asyncpg/pgproto/codecs/numeric.pyx":317 * buf += 1 * * d = pgdigit // 100 # <<<<<<<<<<<<<< * significant |= (d > 0) * if significant: */ __pyx_v_d = __Pyx_div_int64_t(__pyx_v_pgdigit, 0x64); /* "asyncpg/pgproto/codecs/numeric.pyx":318 * * d = pgdigit // 100 * significant |= (d > 0) # <<<<<<<<<<<<<< * if significant: * pgdigit -= d * 100 */ __pyx_v_significant = (__pyx_v_significant | (__pyx_v_d > 0)); /* "asyncpg/pgproto/codecs/numeric.pyx":319 * d = pgdigit // 100 * significant |= (d > 0) * if significant: # <<<<<<<<<<<<<< * pgdigit -= d * 100 * buf[0] = (d + b'0') */ if (__pyx_v_significant) { /* "asyncpg/pgproto/codecs/numeric.pyx":320 * significant |= (d > 0) * if significant: * pgdigit -= d * 100 # <<<<<<<<<<<<<< * buf[0] = (d + b'0') * buf += 1 */ __pyx_v_pgdigit = (__pyx_v_pgdigit - (__pyx_v_d * 0x64)); /* "asyncpg/pgproto/codecs/numeric.pyx":321 * if significant: * pgdigit -= d * 100 * buf[0] = (d + b'0') # <<<<<<<<<<<<<< * buf += 1 * */ (__pyx_v_buf[0]) = ((char)(__pyx_v_d + ((int32_t)'0'))); /* "asyncpg/pgproto/codecs/numeric.pyx":322 * pgdigit -= d * 100 * buf[0] = (d + b'0') * buf += 1 # <<<<<<<<<<<<<< * * d = pgdigit // 10 */ __pyx_v_buf = (__pyx_v_buf + 1); /* "asyncpg/pgproto/codecs/numeric.pyx":319 * d = pgdigit // 100 * significant |= (d > 0) * if significant: # <<<<<<<<<<<<<< * pgdigit -= d * 100 * buf[0] = (d + b'0') */ } /* "asyncpg/pgproto/codecs/numeric.pyx":324 * buf += 1 * * d = pgdigit // 10 # <<<<<<<<<<<<<< * significant |= (d > 0) * if significant: */ __pyx_v_d = __Pyx_div_int64_t(__pyx_v_pgdigit, 10); /* "asyncpg/pgproto/codecs/numeric.pyx":325 * * d = pgdigit // 10 * significant |= (d > 0) # <<<<<<<<<<<<<< * if significant: * pgdigit -= d * 10 */ __pyx_v_significant = (__pyx_v_significant | (__pyx_v_d > 0)); /* "asyncpg/pgproto/codecs/numeric.pyx":326 * d = pgdigit // 10 * significant |= (d > 0) * if significant: # <<<<<<<<<<<<<< * pgdigit -= d * 10 * buf[0] = (d + b'0') */ if (__pyx_v_significant) { /* "asyncpg/pgproto/codecs/numeric.pyx":327 * significant |= (d > 0) * if significant: * pgdigit -= d * 10 # <<<<<<<<<<<<<< * buf[0] = (d + b'0') * buf += 1 */ __pyx_v_pgdigit = (__pyx_v_pgdigit - (__pyx_v_d * 10)); /* "asyncpg/pgproto/codecs/numeric.pyx":328 * if significant: * pgdigit -= d * 10 * buf[0] = (d + b'0') # <<<<<<<<<<<<<< * buf += 1 * */ (__pyx_v_buf[0]) = ((char)(__pyx_v_d + ((int32_t)'0'))); /* "asyncpg/pgproto/codecs/numeric.pyx":329 * pgdigit -= d * 10 * buf[0] = (d + b'0') * buf += 1 # <<<<<<<<<<<<<< * * buf[0] = (pgdigit + b'0') */ __pyx_v_buf = (__pyx_v_buf + 1); /* "asyncpg/pgproto/codecs/numeric.pyx":326 * d = pgdigit // 10 * significant |= (d > 0) * if significant: # <<<<<<<<<<<<<< * pgdigit -= d * 10 * buf[0] = (d + b'0') */ } /* "asyncpg/pgproto/codecs/numeric.pyx":331 * buf += 1 * * buf[0] = (pgdigit + b'0') # <<<<<<<<<<<<<< * buf += 1 * */ (__pyx_v_buf[0]) = ((char)(__pyx_v_pgdigit + ((int32_t)'0'))); /* "asyncpg/pgproto/codecs/numeric.pyx":332 * * buf[0] = (pgdigit + b'0') * buf += 1 # <<<<<<<<<<<<<< * * return buf */ __pyx_v_buf = (__pyx_v_buf + 1); /* "asyncpg/pgproto/codecs/numeric.pyx":334 * buf += 1 * * return buf # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_buf; goto __pyx_L0; /* "asyncpg/pgproto/codecs/numeric.pyx":305 * * * cdef inline char *_unpack_digit_stripping_lzeros(char *buf, int64_t pgdigit): # <<<<<<<<<<<<<< * cdef: * int64_t d */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "asyncpg/pgproto/codecs/numeric.pyx":337 * * * cdef inline char *_unpack_digit(char *buf, int64_t pgdigit): # <<<<<<<<<<<<<< * cdef: * int64_t d */ static CYTHON_INLINE char *__pyx_f_7asyncpg_7pgproto_7pgproto__unpack_digit(char *__pyx_v_buf, int64_t __pyx_v_pgdigit) { int64_t __pyx_v_d; char *__pyx_r; /* "asyncpg/pgproto/codecs/numeric.pyx":341 * int64_t d * * d = pgdigit // 1000 # <<<<<<<<<<<<<< * pgdigit -= d * 1000 * buf[0] = (d + b'0') */ __pyx_v_d = __Pyx_div_int64_t(__pyx_v_pgdigit, 0x3E8); /* "asyncpg/pgproto/codecs/numeric.pyx":342 * * d = pgdigit // 1000 * pgdigit -= d * 1000 # <<<<<<<<<<<<<< * buf[0] = (d + b'0') * */ __pyx_v_pgdigit = (__pyx_v_pgdigit - (__pyx_v_d * 0x3E8)); /* "asyncpg/pgproto/codecs/numeric.pyx":343 * d = pgdigit // 1000 * pgdigit -= d * 1000 * buf[0] = (d + b'0') # <<<<<<<<<<<<<< * * d = pgdigit // 100 */ (__pyx_v_buf[0]) = ((char)(__pyx_v_d + ((int32_t)'0'))); /* "asyncpg/pgproto/codecs/numeric.pyx":345 * buf[0] = (d + b'0') * * d = pgdigit // 100 # <<<<<<<<<<<<<< * pgdigit -= d * 100 * buf[1] = (d + b'0') */ __pyx_v_d = __Pyx_div_int64_t(__pyx_v_pgdigit, 0x64); /* "asyncpg/pgproto/codecs/numeric.pyx":346 * * d = pgdigit // 100 * pgdigit -= d * 100 # <<<<<<<<<<<<<< * buf[1] = (d + b'0') * */ __pyx_v_pgdigit = (__pyx_v_pgdigit - (__pyx_v_d * 0x64)); /* "asyncpg/pgproto/codecs/numeric.pyx":347 * d = pgdigit // 100 * pgdigit -= d * 100 * buf[1] = (d + b'0') # <<<<<<<<<<<<<< * * d = pgdigit // 10 */ (__pyx_v_buf[1]) = ((char)(__pyx_v_d + ((int32_t)'0'))); /* "asyncpg/pgproto/codecs/numeric.pyx":349 * buf[1] = (d + b'0') * * d = pgdigit // 10 # <<<<<<<<<<<<<< * pgdigit -= d * 10 * buf[2] = (d + b'0') */ __pyx_v_d = __Pyx_div_int64_t(__pyx_v_pgdigit, 10); /* "asyncpg/pgproto/codecs/numeric.pyx":350 * * d = pgdigit // 10 * pgdigit -= d * 10 # <<<<<<<<<<<<<< * buf[2] = (d + b'0') * */ __pyx_v_pgdigit = (__pyx_v_pgdigit - (__pyx_v_d * 10)); /* "asyncpg/pgproto/codecs/numeric.pyx":351 * d = pgdigit // 10 * pgdigit -= d * 10 * buf[2] = (d + b'0') # <<<<<<<<<<<<<< * * buf[3] = (pgdigit + b'0') */ (__pyx_v_buf[2]) = ((char)(__pyx_v_d + ((int32_t)'0'))); /* "asyncpg/pgproto/codecs/numeric.pyx":353 * buf[2] = (d + b'0') * * buf[3] = (pgdigit + b'0') # <<<<<<<<<<<<<< * buf += 4 * */ (__pyx_v_buf[3]) = ((char)(__pyx_v_pgdigit + ((int32_t)'0'))); /* "asyncpg/pgproto/codecs/numeric.pyx":354 * * buf[3] = (pgdigit + b'0') * buf += 4 # <<<<<<<<<<<<<< * * return buf */ __pyx_v_buf = (__pyx_v_buf + 4); /* "asyncpg/pgproto/codecs/numeric.pyx":356 * buf += 4 * * return buf # <<<<<<<<<<<<<< */ __pyx_r = __pyx_v_buf; goto __pyx_L0; /* "asyncpg/pgproto/codecs/numeric.pyx":337 * * * cdef inline char *_unpack_digit(char *buf, int64_t pgdigit): # <<<<<<<<<<<<<< * cdef: * int64_t d */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "asyncpg/pgproto/codecs/bits.pyx":8 * * * cdef bits_encode(CodecContext settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * cdef: * Py_buffer pybuf */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_bits_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_wbuf, PyObject *__pyx_v_obj) { Py_buffer __pyx_v_pybuf; int __pyx_v_pybuf_used; char *__pyx_v_buf; Py_ssize_t __pyx_v_len; Py_ssize_t __pyx_v_bitlen; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; Py_ssize_t __pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_t_9; char const *__pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bits_encode", 1); /* "asyncpg/pgproto/codecs/bits.pyx":11 * cdef: * Py_buffer pybuf * bint pybuf_used = False # <<<<<<<<<<<<<< * char *buf * ssize_t len */ __pyx_v_pybuf_used = 0; /* "asyncpg/pgproto/codecs/bits.pyx":16 * ssize_t bitlen * * if cpython.PyBytes_CheckExact(obj): # <<<<<<<<<<<<<< * buf = cpython.PyBytes_AS_STRING(obj) * len = cpython.Py_SIZE(obj) */ __pyx_t_1 = PyBytes_CheckExact(__pyx_v_obj); if (__pyx_t_1) { /* "asyncpg/pgproto/codecs/bits.pyx":17 * * if cpython.PyBytes_CheckExact(obj): * buf = cpython.PyBytes_AS_STRING(obj) # <<<<<<<<<<<<<< * len = cpython.Py_SIZE(obj) * bitlen = len * 8 */ __pyx_v_buf = PyBytes_AS_STRING(__pyx_v_obj); /* "asyncpg/pgproto/codecs/bits.pyx":18 * if cpython.PyBytes_CheckExact(obj): * buf = cpython.PyBytes_AS_STRING(obj) * len = cpython.Py_SIZE(obj) # <<<<<<<<<<<<<< * bitlen = len * 8 * elif isinstance(obj, pgproto_types.BitString): */ __pyx_v_len = Py_SIZE(__pyx_v_obj); /* "asyncpg/pgproto/codecs/bits.pyx":19 * buf = cpython.PyBytes_AS_STRING(obj) * len = cpython.Py_SIZE(obj) * bitlen = len * 8 # <<<<<<<<<<<<<< * elif isinstance(obj, pgproto_types.BitString): * cpython.PyBytes_AsStringAndSize(obj.bytes, &buf, &len) */ __pyx_v_bitlen = (__pyx_v_len * 8); /* "asyncpg/pgproto/codecs/bits.pyx":16 * ssize_t bitlen * * if cpython.PyBytes_CheckExact(obj): # <<<<<<<<<<<<<< * buf = cpython.PyBytes_AS_STRING(obj) * len = cpython.Py_SIZE(obj) */ goto __pyx_L3; } /* "asyncpg/pgproto/codecs/bits.pyx":20 * len = cpython.Py_SIZE(obj) * bitlen = len * 8 * elif isinstance(obj, pgproto_types.BitString): # <<<<<<<<<<<<<< * cpython.PyBytes_AsStringAndSize(obj.bytes, &buf, &len) * bitlen = obj.__len__() */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pgproto_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_BitString); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(19, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { /* "asyncpg/pgproto/codecs/bits.pyx":21 * bitlen = len * 8 * elif isinstance(obj, pgproto_types.BitString): * cpython.PyBytes_AsStringAndSize(obj.bytes, &buf, &len) # <<<<<<<<<<<<<< * bitlen = obj.__len__() * else: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyBytes_AsStringAndSize(__pyx_t_3, (&__pyx_v_buf), ((Py_ssize_t *)(&__pyx_v_len))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(19, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/bits.pyx":22 * elif isinstance(obj, pgproto_types.BitString): * cpython.PyBytes_AsStringAndSize(obj.bytes, &buf, &len) * bitlen = obj.__len__() # <<<<<<<<<<<<<< * else: * cpython.PyObject_GetBuffer(obj, &pybuf, cpython.PyBUF_SIMPLE) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_7 = PyInt_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(19, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_bitlen = __pyx_t_7; /* "asyncpg/pgproto/codecs/bits.pyx":20 * len = cpython.Py_SIZE(obj) * bitlen = len * 8 * elif isinstance(obj, pgproto_types.BitString): # <<<<<<<<<<<<<< * cpython.PyBytes_AsStringAndSize(obj.bytes, &buf, &len) * bitlen = obj.__len__() */ goto __pyx_L3; } /* "asyncpg/pgproto/codecs/bits.pyx":24 * bitlen = obj.__len__() * else: * cpython.PyObject_GetBuffer(obj, &pybuf, cpython.PyBUF_SIMPLE) # <<<<<<<<<<<<<< * pybuf_used = True * buf = pybuf.buf */ /*else*/ { __pyx_t_4 = PyObject_GetBuffer(__pyx_v_obj, (&__pyx_v_pybuf), PyBUF_SIMPLE); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(19, 24, __pyx_L1_error) /* "asyncpg/pgproto/codecs/bits.pyx":25 * else: * cpython.PyObject_GetBuffer(obj, &pybuf, cpython.PyBUF_SIMPLE) * pybuf_used = True # <<<<<<<<<<<<<< * buf = pybuf.buf * len = pybuf.len */ __pyx_v_pybuf_used = 1; /* "asyncpg/pgproto/codecs/bits.pyx":26 * cpython.PyObject_GetBuffer(obj, &pybuf, cpython.PyBUF_SIMPLE) * pybuf_used = True * buf = pybuf.buf # <<<<<<<<<<<<<< * len = pybuf.len * bitlen = len * 8 */ __pyx_v_buf = ((char *)__pyx_v_pybuf.buf); /* "asyncpg/pgproto/codecs/bits.pyx":27 * pybuf_used = True * buf = pybuf.buf * len = pybuf.len # <<<<<<<<<<<<<< * bitlen = len * 8 * */ __pyx_t_8 = __pyx_v_pybuf.len; __pyx_v_len = __pyx_t_8; /* "asyncpg/pgproto/codecs/bits.pyx":28 * buf = pybuf.buf * len = pybuf.len * bitlen = len * 8 # <<<<<<<<<<<<<< * * try: */ __pyx_v_bitlen = (__pyx_v_len * 8); } __pyx_L3:; /* "asyncpg/pgproto/codecs/bits.pyx":30 * bitlen = len * 8 * * try: # <<<<<<<<<<<<<< * if bitlen > _MAXINT32: * raise ValueError('bit value too long') */ /*try:*/ { /* "asyncpg/pgproto/codecs/bits.pyx":31 * * try: * if bitlen > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('bit value too long') * wbuf.write_int32(4 + len) */ __pyx_t_1 = (__pyx_v_bitlen > 0x7FFFFFFF); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/codecs/bits.pyx":32 * try: * if bitlen > _MAXINT32: * raise ValueError('bit value too long') # <<<<<<<<<<<<<< * wbuf.write_int32(4 + len) * wbuf.write_int32(bitlen) */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 32, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(19, 32, __pyx_L5_error) /* "asyncpg/pgproto/codecs/bits.pyx":31 * * try: * if bitlen > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('bit value too long') * wbuf.write_int32(4 + len) */ } /* "asyncpg/pgproto/codecs/bits.pyx":33 * if bitlen > _MAXINT32: * raise ValueError('bit value too long') * wbuf.write_int32(4 + len) # <<<<<<<<<<<<<< * wbuf.write_int32(bitlen) * wbuf.write_cstr(buf, len) */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_wbuf, (4 + ((int32_t)__pyx_v_len))); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 33, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/bits.pyx":34 * raise ValueError('bit value too long') * wbuf.write_int32(4 + len) * wbuf.write_int32(bitlen) # <<<<<<<<<<<<<< * wbuf.write_cstr(buf, len) * finally: */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_wbuf, ((int32_t)__pyx_v_bitlen)); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 34, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/bits.pyx":35 * wbuf.write_int32(4 + len) * wbuf.write_int32(bitlen) * wbuf.write_cstr(buf, len) # <<<<<<<<<<<<<< * finally: * if pybuf_used: */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_cstr(__pyx_v_wbuf, __pyx_v_buf, __pyx_v_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 35, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "asyncpg/pgproto/codecs/bits.pyx":37 * wbuf.write_cstr(buf, len) * finally: * if pybuf_used: # <<<<<<<<<<<<<< * cpython.PyBuffer_Release(&pybuf) * */ /*finally:*/ { /*normal exit:*/{ if (__pyx_v_pybuf_used) { /* "asyncpg/pgproto/codecs/bits.pyx":38 * finally: * if pybuf_used: * cpython.PyBuffer_Release(&pybuf) # <<<<<<<<<<<<<< * * */ PyBuffer_Release((&__pyx_v_pybuf)); /* "asyncpg/pgproto/codecs/bits.pyx":37 * wbuf.write_cstr(buf, len) * finally: * if pybuf_used: # <<<<<<<<<<<<<< * cpython.PyBuffer_Release(&pybuf) * */ } goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __pyx_t_4 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; { if (__pyx_v_pybuf_used) { /* "asyncpg/pgproto/codecs/bits.pyx":38 * finally: * if pybuf_used: * cpython.PyBuffer_Release(&pybuf) # <<<<<<<<<<<<<< * * */ PyBuffer_Release((&__pyx_v_pybuf)); /* "asyncpg/pgproto/codecs/bits.pyx":37 * wbuf.write_cstr(buf, len) * finally: * if pybuf_used: # <<<<<<<<<<<<<< * cpython.PyBuffer_Release(&pybuf) * */ } } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); } __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; goto __pyx_L1_error; } __pyx_L6:; } /* "asyncpg/pgproto/codecs/bits.pyx":8 * * * cdef bits_encode(CodecContext settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * cdef: * Py_buffer pybuf */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.bits_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/bits.pyx":41 * * * cdef bits_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int32_t bitlen = hton.unpack_int32(frb_read(buf, 4)) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_bits_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { int32_t __pyx_v_bitlen; Py_ssize_t __pyx_v_buf_len; PyObject *__pyx_v_bytes_ = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; Py_ssize_t __pyx_t_2; char const *__pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bits_decode", 1); /* "asyncpg/pgproto/codecs/bits.pyx":43 * cdef bits_decode(CodecContext settings, FRBuffer *buf): * cdef: * int32_t bitlen = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * ssize_t buf_len = buf.len * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(19, 43, __pyx_L1_error) __pyx_v_bitlen = unpack_int32(__pyx_t_1); /* "asyncpg/pgproto/codecs/bits.pyx":44 * cdef: * int32_t bitlen = hton.unpack_int32(frb_read(buf, 4)) * ssize_t buf_len = buf.len # <<<<<<<<<<<<<< * * bytes_ = cpython.PyBytes_FromStringAndSize(frb_read_all(buf), buf_len) */ __pyx_t_2 = __pyx_v_buf->len; __pyx_v_buf_len = __pyx_t_2; /* "asyncpg/pgproto/codecs/bits.pyx":46 * ssize_t buf_len = buf.len * * bytes_ = cpython.PyBytes_FromStringAndSize(frb_read_all(buf), buf_len) # <<<<<<<<<<<<<< * return pgproto_types.BitString.frombytes(bytes_, bitlen) */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read_all(__pyx_v_buf); if (unlikely(__pyx_t_3 == ((char const *)NULL) && PyErr_Occurred())) __PYX_ERR(19, 46, __pyx_L1_error) __pyx_t_4 = PyBytes_FromStringAndSize(__pyx_t_3, __pyx_v_buf_len); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_bytes_ = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/bits.pyx":47 * * bytes_ = cpython.PyBytes_FromStringAndSize(frb_read_all(buf), buf_len) * return pgproto_types.BitString.frombytes(bytes_, bitlen) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pgproto_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_BitString); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_bitlen); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_bytes_, __pyx_t_6}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/bits.pyx":41 * * * cdef bits_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int32_t bitlen = hton.unpack_int32(frb_read(buf, 4)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.bits_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_bytes_); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/geometry.pyx":8 * * * cdef inline _encode_points(WriteBuffer wbuf, object points): # <<<<<<<<<<<<<< * cdef object point * */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto__encode_points(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_wbuf, PyObject *__pyx_v_points) { PyObject *__pyx_v_point = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; double __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_encode_points", 1); /* "asyncpg/pgproto/codecs/geometry.pyx":11 * cdef object point * * for point in points: # <<<<<<<<<<<<<< * wbuf.write_double(point[0]) * wbuf.write_double(point[1]) */ if (likely(PyList_CheckExact(__pyx_v_points)) || PyTuple_CheckExact(__pyx_v_points)) { __pyx_t_1 = __pyx_v_points; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 11, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(20, 11, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(20, 11, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(20, 11, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(20, 11, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(20, 11, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_point, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":12 * * for point in points: * wbuf.write_double(point[0]) # <<<<<<<<<<<<<< * wbuf.write_double(point[1]) * */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(20, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_double(__pyx_v_wbuf, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":13 * for point in points: * wbuf.write_double(point[0]) * wbuf.write_double(point[1]) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(20, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_double(__pyx_v_wbuf, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":11 * cdef object point * * for point in points: # <<<<<<<<<<<<<< * wbuf.write_double(point[0]) * wbuf.write_double(point[1]) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":8 * * * cdef inline _encode_points(WriteBuffer wbuf, object points): # <<<<<<<<<<<<<< * cdef object point * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto._encode_points", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_point); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/geometry.pyx":16 * * * cdef inline _decode_points(FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int32_t npts = hton.unpack_int32(frb_read(buf, 4)) */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto__decode_points(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { int32_t __pyx_v_npts; PyObject *__pyx_v_pts = 0; int32_t __pyx_v_i; PyObject *__pyx_v_point = 0; double __pyx_v_x; double __pyx_v_y; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int32_t __pyx_t_3; int32_t __pyx_t_4; int32_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; unsigned int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_decode_points", 1); /* "asyncpg/pgproto/codecs/geometry.pyx":18 * cdef inline _decode_points(FRBuffer *buf): * cdef: * int32_t npts = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * pts = cpython.PyTuple_New(npts) * int32_t i */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 18, __pyx_L1_error) __pyx_v_npts = unpack_int32(__pyx_t_1); /* "asyncpg/pgproto/codecs/geometry.pyx":19 * cdef: * int32_t npts = hton.unpack_int32(frb_read(buf, 4)) * pts = cpython.PyTuple_New(npts) # <<<<<<<<<<<<<< * int32_t i * object point */ __pyx_t_2 = PyTuple_New(__pyx_v_npts); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_pts = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":25 * double y * * for i in range(npts): # <<<<<<<<<<<<<< * x = hton.unpack_double(frb_read(buf, 8)) * y = hton.unpack_double(frb_read(buf, 8)) */ __pyx_t_3 = __pyx_v_npts; __pyx_t_4 = __pyx_t_3; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; /* "asyncpg/pgproto/codecs/geometry.pyx":26 * * for i in range(npts): * x = hton.unpack_double(frb_read(buf, 8)) # <<<<<<<<<<<<<< * y = hton.unpack_double(frb_read(buf, 8)) * point = pgproto_types.Point(x, y) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 26, __pyx_L1_error) __pyx_v_x = unpack_double(__pyx_t_1); /* "asyncpg/pgproto/codecs/geometry.pyx":27 * for i in range(npts): * x = hton.unpack_double(frb_read(buf, 8)) * y = hton.unpack_double(frb_read(buf, 8)) # <<<<<<<<<<<<<< * point = pgproto_types.Point(x, y) * cpython.Py_INCREF(point) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 27, __pyx_L1_error) __pyx_v_y = unpack_double(__pyx_t_1); /* "asyncpg/pgproto/codecs/geometry.pyx":28 * x = hton.unpack_double(frb_read(buf, 8)) * y = hton.unpack_double(frb_read(buf, 8)) * point = pgproto_types.Point(x, y) # <<<<<<<<<<<<<< * cpython.Py_INCREF(point) * cpython.PyTuple_SET_ITEM(pts, i, point) */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pgproto_types); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_6, __pyx_t_8}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_XDECREF_SET(__pyx_v_point, __pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":29 * y = hton.unpack_double(frb_read(buf, 8)) * point = pgproto_types.Point(x, y) * cpython.Py_INCREF(point) # <<<<<<<<<<<<<< * cpython.PyTuple_SET_ITEM(pts, i, point) * */ Py_INCREF(__pyx_v_point); /* "asyncpg/pgproto/codecs/geometry.pyx":30 * point = pgproto_types.Point(x, y) * cpython.Py_INCREF(point) * cpython.PyTuple_SET_ITEM(pts, i, point) # <<<<<<<<<<<<<< * * return pts */ PyTuple_SET_ITEM(__pyx_v_pts, __pyx_v_i, __pyx_v_point); } /* "asyncpg/pgproto/codecs/geometry.pyx":32 * cpython.PyTuple_SET_ITEM(pts, i, point) * * return pts # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_pts); __pyx_r = __pyx_v_pts; goto __pyx_L0; /* "asyncpg/pgproto/codecs/geometry.pyx":16 * * * cdef inline _decode_points(FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int32_t npts = hton.unpack_int32(frb_read(buf, 4)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("asyncpg.pgproto.pgproto._decode_points", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_pts); __Pyx_XDECREF(__pyx_v_point); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/geometry.pyx":35 * * * cdef box_encode(CodecContext settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * wbuf.write_int32(32) * _encode_points(wbuf, (obj[0], obj[1])) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_box_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_wbuf, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("box_encode", 1); /* "asyncpg/pgproto/codecs/geometry.pyx":36 * * cdef box_encode(CodecContext settings, WriteBuffer wbuf, obj): * wbuf.write_int32(32) # <<<<<<<<<<<<<< * _encode_points(wbuf, (obj[0], obj[1])) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_wbuf, 32); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":37 * cdef box_encode(CodecContext settings, WriteBuffer wbuf, obj): * wbuf.write_int32(32) * _encode_points(wbuf, (obj[0], obj[1])) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_obj, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(20, 37, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(20, 37, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto__encode_points(__pyx_v_wbuf, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":35 * * * cdef box_encode(CodecContext settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * wbuf.write_int32(32) * _encode_points(wbuf, (obj[0], obj[1])) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.box_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/geometry.pyx":40 * * * cdef box_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * double high_x = hton.unpack_double(frb_read(buf, 8)) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_box_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { double __pyx_v_high_x; double __pyx_v_high_y; double __pyx_v_low_x; double __pyx_v_low_y; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("box_decode", 1); /* "asyncpg/pgproto/codecs/geometry.pyx":42 * cdef box_decode(CodecContext settings, FRBuffer *buf): * cdef: * double high_x = hton.unpack_double(frb_read(buf, 8)) # <<<<<<<<<<<<<< * double high_y = hton.unpack_double(frb_read(buf, 8)) * double low_x = hton.unpack_double(frb_read(buf, 8)) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 42, __pyx_L1_error) __pyx_v_high_x = unpack_double(__pyx_t_1); /* "asyncpg/pgproto/codecs/geometry.pyx":43 * cdef: * double high_x = hton.unpack_double(frb_read(buf, 8)) * double high_y = hton.unpack_double(frb_read(buf, 8)) # <<<<<<<<<<<<<< * double low_x = hton.unpack_double(frb_read(buf, 8)) * double low_y = hton.unpack_double(frb_read(buf, 8)) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 43, __pyx_L1_error) __pyx_v_high_y = unpack_double(__pyx_t_1); /* "asyncpg/pgproto/codecs/geometry.pyx":44 * double high_x = hton.unpack_double(frb_read(buf, 8)) * double high_y = hton.unpack_double(frb_read(buf, 8)) * double low_x = hton.unpack_double(frb_read(buf, 8)) # <<<<<<<<<<<<<< * double low_y = hton.unpack_double(frb_read(buf, 8)) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 44, __pyx_L1_error) __pyx_v_low_x = unpack_double(__pyx_t_1); /* "asyncpg/pgproto/codecs/geometry.pyx":45 * double high_y = hton.unpack_double(frb_read(buf, 8)) * double low_x = hton.unpack_double(frb_read(buf, 8)) * double low_y = hton.unpack_double(frb_read(buf, 8)) # <<<<<<<<<<<<<< * * return pgproto_types.Box( */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 45, __pyx_L1_error) __pyx_v_low_y = unpack_double(__pyx_t_1); /* "asyncpg/pgproto/codecs/geometry.pyx":47 * double low_y = hton.unpack_double(frb_read(buf, 8)) * * return pgproto_types.Box( # <<<<<<<<<<<<<< * pgproto_types.Point(high_x, high_y), * pgproto_types.Point(low_x, low_y)) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pgproto_types); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Box); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":48 * * return pgproto_types.Box( * pgproto_types.Point(high_x, high_y), # <<<<<<<<<<<<<< * pgproto_types.Point(low_x, low_y)) * */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pgproto_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyFloat_FromDouble(__pyx_v_high_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = PyFloat_FromDouble(__pyx_v_high_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_5, __pyx_t_7}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } /* "asyncpg/pgproto/codecs/geometry.pyx":49 * return pgproto_types.Box( * pgproto_types.Point(high_x, high_y), * pgproto_types.Point(low_x, low_y)) # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pgproto_types); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyFloat_FromDouble(__pyx_v_low_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyFloat_FromDouble(__pyx_v_low_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_7, __pyx_t_8}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/geometry.pyx":40 * * * cdef box_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * double high_x = hton.unpack_double(frb_read(buf, 8)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.box_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/geometry.pyx":52 * * * cdef line_encode(CodecContext settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * wbuf.write_int32(24) * wbuf.write_double(obj[0]) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_line_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_wbuf, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; double __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("line_encode", 1); /* "asyncpg/pgproto/codecs/geometry.pyx":53 * * cdef line_encode(CodecContext settings, WriteBuffer wbuf, obj): * wbuf.write_int32(24) # <<<<<<<<<<<<<< * wbuf.write_double(obj[0]) * wbuf.write_double(obj[1]) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_wbuf, 24); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":54 * cdef line_encode(CodecContext settings, WriteBuffer wbuf, obj): * wbuf.write_int32(24) * wbuf.write_double(obj[0]) # <<<<<<<<<<<<<< * wbuf.write_double(obj[1]) * wbuf.write_double(obj[2]) */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(20, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_double(__pyx_v_wbuf, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":55 * wbuf.write_int32(24) * wbuf.write_double(obj[0]) * wbuf.write_double(obj[1]) # <<<<<<<<<<<<<< * wbuf.write_double(obj[2]) * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(20, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_double(__pyx_v_wbuf, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":56 * wbuf.write_double(obj[0]) * wbuf.write_double(obj[1]) * wbuf.write_double(obj[2]) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(20, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_double(__pyx_v_wbuf, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":52 * * * cdef line_encode(CodecContext settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * wbuf.write_int32(24) * wbuf.write_double(obj[0]) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.line_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/geometry.pyx":59 * * * cdef line_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * double A = hton.unpack_double(frb_read(buf, 8)) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_line_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { double __pyx_v_A; double __pyx_v_B; double __pyx_v_C; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("line_decode", 1); /* "asyncpg/pgproto/codecs/geometry.pyx":61 * cdef line_decode(CodecContext settings, FRBuffer *buf): * cdef: * double A = hton.unpack_double(frb_read(buf, 8)) # <<<<<<<<<<<<<< * double B = hton.unpack_double(frb_read(buf, 8)) * double C = hton.unpack_double(frb_read(buf, 8)) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 61, __pyx_L1_error) __pyx_v_A = unpack_double(__pyx_t_1); /* "asyncpg/pgproto/codecs/geometry.pyx":62 * cdef: * double A = hton.unpack_double(frb_read(buf, 8)) * double B = hton.unpack_double(frb_read(buf, 8)) # <<<<<<<<<<<<<< * double C = hton.unpack_double(frb_read(buf, 8)) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 62, __pyx_L1_error) __pyx_v_B = unpack_double(__pyx_t_1); /* "asyncpg/pgproto/codecs/geometry.pyx":63 * double A = hton.unpack_double(frb_read(buf, 8)) * double B = hton.unpack_double(frb_read(buf, 8)) * double C = hton.unpack_double(frb_read(buf, 8)) # <<<<<<<<<<<<<< * * return pgproto_types.Line(A, B, C) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 63, __pyx_L1_error) __pyx_v_C = unpack_double(__pyx_t_1); /* "asyncpg/pgproto/codecs/geometry.pyx":65 * double C = hton.unpack_double(frb_read(buf, 8)) * * return pgproto_types.Line(A, B, C) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pgproto_types); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyFloat_FromDouble(__pyx_v_A); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyFloat_FromDouble(__pyx_v_B); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyFloat_FromDouble(__pyx_v_C); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/geometry.pyx":59 * * * cdef line_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * double A = hton.unpack_double(frb_read(buf, 8)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.line_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/geometry.pyx":68 * * * cdef lseg_encode(CodecContext settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * wbuf.write_int32(32) * _encode_points(wbuf, (obj[0], obj[1])) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_lseg_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_wbuf, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lseg_encode", 1); /* "asyncpg/pgproto/codecs/geometry.pyx":69 * * cdef lseg_encode(CodecContext settings, WriteBuffer wbuf, obj): * wbuf.write_int32(32) # <<<<<<<<<<<<<< * _encode_points(wbuf, (obj[0], obj[1])) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_wbuf, 32); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":70 * cdef lseg_encode(CodecContext settings, WriteBuffer wbuf, obj): * wbuf.write_int32(32) * _encode_points(wbuf, (obj[0], obj[1])) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_obj, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(20, 70, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(20, 70, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto__encode_points(__pyx_v_wbuf, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":68 * * * cdef lseg_encode(CodecContext settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * wbuf.write_int32(32) * _encode_points(wbuf, (obj[0], obj[1])) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.lseg_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/geometry.pyx":73 * * * cdef lseg_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * double p1_x = hton.unpack_double(frb_read(buf, 8)) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_lseg_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { double __pyx_v_p1_x; double __pyx_v_p1_y; double __pyx_v_p2_x; double __pyx_v_p2_y; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lseg_decode", 1); /* "asyncpg/pgproto/codecs/geometry.pyx":75 * cdef lseg_decode(CodecContext settings, FRBuffer *buf): * cdef: * double p1_x = hton.unpack_double(frb_read(buf, 8)) # <<<<<<<<<<<<<< * double p1_y = hton.unpack_double(frb_read(buf, 8)) * double p2_x = hton.unpack_double(frb_read(buf, 8)) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 75, __pyx_L1_error) __pyx_v_p1_x = unpack_double(__pyx_t_1); /* "asyncpg/pgproto/codecs/geometry.pyx":76 * cdef: * double p1_x = hton.unpack_double(frb_read(buf, 8)) * double p1_y = hton.unpack_double(frb_read(buf, 8)) # <<<<<<<<<<<<<< * double p2_x = hton.unpack_double(frb_read(buf, 8)) * double p2_y = hton.unpack_double(frb_read(buf, 8)) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 76, __pyx_L1_error) __pyx_v_p1_y = unpack_double(__pyx_t_1); /* "asyncpg/pgproto/codecs/geometry.pyx":77 * double p1_x = hton.unpack_double(frb_read(buf, 8)) * double p1_y = hton.unpack_double(frb_read(buf, 8)) * double p2_x = hton.unpack_double(frb_read(buf, 8)) # <<<<<<<<<<<<<< * double p2_y = hton.unpack_double(frb_read(buf, 8)) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 77, __pyx_L1_error) __pyx_v_p2_x = unpack_double(__pyx_t_1); /* "asyncpg/pgproto/codecs/geometry.pyx":78 * double p1_y = hton.unpack_double(frb_read(buf, 8)) * double p2_x = hton.unpack_double(frb_read(buf, 8)) * double p2_y = hton.unpack_double(frb_read(buf, 8)) # <<<<<<<<<<<<<< * * return pgproto_types.LineSegment((p1_x, p1_y), (p2_x, p2_y)) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 78, __pyx_L1_error) __pyx_v_p2_y = unpack_double(__pyx_t_1); /* "asyncpg/pgproto/codecs/geometry.pyx":80 * double p2_y = hton.unpack_double(frb_read(buf, 8)) * * return pgproto_types.LineSegment((p1_x, p1_y), (p2_x, p2_y)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pgproto_types); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_LineSegment); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyFloat_FromDouble(__pyx_v_p1_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyFloat_FromDouble(__pyx_v_p1_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(20, 80, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(20, 80, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_5 = 0; __pyx_t_5 = PyFloat_FromDouble(__pyx_v_p2_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_p2_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5)) __PYX_ERR(20, 80, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3)) __PYX_ERR(20, 80, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/geometry.pyx":73 * * * cdef lseg_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * double p1_x = hton.unpack_double(frb_read(buf, 8)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.lseg_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/geometry.pyx":83 * * * cdef point_encode(CodecContext settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * wbuf.write_int32(16) * wbuf.write_double(obj[0]) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_point_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_wbuf, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; double __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("point_encode", 1); /* "asyncpg/pgproto/codecs/geometry.pyx":84 * * cdef point_encode(CodecContext settings, WriteBuffer wbuf, obj): * wbuf.write_int32(16) # <<<<<<<<<<<<<< * wbuf.write_double(obj[0]) * wbuf.write_double(obj[1]) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_wbuf, 16); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":85 * cdef point_encode(CodecContext settings, WriteBuffer wbuf, obj): * wbuf.write_int32(16) * wbuf.write_double(obj[0]) # <<<<<<<<<<<<<< * wbuf.write_double(obj[1]) * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(20, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_double(__pyx_v_wbuf, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":86 * wbuf.write_int32(16) * wbuf.write_double(obj[0]) * wbuf.write_double(obj[1]) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(20, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_double(__pyx_v_wbuf, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":83 * * * cdef point_encode(CodecContext settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * wbuf.write_int32(16) * wbuf.write_double(obj[0]) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.point_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/geometry.pyx":89 * * * cdef point_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * double x = hton.unpack_double(frb_read(buf, 8)) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_point_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { double __pyx_v_x; double __pyx_v_y; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("point_decode", 1); /* "asyncpg/pgproto/codecs/geometry.pyx":91 * cdef point_decode(CodecContext settings, FRBuffer *buf): * cdef: * double x = hton.unpack_double(frb_read(buf, 8)) # <<<<<<<<<<<<<< * double y = hton.unpack_double(frb_read(buf, 8)) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 91, __pyx_L1_error) __pyx_v_x = unpack_double(__pyx_t_1); /* "asyncpg/pgproto/codecs/geometry.pyx":92 * cdef: * double x = hton.unpack_double(frb_read(buf, 8)) * double y = hton.unpack_double(frb_read(buf, 8)) # <<<<<<<<<<<<<< * * return pgproto_types.Point(x, y) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 92, __pyx_L1_error) __pyx_v_y = unpack_double(__pyx_t_1); /* "asyncpg/pgproto/codecs/geometry.pyx":94 * double y = hton.unpack_double(frb_read(buf, 8)) * * return pgproto_types.Point(x, y) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pgproto_types); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/geometry.pyx":89 * * * cdef point_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * double x = hton.unpack_double(frb_read(buf, 8)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.point_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/geometry.pyx":97 * * * cdef path_encode(CodecContext settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * cdef: * int8_t is_closed = 0 */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_path_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_wbuf, PyObject *__pyx_v_obj) { int8_t __pyx_v_is_closed; Py_ssize_t __pyx_v_npts; Py_ssize_t __pyx_v_encoded_len; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int8_t __pyx_t_4; Py_ssize_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("path_encode", 1); /* "asyncpg/pgproto/codecs/geometry.pyx":99 * cdef path_encode(CodecContext settings, WriteBuffer wbuf, obj): * cdef: * int8_t is_closed = 0 # <<<<<<<<<<<<<< * ssize_t npts * ssize_t encoded_len */ __pyx_v_is_closed = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":104 * int32_t i * * if cpython.PyTuple_Check(obj): # <<<<<<<<<<<<<< * is_closed = 1 * elif cpython.PyList_Check(obj): */ __pyx_t_1 = PyTuple_Check(__pyx_v_obj); if (__pyx_t_1) { /* "asyncpg/pgproto/codecs/geometry.pyx":105 * * if cpython.PyTuple_Check(obj): * is_closed = 1 # <<<<<<<<<<<<<< * elif cpython.PyList_Check(obj): * is_closed = 0 */ __pyx_v_is_closed = 1; /* "asyncpg/pgproto/codecs/geometry.pyx":104 * int32_t i * * if cpython.PyTuple_Check(obj): # <<<<<<<<<<<<<< * is_closed = 1 * elif cpython.PyList_Check(obj): */ goto __pyx_L3; } /* "asyncpg/pgproto/codecs/geometry.pyx":106 * if cpython.PyTuple_Check(obj): * is_closed = 1 * elif cpython.PyList_Check(obj): # <<<<<<<<<<<<<< * is_closed = 0 * elif isinstance(obj, pgproto_types.Path): */ __pyx_t_1 = PyList_Check(__pyx_v_obj); if (__pyx_t_1) { /* "asyncpg/pgproto/codecs/geometry.pyx":107 * is_closed = 1 * elif cpython.PyList_Check(obj): * is_closed = 0 # <<<<<<<<<<<<<< * elif isinstance(obj, pgproto_types.Path): * is_closed = obj.is_closed */ __pyx_v_is_closed = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":106 * if cpython.PyTuple_Check(obj): * is_closed = 1 * elif cpython.PyList_Check(obj): # <<<<<<<<<<<<<< * is_closed = 0 * elif isinstance(obj, pgproto_types.Path): */ goto __pyx_L3; } /* "asyncpg/pgproto/codecs/geometry.pyx":108 * elif cpython.PyList_Check(obj): * is_closed = 0 * elif isinstance(obj, pgproto_types.Path): # <<<<<<<<<<<<<< * is_closed = obj.is_closed * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pgproto_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Path); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(20, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { /* "asyncpg/pgproto/codecs/geometry.pyx":109 * is_closed = 0 * elif isinstance(obj, pgproto_types.Path): * is_closed = obj.is_closed # <<<<<<<<<<<<<< * * npts = len(obj) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_is_closed); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_As_int8_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((int8_t)-1)) && PyErr_Occurred())) __PYX_ERR(20, 109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_is_closed = __pyx_t_4; /* "asyncpg/pgproto/codecs/geometry.pyx":108 * elif cpython.PyList_Check(obj): * is_closed = 0 * elif isinstance(obj, pgproto_types.Path): # <<<<<<<<<<<<<< * is_closed = obj.is_closed * */ } __pyx_L3:; /* "asyncpg/pgproto/codecs/geometry.pyx":111 * is_closed = obj.is_closed * * npts = len(obj) # <<<<<<<<<<<<<< * encoded_len = 1 + 4 + 16 * npts * if encoded_len > _MAXINT32: */ __pyx_t_5 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(20, 111, __pyx_L1_error) __pyx_v_npts = __pyx_t_5; /* "asyncpg/pgproto/codecs/geometry.pyx":112 * * npts = len(obj) * encoded_len = 1 + 4 + 16 * npts # <<<<<<<<<<<<<< * if encoded_len > _MAXINT32: * raise ValueError('path value too long') */ __pyx_v_encoded_len = (0x5 + (16 * __pyx_v_npts)); /* "asyncpg/pgproto/codecs/geometry.pyx":113 * npts = len(obj) * encoded_len = 1 + 4 + 16 * npts * if encoded_len > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('path value too long') * */ __pyx_t_1 = (__pyx_v_encoded_len > 0x7FFFFFFF); if (unlikely(__pyx_t_1)) { /* "asyncpg/pgproto/codecs/geometry.pyx":114 * encoded_len = 1 + 4 + 16 * npts * if encoded_len > _MAXINT32: * raise ValueError('path value too long') # <<<<<<<<<<<<<< * * wbuf.write_int32(encoded_len) */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(20, 114, __pyx_L1_error) /* "asyncpg/pgproto/codecs/geometry.pyx":113 * npts = len(obj) * encoded_len = 1 + 4 + 16 * npts * if encoded_len > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('path value too long') * */ } /* "asyncpg/pgproto/codecs/geometry.pyx":116 * raise ValueError('path value too long') * * wbuf.write_int32(encoded_len) # <<<<<<<<<<<<<< * wbuf.write_byte(is_closed) * wbuf.write_int32(npts) */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_wbuf, ((int32_t)__pyx_v_encoded_len)); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":117 * * wbuf.write_int32(encoded_len) * wbuf.write_byte(is_closed) # <<<<<<<<<<<<<< * wbuf.write_int32(npts) * */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_byte(__pyx_v_wbuf, __pyx_v_is_closed); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":118 * wbuf.write_int32(encoded_len) * wbuf.write_byte(is_closed) * wbuf.write_int32(npts) # <<<<<<<<<<<<<< * * _encode_points(wbuf, obj) */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_wbuf, ((int32_t)__pyx_v_npts)); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":120 * wbuf.write_int32(npts) * * _encode_points(wbuf, obj) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto__encode_points(__pyx_v_wbuf, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":97 * * * cdef path_encode(CodecContext settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * cdef: * int8_t is_closed = 0 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.path_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/geometry.pyx":123 * * * cdef path_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int8_t is_closed = (frb_read(buf, 1)[0]) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_path_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { int8_t __pyx_v_is_closed; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("path_decode", 1); /* "asyncpg/pgproto/codecs/geometry.pyx":125 * cdef path_decode(CodecContext settings, FRBuffer *buf): * cdef: * int8_t is_closed = (frb_read(buf, 1)[0]) # <<<<<<<<<<<<<< * * return pgproto_types.Path(*_decode_points(buf), is_closed=is_closed == 1) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 1); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 125, __pyx_L1_error) __pyx_v_is_closed = ((int8_t)(__pyx_t_1[0])); /* "asyncpg/pgproto/codecs/geometry.pyx":127 * int8_t is_closed = (frb_read(buf, 1)[0]) * * return pgproto_types.Path(*_decode_points(buf), is_closed=is_closed == 1) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pgproto_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Path); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto__decode_points(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyBool_FromLong((__pyx_v_is_closed == 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_closed, __pyx_t_5) < 0) __PYX_ERR(20, 127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/geometry.pyx":123 * * * cdef path_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int8_t is_closed = (frb_read(buf, 1)[0]) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.path_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/geometry.pyx":130 * * * cdef poly_encode(CodecContext settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * cdef: * bint is_closed */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_poly_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_wbuf, PyObject *__pyx_v_obj) { Py_ssize_t __pyx_v_npts; Py_ssize_t __pyx_v_encoded_len; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("poly_encode", 1); /* "asyncpg/pgproto/codecs/geometry.pyx":137 * int32_t i * * npts = len(obj) # <<<<<<<<<<<<<< * encoded_len = 4 + 16 * npts * if encoded_len > _MAXINT32: */ __pyx_t_1 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(20, 137, __pyx_L1_error) __pyx_v_npts = __pyx_t_1; /* "asyncpg/pgproto/codecs/geometry.pyx":138 * * npts = len(obj) * encoded_len = 4 + 16 * npts # <<<<<<<<<<<<<< * if encoded_len > _MAXINT32: * raise ValueError('polygon value too long') */ __pyx_v_encoded_len = (4 + (16 * __pyx_v_npts)); /* "asyncpg/pgproto/codecs/geometry.pyx":139 * npts = len(obj) * encoded_len = 4 + 16 * npts * if encoded_len > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('polygon value too long') * */ __pyx_t_2 = (__pyx_v_encoded_len > 0x7FFFFFFF); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/codecs/geometry.pyx":140 * encoded_len = 4 + 16 * npts * if encoded_len > _MAXINT32: * raise ValueError('polygon value too long') # <<<<<<<<<<<<<< * * wbuf.write_int32(encoded_len) */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(20, 140, __pyx_L1_error) /* "asyncpg/pgproto/codecs/geometry.pyx":139 * npts = len(obj) * encoded_len = 4 + 16 * npts * if encoded_len > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('polygon value too long') * */ } /* "asyncpg/pgproto/codecs/geometry.pyx":142 * raise ValueError('polygon value too long') * * wbuf.write_int32(encoded_len) # <<<<<<<<<<<<<< * wbuf.write_int32(npts) * _encode_points(wbuf, obj) */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_wbuf, ((int32_t)__pyx_v_encoded_len)); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":143 * * wbuf.write_int32(encoded_len) * wbuf.write_int32(npts) # <<<<<<<<<<<<<< * _encode_points(wbuf, obj) * */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_wbuf, ((int32_t)__pyx_v_npts)); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":144 * wbuf.write_int32(encoded_len) * wbuf.write_int32(npts) * _encode_points(wbuf, obj) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto__encode_points(__pyx_v_wbuf, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":130 * * * cdef poly_encode(CodecContext settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * cdef: * bint is_closed */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.poly_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/geometry.pyx":147 * * * cdef poly_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return pgproto_types.Polygon(*_decode_points(buf)) * */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_poly_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("poly_decode", 1); /* "asyncpg/pgproto/codecs/geometry.pyx":148 * * cdef poly_decode(CodecContext settings, FRBuffer *buf): * return pgproto_types.Polygon(*_decode_points(buf)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pgproto_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto__decode_points(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/geometry.pyx":147 * * * cdef poly_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return pgproto_types.Polygon(*_decode_points(buf)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.poly_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/geometry.pyx":151 * * * cdef circle_encode(CodecContext settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * wbuf.write_int32(24) * wbuf.write_double(obj[0][0]) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_circle_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_wbuf, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; double __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("circle_encode", 1); /* "asyncpg/pgproto/codecs/geometry.pyx":152 * * cdef circle_encode(CodecContext settings, WriteBuffer wbuf, obj): * wbuf.write_int32(24) # <<<<<<<<<<<<<< * wbuf.write_double(obj[0][0]) * wbuf.write_double(obj[0][1]) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_wbuf, 24); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":153 * cdef circle_encode(CodecContext settings, WriteBuffer wbuf, obj): * wbuf.write_int32(24) * wbuf.write_double(obj[0][0]) # <<<<<<<<<<<<<< * wbuf.write_double(obj[0][1]) * wbuf.write_double(obj[1]) */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(20, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_double(__pyx_v_wbuf, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":154 * wbuf.write_int32(24) * wbuf.write_double(obj[0][0]) * wbuf.write_double(obj[0][1]) # <<<<<<<<<<<<<< * wbuf.write_double(obj[1]) * */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(20, 154, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_double(__pyx_v_wbuf, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":155 * wbuf.write_double(obj[0][0]) * wbuf.write_double(obj[0][1]) * wbuf.write_double(obj[1]) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(20, 155, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_double(__pyx_v_wbuf, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/geometry.pyx":151 * * * cdef circle_encode(CodecContext settings, WriteBuffer wbuf, obj): # <<<<<<<<<<<<<< * wbuf.write_int32(24) * wbuf.write_double(obj[0][0]) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.circle_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/geometry.pyx":158 * * * cdef circle_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * double center_x = hton.unpack_double(frb_read(buf, 8)) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_circle_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { double __pyx_v_center_x; double __pyx_v_center_y; double __pyx_v_radius; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("circle_decode", 1); /* "asyncpg/pgproto/codecs/geometry.pyx":160 * cdef circle_decode(CodecContext settings, FRBuffer *buf): * cdef: * double center_x = hton.unpack_double(frb_read(buf, 8)) # <<<<<<<<<<<<<< * double center_y = hton.unpack_double(frb_read(buf, 8)) * double radius = hton.unpack_double(frb_read(buf, 8)) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 160, __pyx_L1_error) __pyx_v_center_x = unpack_double(__pyx_t_1); /* "asyncpg/pgproto/codecs/geometry.pyx":161 * cdef: * double center_x = hton.unpack_double(frb_read(buf, 8)) * double center_y = hton.unpack_double(frb_read(buf, 8)) # <<<<<<<<<<<<<< * double radius = hton.unpack_double(frb_read(buf, 8)) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 161, __pyx_L1_error) __pyx_v_center_y = unpack_double(__pyx_t_1); /* "asyncpg/pgproto/codecs/geometry.pyx":162 * double center_x = hton.unpack_double(frb_read(buf, 8)) * double center_y = hton.unpack_double(frb_read(buf, 8)) * double radius = hton.unpack_double(frb_read(buf, 8)) # <<<<<<<<<<<<<< * * return pgproto_types.Circle((center_x, center_y), radius) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(20, 162, __pyx_L1_error) __pyx_v_radius = unpack_double(__pyx_t_1); /* "asyncpg/pgproto/codecs/geometry.pyx":164 * double radius = hton.unpack_double(frb_read(buf, 8)) * * return pgproto_types.Circle((center_x, center_y), radius) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pgproto_types); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Circle); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyFloat_FromDouble(__pyx_v_center_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyFloat_FromDouble(__pyx_v_center_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(20, 164, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(20, 164, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_5 = 0; __pyx_t_5 = PyFloat_FromDouble(__pyx_v_radius); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_6, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/geometry.pyx":158 * * * cdef circle_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * double center_x = hton.unpack_double(frb_read(buf, 8)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.circle_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/hstore.pyx":8 * * * cdef hstore_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * char *str */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_hstore_encode(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { char *__pyx_v_str; Py_ssize_t __pyx_v_size; Py_ssize_t __pyx_v_count; PyObject *__pyx_v_items = 0; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_item_buf = 0; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); int32_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hstore_encode", 1); /* "asyncpg/pgproto/codecs/hstore.pyx":14 * ssize_t count * object items * WriteBuffer item_buf = WriteBuffer.new() # <<<<<<<<<<<<<< * * count = len(obj) */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_item_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/hstore.pyx":16 * WriteBuffer item_buf = WriteBuffer.new() * * count = len(obj) # <<<<<<<<<<<<<< * if count > _MAXINT32: * raise ValueError('hstore value is too large') */ __pyx_t_2 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(21, 16, __pyx_L1_error) __pyx_v_count = __pyx_t_2; /* "asyncpg/pgproto/codecs/hstore.pyx":17 * * count = len(obj) * if count > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('hstore value is too large') * item_buf.write_int32(count) */ __pyx_t_3 = (__pyx_v_count > 0x7FFFFFFF); if (unlikely(__pyx_t_3)) { /* "asyncpg/pgproto/codecs/hstore.pyx":18 * count = len(obj) * if count > _MAXINT32: * raise ValueError('hstore value is too large') # <<<<<<<<<<<<<< * item_buf.write_int32(count) * */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(21, 18, __pyx_L1_error) /* "asyncpg/pgproto/codecs/hstore.pyx":17 * * count = len(obj) * if count > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('hstore value is too large') * item_buf.write_int32(count) */ } /* "asyncpg/pgproto/codecs/hstore.pyx":19 * if count > _MAXINT32: * raise ValueError('hstore value is too large') * item_buf.write_int32(count) # <<<<<<<<<<<<<< * * if hasattr(obj, 'items'): */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_item_buf, ((int32_t)__pyx_v_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/hstore.pyx":21 * item_buf.write_int32(count) * * if hasattr(obj, 'items'): # <<<<<<<<<<<<<< * items = obj.items() * else: */ __pyx_t_3 = __Pyx_HasAttr(__pyx_v_obj, __pyx_n_u_items); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(21, 21, __pyx_L1_error) if (__pyx_t_3) { /* "asyncpg/pgproto/codecs/hstore.pyx":22 * * if hasattr(obj, 'items'): * items = obj.items() # <<<<<<<<<<<<<< * else: * items = obj */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_items = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/hstore.pyx":21 * item_buf.write_int32(count) * * if hasattr(obj, 'items'): # <<<<<<<<<<<<<< * items = obj.items() * else: */ goto __pyx_L4; } /* "asyncpg/pgproto/codecs/hstore.pyx":24 * items = obj.items() * else: * items = obj # <<<<<<<<<<<<<< * * for k, v in items: */ /*else*/ { __Pyx_INCREF(__pyx_v_obj); __pyx_v_items = __pyx_v_obj; } __pyx_L4:; /* "asyncpg/pgproto/codecs/hstore.pyx":26 * items = obj * * for k, v in items: # <<<<<<<<<<<<<< * if k is None: * raise ValueError('null value not allowed in hstore key') */ if (likely(PyList_CheckExact(__pyx_v_items)) || PyTuple_CheckExact(__pyx_v_items)) { __pyx_t_1 = __pyx_v_items; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_7 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 26, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(21, 26, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(21, 26, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(21, 26, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(21, 26, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(21, 26, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(21, 26, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(21, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(21, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_5 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(21, 26, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(21, 26, __pyx_L1_error) __pyx_L8_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/pgproto/codecs/hstore.pyx":27 * * for k, v in items: * if k is None: # <<<<<<<<<<<<<< * raise ValueError('null value not allowed in hstore key') * as_pg_string_and_size(settings, k, &str, &size) */ __pyx_t_3 = (__pyx_v_k == Py_None); if (unlikely(__pyx_t_3)) { /* "asyncpg/pgproto/codecs/hstore.pyx":28 * for k, v in items: * if k is None: * raise ValueError('null value not allowed in hstore key') # <<<<<<<<<<<<<< * as_pg_string_and_size(settings, k, &str, &size) * item_buf.write_int32(size) */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(21, 28, __pyx_L1_error) /* "asyncpg/pgproto/codecs/hstore.pyx":27 * * for k, v in items: * if k is None: # <<<<<<<<<<<<<< * raise ValueError('null value not allowed in hstore key') * as_pg_string_and_size(settings, k, &str, &size) */ } /* "asyncpg/pgproto/codecs/hstore.pyx":29 * if k is None: * raise ValueError('null value not allowed in hstore key') * as_pg_string_and_size(settings, k, &str, &size) # <<<<<<<<<<<<<< * item_buf.write_int32(size) * item_buf.write_cstr(str, size) */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_as_pg_string_and_size(__pyx_v_settings, __pyx_v_k, (&__pyx_v_str), (&__pyx_v_size)); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/hstore.pyx":30 * raise ValueError('null value not allowed in hstore key') * as_pg_string_and_size(settings, k, &str, &size) * item_buf.write_int32(size) # <<<<<<<<<<<<<< * item_buf.write_cstr(str, size) * if v is None: */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_item_buf, ((int32_t)__pyx_v_size)); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/hstore.pyx":31 * as_pg_string_and_size(settings, k, &str, &size) * item_buf.write_int32(size) * item_buf.write_cstr(str, size) # <<<<<<<<<<<<<< * if v is None: * item_buf.write_int32(-1) */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_cstr(__pyx_v_item_buf, __pyx_v_str, __pyx_v_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/hstore.pyx":32 * item_buf.write_int32(size) * item_buf.write_cstr(str, size) * if v is None: # <<<<<<<<<<<<<< * item_buf.write_int32(-1) * else: */ __pyx_t_3 = (__pyx_v_v == Py_None); if (__pyx_t_3) { /* "asyncpg/pgproto/codecs/hstore.pyx":33 * item_buf.write_cstr(str, size) * if v is None: * item_buf.write_int32(-1) # <<<<<<<<<<<<<< * else: * as_pg_string_and_size(settings, v, &str, &size) */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_item_buf, ((int32_t)-1L)); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/hstore.pyx":32 * item_buf.write_int32(size) * item_buf.write_cstr(str, size) * if v is None: # <<<<<<<<<<<<<< * item_buf.write_int32(-1) * else: */ goto __pyx_L10; } /* "asyncpg/pgproto/codecs/hstore.pyx":35 * item_buf.write_int32(-1) * else: * as_pg_string_and_size(settings, v, &str, &size) # <<<<<<<<<<<<<< * item_buf.write_int32(size) * item_buf.write_cstr(str, size) */ /*else*/ { __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_as_pg_string_and_size(__pyx_v_settings, __pyx_v_v, (&__pyx_v_str), (&__pyx_v_size)); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/hstore.pyx":36 * else: * as_pg_string_and_size(settings, v, &str, &size) * item_buf.write_int32(size) # <<<<<<<<<<<<<< * item_buf.write_cstr(str, size) * */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_item_buf, ((int32_t)__pyx_v_size)); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/hstore.pyx":37 * as_pg_string_and_size(settings, v, &str, &size) * item_buf.write_int32(size) * item_buf.write_cstr(str, size) # <<<<<<<<<<<<<< * * buf.write_int32(item_buf.len()) */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_cstr(__pyx_v_item_buf, __pyx_v_str, __pyx_v_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L10:; /* "asyncpg/pgproto/codecs/hstore.pyx":26 * items = obj * * for k, v in items: # <<<<<<<<<<<<<< * if k is None: * raise ValueError('null value not allowed in hstore key') */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/hstore.pyx":39 * item_buf.write_cstr(str, size) * * buf.write_int32(item_buf.len()) # <<<<<<<<<<<<<< * buf.write_buffer(item_buf) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_item_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_11 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(21, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/hstore.pyx":40 * * buf.write_int32(item_buf.len()) * buf.write_buffer(item_buf) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_buffer(__pyx_v_buf, __pyx_v_item_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/hstore.pyx":8 * * * cdef hstore_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * char *str */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.hstore_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_items); __Pyx_XDECREF((PyObject *)__pyx_v_item_buf); __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF(__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/hstore.pyx":43 * * * cdef hstore_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * dict result */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_hstore_decode(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_v_result = 0; uint32_t __pyx_v_elem_count; int32_t __pyx_v_elem_len; CYTHON_UNUSED uint32_t __pyx_v_i; PyObject *__pyx_v_k = 0; PyObject *__pyx_v_v = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; int __pyx_t_3; uint32_t __pyx_t_4; uint32_t __pyx_t_5; uint32_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hstore_decode", 1); /* "asyncpg/pgproto/codecs/hstore.pyx":52 * str v * * result = {} # <<<<<<<<<<<<<< * * elem_count = hton.unpack_int32(frb_read(buf, 4)) */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/hstore.pyx":54 * result = {} * * elem_count = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * if elem_count == 0: * return result */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(21, 54, __pyx_L1_error) __pyx_v_elem_count = ((uint32_t)unpack_int32(__pyx_t_2)); /* "asyncpg/pgproto/codecs/hstore.pyx":55 * * elem_count = hton.unpack_int32(frb_read(buf, 4)) * if elem_count == 0: # <<<<<<<<<<<<<< * return result * */ __pyx_t_3 = (__pyx_v_elem_count == 0); if (__pyx_t_3) { /* "asyncpg/pgproto/codecs/hstore.pyx":56 * elem_count = hton.unpack_int32(frb_read(buf, 4)) * if elem_count == 0: * return result # <<<<<<<<<<<<<< * * for i in range(elem_count): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/pgproto/codecs/hstore.pyx":55 * * elem_count = hton.unpack_int32(frb_read(buf, 4)) * if elem_count == 0: # <<<<<<<<<<<<<< * return result * */ } /* "asyncpg/pgproto/codecs/hstore.pyx":58 * return result * * for i in range(elem_count): # <<<<<<<<<<<<<< * elem_len = hton.unpack_int32(frb_read(buf, 4)) * if elem_len < 0: */ __pyx_t_4 = __pyx_v_elem_count; __pyx_t_5 = __pyx_t_4; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; /* "asyncpg/pgproto/codecs/hstore.pyx":59 * * for i in range(elem_count): * elem_len = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * if elem_len < 0: * raise ValueError('null value not allowed in hstore key') */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(21, 59, __pyx_L1_error) __pyx_v_elem_len = unpack_int32(__pyx_t_2); /* "asyncpg/pgproto/codecs/hstore.pyx":60 * for i in range(elem_count): * elem_len = hton.unpack_int32(frb_read(buf, 4)) * if elem_len < 0: # <<<<<<<<<<<<<< * raise ValueError('null value not allowed in hstore key') * */ __pyx_t_3 = (__pyx_v_elem_len < 0); if (unlikely(__pyx_t_3)) { /* "asyncpg/pgproto/codecs/hstore.pyx":61 * elem_len = hton.unpack_int32(frb_read(buf, 4)) * if elem_len < 0: * raise ValueError('null value not allowed in hstore key') # <<<<<<<<<<<<<< * * k = decode_pg_string(settings, frb_read(buf, elem_len), elem_len) */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(21, 61, __pyx_L1_error) /* "asyncpg/pgproto/codecs/hstore.pyx":60 * for i in range(elem_count): * elem_len = hton.unpack_int32(frb_read(buf, 4)) * if elem_len < 0: # <<<<<<<<<<<<<< * raise ValueError('null value not allowed in hstore key') * */ } /* "asyncpg/pgproto/codecs/hstore.pyx":63 * raise ValueError('null value not allowed in hstore key') * * k = decode_pg_string(settings, frb_read(buf, elem_len), elem_len) # <<<<<<<<<<<<<< * * elem_len = hton.unpack_int32(frb_read(buf, 4)) */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, __pyx_v_elem_len); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(21, 63, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_decode_pg_string(__pyx_v_settings, __pyx_t_2, __pyx_v_elem_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(21, 63, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_k, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/hstore.pyx":65 * k = decode_pg_string(settings, frb_read(buf, elem_len), elem_len) * * elem_len = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * if elem_len < 0: * v = None */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(21, 65, __pyx_L1_error) __pyx_v_elem_len = unpack_int32(__pyx_t_2); /* "asyncpg/pgproto/codecs/hstore.pyx":66 * * elem_len = hton.unpack_int32(frb_read(buf, 4)) * if elem_len < 0: # <<<<<<<<<<<<<< * v = None * else: */ __pyx_t_3 = (__pyx_v_elem_len < 0); if (__pyx_t_3) { /* "asyncpg/pgproto/codecs/hstore.pyx":67 * elem_len = hton.unpack_int32(frb_read(buf, 4)) * if elem_len < 0: * v = None # <<<<<<<<<<<<<< * else: * v = decode_pg_string(settings, frb_read(buf, elem_len), elem_len) */ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_v, ((PyObject*)Py_None)); /* "asyncpg/pgproto/codecs/hstore.pyx":66 * * elem_len = hton.unpack_int32(frb_read(buf, 4)) * if elem_len < 0: # <<<<<<<<<<<<<< * v = None * else: */ goto __pyx_L7; } /* "asyncpg/pgproto/codecs/hstore.pyx":69 * v = None * else: * v = decode_pg_string(settings, frb_read(buf, elem_len), elem_len) # <<<<<<<<<<<<<< * * result[k] = v */ /*else*/ { __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, __pyx_v_elem_len); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(21, 69, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_decode_pg_string(__pyx_v_settings, __pyx_t_2, __pyx_v_elem_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(21, 69, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_v, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; } __pyx_L7:; /* "asyncpg/pgproto/codecs/hstore.pyx":71 * v = decode_pg_string(settings, frb_read(buf, elem_len), elem_len) * * result[k] = v # <<<<<<<<<<<<<< * * return result */ if (unlikely((PyDict_SetItem(__pyx_v_result, __pyx_v_k, __pyx_v_v) < 0))) __PYX_ERR(21, 71, __pyx_L1_error) } /* "asyncpg/pgproto/codecs/hstore.pyx":73 * result[k] = v * * return result # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/pgproto/codecs/hstore.pyx":43 * * * cdef hstore_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * dict result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.hstore_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF(__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/misc.pyx":8 * * * cdef void_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * # Void is zero bytes * buf.write_int32(0) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_void_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, CYTHON_UNUSED PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("void_encode", 1); /* "asyncpg/pgproto/codecs/misc.pyx":10 * cdef void_encode(CodecContext settings, WriteBuffer buf, obj): * # Void is zero bytes * buf.write_int32(0) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/misc.pyx":8 * * * cdef void_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * # Void is zero bytes * buf.write_int32(0) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.void_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/misc.pyx":13 * * * cdef void_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * # Do nothing; void will be passed as NULL so this function * # will never be called. */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_void_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, CYTHON_UNUSED struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("void_decode", 1); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/network.pyx":22 * * * cdef inline uint8_t _ip_max_prefix_len(int32_t family): # <<<<<<<<<<<<<< * # Maximum number of bits in the network prefix of the specified * # IP protocol version. */ static CYTHON_INLINE uint8_t __pyx_f_7asyncpg_7pgproto_7pgproto__ip_max_prefix_len(int32_t __pyx_v_family) { uint8_t __pyx_r; int __pyx_t_1; /* "asyncpg/pgproto/codecs/network.pyx":25 * # Maximum number of bits in the network prefix of the specified * # IP protocol version. * if family == PGSQL_AF_INET: # <<<<<<<<<<<<<< * return 32 * else: */ __pyx_t_1 = (__pyx_v_family == 2); if (__pyx_t_1) { /* "asyncpg/pgproto/codecs/network.pyx":26 * # IP protocol version. * if family == PGSQL_AF_INET: * return 32 # <<<<<<<<<<<<<< * else: * return 128 */ __pyx_r = 32; goto __pyx_L0; /* "asyncpg/pgproto/codecs/network.pyx":25 * # Maximum number of bits in the network prefix of the specified * # IP protocol version. * if family == PGSQL_AF_INET: # <<<<<<<<<<<<<< * return 32 * else: */ } /* "asyncpg/pgproto/codecs/network.pyx":28 * return 32 * else: * return 128 # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_r = 0x80; goto __pyx_L0; } /* "asyncpg/pgproto/codecs/network.pyx":22 * * * cdef inline uint8_t _ip_max_prefix_len(int32_t family): # <<<<<<<<<<<<<< * # Maximum number of bits in the network prefix of the specified * # IP protocol version. */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "asyncpg/pgproto/codecs/network.pyx":31 * * * cdef inline int32_t _ip_addr_len(int32_t family): # <<<<<<<<<<<<<< * # Length of address in bytes for the specified IP protocol version. * if family == PGSQL_AF_INET: */ static CYTHON_INLINE int32_t __pyx_f_7asyncpg_7pgproto_7pgproto__ip_addr_len(int32_t __pyx_v_family) { int32_t __pyx_r; int __pyx_t_1; /* "asyncpg/pgproto/codecs/network.pyx":33 * cdef inline int32_t _ip_addr_len(int32_t family): * # Length of address in bytes for the specified IP protocol version. * if family == PGSQL_AF_INET: # <<<<<<<<<<<<<< * return 4 * else: */ __pyx_t_1 = (__pyx_v_family == 2); if (__pyx_t_1) { /* "asyncpg/pgproto/codecs/network.pyx":34 * # Length of address in bytes for the specified IP protocol version. * if family == PGSQL_AF_INET: * return 4 # <<<<<<<<<<<<<< * else: * return 16 */ __pyx_r = 4; goto __pyx_L0; /* "asyncpg/pgproto/codecs/network.pyx":33 * cdef inline int32_t _ip_addr_len(int32_t family): * # Length of address in bytes for the specified IP protocol version. * if family == PGSQL_AF_INET: # <<<<<<<<<<<<<< * return 4 * else: */ } /* "asyncpg/pgproto/codecs/network.pyx":36 * return 4 * else: * return 16 # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_r = 16; goto __pyx_L0; } /* "asyncpg/pgproto/codecs/network.pyx":31 * * * cdef inline int32_t _ip_addr_len(int32_t family): # <<<<<<<<<<<<<< * # Length of address in bytes for the specified IP protocol version. * if family == PGSQL_AF_INET: */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "asyncpg/pgproto/codecs/network.pyx":39 * * * cdef inline int8_t _ver_to_family(int32_t version): # <<<<<<<<<<<<<< * if version == 4: * return PGSQL_AF_INET */ static CYTHON_INLINE int8_t __pyx_f_7asyncpg_7pgproto_7pgproto__ver_to_family(int32_t __pyx_v_version) { int8_t __pyx_r; int __pyx_t_1; /* "asyncpg/pgproto/codecs/network.pyx":40 * * cdef inline int8_t _ver_to_family(int32_t version): * if version == 4: # <<<<<<<<<<<<<< * return PGSQL_AF_INET * else: */ __pyx_t_1 = (__pyx_v_version == 4); if (__pyx_t_1) { /* "asyncpg/pgproto/codecs/network.pyx":41 * cdef inline int8_t _ver_to_family(int32_t version): * if version == 4: * return PGSQL_AF_INET # <<<<<<<<<<<<<< * else: * return PGSQL_AF_INET6 */ __pyx_r = 2; goto __pyx_L0; /* "asyncpg/pgproto/codecs/network.pyx":40 * * cdef inline int8_t _ver_to_family(int32_t version): * if version == 4: # <<<<<<<<<<<<<< * return PGSQL_AF_INET * else: */ } /* "asyncpg/pgproto/codecs/network.pyx":43 * return PGSQL_AF_INET * else: * return PGSQL_AF_INET6 # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_r = 3; goto __pyx_L0; } /* "asyncpg/pgproto/codecs/network.pyx":39 * * * cdef inline int8_t _ver_to_family(int32_t version): # <<<<<<<<<<<<<< * if version == 4: * return PGSQL_AF_INET */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "asyncpg/pgproto/codecs/network.pyx":46 * * * cdef inline _net_encode(WriteBuffer buf, int8_t family, uint32_t bits, # <<<<<<<<<<<<<< * int8_t is_cidr, bytes addr): * */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto__net_encode(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, int8_t __pyx_v_family, uint32_t __pyx_v_bits, int8_t __pyx_v_is_cidr, PyObject *__pyx_v_addr) { char *__pyx_v_addrbytes; Py_ssize_t __pyx_v_addrlen; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_net_encode", 1); /* "asyncpg/pgproto/codecs/network.pyx":53 * ssize_t addrlen * * cpython.PyBytes_AsStringAndSize(addr, &addrbytes, &addrlen) # <<<<<<<<<<<<<< * * buf.write_int32(4 + addrlen) */ __pyx_t_1 = PyBytes_AsStringAndSize(__pyx_v_addr, (&__pyx_v_addrbytes), ((Py_ssize_t *)(&__pyx_v_addrlen))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(23, 53, __pyx_L1_error) /* "asyncpg/pgproto/codecs/network.pyx":55 * cpython.PyBytes_AsStringAndSize(addr, &addrbytes, &addrlen) * * buf.write_int32(4 + addrlen) # <<<<<<<<<<<<<< * buf.write_byte(family) * buf.write_byte(bits) */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, (4 + ((int32_t)__pyx_v_addrlen))); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/network.pyx":56 * * buf.write_int32(4 + addrlen) * buf.write_byte(family) # <<<<<<<<<<<<<< * buf.write_byte(bits) * buf.write_byte(is_cidr) */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_byte(__pyx_v_buf, __pyx_v_family); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/network.pyx":57 * buf.write_int32(4 + addrlen) * buf.write_byte(family) * buf.write_byte(bits) # <<<<<<<<<<<<<< * buf.write_byte(is_cidr) * buf.write_byte(addrlen) */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_byte(__pyx_v_buf, ((int8_t)__pyx_v_bits)); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/network.pyx":58 * buf.write_byte(family) * buf.write_byte(bits) * buf.write_byte(is_cidr) # <<<<<<<<<<<<<< * buf.write_byte(addrlen) * buf.write_cstr(addrbytes, addrlen) */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_byte(__pyx_v_buf, __pyx_v_is_cidr); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/network.pyx":59 * buf.write_byte(bits) * buf.write_byte(is_cidr) * buf.write_byte(addrlen) # <<<<<<<<<<<<<< * buf.write_cstr(addrbytes, addrlen) * */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_byte(__pyx_v_buf, ((int8_t)__pyx_v_addrlen)); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/network.pyx":60 * buf.write_byte(is_cidr) * buf.write_byte(addrlen) * buf.write_cstr(addrbytes, addrlen) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_cstr(__pyx_v_buf, __pyx_v_addrbytes, __pyx_v_addrlen); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/network.pyx":46 * * * cdef inline _net_encode(WriteBuffer buf, int8_t family, uint32_t bits, # <<<<<<<<<<<<<< * int8_t is_cidr, bytes addr): * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto._net_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/network.pyx":63 * * * cdef net_decode(CodecContext settings, FRBuffer *buf, bint as_cidr): # <<<<<<<<<<<<<< * cdef: * int32_t family = frb_read(buf, 1)[0] */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_net_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf, int __pyx_v_as_cidr) { int32_t __pyx_v_family; uint8_t __pyx_v_bits; int __pyx_v_prefix_len; int32_t __pyx_v_is_cidr; int32_t __pyx_v_addrlen; PyObject *__pyx_v_addr = 0; uint8_t __pyx_v_max_prefix_len; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; uint8_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int32_t __pyx_t_9; int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("net_decode", 1); /* "asyncpg/pgproto/codecs/network.pyx":65 * cdef net_decode(CodecContext settings, FRBuffer *buf, bint as_cidr): * cdef: * int32_t family = frb_read(buf, 1)[0] # <<<<<<<<<<<<<< * uint8_t bits = frb_read(buf, 1)[0] * int prefix_len */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 1); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(23, 65, __pyx_L1_error) __pyx_v_family = ((int32_t)(__pyx_t_1[0])); /* "asyncpg/pgproto/codecs/network.pyx":66 * cdef: * int32_t family = frb_read(buf, 1)[0] * uint8_t bits = frb_read(buf, 1)[0] # <<<<<<<<<<<<<< * int prefix_len * int32_t is_cidr = frb_read(buf, 1)[0] */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 1); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(23, 66, __pyx_L1_error) __pyx_v_bits = ((uint8_t)(__pyx_t_1[0])); /* "asyncpg/pgproto/codecs/network.pyx":68 * uint8_t bits = frb_read(buf, 1)[0] * int prefix_len * int32_t is_cidr = frb_read(buf, 1)[0] # <<<<<<<<<<<<<< * int32_t addrlen = frb_read(buf, 1)[0] * bytes addr */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 1); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(23, 68, __pyx_L1_error) __pyx_v_is_cidr = ((int32_t)(__pyx_t_1[0])); /* "asyncpg/pgproto/codecs/network.pyx":69 * int prefix_len * int32_t is_cidr = frb_read(buf, 1)[0] * int32_t addrlen = frb_read(buf, 1)[0] # <<<<<<<<<<<<<< * bytes addr * uint8_t max_prefix_len = _ip_max_prefix_len(family) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 1); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(23, 69, __pyx_L1_error) __pyx_v_addrlen = ((int32_t)(__pyx_t_1[0])); /* "asyncpg/pgproto/codecs/network.pyx":71 * int32_t addrlen = frb_read(buf, 1)[0] * bytes addr * uint8_t max_prefix_len = _ip_max_prefix_len(family) # <<<<<<<<<<<<<< * * if is_cidr != as_cidr: */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto__ip_max_prefix_len(__pyx_v_family); if (unlikely(__pyx_t_2 == ((uint8_t)-1) && PyErr_Occurred())) __PYX_ERR(23, 71, __pyx_L1_error) __pyx_v_max_prefix_len = __pyx_t_2; /* "asyncpg/pgproto/codecs/network.pyx":73 * uint8_t max_prefix_len = _ip_max_prefix_len(family) * * if is_cidr != as_cidr: # <<<<<<<<<<<<<< * raise ValueError('unexpected CIDR flag set in non-cidr value') * */ __pyx_t_3 = (__pyx_v_is_cidr != __pyx_v_as_cidr); if (unlikely(__pyx_t_3)) { /* "asyncpg/pgproto/codecs/network.pyx":74 * * if is_cidr != as_cidr: * raise ValueError('unexpected CIDR flag set in non-cidr value') # <<<<<<<<<<<<<< * * if family != PGSQL_AF_INET and family != PGSQL_AF_INET6: */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(23, 74, __pyx_L1_error) /* "asyncpg/pgproto/codecs/network.pyx":73 * uint8_t max_prefix_len = _ip_max_prefix_len(family) * * if is_cidr != as_cidr: # <<<<<<<<<<<<<< * raise ValueError('unexpected CIDR flag set in non-cidr value') * */ } /* "asyncpg/pgproto/codecs/network.pyx":76 * raise ValueError('unexpected CIDR flag set in non-cidr value') * * if family != PGSQL_AF_INET and family != PGSQL_AF_INET6: # <<<<<<<<<<<<<< * raise ValueError('invalid address family in "{}" value'.format( * 'cidr' if is_cidr else 'inet' */ switch (__pyx_v_family) { case 2: case 3: __pyx_t_3 = 0; break; default: __pyx_t_3 = 1; break; } if (unlikely(__pyx_t_3)) { /* "asyncpg/pgproto/codecs/network.pyx":77 * * if family != PGSQL_AF_INET and family != PGSQL_AF_INET6: * raise ValueError('invalid address family in "{}" value'.format( # <<<<<<<<<<<<<< * 'cidr' if is_cidr else 'inet' * )) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_address_family_in_value, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "asyncpg/pgproto/codecs/network.pyx":78 * if family != PGSQL_AF_INET and family != PGSQL_AF_INET6: * raise ValueError('invalid address family in "{}" value'.format( * 'cidr' if is_cidr else 'inet' # <<<<<<<<<<<<<< * )) * */ __pyx_t_3 = (__pyx_v_is_cidr != 0); if (__pyx_t_3) { __Pyx_INCREF(__pyx_n_u_cidr); __pyx_t_6 = __pyx_n_u_cidr; } else { __Pyx_INCREF(__pyx_n_u_inet); __pyx_t_6 = __pyx_n_u_inet; } __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* "asyncpg/pgproto/codecs/network.pyx":77 * * if family != PGSQL_AF_INET and family != PGSQL_AF_INET6: * raise ValueError('invalid address family in "{}" value'.format( # <<<<<<<<<<<<<< * 'cidr' if is_cidr else 'inet' * )) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(23, 77, __pyx_L1_error) /* "asyncpg/pgproto/codecs/network.pyx":76 * raise ValueError('unexpected CIDR flag set in non-cidr value') * * if family != PGSQL_AF_INET and family != PGSQL_AF_INET6: # <<<<<<<<<<<<<< * raise ValueError('invalid address family in "{}" value'.format( * 'cidr' if is_cidr else 'inet' */ } /* "asyncpg/pgproto/codecs/network.pyx":81 * )) * * max_prefix_len = _ip_max_prefix_len(family) # <<<<<<<<<<<<<< * * if bits > max_prefix_len: */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto__ip_max_prefix_len(__pyx_v_family); if (unlikely(__pyx_t_2 == ((uint8_t)-1) && PyErr_Occurred())) __PYX_ERR(23, 81, __pyx_L1_error) __pyx_v_max_prefix_len = __pyx_t_2; /* "asyncpg/pgproto/codecs/network.pyx":83 * max_prefix_len = _ip_max_prefix_len(family) * * if bits > max_prefix_len: # <<<<<<<<<<<<<< * raise ValueError('invalid network prefix length in "{}" value'.format( * 'cidr' if is_cidr else 'inet' */ __pyx_t_3 = (__pyx_v_bits > __pyx_v_max_prefix_len); if (unlikely(__pyx_t_3)) { /* "asyncpg/pgproto/codecs/network.pyx":84 * * if bits > max_prefix_len: * raise ValueError('invalid network prefix length in "{}" value'.format( # <<<<<<<<<<<<<< * 'cidr' if is_cidr else 'inet' * )) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_network_prefix_length_in, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/pgproto/codecs/network.pyx":85 * if bits > max_prefix_len: * raise ValueError('invalid network prefix length in "{}" value'.format( * 'cidr' if is_cidr else 'inet' # <<<<<<<<<<<<<< * )) * */ __pyx_t_3 = (__pyx_v_is_cidr != 0); if (__pyx_t_3) { __Pyx_INCREF(__pyx_n_u_cidr); __pyx_t_6 = __pyx_n_u_cidr; } else { __Pyx_INCREF(__pyx_n_u_inet); __pyx_t_6 = __pyx_n_u_inet; } __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/pgproto/codecs/network.pyx":84 * * if bits > max_prefix_len: * raise ValueError('invalid network prefix length in "{}" value'.format( # <<<<<<<<<<<<<< * 'cidr' if is_cidr else 'inet' * )) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(23, 84, __pyx_L1_error) /* "asyncpg/pgproto/codecs/network.pyx":83 * max_prefix_len = _ip_max_prefix_len(family) * * if bits > max_prefix_len: # <<<<<<<<<<<<<< * raise ValueError('invalid network prefix length in "{}" value'.format( * 'cidr' if is_cidr else 'inet' */ } /* "asyncpg/pgproto/codecs/network.pyx":88 * )) * * if addrlen != _ip_addr_len(family): # <<<<<<<<<<<<<< * raise ValueError('invalid address length in "{}" value'.format( * 'cidr' if is_cidr else 'inet' */ __pyx_t_9 = __pyx_f_7asyncpg_7pgproto_7pgproto__ip_addr_len(__pyx_v_family); if (unlikely(__pyx_t_9 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(23, 88, __pyx_L1_error) __pyx_t_3 = (__pyx_v_addrlen != __pyx_t_9); if (unlikely(__pyx_t_3)) { /* "asyncpg/pgproto/codecs/network.pyx":89 * * if addrlen != _ip_addr_len(family): * raise ValueError('invalid address length in "{}" value'.format( # <<<<<<<<<<<<<< * 'cidr' if is_cidr else 'inet' * )) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_address_length_in_value, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "asyncpg/pgproto/codecs/network.pyx":90 * if addrlen != _ip_addr_len(family): * raise ValueError('invalid address length in "{}" value'.format( * 'cidr' if is_cidr else 'inet' # <<<<<<<<<<<<<< * )) * */ __pyx_t_3 = (__pyx_v_is_cidr != 0); if (__pyx_t_3) { __Pyx_INCREF(__pyx_n_u_cidr); __pyx_t_6 = __pyx_n_u_cidr; } else { __Pyx_INCREF(__pyx_n_u_inet); __pyx_t_6 = __pyx_n_u_inet; } __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* "asyncpg/pgproto/codecs/network.pyx":89 * * if addrlen != _ip_addr_len(family): * raise ValueError('invalid address length in "{}" value'.format( # <<<<<<<<<<<<<< * 'cidr' if is_cidr else 'inet' * )) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(23, 89, __pyx_L1_error) /* "asyncpg/pgproto/codecs/network.pyx":88 * )) * * if addrlen != _ip_addr_len(family): # <<<<<<<<<<<<<< * raise ValueError('invalid address length in "{}" value'.format( * 'cidr' if is_cidr else 'inet' */ } /* "asyncpg/pgproto/codecs/network.pyx":93 * )) * * addr = cpython.PyBytes_FromStringAndSize(frb_read(buf, addrlen), addrlen) # <<<<<<<<<<<<<< * * if as_cidr or bits != max_prefix_len: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, __pyx_v_addrlen); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(23, 93, __pyx_L1_error) __pyx_t_5 = PyBytes_FromStringAndSize(__pyx_t_1, __pyx_v_addrlen); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_addr = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/pgproto/codecs/network.pyx":95 * addr = cpython.PyBytes_FromStringAndSize(frb_read(buf, addrlen), addrlen) * * if as_cidr or bits != max_prefix_len: # <<<<<<<<<<<<<< * prefix_len = cpython.PyLong_FromLong(bits) * */ if (!__pyx_v_as_cidr) { } else { __pyx_t_3 = __pyx_v_as_cidr; goto __pyx_L8_bool_binop_done; } __pyx_t_10 = (__pyx_v_bits != __pyx_v_max_prefix_len); __pyx_t_3 = __pyx_t_10; __pyx_L8_bool_binop_done:; if (__pyx_t_3) { /* "asyncpg/pgproto/codecs/network.pyx":96 * * if as_cidr or bits != max_prefix_len: * prefix_len = cpython.PyLong_FromLong(bits) # <<<<<<<<<<<<<< * * if as_cidr: */ __pyx_t_5 = PyLong_FromLong(__pyx_v_bits); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(23, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_prefix_len = __pyx_t_11; /* "asyncpg/pgproto/codecs/network.pyx":98 * prefix_len = cpython.PyLong_FromLong(bits) * * if as_cidr: # <<<<<<<<<<<<<< * return _ipnet((addr, prefix_len)) * else: */ if (__pyx_v_as_cidr) { /* "asyncpg/pgproto/codecs/network.pyx":99 * * if as_cidr: * return _ipnet((addr, prefix_len)) # <<<<<<<<<<<<<< * else: * return _ipiface((addr, prefix_len)) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ipnet); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_prefix_len); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_addr); __Pyx_GIVEREF(__pyx_v_addr); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_addr)) __PYX_ERR(23, 99, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6)) __PYX_ERR(23, 99, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/network.pyx":98 * prefix_len = cpython.PyLong_FromLong(bits) * * if as_cidr: # <<<<<<<<<<<<<< * return _ipnet((addr, prefix_len)) * else: */ } /* "asyncpg/pgproto/codecs/network.pyx":101 * return _ipnet((addr, prefix_len)) * else: * return _ipiface((addr, prefix_len)) # <<<<<<<<<<<<<< * else: * return _ipaddr(addr) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ipiface); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_prefix_len); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_addr); __Pyx_GIVEREF(__pyx_v_addr); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_addr)) __PYX_ERR(23, 101, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7)) __PYX_ERR(23, 101, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; } /* "asyncpg/pgproto/codecs/network.pyx":95 * addr = cpython.PyBytes_FromStringAndSize(frb_read(buf, addrlen), addrlen) * * if as_cidr or bits != max_prefix_len: # <<<<<<<<<<<<<< * prefix_len = cpython.PyLong_FromLong(bits) * */ } /* "asyncpg/pgproto/codecs/network.pyx":103 * return _ipiface((addr, prefix_len)) * else: * return _ipaddr(addr) # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ipaddr); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_addr}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; } /* "asyncpg/pgproto/codecs/network.pyx":63 * * * cdef net_decode(CodecContext settings, FRBuffer *buf, bint as_cidr): # <<<<<<<<<<<<<< * cdef: * int32_t family = frb_read(buf, 1)[0] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.net_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_addr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/network.pyx":106 * * * cdef cidr_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * object ipnet */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_cidr_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { PyObject *__pyx_v_ipnet = 0; int8_t __pyx_v_family; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int32_t __pyx_t_5; int8_t __pyx_t_6; uint32_t __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("cidr_encode", 1); /* "asyncpg/pgproto/codecs/network.pyx":111 * int8_t family * * ipnet = _ipnet(obj) # <<<<<<<<<<<<<< * family = _ver_to_family(ipnet.version) * _net_encode(buf, family, ipnet.prefixlen, 1, ipnet.network_address.packed) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ipnet); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_obj}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_ipnet = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/network.pyx":112 * * ipnet = _ipnet(obj) * family = _ver_to_family(ipnet.version) # <<<<<<<<<<<<<< * _net_encode(buf, family, ipnet.prefixlen, 1, ipnet.network_address.packed) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ipnet, __pyx_n_s_version); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_5 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(23, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __pyx_f_7asyncpg_7pgproto_7pgproto__ver_to_family(__pyx_t_5); if (unlikely(__pyx_t_6 == ((int8_t)-1) && PyErr_Occurred())) __PYX_ERR(23, 112, __pyx_L1_error) __pyx_v_family = __pyx_t_6; /* "asyncpg/pgproto/codecs/network.pyx":113 * ipnet = _ipnet(obj) * family = _ver_to_family(ipnet.version) * _net_encode(buf, family, ipnet.prefixlen, 1, ipnet.network_address.packed) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ipnet, __pyx_n_s_prefixlen); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(23, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ipnet, __pyx_n_s_network_address); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_packed); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_2))) __PYX_ERR(23, 113, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto__net_encode(__pyx_v_buf, __pyx_v_family, __pyx_t_7, 1, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/network.pyx":106 * * * cdef cidr_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * object ipnet */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.cidr_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ipnet); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/network.pyx":116 * * * cdef cidr_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return net_decode(settings, buf, True) * */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_cidr_decode(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("cidr_decode", 1); /* "asyncpg/pgproto/codecs/network.pyx":117 * * cdef cidr_decode(CodecContext settings, FRBuffer *buf): * return net_decode(settings, buf, True) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_net_decode(__pyx_v_settings, __pyx_v_buf, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/network.pyx":116 * * * cdef cidr_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return net_decode(settings, buf, True) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.cidr_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/network.pyx":120 * * * cdef inet_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * object ipaddr */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_inet_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { PyObject *__pyx_v_ipaddr = 0; int8_t __pyx_v_family; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int32_t __pyx_t_8; int8_t __pyx_t_9; uint8_t __pyx_t_10; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; uint32_t __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("inet_encode", 1); /* "asyncpg/pgproto/codecs/network.pyx":125 * int8_t family * * try: # <<<<<<<<<<<<<< * ipaddr = _ipaddr(obj) * except ValueError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "asyncpg/pgproto/codecs/network.pyx":126 * * try: * ipaddr = _ipaddr(obj) # <<<<<<<<<<<<<< * except ValueError: * # PostgreSQL accepts *both* CIDR and host values */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ipaddr); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 126, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_obj}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 126, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_ipaddr = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/network.pyx":125 * int8_t family * * try: # <<<<<<<<<<<<<< * ipaddr = _ipaddr(obj) * except ValueError: */ } /* "asyncpg/pgproto/codecs/network.pyx":134 * _net_encode(buf, family, ipaddr.network.prefixlen, 1, ipaddr.packed) * else: * family = _ver_to_family(ipaddr.version) # <<<<<<<<<<<<<< * _net_encode(buf, family, _ip_max_prefix_len(family), 0, ipaddr.packed) * */ /*else:*/ { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ipaddr, __pyx_n_s_version); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 134, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_t_4); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(23, 134, __pyx_L5_except_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __pyx_f_7asyncpg_7pgproto_7pgproto__ver_to_family(__pyx_t_8); if (unlikely(__pyx_t_9 == ((int8_t)-1) && PyErr_Occurred())) __PYX_ERR(23, 134, __pyx_L5_except_error) __pyx_v_family = __pyx_t_9; /* "asyncpg/pgproto/codecs/network.pyx":135 * else: * family = _ver_to_family(ipaddr.version) * _net_encode(buf, family, _ip_max_prefix_len(family), 0, ipaddr.packed) # <<<<<<<<<<<<<< * * */ __pyx_t_10 = __pyx_f_7asyncpg_7pgproto_7pgproto__ip_max_prefix_len(__pyx_v_family); if (unlikely(__pyx_t_10 == ((uint8_t)-1) && PyErr_Occurred())) __PYX_ERR(23, 135, __pyx_L5_except_error) __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ipaddr, __pyx_n_s_packed); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 135, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(23, 135, __pyx_L5_except_error) __pyx_t_5 = __pyx_f_7asyncpg_7pgproto_7pgproto__net_encode(__pyx_v_buf, __pyx_v_family, __pyx_t_10, 0, ((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 135, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/pgproto/codecs/network.pyx":127 * try: * ipaddr = _ipaddr(obj) * except ValueError: # <<<<<<<<<<<<<< * # PostgreSQL accepts *both* CIDR and host values * # for the host datatype. */ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_11) { __Pyx_AddTraceback("asyncpg.pgproto.pgproto.inet_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_6) < 0) __PYX_ERR(23, 127, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); /* "asyncpg/pgproto/codecs/network.pyx":130 * # PostgreSQL accepts *both* CIDR and host values * # for the host datatype. * ipaddr = _ipiface(obj) # <<<<<<<<<<<<<< * family = _ver_to_family(ipaddr.version) * _net_encode(buf, family, ipaddr.network.prefixlen, 1, ipaddr.packed) */ __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_ipiface); if (unlikely(!__pyx_t_13)) __PYX_ERR(23, 130, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_obj}; __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(23, 130, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_XDECREF_SET(__pyx_v_ipaddr, __pyx_t_12); __pyx_t_12 = 0; /* "asyncpg/pgproto/codecs/network.pyx":131 * # for the host datatype. * ipaddr = _ipiface(obj) * family = _ver_to_family(ipaddr.version) # <<<<<<<<<<<<<< * _net_encode(buf, family, ipaddr.network.prefixlen, 1, ipaddr.packed) * else: */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_ipaddr, __pyx_n_s_version); if (unlikely(!__pyx_t_12)) __PYX_ERR(23, 131, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_t_12); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(23, 131, __pyx_L5_except_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_9 = __pyx_f_7asyncpg_7pgproto_7pgproto__ver_to_family(__pyx_t_8); if (unlikely(__pyx_t_9 == ((int8_t)-1) && PyErr_Occurred())) __PYX_ERR(23, 131, __pyx_L5_except_error) __pyx_v_family = __pyx_t_9; /* "asyncpg/pgproto/codecs/network.pyx":132 * ipaddr = _ipiface(obj) * family = _ver_to_family(ipaddr.version) * _net_encode(buf, family, ipaddr.network.prefixlen, 1, ipaddr.packed) # <<<<<<<<<<<<<< * else: * family = _ver_to_family(ipaddr.version) */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_ipaddr, __pyx_n_s_network); if (unlikely(!__pyx_t_12)) __PYX_ERR(23, 132, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_prefixlen); if (unlikely(!__pyx_t_13)) __PYX_ERR(23, 132, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_15 = __Pyx_PyInt_As_uint32_t(__pyx_t_13); if (unlikely((__pyx_t_15 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(23, 132, __pyx_L5_except_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_ipaddr, __pyx_n_s_packed); if (unlikely(!__pyx_t_13)) __PYX_ERR(23, 132, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_13); if (!(likely(PyBytes_CheckExact(__pyx_t_13))||((__pyx_t_13) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_13))) __PYX_ERR(23, 132, __pyx_L5_except_error) __pyx_t_12 = __pyx_f_7asyncpg_7pgproto_7pgproto__net_encode(__pyx_v_buf, __pyx_v_family, __pyx_t_15, 1, ((PyObject*)__pyx_t_13)); if (unlikely(!__pyx_t_12)) __PYX_ERR(23, 132, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; /* "asyncpg/pgproto/codecs/network.pyx":125 * int8_t family * * try: # <<<<<<<<<<<<<< * ipaddr = _ipaddr(obj) * except ValueError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L8_try_end:; } /* "asyncpg/pgproto/codecs/network.pyx":120 * * * cdef inet_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * object ipaddr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.inet_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ipaddr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/network.pyx":138 * * * cdef inet_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return net_decode(settings, buf, False) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_inet_decode(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("inet_decode", 1); /* "asyncpg/pgproto/codecs/network.pyx":139 * * cdef inet_decode(CodecContext settings, FRBuffer *buf): * return net_decode(settings, buf, False) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_net_decode(__pyx_v_settings, __pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/network.pyx":138 * * * cdef inet_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return net_decode(settings, buf, False) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.inet_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/tid.pyx":8 * * * cdef tid_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef int overflow = 0 * cdef unsigned long block, offset */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_tid_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { int __pyx_v_overflow; unsigned long __pyx_v_block; unsigned long __pyx_v_offset; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; Py_ssize_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; unsigned long __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tid_encode", 1); /* "asyncpg/pgproto/codecs/tid.pyx":9 * * cdef tid_encode(CodecContext settings, WriteBuffer buf, obj): * cdef int overflow = 0 # <<<<<<<<<<<<<< * cdef unsigned long block, offset * */ __pyx_v_overflow = 0; /* "asyncpg/pgproto/codecs/tid.pyx":12 * cdef unsigned long block, offset * * if not (cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj)): # <<<<<<<<<<<<<< * raise TypeError( * 'list or tuple expected (got type {})'.format(type(obj))) */ __pyx_t_2 = PyTuple_Check(__pyx_v_obj); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = PyList_Check(__pyx_v_obj); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; __pyx_t_2 = (!__pyx_t_1); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/codecs/tid.pyx":14 * if not (cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj)): * raise TypeError( * 'list or tuple expected (got type {})'.format(type(obj))) # <<<<<<<<<<<<<< * * if len(obj) != 2: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_list_or_tuple_expected_got_type, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)Py_TYPE(__pyx_v_obj))}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/pgproto/codecs/tid.pyx":13 * * if not (cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj)): * raise TypeError( # <<<<<<<<<<<<<< * 'list or tuple expected (got type {})'.format(type(obj))) * */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(24, 13, __pyx_L1_error) /* "asyncpg/pgproto/codecs/tid.pyx":12 * cdef unsigned long block, offset * * if not (cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj)): # <<<<<<<<<<<<<< * raise TypeError( * 'list or tuple expected (got type {})'.format(type(obj))) */ } /* "asyncpg/pgproto/codecs/tid.pyx":16 * 'list or tuple expected (got type {})'.format(type(obj))) * * if len(obj) != 2: # <<<<<<<<<<<<<< * raise ValueError( * 'invalid number of elements in tid tuple, expecting 2') */ __pyx_t_7 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(24, 16, __pyx_L1_error) __pyx_t_2 = (__pyx_t_7 != 2); if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/codecs/tid.pyx":17 * * if len(obj) != 2: * raise ValueError( # <<<<<<<<<<<<<< * 'invalid number of elements in tid tuple, expecting 2') * */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(24, 17, __pyx_L1_error) /* "asyncpg/pgproto/codecs/tid.pyx":16 * 'list or tuple expected (got type {})'.format(type(obj))) * * if len(obj) != 2: # <<<<<<<<<<<<<< * raise ValueError( * 'invalid number of elements in tid tuple, expecting 2') */ } /* "asyncpg/pgproto/codecs/tid.pyx":20 * 'invalid number of elements in tid tuple, expecting 2') * * try: # <<<<<<<<<<<<<< * block = cpython.PyLong_AsUnsignedLong(obj[0]) * except OverflowError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); /*try:*/ { /* "asyncpg/pgproto/codecs/tid.pyx":21 * * try: * block = cpython.PyLong_AsUnsignedLong(obj[0]) # <<<<<<<<<<<<<< * except OverflowError: * overflow = 1 */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 21, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = PyLong_AsUnsignedLong(__pyx_t_4); if (unlikely(__pyx_t_11 == ((unsigned long)-1L) && PyErr_Occurred())) __PYX_ERR(24, 21, __pyx_L7_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_block = __pyx_t_11; /* "asyncpg/pgproto/codecs/tid.pyx":20 * 'invalid number of elements in tid tuple, expecting 2') * * try: # <<<<<<<<<<<<<< * block = cpython.PyLong_AsUnsignedLong(obj[0]) * except OverflowError: */ } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L12_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/pgproto/codecs/tid.pyx":22 * try: * block = cpython.PyLong_AsUnsignedLong(obj[0]) * except OverflowError: # <<<<<<<<<<<<<< * overflow = 1 * */ __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OverflowError); if (__pyx_t_12) { __Pyx_AddTraceback("asyncpg.pgproto.pgproto.tid_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_5) < 0) __PYX_ERR(24, 22, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_5); /* "asyncpg/pgproto/codecs/tid.pyx":23 * block = cpython.PyLong_AsUnsignedLong(obj[0]) * except OverflowError: * overflow = 1 # <<<<<<<<<<<<<< * * # "long" and "long long" have the same size for x86_64, need an extra check */ __pyx_v_overflow = 1; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L8_exception_handled; } goto __pyx_L9_except_error; /* "asyncpg/pgproto/codecs/tid.pyx":20 * 'invalid number of elements in tid tuple, expecting 2') * * try: # <<<<<<<<<<<<<< * block = cpython.PyLong_AsUnsignedLong(obj[0]) * except OverflowError: */ __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_L12_try_end:; } /* "asyncpg/pgproto/codecs/tid.pyx":26 * * # "long" and "long long" have the same size for x86_64, need an extra check * if overflow or (sizeof(block) > 4 and block > UINT32_MAX): # <<<<<<<<<<<<<< * raise OverflowError('tuple id block value out of uint32 range') * */ __pyx_t_1 = (__pyx_v_overflow != 0); if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L16_bool_binop_done; } __pyx_t_1 = ((sizeof(__pyx_v_block)) > 4); if (__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L16_bool_binop_done; } __pyx_t_1 = (__pyx_v_block > UINT32_MAX); __pyx_t_2 = __pyx_t_1; __pyx_L16_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/codecs/tid.pyx":27 * # "long" and "long long" have the same size for x86_64, need an extra check * if overflow or (sizeof(block) > 4 and block > UINT32_MAX): * raise OverflowError('tuple id block value out of uint32 range') # <<<<<<<<<<<<<< * * try: */ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_OverflowError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(24, 27, __pyx_L1_error) /* "asyncpg/pgproto/codecs/tid.pyx":26 * * # "long" and "long long" have the same size for x86_64, need an extra check * if overflow or (sizeof(block) > 4 and block > UINT32_MAX): # <<<<<<<<<<<<<< * raise OverflowError('tuple id block value out of uint32 range') * */ } /* "asyncpg/pgproto/codecs/tid.pyx":29 * raise OverflowError('tuple id block value out of uint32 range') * * try: # <<<<<<<<<<<<<< * offset = cpython.PyLong_AsUnsignedLong(obj[1]) * overflow = 0 */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "asyncpg/pgproto/codecs/tid.pyx":30 * * try: * offset = cpython.PyLong_AsUnsignedLong(obj[1]) # <<<<<<<<<<<<<< * overflow = 0 * except OverflowError: */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_obj, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 30, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = PyLong_AsUnsignedLong(__pyx_t_5); if (unlikely(__pyx_t_11 == ((unsigned long)-1L) && PyErr_Occurred())) __PYX_ERR(24, 30, __pyx_L19_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_offset = __pyx_t_11; /* "asyncpg/pgproto/codecs/tid.pyx":31 * try: * offset = cpython.PyLong_AsUnsignedLong(obj[1]) * overflow = 0 # <<<<<<<<<<<<<< * except OverflowError: * overflow = 1 */ __pyx_v_overflow = 0; /* "asyncpg/pgproto/codecs/tid.pyx":29 * raise OverflowError('tuple id block value out of uint32 range') * * try: # <<<<<<<<<<<<<< * offset = cpython.PyLong_AsUnsignedLong(obj[1]) * overflow = 0 */ } __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L24_try_end; __pyx_L19_error:; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/pgproto/codecs/tid.pyx":32 * offset = cpython.PyLong_AsUnsignedLong(obj[1]) * overflow = 0 * except OverflowError: # <<<<<<<<<<<<<< * overflow = 1 * */ __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OverflowError); if (__pyx_t_12) { __Pyx_AddTraceback("asyncpg.pgproto.pgproto.tid_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(24, 32, __pyx_L21_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /* "asyncpg/pgproto/codecs/tid.pyx":33 * overflow = 0 * except OverflowError: * overflow = 1 # <<<<<<<<<<<<<< * * if overflow or offset > 65535: */ __pyx_v_overflow = 1; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L20_exception_handled; } goto __pyx_L21_except_error; /* "asyncpg/pgproto/codecs/tid.pyx":29 * raise OverflowError('tuple id block value out of uint32 range') * * try: # <<<<<<<<<<<<<< * offset = cpython.PyLong_AsUnsignedLong(obj[1]) * overflow = 0 */ __pyx_L21_except_error:; __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); goto __pyx_L1_error; __pyx_L20_exception_handled:; __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); __pyx_L24_try_end:; } /* "asyncpg/pgproto/codecs/tid.pyx":35 * overflow = 1 * * if overflow or offset > 65535: # <<<<<<<<<<<<<< * raise OverflowError('tuple id offset value out of uint16 range') * */ __pyx_t_1 = (__pyx_v_overflow != 0); if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L28_bool_binop_done; } __pyx_t_1 = (__pyx_v_offset > 0xFFFF); __pyx_t_2 = __pyx_t_1; __pyx_L28_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "asyncpg/pgproto/codecs/tid.pyx":36 * * if overflow or offset > 65535: * raise OverflowError('tuple id offset value out of uint16 range') # <<<<<<<<<<<<<< * * buf.write_int32(6) */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_OverflowError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(24, 36, __pyx_L1_error) /* "asyncpg/pgproto/codecs/tid.pyx":35 * overflow = 1 * * if overflow or offset > 65535: # <<<<<<<<<<<<<< * raise OverflowError('tuple id offset value out of uint16 range') * */ } /* "asyncpg/pgproto/codecs/tid.pyx":38 * raise OverflowError('tuple id offset value out of uint16 range') * * buf.write_int32(6) # <<<<<<<<<<<<<< * buf.write_int32(block) * buf.write_int16(offset) */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, 6); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/tid.pyx":39 * * buf.write_int32(6) * buf.write_int32(block) # <<<<<<<<<<<<<< * buf.write_int16(offset) * */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, ((int32_t)__pyx_v_block)); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/tid.pyx":40 * buf.write_int32(6) * buf.write_int32(block) * buf.write_int16(offset) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int16(__pyx_v_buf, ((int16_t)__pyx_v_offset)); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/tid.pyx":8 * * * cdef tid_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef int overflow = 0 * cdef unsigned long block, offset */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.tid_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/tid.pyx":43 * * * cdef tid_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * uint32_t block */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_tid_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { uint32_t __pyx_v_block; uint16_t __pyx_v_offset; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tid_decode", 1); /* "asyncpg/pgproto/codecs/tid.pyx":48 * uint16_t offset * * block = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * offset = hton.unpack_int16(frb_read(buf, 2)) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(24, 48, __pyx_L1_error) __pyx_v_block = ((uint32_t)unpack_int32(__pyx_t_1)); /* "asyncpg/pgproto/codecs/tid.pyx":49 * * block = hton.unpack_int32(frb_read(buf, 4)) * offset = hton.unpack_int16(frb_read(buf, 2)) # <<<<<<<<<<<<<< * * return (block, offset) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(24, 49, __pyx_L1_error) __pyx_v_offset = ((uint16_t)unpack_int16(__pyx_t_1)); /* "asyncpg/pgproto/codecs/tid.pyx":51 * offset = hton.unpack_int16(frb_read(buf, 2)) * * return (block, offset) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_block); if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_uint16_t(__pyx_v_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(24, 51, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(24, 51, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/tid.pyx":43 * * * cdef tid_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * uint32_t block */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.tid_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":8 * * * cdef pg_snapshot_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * ssize_t nxip */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { Py_ssize_t __pyx_v_nxip; uint64_t __pyx_v_xmin; uint64_t __pyx_v_xmax; int __pyx_v_i; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_xip_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; Py_ssize_t __pyx_t_7; uint64_t __pyx_t_8; Py_ssize_t __pyx_t_9; Py_ssize_t __pyx_t_10; int __pyx_t_11; unsigned PY_LONG_LONG __pyx_t_12; int32_t __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pg_snapshot_encode", 1); /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":14 * uint64_t xmax * int i * WriteBuffer xip_buf = WriteBuffer.new() # <<<<<<<<<<<<<< * * if not (cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj)): */ __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_xip_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":16 * WriteBuffer xip_buf = WriteBuffer.new() * * if not (cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj)): # <<<<<<<<<<<<<< * raise TypeError( * 'list or tuple expected (got type {})'.format(type(obj))) */ __pyx_t_3 = PyTuple_Check(__pyx_v_obj); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = PyList_Check(__pyx_v_obj); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; __pyx_t_3 = (!__pyx_t_2); if (unlikely(__pyx_t_3)) { /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":18 * if not (cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj)): * raise TypeError( * 'list or tuple expected (got type {})'.format(type(obj))) # <<<<<<<<<<<<<< * * if len(obj) != 3: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_list_or_tuple_expected_got_type, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)Py_TYPE(__pyx_v_obj))}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":17 * * if not (cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj)): * raise TypeError( # <<<<<<<<<<<<<< * 'list or tuple expected (got type {})'.format(type(obj))) * */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(25, 17, __pyx_L1_error) /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":16 * WriteBuffer xip_buf = WriteBuffer.new() * * if not (cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj)): # <<<<<<<<<<<<<< * raise TypeError( * 'list or tuple expected (got type {})'.format(type(obj))) */ } /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":20 * 'list or tuple expected (got type {})'.format(type(obj))) * * if len(obj) != 3: # <<<<<<<<<<<<<< * raise ValueError( * 'invalid number of elements in txid_snapshot tuple, expecting 4') */ __pyx_t_7 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(25, 20, __pyx_L1_error) __pyx_t_3 = (__pyx_t_7 != 3); if (unlikely(__pyx_t_3)) { /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":21 * * if len(obj) != 3: * raise ValueError( # <<<<<<<<<<<<<< * 'invalid number of elements in txid_snapshot tuple, expecting 4') * */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(25, 21, __pyx_L1_error) /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":20 * 'list or tuple expected (got type {})'.format(type(obj))) * * if len(obj) != 3: # <<<<<<<<<<<<<< * raise ValueError( * 'invalid number of elements in txid_snapshot tuple, expecting 4') */ } /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":24 * 'invalid number of elements in txid_snapshot tuple, expecting 4') * * nxip = len(obj[2]) # <<<<<<<<<<<<<< * if nxip > _MAXINT32: * raise ValueError('txid_snapshot value is too long') */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_obj, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(25, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_nxip = __pyx_t_7; /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":25 * * nxip = len(obj[2]) * if nxip > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('txid_snapshot value is too long') * */ __pyx_t_3 = (__pyx_v_nxip > 0x7FFFFFFF); if (unlikely(__pyx_t_3)) { /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":26 * nxip = len(obj[2]) * if nxip > _MAXINT32: * raise ValueError('txid_snapshot value is too long') # <<<<<<<<<<<<<< * * xmin = obj[0] */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(25, 26, __pyx_L1_error) /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":25 * * nxip = len(obj[2]) * if nxip > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('txid_snapshot value is too long') * */ } /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":28 * raise ValueError('txid_snapshot value is too long') * * xmin = obj[0] # <<<<<<<<<<<<<< * xmax = obj[1] * */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyInt_As_uint64_t(__pyx_t_4); if (unlikely((__pyx_t_8 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(25, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_xmin = __pyx_t_8; /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":29 * * xmin = obj[0] * xmax = obj[1] # <<<<<<<<<<<<<< * * for i in range(nxip): */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_obj, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyInt_As_uint64_t(__pyx_t_4); if (unlikely((__pyx_t_8 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(25, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_xmax = __pyx_t_8; /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":31 * xmax = obj[1] * * for i in range(nxip): # <<<<<<<<<<<<<< * xip_buf.write_int64( * cpython.PyLong_AsUnsignedLongLong(obj[2][i])) */ __pyx_t_9 = __pyx_v_nxip; __pyx_t_10 = __pyx_t_9; for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":33 * for i in range(nxip): * xip_buf.write_int64( * cpython.PyLong_AsUnsignedLongLong(obj[2][i])) # <<<<<<<<<<<<<< * * buf.write_int32(20 + xip_buf.len()) */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_obj, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = PyLong_AsUnsignedLongLong(__pyx_t_1); if (unlikely(__pyx_t_12 == ((unsigned PY_LONG_LONG)-1LL) && PyErr_Occurred())) __PYX_ERR(25, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":32 * * for i in range(nxip): * xip_buf.write_int64( # <<<<<<<<<<<<<< * cpython.PyLong_AsUnsignedLongLong(obj[2][i])) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_xip_buf, ((int64_t)__pyx_t_12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":35 * cpython.PyLong_AsUnsignedLongLong(obj[2][i])) * * buf.write_int32(20 + xip_buf.len()) # <<<<<<<<<<<<<< * * buf.write_int32(nxip) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_xip_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_AddCObj(__pyx_int_20, __pyx_t_1, 20, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_13 = __Pyx_PyInt_As_int32_t(__pyx_t_4); if (unlikely((__pyx_t_13 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(25, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, __pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":37 * buf.write_int32(20 + xip_buf.len()) * * buf.write_int32(nxip) # <<<<<<<<<<<<<< * buf.write_int64(xmin) * buf.write_int64(xmax) */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32(__pyx_v_buf, ((int32_t)__pyx_v_nxip)); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":38 * * buf.write_int32(nxip) * buf.write_int64(xmin) # <<<<<<<<<<<<<< * buf.write_int64(xmax) * buf.write_buffer(xip_buf) */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_buf, ((int64_t)__pyx_v_xmin)); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":39 * buf.write_int32(nxip) * buf.write_int64(xmin) * buf.write_int64(xmax) # <<<<<<<<<<<<<< * buf.write_buffer(xip_buf) * */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64(__pyx_v_buf, ((int64_t)__pyx_v_xmax)); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":40 * buf.write_int64(xmin) * buf.write_int64(xmax) * buf.write_buffer(xip_buf) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_buffer(__pyx_v_buf, __pyx_v_xip_buf); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":8 * * * cdef pg_snapshot_encode(CodecContext settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * cdef: * ssize_t nxip */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.pg_snapshot_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_xip_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":43 * * * cdef pg_snapshot_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int32_t nxip */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_decode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { int32_t __pyx_v_nxip; uint64_t __pyx_v_xmin; uint64_t __pyx_v_xmax; PyObject *__pyx_v_xip_tup = 0; int32_t __pyx_v_i; PyObject *__pyx_v_xip = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int32_t __pyx_t_3; int32_t __pyx_t_4; int32_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pg_snapshot_decode", 1); /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":52 * object xip * * nxip = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * xmin = hton.unpack_int64(frb_read(buf, 8)) * xmax = hton.unpack_int64(frb_read(buf, 8)) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(25, 52, __pyx_L1_error) __pyx_v_nxip = unpack_int32(__pyx_t_1); /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":53 * * nxip = hton.unpack_int32(frb_read(buf, 4)) * xmin = hton.unpack_int64(frb_read(buf, 8)) # <<<<<<<<<<<<<< * xmax = hton.unpack_int64(frb_read(buf, 8)) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(25, 53, __pyx_L1_error) __pyx_v_xmin = ((uint64_t)unpack_int64(__pyx_t_1)); /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":54 * nxip = hton.unpack_int32(frb_read(buf, 4)) * xmin = hton.unpack_int64(frb_read(buf, 8)) * xmax = hton.unpack_int64(frb_read(buf, 8)) # <<<<<<<<<<<<<< * * xip_tup = cpython.PyTuple_New(nxip) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(25, 54, __pyx_L1_error) __pyx_v_xmax = ((uint64_t)unpack_int64(__pyx_t_1)); /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":56 * xmax = hton.unpack_int64(frb_read(buf, 8)) * * xip_tup = cpython.PyTuple_New(nxip) # <<<<<<<<<<<<<< * for i in range(nxip): * xip = cpython.PyLong_FromUnsignedLongLong( */ __pyx_t_2 = PyTuple_New(__pyx_v_nxip); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_xip_tup = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":57 * * xip_tup = cpython.PyTuple_New(nxip) * for i in range(nxip): # <<<<<<<<<<<<<< * xip = cpython.PyLong_FromUnsignedLongLong( * hton.unpack_int64(frb_read(buf, 8))) */ __pyx_t_3 = __pyx_v_nxip; __pyx_t_4 = __pyx_t_3; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":59 * for i in range(nxip): * xip = cpython.PyLong_FromUnsignedLongLong( * hton.unpack_int64(frb_read(buf, 8))) # <<<<<<<<<<<<<< * cpython.Py_INCREF(xip) * cpython.PyTuple_SET_ITEM(xip_tup, i, xip) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(25, 59, __pyx_L1_error) /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":58 * xip_tup = cpython.PyTuple_New(nxip) * for i in range(nxip): * xip = cpython.PyLong_FromUnsignedLongLong( # <<<<<<<<<<<<<< * hton.unpack_int64(frb_read(buf, 8))) * cpython.Py_INCREF(xip) */ __pyx_t_2 = PyLong_FromUnsignedLongLong(((uint64_t)unpack_int64(__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_xip, __pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":60 * xip = cpython.PyLong_FromUnsignedLongLong( * hton.unpack_int64(frb_read(buf, 8))) * cpython.Py_INCREF(xip) # <<<<<<<<<<<<<< * cpython.PyTuple_SET_ITEM(xip_tup, i, xip) * */ Py_INCREF(__pyx_v_xip); /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":61 * hton.unpack_int64(frb_read(buf, 8))) * cpython.Py_INCREF(xip) * cpython.PyTuple_SET_ITEM(xip_tup, i, xip) # <<<<<<<<<<<<<< * * return (xmin, xmax, xip_tup) */ PyTuple_SET_ITEM(__pyx_v_xip_tup, __pyx_v_i, __pyx_v_xip); } /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":63 * cpython.PyTuple_SET_ITEM(xip_tup, i, xip) * * return (xmin, xmax, xip_tup) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_uint64_t(__pyx_v_xmin); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyInt_From_uint64_t(__pyx_v_xmax); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2)) __PYX_ERR(25, 63, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6)) __PYX_ERR(25, 63, __pyx_L1_error); __Pyx_INCREF(__pyx_v_xip_tup); __Pyx_GIVEREF(__pyx_v_xip_tup); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_xip_tup)) __PYX_ERR(25, 63, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_6 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":43 * * * cdef pg_snapshot_decode(CodecContext settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * int32_t nxip */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.pg_snapshot_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_xip_tup); __Pyx_XDECREF(__pyx_v_xip); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle___UUIDReplaceMe(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_1__pyx_unpickle___UUIDReplaceMe(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_7pgproto_7pgproto_1__pyx_unpickle___UUIDReplaceMe = {"__pyx_unpickle___UUIDReplaceMe", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_1__pyx_unpickle___UUIDReplaceMe, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_1__pyx_unpickle___UUIDReplaceMe(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle___UUIDReplaceMe (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle___UUIDReplaceMe", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle___UUIDReplaceMe", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle___UUIDReplaceMe") < 0)) __PYX_ERR(2, 1, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle___UUIDReplaceMe", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 1, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.pgproto.pgproto.__pyx_unpickle___UUIDReplaceMe", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto___pyx_unpickle___UUIDReplaceMe(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto___pyx_unpickle___UUIDReplaceMe(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle___UUIDReplaceMe", 1); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum */ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__32, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "(tree fragment)":5 * cdef object __pyx_result * if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd): * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum * __pyx_result = __UUIDReplaceMe.__new__(__pyx_type) */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(2, 5, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v___pyx_PickleError = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd): * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum # <<<<<<<<<<<<<< * __pyx_result = __UUIDReplaceMe.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(2, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum * __pyx_result = __UUIDReplaceMe.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle___UUIDReplaceMe__set_state(<__UUIDReplaceMe> __pyx_result, __pyx_state) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v___pyx_result = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum * __pyx_result = __UUIDReplaceMe.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle___UUIDReplaceMe__set_state(<__UUIDReplaceMe> __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_2 = (__pyx_v___pyx_state != Py_None); if (__pyx_t_2) { /* "(tree fragment)":9 * __pyx_result = __UUIDReplaceMe.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle___UUIDReplaceMe__set_state(<__UUIDReplaceMe> __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle___UUIDReplaceMe__set_state(__UUIDReplaceMe __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 9, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto___pyx_unpickle___UUIDReplaceMe__set_state(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum * __pyx_result = __UUIDReplaceMe.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle___UUIDReplaceMe__set_state(<__UUIDReplaceMe> __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: * __pyx_unpickle___UUIDReplaceMe__set_state(<__UUIDReplaceMe> __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle___UUIDReplaceMe__set_state(__UUIDReplaceMe __pyx_result, tuple __pyx_state): * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle___UUIDReplaceMe(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.__pyx_unpickle___UUIDReplaceMe", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":11 * __pyx_unpickle___UUIDReplaceMe__set_state(<__UUIDReplaceMe> __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle___UUIDReplaceMe__set_state(__UUIDReplaceMe __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[0]) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto___pyx_unpickle___UUIDReplaceMe__set_state(struct __pyx_obj_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle___UUIDReplaceMe__set_state", 1); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle___UUIDReplaceMe__set_state(__UUIDReplaceMe __pyx_result, tuple __pyx_state): * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[0]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(2, 12, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 > 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 12, __pyx_L1_error) __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "(tree fragment)":13 * cdef __pyx_unpickle___UUIDReplaceMe__set_state(__UUIDReplaceMe __pyx_result, tuple __pyx_state): * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[0]) # <<<<<<<<<<<<<< */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 13, __pyx_L1_error) } __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle___UUIDReplaceMe__set_state(__UUIDReplaceMe __pyx_result, tuple __pyx_state): * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[0]) */ } /* "(tree fragment)":11 * __pyx_unpickle___UUIDReplaceMe__set_state(<__UUIDReplaceMe> __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle___UUIDReplaceMe__set_state(__UUIDReplaceMe __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[0]) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.__pyx_unpickle___UUIDReplaceMe__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_CodecContext(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_3__pyx_unpickle_CodecContext(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_7pgproto_7pgproto_3__pyx_unpickle_CodecContext = {"__pyx_unpickle_CodecContext", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_3__pyx_unpickle_CodecContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_7pgproto_7pgproto_3__pyx_unpickle_CodecContext(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_CodecContext (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CodecContext", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CodecContext", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_CodecContext") < 0)) __PYX_ERR(2, 1, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CodecContext", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 1, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.pgproto.pgproto.__pyx_unpickle_CodecContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_7pgproto_7pgproto_2__pyx_unpickle_CodecContext(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_7pgproto_7pgproto_2__pyx_unpickle_CodecContext(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_CodecContext", 1); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum */ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__32, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "(tree fragment)":5 * cdef object __pyx_result * if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd): * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum * __pyx_result = CodecContext.__new__(__pyx_type) */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(2, 5, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v___pyx_PickleError = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd): * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum # <<<<<<<<<<<<<< * __pyx_result = CodecContext.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(2, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum * __pyx_result = CodecContext.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_CodecContext__set_state( __pyx_result, __pyx_state) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v___pyx_result = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum * __pyx_result = CodecContext.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_CodecContext__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_2 = (__pyx_v___pyx_state != Py_None); if (__pyx_t_2) { /* "(tree fragment)":9 * __pyx_result = CodecContext.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_CodecContext__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_CodecContext__set_state(CodecContext __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 9, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto___pyx_unpickle_CodecContext__set_state(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum * __pyx_result = CodecContext.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_CodecContext__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: * __pyx_unpickle_CodecContext__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_CodecContext__set_state(CodecContext __pyx_result, tuple __pyx_state): * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_CodecContext(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.__pyx_unpickle_CodecContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":11 * __pyx_unpickle_CodecContext__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_CodecContext__set_state(CodecContext __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[0]) */ static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto___pyx_unpickle_CodecContext__set_state(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_CodecContext__set_state", 1); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_CodecContext__set_state(CodecContext __pyx_result, tuple __pyx_state): * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[0]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(2, 12, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 > 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 12, __pyx_L1_error) __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "(tree fragment)":13 * cdef __pyx_unpickle_CodecContext__set_state(CodecContext __pyx_result, tuple __pyx_state): * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[0]) # <<<<<<<<<<<<<< */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 13, __pyx_L1_error) } __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_CodecContext__set_state(CodecContext __pyx_result, tuple __pyx_state): * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[0]) */ } /* "(tree fragment)":11 * __pyx_unpickle_CodecContext__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_CodecContext__set_state(CodecContext __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[0]) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.__pyx_unpickle_CodecContext__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer; #if CYTHON_USE_FREELISTS static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_freelist_7asyncpg_7pgproto_7pgproto_WriteBuffer[256]; static int __pyx_freecount_7asyncpg_7pgproto_7pgproto_WriteBuffer = 0; #endif static PyObject *__pyx_tp_new_7asyncpg_7pgproto_7pgproto_WriteBuffer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_7asyncpg_7pgproto_7pgproto_WriteBuffer > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer)))) { o = (PyObject*)__pyx_freelist_7asyncpg_7pgproto_7pgproto_WriteBuffer[--__pyx_freecount_7asyncpg_7pgproto_7pgproto_WriteBuffer]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer)); (void) PyObject_INIT(o, t); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif p = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)o); p->__pyx_vtab = __pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer; if (unlikely(__pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7asyncpg_7pgproto_7pgproto_WriteBuffer(PyObject *o) { { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_7asyncpg_7pgproto_7pgproto_WriteBuffer < 256) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer)))) { __pyx_freelist_7asyncpg_7pgproto_7pgproto_WriteBuffer[__pyx_freecount_7asyncpg_7pgproto_7pgproto_WriteBuffer++] = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static PyMethodDef __pyx_methods_7asyncpg_7pgproto_7pgproto_WriteBuffer[] = { {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS #if !CYTHON_COMPILING_IN_LIMITED_API static PyBufferProcs __pyx_tp_as_buffer_WriteBuffer = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif __pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_5__getbuffer__, /*bf_getbuffer*/ __pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_7__releasebuffer__, /*bf_releasebuffer*/ }; #endif static PyType_Slot __pyx_type_7asyncpg_7pgproto_7pgproto_WriteBuffer_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_7pgproto_7pgproto_WriteBuffer}, #if defined(Py_bf_getbuffer) {Py_bf_getbuffer, (void *)__pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_5__getbuffer__}, #endif #if defined(Py_bf_releasebuffer) {Py_bf_releasebuffer, (void *)__pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_7__releasebuffer__}, #endif {Py_tp_methods, (void *)__pyx_methods_7asyncpg_7pgproto_7pgproto_WriteBuffer}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_7pgproto_7pgproto_WriteBuffer}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_7pgproto_7pgproto_WriteBuffer_spec = { "asyncpg.pgproto.pgproto.WriteBuffer", sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER, __pyx_type_7asyncpg_7pgproto_7pgproto_WriteBuffer_slots, }; #else static PyBufferProcs __pyx_tp_as_buffer_WriteBuffer = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif __pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_5__getbuffer__, /*bf_getbuffer*/ __pyx_pw_7asyncpg_7pgproto_7pgproto_11WriteBuffer_7__releasebuffer__, /*bf_releasebuffer*/ }; static PyTypeObject __pyx_type_7asyncpg_7pgproto_7pgproto_WriteBuffer = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.pgproto.pgproto.""WriteBuffer", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_7pgproto_7pgproto_WriteBuffer, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_WriteBuffer, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7asyncpg_7pgproto_7pgproto_WriteBuffer, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_7pgproto_7pgproto_WriteBuffer, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer; #if CYTHON_USE_FREELISTS static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_freelist_7asyncpg_7pgproto_7pgproto_ReadBuffer[256]; static int __pyx_freecount_7asyncpg_7pgproto_7pgproto_ReadBuffer = 0; #endif static PyObject *__pyx_tp_new_7asyncpg_7pgproto_7pgproto_ReadBuffer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_7asyncpg_7pgproto_7pgproto_ReadBuffer > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer)))) { o = (PyObject*)__pyx_freelist_7asyncpg_7pgproto_7pgproto_ReadBuffer[--__pyx_freecount_7asyncpg_7pgproto_7pgproto_ReadBuffer]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif p = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)o); p->__pyx_vtab = __pyx_vtabptr_7asyncpg_7pgproto_7pgproto_ReadBuffer; p->_bufs = Py_None; Py_INCREF(Py_None); p->_bufs_append = Py_None; Py_INCREF(Py_None); p->_bufs_popleft = Py_None; Py_INCREF(Py_None); p->_buf0 = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_buf0_prev = ((PyObject*)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_7asyncpg_7pgproto_7pgproto_10ReadBuffer_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7asyncpg_7pgproto_7pgproto_ReadBuffer(PyObject *o) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *p = (struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->_bufs); Py_CLEAR(p->_bufs_append); Py_CLEAR(p->_bufs_popleft); Py_CLEAR(p->_buf0); Py_CLEAR(p->_buf0_prev); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_7asyncpg_7pgproto_7pgproto_ReadBuffer < 256) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer)))) { __pyx_freelist_7asyncpg_7pgproto_7pgproto_ReadBuffer[__pyx_freecount_7asyncpg_7pgproto_7pgproto_ReadBuffer++] = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_7asyncpg_7pgproto_7pgproto_ReadBuffer(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *p = (struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)o; if (p->_bufs) { e = (*v)(p->_bufs, a); if (e) return e; } if (p->_bufs_append) { e = (*v)(p->_bufs_append, a); if (e) return e; } if (p->_bufs_popleft) { e = (*v)(p->_bufs_popleft, a); if (e) return e; } return 0; } static PyMethodDef __pyx_methods_7asyncpg_7pgproto_7pgproto_ReadBuffer[] = { {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_10ReadBuffer_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_10ReadBuffer_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_7pgproto_7pgproto_ReadBuffer_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_7pgproto_7pgproto_ReadBuffer}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_7pgproto_7pgproto_ReadBuffer}, {Py_tp_methods, (void *)__pyx_methods_7asyncpg_7pgproto_7pgproto_ReadBuffer}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_7pgproto_7pgproto_ReadBuffer}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_7pgproto_7pgproto_ReadBuffer_spec = { "asyncpg.pgproto.pgproto.ReadBuffer", sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_7asyncpg_7pgproto_7pgproto_ReadBuffer_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_7pgproto_7pgproto_ReadBuffer = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.pgproto.pgproto.""ReadBuffer", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_7pgproto_7pgproto_ReadBuffer, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_7pgproto_7pgproto_ReadBuffer, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7asyncpg_7pgproto_7pgproto_ReadBuffer, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_7pgproto_7pgproto_ReadBuffer, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext __pyx_vtable_7asyncpg_7pgproto_7pgproto_CodecContext; static PyObject *__pyx_tp_new_7asyncpg_7pgproto_7pgproto_CodecContext(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)o); p->__pyx_vtab = __pyx_vtabptr_7asyncpg_7pgproto_7pgproto_CodecContext; return o; } static void __pyx_tp_dealloc_7asyncpg_7pgproto_7pgproto_CodecContext(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_7pgproto_7pgproto_CodecContext) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyMethodDef __pyx_methods_7asyncpg_7pgproto_7pgproto_CodecContext[] = { {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_12CodecContext_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_7pgproto_7pgproto_CodecContext_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_7pgproto_7pgproto_CodecContext}, {Py_tp_methods, (void *)__pyx_methods_7asyncpg_7pgproto_7pgproto_CodecContext}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_7pgproto_7pgproto_CodecContext}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_7pgproto_7pgproto_CodecContext_spec = { "asyncpg.pgproto.pgproto.CodecContext", sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_7asyncpg_7pgproto_7pgproto_CodecContext_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_7pgproto_7pgproto_CodecContext = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.pgproto.pgproto.""CodecContext", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_7pgproto_7pgproto_CodecContext, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7asyncpg_7pgproto_7pgproto_CodecContext, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_7pgproto_7pgproto_CodecContext, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif return o; } static void __pyx_tp_dealloc_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static PyMethodDef __pyx_methods_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe[] = { {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_15__UUIDReplaceMe_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_15__UUIDReplaceMe_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe}, {Py_tp_methods, (void *)__pyx_methods_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe_spec = { "asyncpg.pgproto.pgproto.__UUIDReplaceMe", sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, __pyx_type_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.pgproto.pgproto.""__UUIDReplaceMe", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyObject *__pyx_tp_new_7asyncpg_7pgproto_7pgproto_UUID(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *p; PyObject *o = __pyx_tp_new_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)o); p->_int = Py_None; Py_INCREF(Py_None); p->_hash = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7asyncpg_7pgproto_7pgproto_UUID(PyObject *o) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *p = (struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)o; PyObject_GC_UnTrack(o); if (p->__weakref__) PyObject_ClearWeakRefs(o); Py_CLEAR(p->_int); Py_CLEAR(p->_hash); __pyx_tp_dealloc_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe(o); } static int __pyx_tp_traverse_7asyncpg_7pgproto_7pgproto_UUID(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *p = (struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID *)o; e = ((likely(__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe)) ? ((__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe->tp_traverse) ? __pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7asyncpg_7pgproto_7pgproto_UUID)); if (e) return e; if (p->_int) { e = (*v)(p->_int, a); if (e) return e; } if (p->_hash) { e = (*v)(p->_hash, a); if (e) return e; } return 0; } static PyObject *__pyx_tp_richcompare_7asyncpg_7pgproto_7pgproto_UUID(PyObject *o1, PyObject *o2, int op) { switch (op) { case Py_EQ: { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_11__eq__(o1, o2); } case Py_NE: { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_13__ne__(o1, o2); } case Py_LT: { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_15__lt__(o1, o2); } case Py_GT: { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_17__gt__(o1, o2); } case Py_LE: { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_19__le__(o1, o2); } case Py_GE: { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_21__ge__(o1, o2); } default: { return __Pyx_NewRef(Py_NotImplemented); } } } static PyObject *__pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_bytes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_5bytes_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_int(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_3int_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_is_safe(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_7is_safe_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_hex(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_3hex_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_bytes_le(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_8bytes_le_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_fields(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_6fields_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_time_low(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_8time_low_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_time_mid(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_8time_mid_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_time_hi_version(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_15time_hi_version_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_clock_seq_hi_variant(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_20clock_seq_hi_variant_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_clock_seq_low(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_13clock_seq_low_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_time(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_4time_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_clock_seq(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_9clock_seq_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_node(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_4node_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_urn(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_3urn_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_variant(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_7variant_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_version(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_7version_1__get__(o); } static PyObject *__pyx_specialmethod___pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_7__repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) { return __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_7__repr__(self); } static PyMethodDef __pyx_methods_7asyncpg_7pgproto_7pgproto_UUID[] = { {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_7__repr__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_9__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_7asyncpg_7pgproto_7pgproto_UUID[] = { {(char *)"bytes", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_bytes, 0, (char *)0, 0}, {(char *)"int", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_int, 0, (char *)0, 0}, {(char *)"is_safe", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_is_safe, 0, (char *)0, 0}, {(char *)"hex", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_hex, 0, (char *)0, 0}, {(char *)"bytes_le", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_bytes_le, 0, (char *)0, 0}, {(char *)"fields", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_fields, 0, (char *)0, 0}, {(char *)"time_low", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_time_low, 0, (char *)0, 0}, {(char *)"time_mid", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_time_mid, 0, (char *)0, 0}, {(char *)"time_hi_version", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_time_hi_version, 0, (char *)0, 0}, {(char *)"clock_seq_hi_variant", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_clock_seq_hi_variant, 0, (char *)0, 0}, {(char *)"clock_seq_low", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_clock_seq_low, 0, (char *)0, 0}, {(char *)"time", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_time, 0, (char *)0, 0}, {(char *)"clock_seq", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_clock_seq, 0, (char *)0, 0}, {(char *)"node", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_node, 0, (char *)0, 0}, {(char *)"urn", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_urn, 0, (char *)0, 0}, {(char *)"variant", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_variant, 0, (char *)0, 0}, {(char *)"version", __pyx_getprop_7asyncpg_7pgproto_7pgproto_4UUID_version, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_7pgproto_7pgproto_UUID_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_7pgproto_7pgproto_UUID}, {Py_tp_repr, (void *)__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_7__repr__}, {Py_nb_int, (void *)__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_25__int__}, #if PY_MAJOR_VERSION < 3 {Py_nb_long, (void *)__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_25__int__}, #endif {Py_tp_hash, (void *)__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_23__hash__}, {Py_tp_str, (void *)__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_5__str__}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_7pgproto_7pgproto_UUID}, {Py_tp_richcompare, (void *)__pyx_tp_richcompare_7asyncpg_7pgproto_7pgproto_UUID}, {Py_tp_methods, (void *)__pyx_methods_7asyncpg_7pgproto_7pgproto_UUID}, {Py_tp_getset, (void *)__pyx_getsets_7asyncpg_7pgproto_7pgproto_UUID}, {Py_tp_init, (void *)__pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_3__init__}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_7pgproto_7pgproto_UUID}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_7pgproto_7pgproto_UUID_spec = { "asyncpg.pgproto.pgproto.UUID", sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_7asyncpg_7pgproto_7pgproto_UUID_slots, }; #else static PyNumberMethods __pyx_tp_as_number_UUID = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_bool*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_coerce*/ #endif __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_25__int__, /*nb_int*/ #if PY_MAJOR_VERSION < 3 __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_25__int__, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ 0, /*nb_index*/ #if PY_VERSION_HEX >= 0x03050000 0, /*nb_matrix_multiply*/ #endif #if PY_VERSION_HEX >= 0x03050000 0, /*nb_inplace_matrix_multiply*/ #endif }; static PyTypeObject __pyx_type_7asyncpg_7pgproto_7pgproto_UUID = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.pgproto.pgproto.""UUID", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_7pgproto_7pgproto_UUID, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_7__repr__, /*tp_repr*/ &__pyx_tp_as_number_UUID, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_23__hash__, /*tp_hash*/ 0, /*tp_call*/ __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_5__str__, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_7pgproto_7pgproto_UUID, /*tp_traverse*/ 0, /*tp_clear*/ __pyx_tp_richcompare_7asyncpg_7pgproto_7pgproto_UUID, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7asyncpg_7pgproto_7pgproto_UUID, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_7asyncpg_7pgproto_7pgproto_UUID, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_7asyncpg_7pgproto_7pgproto_4UUID_3__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_7pgproto_7pgproto_UUID, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_0e, __pyx_k_0e, sizeof(__pyx_k_0e), 0, 1, 0, 0}, {&__pyx_kp_u_16_bytes_were_expected_got, __pyx_k_16_bytes_were_expected_got, sizeof(__pyx_k_16_bytes_were_expected_got), 0, 1, 0, 0}, {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, {&__pyx_n_s_BitString, __pyx_k_BitString, sizeof(__pyx_k_BitString), 0, 0, 1, 1}, {&__pyx_n_s_Box, __pyx_k_Box, sizeof(__pyx_k_Box), 0, 0, 1, 1}, {&__pyx_n_s_BufferError, __pyx_k_BufferError, sizeof(__pyx_k_BufferError), 0, 0, 1, 1}, {&__pyx_n_s_Circle, __pyx_k_Circle, sizeof(__pyx_k_Circle), 0, 0, 1, 1}, {&__pyx_n_s_CodecContext, __pyx_k_CodecContext, sizeof(__pyx_k_CodecContext), 0, 0, 1, 1}, {&__pyx_n_s_CodecContext___reduce_cython, __pyx_k_CodecContext___reduce_cython, sizeof(__pyx_k_CodecContext___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_CodecContext___setstate_cython, __pyx_k_CodecContext___setstate_cython, sizeof(__pyx_k_CodecContext___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_CodecContext_get_json_decoder, __pyx_k_CodecContext_get_json_decoder, sizeof(__pyx_k_CodecContext_get_json_decoder), 0, 0, 1, 1}, {&__pyx_n_s_CodecContext_get_json_encoder, __pyx_k_CodecContext_get_json_encoder, sizeof(__pyx_k_CodecContext_get_json_encoder), 0, 0, 1, 1}, {&__pyx_n_s_CodecContext_get_text_codec, __pyx_k_CodecContext_get_text_codec, sizeof(__pyx_k_CodecContext_get_text_codec), 0, 0, 1, 1}, {&__pyx_kp_u_Deallocating_buffer_with_attache, __pyx_k_Deallocating_buffer_with_attache, sizeof(__pyx_k_Deallocating_buffer_with_attache), 0, 1, 0, 0}, {&__pyx_n_s_Dec, __pyx_k_Dec, sizeof(__pyx_k_Dec), 0, 0, 1, 1}, {&__pyx_n_s_Decimal, __pyx_k_Decimal, sizeof(__pyx_k_Decimal), 0, 0, 1, 1}, {&__pyx_n_u_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 1, 0, 1}, {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0}, {&__pyx_n_u_Infinity, __pyx_k_Infinity, sizeof(__pyx_k_Infinity), 0, 1, 0, 1}, {&__pyx_kp_u_Infinity_2, __pyx_k_Infinity_2, sizeof(__pyx_k_Infinity_2), 0, 1, 0, 0}, {&__pyx_n_s_Line, __pyx_k_Line, sizeof(__pyx_k_Line), 0, 0, 1, 1}, {&__pyx_n_s_LineSegment, __pyx_k_LineSegment, sizeof(__pyx_k_LineSegment), 0, 0, 1, 1}, {&__pyx_n_s_MAXYEAR, __pyx_k_MAXYEAR, sizeof(__pyx_k_MAXYEAR), 0, 0, 1, 1}, {&__pyx_n_s_MINYEAR, __pyx_k_MINYEAR, sizeof(__pyx_k_MINYEAR), 0, 0, 1, 1}, {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, {&__pyx_n_u_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 1, 0, 1}, {&__pyx_n_u_NaN, __pyx_k_NaN, sizeof(__pyx_k_NaN), 0, 1, 0, 1}, {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented, sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1}, {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1}, {&__pyx_n_s_Path, __pyx_k_Path, sizeof(__pyx_k_Path), 0, 0, 1, 1}, {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_Point, __pyx_k_Point, sizeof(__pyx_k_Point), 0, 0, 1, 1}, {&__pyx_n_s_Polygon, __pyx_k_Polygon, sizeof(__pyx_k_Polygon), 0, 0, 1, 1}, {&__pyx_n_s_RESERVED_FUTURE, __pyx_k_RESERVED_FUTURE, sizeof(__pyx_k_RESERVED_FUTURE), 0, 0, 1, 1}, {&__pyx_n_s_RESERVED_MICROSOFT, __pyx_k_RESERVED_MICROSOFT, sizeof(__pyx_k_RESERVED_MICROSOFT), 0, 0, 1, 1}, {&__pyx_n_s_RESERVED_NCS, __pyx_k_RESERVED_NCS, sizeof(__pyx_k_RESERVED_NCS), 0, 0, 1, 1}, {&__pyx_n_s_RFC_4122, __pyx_k_RFC_4122, sizeof(__pyx_k_RFC_4122), 0, 0, 1, 1}, {&__pyx_n_s_ReadBuffer, __pyx_k_ReadBuffer, sizeof(__pyx_k_ReadBuffer), 0, 0, 1, 1}, {&__pyx_n_s_ReadBuffer___reduce_cython, __pyx_k_ReadBuffer___reduce_cython, sizeof(__pyx_k_ReadBuffer___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_ReadBuffer___setstate_cython, __pyx_k_ReadBuffer___setstate_cython, sizeof(__pyx_k_ReadBuffer___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s_SafeUUID, __pyx_k_SafeUUID, sizeof(__pyx_k_SafeUUID), 0, 0, 1, 1}, {&__pyx_kp_u_Time_zones_are_not_available_fro, __pyx_k_Time_zones_are_not_available_fro, sizeof(__pyx_k_Time_zones_are_not_available_fro), 0, 1, 0, 0}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_kp_u_UUID, __pyx_k_UUID, sizeof(__pyx_k_UUID), 0, 1, 0, 0}, {&__pyx_n_s_UUIDReplaceMe, __pyx_k_UUIDReplaceMe, sizeof(__pyx_k_UUIDReplaceMe), 0, 0, 1, 1}, {&__pyx_n_s_UUIDReplaceMe___reduce_cython, __pyx_k_UUIDReplaceMe___reduce_cython, sizeof(__pyx_k_UUIDReplaceMe___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_UUIDReplaceMe___setstate_cytho, __pyx_k_UUIDReplaceMe___setstate_cytho, sizeof(__pyx_k_UUIDReplaceMe___setstate_cytho), 0, 0, 1, 1}, {&__pyx_n_s_UUID_2, __pyx_k_UUID_2, sizeof(__pyx_k_UUID_2), 0, 0, 1, 1}, {&__pyx_n_s_UUID___reduce, __pyx_k_UUID___reduce, sizeof(__pyx_k_UUID___reduce), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_WriteBuffer, __pyx_k_WriteBuffer, sizeof(__pyx_k_WriteBuffer), 0, 0, 1, 1}, {&__pyx_n_s_WriteBuffer___reduce_cython, __pyx_k_WriteBuffer___reduce_cython, sizeof(__pyx_k_WriteBuffer___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_WriteBuffer___setstate_cython, __pyx_k_WriteBuffer___setstate_cython, sizeof(__pyx_k_WriteBuffer___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 1}, {&__pyx_kp_b__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 0, 0}, {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, {&__pyx_kp_b__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 0, 0}, {&__pyx_kp_u__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 1, 0, 0}, {&__pyx_n_s__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 0, 1, 1}, {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, {&__pyx_n_s__54, __pyx_k__54, sizeof(__pyx_k__54), 0, 0, 1, 1}, {&__pyx_kp_u_a_boolean_is_required_got_type, __pyx_k_a_boolean_is_required_got_type, sizeof(__pyx_k_a_boolean_is_required_got_type), 0, 1, 0, 0}, {&__pyx_kp_u_a_bytes_or_str_object_expected_g, __pyx_k_a_bytes_or_str_object_expected_g, sizeof(__pyx_k_a_bytes_or_str_object_expected_g), 0, 1, 0, 0}, {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_as_tuple, __pyx_k_as_tuple, sizeof(__pyx_k_as_tuple), 0, 0, 1, 1}, {&__pyx_n_s_astimezone, __pyx_k_astimezone, sizeof(__pyx_k_astimezone), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_kp_s_asyncpg_pgproto_codecs_context_p, __pyx_k_asyncpg_pgproto_codecs_context_p, sizeof(__pyx_k_asyncpg_pgproto_codecs_context_p), 0, 0, 1, 0}, {&__pyx_n_s_asyncpg_pgproto_pgproto, __pyx_k_asyncpg_pgproto_pgproto, sizeof(__pyx_k_asyncpg_pgproto_pgproto), 0, 0, 1, 1}, {&__pyx_kp_s_asyncpg_pgproto_uuid_pyx, __pyx_k_asyncpg_pgproto_uuid_pyx, sizeof(__pyx_k_asyncpg_pgproto_uuid_pyx), 0, 0, 1, 0}, {&__pyx_n_s_bases, __pyx_k_bases, sizeof(__pyx_k_bases), 0, 0, 1, 1}, {&__pyx_n_u_big, __pyx_k_big, sizeof(__pyx_k_big), 0, 1, 0, 1}, {&__pyx_kp_u_bit_value_too_long, __pyx_k_bit_value_too_long, sizeof(__pyx_k_bit_value_too_long), 0, 1, 0, 0}, {&__pyx_kp_u_buffer_overread, __pyx_k_buffer_overread, sizeof(__pyx_k_buffer_overread), 0, 1, 0, 0}, {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1}, {&__pyx_kp_u_cannot_decode_UUID_expected_16_b, __pyx_k_cannot_decode_UUID_expected_16_b, sizeof(__pyx_k_cannot_decode_UUID_expected_16_b), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_encode_Decimal_value_into, __pyx_k_cannot_encode_Decimal_value_into, sizeof(__pyx_k_cannot_encode_Decimal_value_into), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_encode_Decimal_value_into_2, __pyx_k_cannot_encode_Decimal_value_into_2, sizeof(__pyx_k_cannot_encode_Decimal_value_into_2), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_encode_Decimal_value_into_3, __pyx_k_cannot_encode_Decimal_value_into_3, sizeof(__pyx_k_cannot_encode_Decimal_value_into_3), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_put_message_no_message_ta, __pyx_k_cannot_put_message_no_message_ta, sizeof(__pyx_k_cannot_put_message_no_message_ta), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_start_message_for_a_non_e, __pyx_k_cannot_start_message_for_a_non_e, sizeof(__pyx_k_cannot_start_message_for_a_non_e), 0, 1, 0, 0}, {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1}, {&__pyx_n_u_cidr, __pyx_k_cidr, sizeof(__pyx_k_cidr), 0, 1, 0, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_clock_seq_hi_variant, __pyx_k_clock_seq_hi_variant, sizeof(__pyx_k_clock_seq_hi_variant), 0, 0, 1, 1}, {&__pyx_n_s_clock_seq_low, __pyx_k_clock_seq_low, sizeof(__pyx_k_clock_seq_low), 0, 0, 1, 1}, {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, {&__pyx_kp_u_consume_full_messages_called_on, __pyx_k_consume_full_messages_called_on, sizeof(__pyx_k_consume_full_messages_called_on), 0, 1, 0, 0}, {&__pyx_kp_u_consume_full_messages_called_on_2, __pyx_k_consume_full_messages_called_on_2, sizeof(__pyx_k_consume_full_messages_called_on_2), 0, 1, 0, 0}, {&__pyx_kp_u_consume_full_messages_called_wit, __pyx_k_consume_full_messages_called_wit, sizeof(__pyx_k_consume_full_messages_called_wit), 0, 1, 0, 0}, {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1}, {&__pyx_n_s_date_from_ordinal, __pyx_k_date_from_ordinal, sizeof(__pyx_k_date_from_ordinal), 0, 0, 1, 1}, {&__pyx_kp_u_date_tuple_encoder_expecting_1_e, __pyx_k_date_tuple_encoder_expecting_1_e, sizeof(__pyx_k_date_tuple_encoder_expecting_1_e), 0, 1, 0, 0}, {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1}, {&__pyx_n_s_day, __pyx_k_day, sizeof(__pyx_k_day), 0, 0, 1, 1}, {&__pyx_n_s_days, __pyx_k_days, sizeof(__pyx_k_days), 0, 0, 1, 1}, {&__pyx_kp_u_debug_first_buffer_of_ReadBuffer, __pyx_k_debug_first_buffer_of_ReadBuffer, sizeof(__pyx_k_debug_first_buffer_of_ReadBuffer), 0, 1, 0, 0}, {&__pyx_kp_u_debug_second_buffer_of_ReadBuffe, __pyx_k_debug_second_buffer_of_ReadBuffe, sizeof(__pyx_k_debug_second_buffer_of_ReadBuffe), 0, 1, 0, 0}, {&__pyx_n_s_decimal, __pyx_k_decimal, sizeof(__pyx_k_decimal), 0, 0, 1, 1}, {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, {&__pyx_kp_u_decodes_to_less_than_16_bytes, __pyx_k_decodes_to_less_than_16_bytes, sizeof(__pyx_k_decodes_to_less_than_16_bytes), 0, 1, 0, 0}, {&__pyx_kp_u_decodes_to_more_than_16_bytes, __pyx_k_decodes_to_more_than_16_bytes, sizeof(__pyx_k_decodes_to_more_than_16_bytes), 0, 1, 0, 0}, {&__pyx_n_s_deque, __pyx_k_deque, sizeof(__pyx_k_deque), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, {&__pyx_n_s_digits, __pyx_k_digits, sizeof(__pyx_k_digits), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_kp_u_discarding_message_r_unread_dat, __pyx_k_discarding_message_r_unread_dat, sizeof(__pyx_k_discarding_message_r_unread_dat), 0, 1, 0, 0}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_kp_u_empty_buffer, __pyx_k_empty_buffer, sizeof(__pyx_k_empty_buffer), 0, 1, 0, 0}, {&__pyx_kp_u_empty_first_buffer, __pyx_k_empty_first_buffer, sizeof(__pyx_k_empty_first_buffer), 0, 1, 0, 0}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_kp_u_end_message_buffer_is_too_small, __pyx_k_end_message_buffer_is_too_small, sizeof(__pyx_k_end_message_buffer_is_too_small), 0, 1, 0, 0}, {&__pyx_kp_u_end_message_can_only_be_called_w, __pyx_k_end_message_can_only_be_called_w, sizeof(__pyx_k_end_message_can_only_be_called_w), 0, 1, 0, 0}, {&__pyx_kp_u_end_message_message_is_too_large, __pyx_k_end_message_message_is_too_large, sizeof(__pyx_k_end_message_message_is_too_large), 0, 1, 0, 0}, {&__pyx_kp_u_expected_a_datetime_date_or_date, __pyx_k_expected_a_datetime_date_or_date, sizeof(__pyx_k_expected_a_datetime_date_or_date), 0, 1, 0, 0}, {&__pyx_kp_u_expected_str_got, __pyx_k_expected_str_got, sizeof(__pyx_k_expected_str_got), 0, 1, 0, 0}, {&__pyx_n_s_exponent, __pyx_k_exponent, sizeof(__pyx_k_exponent), 0, 0, 1, 1}, {&__pyx_kp_u_failed_to_read_one_byte_on_a_non, __pyx_k_failed_to_read_one_byte_on_a_non, sizeof(__pyx_k_failed_to_read_one_byte_on_a_non), 0, 1, 0, 0}, {&__pyx_kp_u_feed_data_a_bytes_or_bytearray_o, __pyx_k_feed_data_a_bytes_or_bytearray_o, sizeof(__pyx_k_feed_data_a_bytes_or_bytearray_o), 0, 1, 0, 0}, {&__pyx_n_s_find, __pyx_k_find, sizeof(__pyx_k_find), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_from_bytes, __pyx_k_from_bytes, sizeof(__pyx_k_from_bytes), 0, 0, 1, 1}, {&__pyx_n_s_frombytes, __pyx_k_frombytes, sizeof(__pyx_k_frombytes), 0, 0, 1, 1}, {&__pyx_n_s_fromordinal, __pyx_k_fromordinal, sizeof(__pyx_k_fromordinal), 0, 0, 1, 1}, {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get_json_decoder, __pyx_k_get_json_decoder, sizeof(__pyx_k_get_json_decoder), 0, 0, 1, 1}, {&__pyx_n_s_get_json_encoder, __pyx_k_get_json_encoder, sizeof(__pyx_k_get_json_encoder), 0, 0, 1, 1}, {&__pyx_n_s_get_text_codec, __pyx_k_get_text_codec, sizeof(__pyx_k_get_text_codec), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_hour, __pyx_k_hour, sizeof(__pyx_k_hour), 0, 0, 1, 1}, {&__pyx_kp_u_hstore_value_is_too_large, __pyx_k_hstore_value_is_too_large, sizeof(__pyx_k_hstore_value_is_too_large), 0, 1, 0, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_u_inet, __pyx_k_inet, sizeof(__pyx_k_inet), 0, 1, 0, 1}, {&__pyx_n_s_infinity_date, __pyx_k_infinity_date, sizeof(__pyx_k_infinity_date), 0, 0, 1, 1}, {&__pyx_n_s_infinity_datetime, __pyx_k_infinity_datetime, sizeof(__pyx_k_infinity_datetime), 0, 0, 1, 1}, {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_s_inp, __pyx_k_inp, sizeof(__pyx_k_inp), 0, 0, 1, 1}, {&__pyx_kp_u_insufficient_data_in_buffer_requ, __pyx_k_insufficient_data_in_buffer_requ, sizeof(__pyx_k_insufficient_data_in_buffer_requ), 0, 1, 0, 0}, {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1}, {&__pyx_n_u_int_2, __pyx_k_int_2, sizeof(__pyx_k_int_2), 0, 1, 0, 1}, {&__pyx_kp_u_interval_tuple_encoder_expecting, __pyx_k_interval_tuple_encoder_expecting, sizeof(__pyx_k_interval_tuple_encoder_expecting), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_UUID, __pyx_k_invalid_UUID, sizeof(__pyx_k_invalid_UUID), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_UUID_u_r_unexpected_char, __pyx_k_invalid_UUID_u_r_unexpected_char, sizeof(__pyx_k_invalid_UUID_u_r_unexpected_char), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_address_family_in_value, __pyx_k_invalid_address_family_in_value, sizeof(__pyx_k_invalid_address_family_in_value), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_address_length_in_value, __pyx_k_invalid_address_length_in_value, sizeof(__pyx_k_invalid_address_length_in_value), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_network_prefix_length_in, __pyx_k_invalid_network_prefix_length_in, sizeof(__pyx_k_invalid_network_prefix_length_in), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_number_of_elements_in_ti, __pyx_k_invalid_number_of_elements_in_ti, sizeof(__pyx_k_invalid_number_of_elements_in_ti), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_number_of_elements_in_tx, __pyx_k_invalid_number_of_elements_in_tx, sizeof(__pyx_k_invalid_number_of_elements_in_tx), 0, 1, 0, 0}, {&__pyx_n_s_ip_address, __pyx_k_ip_address, sizeof(__pyx_k_ip_address), 0, 0, 1, 1}, {&__pyx_n_s_ip_interface, __pyx_k_ip_interface, sizeof(__pyx_k_ip_interface), 0, 0, 1, 1}, {&__pyx_n_s_ip_network, __pyx_k_ip_network, sizeof(__pyx_k_ip_network), 0, 0, 1, 1}, {&__pyx_n_s_ipaddr, __pyx_k_ipaddr, sizeof(__pyx_k_ipaddr), 0, 0, 1, 1}, {&__pyx_n_s_ipaddress, __pyx_k_ipaddress, sizeof(__pyx_k_ipaddress), 0, 0, 1, 1}, {&__pyx_n_s_ipiface, __pyx_k_ipiface, sizeof(__pyx_k_ipiface), 0, 0, 1, 1}, {&__pyx_n_s_ipnet, __pyx_k_ipnet, sizeof(__pyx_k_ipnet), 0, 0, 1, 1}, {&__pyx_n_s_is_closed, __pyx_k_is_closed, sizeof(__pyx_k_is_closed), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, {&__pyx_n_u_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 1, 0, 1}, {&__pyx_n_s_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 0, 1, 1}, {&__pyx_kp_u_length_must_be_between_32_36_ch, __pyx_k_length_must_be_between_32_36_ch, sizeof(__pyx_k_length_must_be_between_32_36_ch), 0, 1, 0, 0}, {&__pyx_kp_u_list_or_tuple_expected_got_type, __pyx_k_list_or_tuple_expected_got_type, sizeof(__pyx_k_list_or_tuple_expected_got_type), 0, 1, 0, 0}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_microsecond, __pyx_k_microsecond, sizeof(__pyx_k_microsecond), 0, 0, 1, 1}, {&__pyx_n_s_microseconds, __pyx_k_microseconds, sizeof(__pyx_k_microseconds), 0, 0, 1, 1}, {&__pyx_n_s_minute, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 0, 1, 1}, {&__pyx_n_s_minutes, __pyx_k_minutes, sizeof(__pyx_k_minutes), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_month, __pyx_k_month, sizeof(__pyx_k_month), 0, 0, 1, 1}, {&__pyx_n_s_mro, __pyx_k_mro, sizeof(__pyx_k_mro), 0, 0, 1, 1}, {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, {&__pyx_n_u_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 1, 0, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_negative_infinity_date, __pyx_k_negative_infinity_date, sizeof(__pyx_k_negative_infinity_date), 0, 0, 1, 1}, {&__pyx_n_s_negative_infinity_datetime, __pyx_k_negative_infinity_datetime, sizeof(__pyx_k_negative_infinity_datetime), 0, 0, 1, 1}, {&__pyx_kp_u_negative_length_for_a_len_prefix, __pyx_k_negative_length_for_a_len_prefix, sizeof(__pyx_k_negative_length_for_a_len_prefix), 0, 1, 0, 0}, {&__pyx_n_s_network, __pyx_k_network, sizeof(__pyx_k_network), 0, 0, 1, 1}, {&__pyx_n_s_network_address, __pyx_k_network_address, sizeof(__pyx_k_network_address), 0, 0, 1, 1}, {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_kp_u_no_message_to_consume, __pyx_k_no_message_to_consume, sizeof(__pyx_k_no_message_to_consume), 0, 1, 0, 0}, {&__pyx_kp_u_no_message_to_discard, __pyx_k_no_message_to_discard, sizeof(__pyx_k_no_message_to_discard), 0, 1, 0, 0}, {&__pyx_n_s_node, __pyx_k_node, sizeof(__pyx_k_node), 0, 0, 1, 1}, {&__pyx_kp_u_not_enough_data_to_read_bytes, __pyx_k_not_enough_data_to_read_bytes, sizeof(__pyx_k_not_enough_data_to_read_bytes), 0, 1, 0, 0}, {&__pyx_kp_u_not_enough_data_to_read_one_byte, __pyx_k_not_enough_data_to_read_one_byte, sizeof(__pyx_k_not_enough_data_to_read_one_byte), 0, 1, 0, 0}, {&__pyx_n_s_now, __pyx_k_now, sizeof(__pyx_k_now), 0, 0, 1, 1}, {&__pyx_kp_u_null_value_not_allowed_in_hstore, __pyx_k_null_value_not_allowed_in_hstore, sizeof(__pyx_k_null_value_not_allowed_in_hstore), 0, 1, 0, 0}, {&__pyx_n_s_packed, __pyx_k_packed, sizeof(__pyx_k_packed), 0, 0, 1, 1}, {&__pyx_kp_u_path_value_too_long, __pyx_k_path_value_too_long, sizeof(__pyx_k_path_value_too_long), 0, 1, 0, 0}, {&__pyx_n_s_pg_epoch_date, __pyx_k_pg_epoch_date, sizeof(__pyx_k_pg_epoch_date), 0, 0, 1, 1}, {&__pyx_n_s_pg_epoch_datetime, __pyx_k_pg_epoch_datetime, sizeof(__pyx_k_pg_epoch_datetime), 0, 0, 1, 1}, {&__pyx_n_s_pg_epoch_datetime_utc, __pyx_k_pg_epoch_datetime_utc, sizeof(__pyx_k_pg_epoch_datetime_utc), 0, 0, 1, 1}, {&__pyx_n_s_pgproto_types, __pyx_k_pgproto_types, sizeof(__pyx_k_pgproto_types), 0, 0, 1, 1}, {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_kp_u_polygon_value_too_long, __pyx_k_polygon_value_too_long, sizeof(__pyx_k_polygon_value_too_long), 0, 1, 0, 0}, {&__pyx_n_s_popleft, __pyx_k_popleft, sizeof(__pyx_k_popleft), 0, 0, 1, 1}, {&__pyx_n_s_prefixlen, __pyx_k_prefixlen, sizeof(__pyx_k_prefixlen), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_CodecContext, __pyx_k_pyx_unpickle_CodecContext, sizeof(__pyx_k_pyx_unpickle_CodecContext), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle___UUIDReplaceMe, __pyx_k_pyx_unpickle___UUIDReplaceMe, sizeof(__pyx_k_pyx_unpickle___UUIDReplaceMe), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_kp_u_read_null_str_buffer_overread, __pyx_k_read_null_str_buffer_overread, sizeof(__pyx_k_read_null_str_buffer_overread), 0, 1, 0, 0}, {&__pyx_kp_u_read_null_str_only_works_when_th, __pyx_k_read_null_str_only_works_when_th, sizeof(__pyx_k_read_null_str_only_works_when_th), 0, 1, 0, 0}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_kp_u_remaining, __pyx_k_remaining, sizeof(__pyx_k_remaining), 0, 1, 0, 0}, {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1}, {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1}, {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_sign, __pyx_k_sign, sizeof(__pyx_k_sign), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_kp_u_string_is_too_large, __pyx_k_string_is_too_large, sizeof(__pyx_k_string_is_too_large), 0, 1, 0, 0}, {&__pyx_kp_u_string_too_long, __pyx_k_string_too_long, sizeof(__pyx_k_string_too_long), 0, 1, 0, 0}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_kp_u_the_buffer_is_in_read_only_mode, __pyx_k_the_buffer_is_in_read_only_mode, sizeof(__pyx_k_the_buffer_is_in_read_only_mode), 0, 1, 0, 0}, {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, {&__pyx_n_s_time_hi_version, __pyx_k_time_hi_version, sizeof(__pyx_k_time_hi_version), 0, 0, 1, 1}, {&__pyx_n_s_time_low, __pyx_k_time_low, sizeof(__pyx_k_time_low), 0, 0, 1, 1}, {&__pyx_n_s_time_mid, __pyx_k_time_mid, sizeof(__pyx_k_time_mid), 0, 0, 1, 1}, {&__pyx_kp_u_time_tuple_encoder_expecting_1_e, __pyx_k_time_tuple_encoder_expecting_1_e, sizeof(__pyx_k_time_tuple_encoder_expecting_1_e), 0, 1, 0, 0}, {&__pyx_kp_u_time_tuple_encoder_expecting_2_e, __pyx_k_time_tuple_encoder_expecting_2_e, sizeof(__pyx_k_time_tuple_encoder_expecting_2_e), 0, 1, 0, 0}, {&__pyx_n_s_timedelta, __pyx_k_timedelta, sizeof(__pyx_k_timedelta), 0, 0, 1, 1}, {&__pyx_n_s_timestamp, __pyx_k_timestamp, sizeof(__pyx_k_timestamp), 0, 0, 1, 1}, {&__pyx_kp_u_timestamp_tuple_encoder_expectin, __pyx_k_timestamp_tuple_encoder_expectin, sizeof(__pyx_k_timestamp_tuple_encoder_expectin), 0, 1, 0, 0}, {&__pyx_n_s_timezone, __pyx_k_timezone, sizeof(__pyx_k_timezone), 0, 0, 1, 1}, {&__pyx_n_s_toordinal, __pyx_k_toordinal, sizeof(__pyx_k_toordinal), 0, 0, 1, 1}, {&__pyx_kp_u_tuple_id_block_value_out_of_uint, __pyx_k_tuple_id_block_value_out_of_uint, sizeof(__pyx_k_tuple_id_block_value_out_of_uint), 0, 1, 0, 0}, {&__pyx_kp_u_tuple_id_offset_value_out_of_uin, __pyx_k_tuple_id_offset_value_out_of_uin, sizeof(__pyx_k_tuple_id_offset_value_out_of_uin), 0, 1, 0, 0}, {&__pyx_kp_u_txid_snapshot_value_is_too_long, __pyx_k_txid_snapshot_value_is_too_long, sizeof(__pyx_k_txid_snapshot_value_is_too_long), 0, 1, 0, 0}, {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1}, {&__pyx_n_s_tzinfo, __pyx_k_tzinfo, sizeof(__pyx_k_tzinfo), 0, 0, 1, 1}, {&__pyx_kp_u_unexpected_CIDR_flag_set_in_non, __pyx_k_unexpected_CIDR_flag_set_in_non, sizeof(__pyx_k_unexpected_CIDR_flag_set_in_non), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_JSONB_format, __pyx_k_unexpected_JSONB_format, sizeof(__pyx_k_unexpected_JSONB_format), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_character, __pyx_k_unexpected_character, sizeof(__pyx_k_unexpected_character), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_jsonpath_format, __pyx_k_unexpected_jsonpath_format, sizeof(__pyx_k_unexpected_jsonpath_format), 0, 1, 0, 0}, {&__pyx_n_s_unknown, __pyx_k_unknown, sizeof(__pyx_k_unknown), 0, 0, 1, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_kp_u_urn_uuid, __pyx_k_urn_uuid, sizeof(__pyx_k_urn_uuid), 0, 1, 0, 0}, {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1}, {&__pyx_n_s_utc, __pyx_k_utc, sizeof(__pyx_k_utc), 0, 0, 1, 1}, {&__pyx_n_s_utcoffset, __pyx_k_utcoffset, sizeof(__pyx_k_utcoffset), 0, 0, 1, 1}, {&__pyx_n_s_uuid, __pyx_k_uuid, sizeof(__pyx_k_uuid), 0, 0, 1, 1}, {&__pyx_kp_u_value_out_of_float32_range, __pyx_k_value_out_of_float32_range, sizeof(__pyx_k_value_out_of_float32_range), 0, 1, 0, 0}, {&__pyx_kp_u_value_out_of_int16_range, __pyx_k_value_out_of_int16_range, sizeof(__pyx_k_value_out_of_int16_range), 0, 1, 0, 0}, {&__pyx_kp_u_value_out_of_int32_range, __pyx_k_value_out_of_int32_range, sizeof(__pyx_k_value_out_of_int32_range), 0, 1, 0, 0}, {&__pyx_kp_u_value_out_of_int64_range, __pyx_k_value_out_of_int64_range, sizeof(__pyx_k_value_out_of_int64_range), 0, 1, 0, 0}, {&__pyx_kp_u_value_out_of_uint32_range, __pyx_k_value_out_of_uint32_range, sizeof(__pyx_k_value_out_of_uint32_range), 0, 1, 0, 0}, {&__pyx_kp_u_value_out_of_uint64_range, __pyx_k_value_out_of_uint64_range, sizeof(__pyx_k_value_out_of_uint64_range), 0, 1, 0, 0}, {&__pyx_n_s_variant, __pyx_k_variant, sizeof(__pyx_k_variant), 0, 0, 1, 1}, {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1}, {&__pyx_n_s_year, __pyx_k_year, sizeof(__pyx_k_year), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 344, __pyx_L1_error) __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 74, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 2, __pyx_L1_error) __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(1, 790, __pyx_L1_error) __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(1, 795, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 88, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 94, __pyx_L1_error) __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 204, __pyx_L1_error) __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(3, 11, __pyx_L1_error) __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(4, 31, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(8, 308, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "cpython/datetime.pxd":308 * cdef inline object timezone_new(object offset, object name=None): * if PY_VERSION_HEX < 0x030700b1: * raise RuntimeError('Time zones are not available from the C-API.') # <<<<<<<<<<<<<< * return __Pyx_TimeZone_FromOffsetAndName(offset, name if name is not None else NULL) * */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_Time_zones_are_not_available_fro); if (unlikely(!__pyx_tuple_)) __PYX_ERR(8, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "asyncpg/pgproto/uuid.pyx":105 * f'invalid UUID {u!r}: unexpected character {chr(ch)!r}') * else: * raise ValueError('invalid UUID {u!r}: unexpected character') # <<<<<<<<<<<<<< * * if acc_set: */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_invalid_UUID_u_r_unexpected_char); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "asyncpg/pgproto/uuid.pyx":257 * def bytes_le(self): * bytes = self.bytes * return (bytes[4-1::-1] + bytes[6-1:4-1:-1] + bytes[8-1:6-1:-1] + # <<<<<<<<<<<<<< * bytes[8:]) * */ __pyx_slice__6 = PySlice_New(__pyx_int_3, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__6)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__6); __Pyx_GIVEREF(__pyx_slice__6); __pyx_slice__7 = PySlice_New(__pyx_int_5, __pyx_int_3, __pyx_int_neg_1); if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__7); __Pyx_GIVEREF(__pyx_slice__7); __pyx_slice__8 = PySlice_New(__pyx_int_7, __pyx_int_5, __pyx_int_neg_1); if (unlikely(!__pyx_slice__8)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__8); __Pyx_GIVEREF(__pyx_slice__8); /* "asyncpg/pgproto/uuid.pyx":258 * bytes = self.bytes * return (bytes[4-1::-1] + bytes[6-1:4-1:-1] + bytes[8-1:6-1:-1] + * bytes[8:]) # <<<<<<<<<<<<<< * * @property */ __pyx_slice__9 = PySlice_New(__pyx_int_8, Py_None, Py_None); if (unlikely(!__pyx_slice__9)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__9); __Pyx_GIVEREF(__pyx_slice__9); /* "asyncpg/pgproto/codecs/text.pyx":21 * * if size[0] > 0x7fffffff: * raise ValueError('string too long') # <<<<<<<<<<<<<< * * */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_string_too_long); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(12, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); /* "asyncpg/pgproto/codecs/float.pyx":15 * cdef float fval = dval * if math.isinf(fval) and not math.isinf(dval): * raise ValueError('value out of float32 range') # <<<<<<<<<<<<<< * * buf.write_int32(4) */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_value_out_of_float32_range); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(14, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); /* "asyncpg/pgproto/codecs/int.pyx":35 * * if overflow or val < INT16_MIN or val > INT16_MAX: * raise OverflowError('value out of int16 range') # <<<<<<<<<<<<<< * * buf.write_int32(2) */ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_value_out_of_int16_range); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(4, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); /* "asyncpg/pgproto/codecs/int.pyx":60 * # "long" and "long long" have the same size for x86_64, need an extra check * if overflow or (sizeof(val) > 4 and (val < INT32_MIN or val > INT32_MAX)): * raise OverflowError('value out of int32 range') # <<<<<<<<<<<<<< * * buf.write_int32(4) */ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_value_out_of_int32_range); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(4, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); /* "asyncpg/pgproto/codecs/int.pyx":85 * # "long" and "long long" have the same size for x86_64, need an extra check * if overflow or (sizeof(val) > 4 and val > UINT32_MAX): * raise OverflowError('value out of uint32 range') # <<<<<<<<<<<<<< * * buf.write_int32(4) */ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_value_out_of_uint32_range); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(4, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); /* "asyncpg/pgproto/codecs/int.pyx":111 * # Just in case for systems with "long long" bigger than 8 bytes * if overflow or (sizeof(val) > 8 and (val < INT64_MIN or val > INT64_MAX)): * raise OverflowError('value out of int64 range') # <<<<<<<<<<<<<< * * buf.write_int32(8) */ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_value_out_of_int64_range); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(4, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); /* "asyncpg/pgproto/codecs/int.pyx":136 * # Just in case for systems with "long long" bigger than 8 bytes * if overflow or (sizeof(val) > 8 and val > UINT64_MAX): * raise OverflowError('value out of uint64 range') # <<<<<<<<<<<<<< * * buf.write_int32(8) */ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_value_out_of_uint64_range); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(4, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* "asyncpg/pgproto/codecs/numeric.pyx":75 * exponent = dt.exponent * if exponent < 0 and -exponent > MAX_DSCALE: * raise ValueError( # <<<<<<<<<<<<<< * 'cannot encode Decimal value into numeric: ' * 'exponent is too small') */ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_cannot_encode_Decimal_value_into); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(18, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); /* "asyncpg/pgproto/codecs/numeric.pyx":94 * * if weight > 2 ** 16 - 1: * raise ValueError( # <<<<<<<<<<<<<< * 'cannot encode Decimal value into numeric: ' * 'exponent is too large') */ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_cannot_encode_Decimal_value_into_2); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(18, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); /* "asyncpg/pgproto/codecs/numeric.pyx":104 * * if num_pgdigits > 2 ** 16 - 1: * raise ValueError( # <<<<<<<<<<<<<< * 'cannot encode Decimal value into numeric: ' * 'number of digits is too large') */ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_cannot_encode_Decimal_value_into_3); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(18, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); /* "asyncpg/pgproto/codecs/numeric.pyx":110 * # Pad decimal digits to provide room for correct Postgres * # digit alignment in the digit computation loop. * pydigits = (0,) * DEC_DIGITS + pydigits + (0,) * DEC_DIGITS # <<<<<<<<<<<<<< * * if exponent < 0: */ __pyx_tuple__20 = PyTuple_New(1 * 4); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(18, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < 4; __pyx_temp++) { __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_tuple__20, __pyx_temp, __pyx_int_0)) __PYX_ERR(18, 110, __pyx_L1_error); } } __Pyx_GIVEREF(__pyx_tuple__20); /* "asyncpg/pgproto/codecs/bits.pyx":32 * try: * if bitlen > _MAXINT32: * raise ValueError('bit value too long') # <<<<<<<<<<<<<< * wbuf.write_int32(4 + len) * wbuf.write_int32(bitlen) */ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_bit_value_too_long); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(19, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); /* "asyncpg/pgproto/codecs/geometry.pyx":114 * encoded_len = 1 + 4 + 16 * npts * if encoded_len > _MAXINT32: * raise ValueError('path value too long') # <<<<<<<<<<<<<< * * wbuf.write_int32(encoded_len) */ __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_path_value_too_long); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(20, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); /* "asyncpg/pgproto/codecs/geometry.pyx":140 * encoded_len = 4 + 16 * npts * if encoded_len > _MAXINT32: * raise ValueError('polygon value too long') # <<<<<<<<<<<<<< * * wbuf.write_int32(encoded_len) */ __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_polygon_value_too_long); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(20, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); /* "asyncpg/pgproto/codecs/hstore.pyx":18 * count = len(obj) * if count > _MAXINT32: * raise ValueError('hstore value is too large') # <<<<<<<<<<<<<< * item_buf.write_int32(count) * */ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_hstore_value_is_too_large); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(21, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); /* "asyncpg/pgproto/codecs/hstore.pyx":28 * for k, v in items: * if k is None: * raise ValueError('null value not allowed in hstore key') # <<<<<<<<<<<<<< * as_pg_string_and_size(settings, k, &str, &size) * item_buf.write_int32(size) */ __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_u_null_value_not_allowed_in_hstore); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(21, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); /* "asyncpg/pgproto/codecs/network.pyx":74 * * if is_cidr != as_cidr: * raise ValueError('unexpected CIDR flag set in non-cidr value') # <<<<<<<<<<<<<< * * if family != PGSQL_AF_INET and family != PGSQL_AF_INET6: */ __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_u_unexpected_CIDR_flag_set_in_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(23, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); /* "asyncpg/pgproto/codecs/tid.pyx":17 * * if len(obj) != 2: * raise ValueError( # <<<<<<<<<<<<<< * 'invalid number of elements in tid tuple, expecting 2') * */ __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_u_invalid_number_of_elements_in_ti); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(24, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); /* "asyncpg/pgproto/codecs/tid.pyx":27 * # "long" and "long long" have the same size for x86_64, need an extra check * if overflow or (sizeof(block) > 4 and block > UINT32_MAX): * raise OverflowError('tuple id block value out of uint32 range') # <<<<<<<<<<<<<< * * try: */ __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_u_tuple_id_block_value_out_of_uint); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(24, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); /* "asyncpg/pgproto/codecs/tid.pyx":36 * * if overflow or offset > 65535: * raise OverflowError('tuple id offset value out of uint16 range') # <<<<<<<<<<<<<< * * buf.write_int32(6) */ __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_u_tuple_id_offset_value_out_of_uin); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(24, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":21 * * if len(obj) != 3: * raise ValueError( # <<<<<<<<<<<<<< * 'invalid number of elements in txid_snapshot tuple, expecting 4') * */ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_u_invalid_number_of_elements_in_tx); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(25, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); /* "asyncpg/pgproto/codecs/pg_snapshot.pyx":26 * nxip = len(obj[2]) * if nxip > _MAXINT32: * raise ValueError('txid_snapshot value is too long') # <<<<<<<<<<<<<< * * xmin = obj[0] */ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_u_txid_snapshot_value_is_too_long); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(25, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum */ __pyx_tuple__32 = PyTuple_Pack(3, __pyx_int_238750788, __pyx_int_228825662, __pyx_int_222419149); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__35 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(2, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_tuple__37 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(2, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(2, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(2, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_tuple__41 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__41); __Pyx_GIVEREF(__pyx_tuple__41); __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(2, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: * return __pyx_unpickle___UUIDReplaceMe, (type(self), 0xe3b0c44, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle___UUIDReplaceMe__set_state(self, __pyx_state) */ __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(2, 16, __pyx_L1_error) /* "asyncpg/pgproto/uuid.pyx":196 * return f"UUID('{self}')" * * def __reduce__(self): # <<<<<<<<<<<<<< * return (type(self), (self.bytes,)) * */ __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_pgproto_uuid_pyx, __pyx_n_s_reduce, 196, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 196, __pyx_L1_error) /* "asyncpg/pgproto/codecs/context.pyx":10 * cdef class CodecContext: * * cpdef get_text_codec(self): # <<<<<<<<<<<<<< * raise NotImplementedError * */ __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_pgproto_codecs_context_p, __pyx_n_s_get_text_codec, 10, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(3, 10, __pyx_L1_error) /* "asyncpg/pgproto/codecs/context.pyx":16 * raise NotImplementedError * * cpdef get_json_decoder(self): # <<<<<<<<<<<<<< * raise NotImplementedError * */ __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_pgproto_codecs_context_p, __pyx_n_s_get_json_decoder, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(3, 16, __pyx_L1_error) /* "asyncpg/pgproto/codecs/context.pyx":22 * return False * * cpdef get_json_encoder(self): # <<<<<<<<<<<<<< * raise NotImplementedError * */ __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_pgproto_codecs_context_p, __pyx_n_s_get_json_encoder, 22, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(3, 22, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(2, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: * return __pyx_unpickle_CodecContext, (type(self), 0xe3b0c44, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_CodecContext__set_state(self, __pyx_state) */ __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(2, 16, __pyx_L1_error) /* "asyncpg/pgproto/codecs/datetime.pyx":17 * timedelta = datetime.timedelta * * pg_epoch_datetime = datetime.datetime(2000, 1, 1) # <<<<<<<<<<<<<< * cdef int32_t pg_epoch_datetime_ts = \ * cpython.PyLong_AsLong(int(pg_epoch_datetime.timestamp())) */ __pyx_tuple__50 = PyTuple_Pack(3, __pyx_int_2000, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(13, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__50); __Pyx_GIVEREF(__pyx_tuple__50); /* "(tree fragment)":1 * def __pyx_unpickle___UUIDReplaceMe(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_tuple__51 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__51); __Pyx_GIVEREF(__pyx_tuple__51); __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle___UUIDReplaceMe, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(2, 1, __pyx_L1_error) __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_CodecContext, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(10, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_23 = PyInt_FromLong(23); if (unlikely(!__pyx_int_23)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_31 = PyInt_FromLong(31); if (unlikely(!__pyx_int_31)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_48 = PyInt_FromLong(48); if (unlikely(!__pyx_int_48)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_56 = PyInt_FromLong(56); if (unlikely(!__pyx_int_56)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_59 = PyInt_FromLong(59); if (unlikely(!__pyx_int_59)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_63 = PyInt_FromLong(63); if (unlikely(!__pyx_int_63)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_64 = PyInt_FromLong(64); if (unlikely(!__pyx_int_64)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_76 = PyInt_FromLong(76); if (unlikely(!__pyx_int_76)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_80 = PyInt_FromLong(80); if (unlikely(!__pyx_int_80)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_96 = PyInt_FromLong(96); if (unlikely(!__pyx_int_96)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_2000 = PyInt_FromLong(2000); if (unlikely(!__pyx_int_2000)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_4095 = PyInt_FromLong(4095); if (unlikely(!__pyx_int_4095)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_65535 = PyInt_FromLong(65535L); if (unlikely(!__pyx_int_65535)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_999999 = PyInt_FromLong(999999L); if (unlikely(!__pyx_int_999999)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_222419149 = PyInt_FromLong(222419149L); if (unlikely(!__pyx_int_222419149)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_228825662 = PyInt_FromLong(228825662L); if (unlikely(!__pyx_int_228825662)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_238750788 = PyInt_FromLong(238750788L); if (unlikely(!__pyx_int_238750788)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_0xffffffffffff = PyInt_FromString((char *)"0xffffffffffff", 0, 0); if (unlikely(!__pyx_int_0xffffffffffff)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_0x2000000000000000 = PyInt_FromString((char *)"0x2000000000000000", 0, 0); if (unlikely(!__pyx_int_0x2000000000000000)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_0x4000000000000000 = PyInt_FromString((char *)"0x4000000000000000", 0, 0); if (unlikely(!__pyx_int_0x4000000000000000)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_0x8000000000000000 = PyInt_FromString((char *)"0x8000000000000000", 0, 0); if (unlikely(!__pyx_int_0x8000000000000000)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(10, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { /* AssertionsEnabled.init */ if (likely(__Pyx_init_assertions_enabled() == 0)); else if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __pyx_v_7asyncpg_7pgproto_7pgproto_std_UUID = Py_None; Py_INCREF(Py_None); __pyx_v_7asyncpg_7pgproto_7pgproto_pg_UUID = Py_None; Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ if (__Pyx_ExportFunction("frb_check", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_frb_check, "PyObject *(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, Py_ssize_t)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("date_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_date_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("date_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_date_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("date_encode_tuple", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_date_encode_tuple, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("date_decode_tuple", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_date_decode_tuple, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("timestamp_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("timestamp_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("timestamp_encode_tuple", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_encode_tuple, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("timestamp_decode_tuple", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_decode_tuple, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("timestamptz_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_timestamptz_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("timestamptz_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_timestamptz_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("time_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_time_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("time_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_time_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("time_encode_tuple", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_time_encode_tuple, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("time_decode_tuple", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_time_decode_tuple, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("timetz_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("timetz_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("timetz_encode_tuple", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_encode_tuple, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("timetz_decode_tuple", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_decode_tuple, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("interval_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_interval_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("interval_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_interval_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("interval_encode_tuple", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_interval_encode_tuple, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("interval_decode_tuple", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_interval_decode_tuple, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("bits_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_bits_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("bits_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_bits_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("bool_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_bool_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("bool_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_bool_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("box_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_box_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("box_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_box_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("line_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_line_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("line_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_line_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("lseg_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_lseg_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("lseg_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_lseg_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("point_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_point_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("point_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_point_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("path_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_path_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("path_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_path_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("poly_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_poly_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("poly_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_poly_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("circle_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_circle_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("circle_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_circle_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("hstore_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_hstore_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("hstore_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_hstore_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("int2_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_int2_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("int2_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_int2_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("int4_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_int4_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("int4_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_int4_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("uint4_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_uint4_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("uint4_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_uint4_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("int8_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_int8_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("int8_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_int8_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("uint8_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_uint8_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("uint8_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_uint8_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("float4_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_float4_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("float4_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_float4_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("float8_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_float8_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("float8_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_float8_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("jsonb_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_jsonb_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("jsonb_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_jsonb_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("jsonpath_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_jsonpath_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("jsonpath_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_jsonpath_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("as_pg_string_and_size", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_as_pg_string_and_size, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, PyObject *, char **, Py_ssize_t *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("text_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("text_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("bytea_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("bytea_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("uuid_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_uuid_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("uuid_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_uuid_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("numeric_encode_text", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_encode_text, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("numeric_decode_text", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_text, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("numeric_encode_binary", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_encode_binary, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("numeric_decode_binary", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_binary, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("numeric_decode_binary_ex", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_binary_ex, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, int)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("void_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_void_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("void_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_void_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("tid_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_tid_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("tid_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_tid_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("cidr_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_cidr_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("cidr_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_cidr_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("inet_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_inet_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("inet_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_inet_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("pg_snapshot_encode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) if (__Pyx_ExportFunction("pg_snapshot_decode", (void (*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(10, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer = &__pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer.len = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer.write_len_prefixed_utf8 = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer._check_readonly = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__check_readonly; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer._ensure_alloced = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, Py_ssize_t))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__ensure_alloced; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer._reallocate = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, Py_ssize_t))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer__reallocate; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer.reset = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_reset; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer.start_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, char))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_start_message; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer.end_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_end_message; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer.write_buffer = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_buffer; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer.write_byte = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, char))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_byte; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer.write_bytes = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_bytes; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer.write_len_prefixed_buffer = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_buffer; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer.write_len_prefixed_bytes = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_bytes; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer.write_bytestring = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_bytestring; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer.write_str = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *, PyObject *))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_str; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer.write_frbuf = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_frbuf; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer.write_cstr = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, char const *, Py_ssize_t))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_cstr; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer.write_int16 = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int16_t))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int16; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer.write_int32 = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int32_t))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int32; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer.write_int64 = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int64_t))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_int64; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer.write_float = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, float))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_float; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer.write_double = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, double))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_double; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer.new_message = (struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*)(char))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_new_message; __pyx_vtable_7asyncpg_7pgproto_7pgproto_WriteBuffer.new = (struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*)(void))__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_new; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_7pgproto_7pgproto_WriteBuffer_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer)) __PYX_ERR(1, 18, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer->tp_as_buffer = &__pyx_tp_as_buffer_WriteBuffer; #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer) /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */ #elif defined(_MSC_VER) #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.") #else #warning "The buffer protocol is not supported in the Limited C-API < 3.11." #endif if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_7pgproto_7pgproto_WriteBuffer_spec, __pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer) < 0) __PYX_ERR(1, 18, __pyx_L1_error) #else __pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer = &__pyx_type_7asyncpg_7pgproto_7pgproto_WriteBuffer; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer) < 0) __PYX_ERR(1, 18, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer->tp_dictoffset && __pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif if (__Pyx_SetVtable(__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer, __pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer) < 0) __PYX_ERR(1, 18, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer) < 0) __PYX_ERR(1, 18, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_WriteBuffer, (PyObject *) __pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer) < 0) __PYX_ERR(1, 18, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer) < 0) __PYX_ERR(1, 18, __pyx_L1_error) #endif __pyx_vtabptr_7asyncpg_7pgproto_7pgproto_ReadBuffer = &__pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.len = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_len; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.get_message_type = (char (*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_type; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.get_message_length = (int32_t (*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_length; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.feed_data = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, PyObject *))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_feed_data; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer._ensure_first_buf = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__ensure_first_buf; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer._switch_to_next_buf = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__switch_to_next_buf; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.read_byte = (char (*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_byte; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer._try_read_bytes = (char const *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__try_read_bytes; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer._read_into = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, char *, Py_ssize_t))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__read_into; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer._read_and_discard = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__read_and_discard; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.read_bytes = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_bytes; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.read_len_prefixed_bytes = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_len_prefixed_bytes; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.read_len_prefixed_utf8 = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_len_prefixed_utf8; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.read_uuid = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_uuid; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.read_int64 = (int64_t (*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_int64; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.read_int32 = (int32_t (*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_int32; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.read_int16 = (int16_t (*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_int16; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.read_null_str = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_read_null_str; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.take_message = (int32_t (*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_take_message; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.take_message_type = (int32_t (*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, char))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_take_message_type; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.put_message = (int32_t (*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_put_message; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.try_consume_message = (char const *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t *))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_try_consume_message; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.consume_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_consume_message; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.discard_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_discard_message; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.redirect_messages = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, char, struct __pyx_opt_args_7asyncpg_7pgproto_7pgproto_10ReadBuffer_redirect_messages *__pyx_optional_args))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_redirect_messages; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.consume_messages = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, char))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_consume_messages; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.finish_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_finish_message; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer._finish_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer__finish_message; __pyx_vtable_7asyncpg_7pgproto_7pgproto_ReadBuffer.new_message_parser = (struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *(*)(PyObject *))__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_new_message_parser; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_7pgproto_7pgproto_ReadBuffer_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer)) __PYX_ERR(1, 241, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_7pgproto_7pgproto_ReadBuffer_spec, __pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer) < 0) __PYX_ERR(1, 241, __pyx_L1_error) #else __pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer = &__pyx_type_7asyncpg_7pgproto_7pgproto_ReadBuffer; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer) < 0) __PYX_ERR(1, 241, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer->tp_dictoffset && __pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif if (__Pyx_SetVtable(__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer, __pyx_vtabptr_7asyncpg_7pgproto_7pgproto_ReadBuffer) < 0) __PYX_ERR(1, 241, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer) < 0) __PYX_ERR(1, 241, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ReadBuffer, (PyObject *) __pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer) < 0) __PYX_ERR(1, 241, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer) < 0) __PYX_ERR(1, 241, __pyx_L1_error) #endif __pyx_vtabptr_7asyncpg_7pgproto_7pgproto_CodecContext = &__pyx_vtable_7asyncpg_7pgproto_7pgproto_CodecContext; __pyx_vtable_7asyncpg_7pgproto_7pgproto_CodecContext.get_text_codec = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, int __pyx_skip_dispatch))__pyx_f_7asyncpg_7pgproto_7pgproto_12CodecContext_get_text_codec; __pyx_vtable_7asyncpg_7pgproto_7pgproto_CodecContext.is_encoding_utf8 = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *))__pyx_f_7asyncpg_7pgproto_7pgproto_12CodecContext_is_encoding_utf8; __pyx_vtable_7asyncpg_7pgproto_7pgproto_CodecContext.get_json_decoder = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, int __pyx_skip_dispatch))__pyx_f_7asyncpg_7pgproto_7pgproto_12CodecContext_get_json_decoder; __pyx_vtable_7asyncpg_7pgproto_7pgproto_CodecContext.is_decoding_json = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *))__pyx_f_7asyncpg_7pgproto_7pgproto_12CodecContext_is_decoding_json; __pyx_vtable_7asyncpg_7pgproto_7pgproto_CodecContext.get_json_encoder = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, int __pyx_skip_dispatch))__pyx_f_7asyncpg_7pgproto_7pgproto_12CodecContext_get_json_encoder; __pyx_vtable_7asyncpg_7pgproto_7pgproto_CodecContext.is_encoding_json = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *))__pyx_f_7asyncpg_7pgproto_7pgproto_12CodecContext_is_encoding_json; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_7pgproto_7pgproto_CodecContext_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext)) __PYX_ERR(3, 8, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_7pgproto_7pgproto_CodecContext_spec, __pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext) < 0) __PYX_ERR(3, 8, __pyx_L1_error) #else __pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext = &__pyx_type_7asyncpg_7pgproto_7pgproto_CodecContext; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext) < 0) __PYX_ERR(3, 8, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext->tp_dictoffset && __pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext, __pyx_vtabptr_7asyncpg_7pgproto_7pgproto_CodecContext) < 0) __PYX_ERR(3, 8, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext) < 0) __PYX_ERR(3, 8, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CodecContext, (PyObject *) __pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext) < 0) __PYX_ERR(3, 8, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext) < 0) __PYX_ERR(3, 8, __pyx_L1_error) #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe)) __PYX_ERR(0, 125, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe_spec, __pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe) < 0) __PYX_ERR(0, 125, __pyx_L1_error) #else __pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe = &__pyx_type_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe) < 0) __PYX_ERR(0, 125, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe->tp_dictoffset && __pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UUIDReplaceMe, (PyObject *) __pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe) < 0) __PYX_ERR(0, 125, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe) < 0) __PYX_ERR(0, 125, __pyx_L1_error) #endif #if CYTHON_USE_TYPE_SPECS __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_7pgproto_7pgproto_UUID_spec, __pyx_t_1); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID)) __PYX_ERR(0, 138, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_7pgproto_7pgproto_UUID_spec, __pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID) < 0) __PYX_ERR(0, 138, __pyx_L1_error) #else __pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID = &__pyx_type_7asyncpg_7pgproto_7pgproto_UUID; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID->tp_base = __pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID) < 0) __PYX_ERR(0, 138, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID->tp_dictoffset && __pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UUID_2, (PyObject *) __pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID) < 0) __PYX_ERR(0, 138, __pyx_L1_error) if (__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID->tp_weaklistoffset == 0) __pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID->tp_weaklistoffset = offsetof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_UUID, __weakref__); __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject), #else sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyHeapTypeObject), #endif __Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(26, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyBoolObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(27, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyComplexObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(28, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("datetime"); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_8datetime_date = __Pyx_ImportType_3_0_11(__pyx_t_1, "datetime", "date", sizeof(PyDateTime_Date), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyDateTime_Date),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_8datetime_date) __PYX_ERR(8, 70, __pyx_L1_error) __pyx_ptype_7cpython_8datetime_time = __Pyx_ImportType_3_0_11(__pyx_t_1, "datetime", "time", sizeof(PyDateTime_Time), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyDateTime_Time),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_8datetime_time) __PYX_ERR(8, 83, __pyx_L1_error) __pyx_ptype_7cpython_8datetime_datetime = __Pyx_ImportType_3_0_11(__pyx_t_1, "datetime", "datetime", sizeof(PyDateTime_DateTime), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyDateTime_DateTime),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_8datetime_datetime) __PYX_ERR(8, 109, __pyx_L1_error) __pyx_ptype_7cpython_8datetime_timedelta = __Pyx_ImportType_3_0_11(__pyx_t_1, "datetime", "timedelta", sizeof(PyDateTime_Delta), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyDateTime_Delta),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_8datetime_timedelta) __PYX_ERR(8, 147, __pyx_L1_error) __pyx_ptype_7cpython_8datetime_tzinfo = __Pyx_ImportType_3_0_11(__pyx_t_1, "datetime", "tzinfo", sizeof(PyDateTime_TZInfo), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyDateTime_TZInfo),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_8datetime_tzinfo) __PYX_ERR(8, 160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_pgproto(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_pgproto}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "pgproto", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initpgproto(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initpgproto(void) #else __Pyx_PyMODINIT_FUNC PyInit_pgproto(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_pgproto(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_pgproto(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; static char __pyx_t_6[256]; int __pyx_t_7; long __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'pgproto' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("pgproto", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(10, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "pgproto" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(10, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(10, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(10, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(10, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(10, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_pgproto(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(10, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(10, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(10, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(10, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(10, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(10, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(10, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(10, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(10, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(10, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(10, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(10, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_asyncpg__pgproto__pgproto) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(10, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(10, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "asyncpg.pgproto.pgproto")) { if (unlikely((PyDict_SetItemString(modules, "asyncpg.pgproto.pgproto", __pyx_m) < 0))) __PYX_ERR(10, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(10, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(10, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(10, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(10, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(10, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(10, 1, __pyx_L1_error) #endif /* "asyncpg/pgproto/pgproto.pyx":23 * * from .debug cimport PG_DEBUG * from . import types as pgproto_types # <<<<<<<<<<<<<< * * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_types); __Pyx_GIVEREF(__pyx_n_s_types); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_types)) __PYX_ERR(10, 23, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s__2, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pgproto_types, __pyx_t_2) < 0) __PYX_ERR(10, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":10 * from libc.string cimport memcpy * * import collections # <<<<<<<<<<<<<< * * class BufferError(Exception): */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_collections, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_3) < 0) __PYX_ERR(1, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/pgproto/buffer.pyx":12 * import collections * * class BufferError(Exception): # <<<<<<<<<<<<<< * pass * */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])); __Pyx_GIVEREF((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])))) __PYX_ERR(1, 12, __pyx_L1_error); __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_2, __pyx_n_s_BufferError, __pyx_n_s_BufferError, (PyObject *) NULL, __pyx_n_s_asyncpg_pgproto_pgproto, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2 != __pyx_t_3) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(1, 12, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_BufferError, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_BufferError, __pyx_t_3) < 0) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_11WriteBuffer_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_WriteBuffer___reduce_cython, NULL, __pyx_n_s_asyncpg_pgproto_pgproto, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_11WriteBuffer_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_WriteBuffer___setstate_cython, NULL, __pyx_n_s_asyncpg_pgproto_pgproto, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_10ReadBuffer_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadBuffer___reduce_cython, NULL, __pyx_n_s_asyncpg_pgproto_pgproto, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_10ReadBuffer_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadBuffer___setstate_cython, NULL, __pyx_n_s_asyncpg_pgproto_pgproto, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/uuid.pyx":1 * import functools # <<<<<<<<<<<<<< * import uuid * */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_functools, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_functools, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/uuid.pyx":2 * import functools * import uuid # <<<<<<<<<<<<<< * * cimport cython */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_uuid, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_uuid, __pyx_t_2) < 0) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/uuid.pyx":60 * * cdef char _hextable[256] * _hextable[:] = [ # <<<<<<<<<<<<<< * -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, * -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, */ __pyx_t_6[0] = -1; __pyx_t_6[1] = -1; __pyx_t_6[2] = -1; __pyx_t_6[3] = -1; __pyx_t_6[4] = -1; __pyx_t_6[5] = -1; __pyx_t_6[6] = -1; __pyx_t_6[7] = -1; __pyx_t_6[8] = -1; __pyx_t_6[9] = -1; __pyx_t_6[10] = -1; __pyx_t_6[11] = -1; __pyx_t_6[12] = -1; __pyx_t_6[13] = -1; __pyx_t_6[14] = -1; __pyx_t_6[15] = -1; __pyx_t_6[16] = -1; __pyx_t_6[17] = -1; __pyx_t_6[18] = -1; __pyx_t_6[19] = -1; __pyx_t_6[20] = -1; __pyx_t_6[21] = -1; __pyx_t_6[22] = -1; __pyx_t_6[23] = -1; __pyx_t_6[24] = -1; __pyx_t_6[25] = -1; __pyx_t_6[26] = -1; __pyx_t_6[27] = -1; __pyx_t_6[28] = -1; __pyx_t_6[29] = -1; __pyx_t_6[30] = -1; __pyx_t_6[31] = -1; __pyx_t_6[32] = -1; __pyx_t_6[33] = -1; __pyx_t_6[34] = -1; __pyx_t_6[35] = -1; __pyx_t_6[36] = -1; __pyx_t_6[37] = -1; __pyx_t_6[38] = -1; __pyx_t_6[39] = -1; __pyx_t_6[40] = -1; __pyx_t_6[41] = -1; __pyx_t_6[42] = -1; __pyx_t_6[43] = -1; __pyx_t_6[44] = -1; __pyx_t_6[45] = -1; __pyx_t_6[46] = -1; __pyx_t_6[47] = -1; __pyx_t_6[48] = 0; __pyx_t_6[49] = 1; __pyx_t_6[50] = 2; __pyx_t_6[51] = 3; __pyx_t_6[52] = 4; __pyx_t_6[53] = 5; __pyx_t_6[54] = 6; __pyx_t_6[55] = 7; __pyx_t_6[56] = 8; __pyx_t_6[57] = 9; __pyx_t_6[58] = -1; __pyx_t_6[59] = -1; __pyx_t_6[60] = -1; __pyx_t_6[61] = -1; __pyx_t_6[62] = -1; __pyx_t_6[63] = -1; __pyx_t_6[64] = -1; __pyx_t_6[65] = 10; __pyx_t_6[66] = 11; __pyx_t_6[67] = 12; __pyx_t_6[68] = 13; __pyx_t_6[69] = 14; __pyx_t_6[70] = 15; __pyx_t_6[71] = -1; __pyx_t_6[72] = -1; __pyx_t_6[73] = -1; __pyx_t_6[74] = -1; __pyx_t_6[75] = -1; __pyx_t_6[76] = -1; __pyx_t_6[77] = -1; __pyx_t_6[78] = -1; __pyx_t_6[79] = -1; __pyx_t_6[80] = -1; __pyx_t_6[81] = -1; __pyx_t_6[82] = -1; __pyx_t_6[83] = -1; __pyx_t_6[84] = -1; __pyx_t_6[85] = -1; __pyx_t_6[86] = -1; __pyx_t_6[87] = -1; __pyx_t_6[88] = -1; __pyx_t_6[89] = -1; __pyx_t_6[90] = -1; __pyx_t_6[91] = -1; __pyx_t_6[92] = -1; __pyx_t_6[93] = -1; __pyx_t_6[94] = -1; __pyx_t_6[95] = -1; __pyx_t_6[96] = -1; __pyx_t_6[97] = 10; __pyx_t_6[98] = 11; __pyx_t_6[99] = 12; __pyx_t_6[100] = 13; __pyx_t_6[101] = 14; __pyx_t_6[102] = 15; __pyx_t_6[103] = -1; __pyx_t_6[104] = -1; __pyx_t_6[105] = -1; __pyx_t_6[106] = -1; __pyx_t_6[107] = -1; __pyx_t_6[108] = -1; __pyx_t_6[109] = -1; __pyx_t_6[110] = -1; __pyx_t_6[111] = -1; __pyx_t_6[112] = -1; __pyx_t_6[113] = -1; __pyx_t_6[114] = -1; __pyx_t_6[115] = -1; __pyx_t_6[116] = -1; __pyx_t_6[117] = -1; __pyx_t_6[118] = -1; __pyx_t_6[119] = -1; __pyx_t_6[120] = -1; __pyx_t_6[121] = -1; __pyx_t_6[122] = -1; __pyx_t_6[123] = -1; __pyx_t_6[124] = -1; __pyx_t_6[125] = -1; __pyx_t_6[126] = -1; __pyx_t_6[127] = -1; __pyx_t_6[128] = -1; __pyx_t_6[129] = -1; __pyx_t_6[130] = -1; __pyx_t_6[131] = -1; __pyx_t_6[132] = -1; __pyx_t_6[133] = -1; __pyx_t_6[134] = -1; __pyx_t_6[135] = -1; __pyx_t_6[136] = -1; __pyx_t_6[137] = -1; __pyx_t_6[138] = -1; __pyx_t_6[139] = -1; __pyx_t_6[140] = -1; __pyx_t_6[141] = -1; __pyx_t_6[142] = -1; __pyx_t_6[143] = -1; __pyx_t_6[144] = -1; __pyx_t_6[145] = -1; __pyx_t_6[146] = -1; __pyx_t_6[147] = -1; __pyx_t_6[148] = -1; __pyx_t_6[149] = -1; __pyx_t_6[150] = -1; __pyx_t_6[151] = -1; __pyx_t_6[152] = -1; __pyx_t_6[153] = -1; __pyx_t_6[154] = -1; __pyx_t_6[155] = -1; __pyx_t_6[156] = -1; __pyx_t_6[157] = -1; __pyx_t_6[158] = -1; __pyx_t_6[159] = -1; __pyx_t_6[160] = -1; __pyx_t_6[161] = -1; __pyx_t_6[162] = -1; __pyx_t_6[163] = -1; __pyx_t_6[164] = -1; __pyx_t_6[165] = -1; __pyx_t_6[166] = -1; __pyx_t_6[167] = -1; __pyx_t_6[168] = -1; __pyx_t_6[169] = -1; __pyx_t_6[170] = -1; __pyx_t_6[171] = -1; __pyx_t_6[172] = -1; __pyx_t_6[173] = -1; __pyx_t_6[174] = -1; __pyx_t_6[175] = -1; __pyx_t_6[176] = -1; __pyx_t_6[177] = -1; __pyx_t_6[178] = -1; __pyx_t_6[179] = -1; __pyx_t_6[180] = -1; __pyx_t_6[181] = -1; __pyx_t_6[182] = -1; __pyx_t_6[183] = -1; __pyx_t_6[184] = -1; __pyx_t_6[185] = -1; __pyx_t_6[186] = -1; __pyx_t_6[187] = -1; __pyx_t_6[188] = -1; __pyx_t_6[189] = -1; __pyx_t_6[190] = -1; __pyx_t_6[191] = -1; __pyx_t_6[192] = -1; __pyx_t_6[193] = -1; __pyx_t_6[194] = -1; __pyx_t_6[195] = -1; __pyx_t_6[196] = -1; __pyx_t_6[197] = -1; __pyx_t_6[198] = -1; __pyx_t_6[199] = -1; __pyx_t_6[200] = -1; __pyx_t_6[201] = -1; __pyx_t_6[202] = -1; __pyx_t_6[203] = -1; __pyx_t_6[204] = -1; __pyx_t_6[205] = -1; __pyx_t_6[206] = -1; __pyx_t_6[207] = -1; __pyx_t_6[208] = -1; __pyx_t_6[209] = -1; __pyx_t_6[210] = -1; __pyx_t_6[211] = -1; __pyx_t_6[212] = -1; __pyx_t_6[213] = -1; __pyx_t_6[214] = -1; __pyx_t_6[215] = -1; __pyx_t_6[216] = -1; __pyx_t_6[217] = -1; __pyx_t_6[218] = -1; __pyx_t_6[219] = -1; __pyx_t_6[220] = -1; __pyx_t_6[221] = -1; __pyx_t_6[222] = -1; __pyx_t_6[223] = -1; __pyx_t_6[224] = -1; __pyx_t_6[225] = -1; __pyx_t_6[226] = -1; __pyx_t_6[227] = -1; __pyx_t_6[228] = -1; __pyx_t_6[229] = -1; __pyx_t_6[230] = -1; __pyx_t_6[231] = -1; __pyx_t_6[232] = -1; __pyx_t_6[233] = -1; __pyx_t_6[234] = -1; __pyx_t_6[235] = -1; __pyx_t_6[236] = -1; __pyx_t_6[237] = -1; __pyx_t_6[238] = -1; __pyx_t_6[239] = -1; __pyx_t_6[240] = -1; __pyx_t_6[241] = -1; __pyx_t_6[242] = -1; __pyx_t_6[243] = -1; __pyx_t_6[244] = -1; __pyx_t_6[245] = -1; __pyx_t_6[246] = -1; __pyx_t_6[247] = -1; __pyx_t_6[248] = -1; __pyx_t_6[249] = -1; __pyx_t_6[250] = -1; __pyx_t_6[251] = -1; __pyx_t_6[252] = -1; __pyx_t_6[253] = -1; __pyx_t_6[254] = -1; __pyx_t_6[255] = -1; if (unlikely((0x100) != (256))) { PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length, expected %" CYTHON_FORMAT_SSIZE_T "d, got %" CYTHON_FORMAT_SSIZE_T "d", (Py_ssize_t)(256), (Py_ssize_t)(0x100)); __PYX_ERR(0, 60, __pyx_L1_error) } memcpy(&(__pyx_v_7asyncpg_7pgproto_7pgproto__hextable[0]), __pyx_t_6, sizeof(__pyx_v_7asyncpg_7pgproto_7pgproto__hextable[0]) * (256)); /* "asyncpg/pgproto/uuid.pyx":75 * * * cdef std_UUID = uuid.UUID # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_uuid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_UUID_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_v_7asyncpg_7pgproto_7pgproto_std_UUID); __Pyx_DECREF_SET(__pyx_v_7asyncpg_7pgproto_7pgproto_std_UUID, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_15__UUIDReplaceMe_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_UUIDReplaceMe___reduce_cython, NULL, __pyx_n_s_asyncpg_pgproto_pgproto, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe, __pyx_n_s_reduce_cython, __pyx_t_4) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe); /* "(tree fragment)":16 * else: * return __pyx_unpickle___UUIDReplaceMe, (type(self), 0xe3b0c44, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle___UUIDReplaceMe__set_state(self, __pyx_state) */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_15__UUIDReplaceMe_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_UUIDReplaceMe___setstate_cytho, NULL, __pyx_n_s_asyncpg_pgproto_pgproto, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe, __pyx_n_s_setstate_cython, __pyx_t_4) < 0) __PYX_ERR(2, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe); /* "asyncpg/pgproto/uuid.pyx":196 * return f"UUID('{self}')" * * def __reduce__(self): # <<<<<<<<<<<<<< * return (type(self), (self.bytes,)) * */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_4UUID_9__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_UUID___reduce, NULL, __pyx_n_s_asyncpg_pgproto_pgproto, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID, __pyx_n_s_reduce, __pyx_t_4) < 0) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID); /* "asyncpg/pgproto/uuid.pyx":344 * # compatible with future Pythons for long enough. * # * assert UUID.__bases__[0] is __UUIDReplaceMe # <<<<<<<<<<<<<< * assert UUID.__mro__[1] is __UUIDReplaceMe * cpython.Py_INCREF(std_UUID) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID), __pyx_n_s_bases); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = (__pyx_t_2 == ((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe)); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_7)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 344, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 344, __pyx_L1_error) #endif /* "asyncpg/pgproto/uuid.pyx":345 * # * assert UUID.__bases__[0] is __UUIDReplaceMe * assert UUID.__mro__[1] is __UUIDReplaceMe # <<<<<<<<<<<<<< * cpython.Py_INCREF(std_UUID) * cpython.PyTuple_SET_ITEM(UUID.__bases__, 0, std_UUID) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID), __pyx_n_s_mro); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = (__pyx_t_4 == ((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto___UUIDReplaceMe)); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_7)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 345, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 345, __pyx_L1_error) #endif /* "asyncpg/pgproto/uuid.pyx":346 * assert UUID.__bases__[0] is __UUIDReplaceMe * assert UUID.__mro__[1] is __UUIDReplaceMe * cpython.Py_INCREF(std_UUID) # <<<<<<<<<<<<<< * cpython.PyTuple_SET_ITEM(UUID.__bases__, 0, std_UUID) * cpython.Py_INCREF(std_UUID) */ __pyx_t_4 = __pyx_v_7asyncpg_7pgproto_7pgproto_std_UUID; __Pyx_INCREF(__pyx_t_4); Py_INCREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/uuid.pyx":347 * assert UUID.__mro__[1] is __UUIDReplaceMe * cpython.Py_INCREF(std_UUID) * cpython.PyTuple_SET_ITEM(UUID.__bases__, 0, std_UUID) # <<<<<<<<<<<<<< * cpython.Py_INCREF(std_UUID) * cpython.PyTuple_SET_ITEM(UUID.__mro__, 1, std_UUID) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID), __pyx_n_s_bases); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_v_7asyncpg_7pgproto_7pgproto_std_UUID; __Pyx_INCREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/uuid.pyx":348 * cpython.Py_INCREF(std_UUID) * cpython.PyTuple_SET_ITEM(UUID.__bases__, 0, std_UUID) * cpython.Py_INCREF(std_UUID) # <<<<<<<<<<<<<< * cpython.PyTuple_SET_ITEM(UUID.__mro__, 1, std_UUID) * # */ __pyx_t_2 = __pyx_v_7asyncpg_7pgproto_7pgproto_std_UUID; __Pyx_INCREF(__pyx_t_2); Py_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/uuid.pyx":349 * cpython.PyTuple_SET_ITEM(UUID.__bases__, 0, std_UUID) * cpython.Py_INCREF(std_UUID) * cpython.PyTuple_SET_ITEM(UUID.__mro__, 1, std_UUID) # <<<<<<<<<<<<<< * # * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID), __pyx_n_s_mro); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __pyx_v_7asyncpg_7pgproto_7pgproto_std_UUID; __Pyx_INCREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/uuid.pyx":353 * * * cdef pg_UUID = UUID # <<<<<<<<<<<<<< */ __Pyx_INCREF((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID); __Pyx_XGOTREF(__pyx_v_7asyncpg_7pgproto_7pgproto_pg_UUID); __Pyx_DECREF_SET(__pyx_v_7asyncpg_7pgproto_7pgproto_pg_UUID, ((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID)); __Pyx_GIVEREF((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_UUID); /* "asyncpg/pgproto/codecs/context.pyx":10 * cdef class CodecContext: * * cpdef get_text_codec(self): # <<<<<<<<<<<<<< * raise NotImplementedError * */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_12CodecContext_1get_text_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CodecContext_get_text_codec, NULL, __pyx_n_s_asyncpg_pgproto_pgproto, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext, __pyx_n_s_get_text_codec, __pyx_t_4) < 0) __PYX_ERR(3, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext); /* "asyncpg/pgproto/codecs/context.pyx":16 * raise NotImplementedError * * cpdef get_json_decoder(self): # <<<<<<<<<<<<<< * raise NotImplementedError * */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_12CodecContext_3get_json_decoder, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CodecContext_get_json_decoder, NULL, __pyx_n_s_asyncpg_pgproto_pgproto, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext, __pyx_n_s_get_json_decoder, __pyx_t_4) < 0) __PYX_ERR(3, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext); /* "asyncpg/pgproto/codecs/context.pyx":22 * return False * * cpdef get_json_encoder(self): # <<<<<<<<<<<<<< * raise NotImplementedError * */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_12CodecContext_5get_json_encoder, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CodecContext_get_json_encoder, NULL, __pyx_n_s_asyncpg_pgproto_pgproto, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext, __pyx_n_s_get_json_encoder, __pyx_t_4) < 0) __PYX_ERR(3, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_12CodecContext_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CodecContext___reduce_cython, NULL, __pyx_n_s_asyncpg_pgproto_pgproto, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext, __pyx_n_s_reduce_cython, __pyx_t_4) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext); /* "(tree fragment)":16 * else: * return __pyx_unpickle_CodecContext, (type(self), 0xe3b0c44, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_CodecContext__set_state(self, __pyx_state) */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_12CodecContext_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CodecContext___setstate_cython, NULL, __pyx_n_s_asyncpg_pgproto_pgproto, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext, __pyx_n_s_setstate_cython, __pyx_t_4) < 0) __PYX_ERR(2, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext); /* "asyncpg/pgproto/codecs/datetime.pyx":9 * * cimport cpython.datetime * import datetime # <<<<<<<<<<<<<< * * cpython.datetime.import_datetime() */ __pyx_t_4 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_4) < 0) __PYX_ERR(13, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":11 * import datetime * * cpython.datetime.import_datetime() # <<<<<<<<<<<<<< * * utc = datetime.timezone.utc */ __pyx_f_7cpython_8datetime_import_datetime(); /* "asyncpg/pgproto/codecs/datetime.pyx":13 * cpython.datetime.import_datetime() * * utc = datetime.timezone.utc # <<<<<<<<<<<<<< * date_from_ordinal = datetime.date.fromordinal * timedelta = datetime.timedelta */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_utc); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_utc, __pyx_t_4) < 0) __PYX_ERR(13, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":14 * * utc = datetime.timezone.utc * date_from_ordinal = datetime.date.fromordinal # <<<<<<<<<<<<<< * timedelta = datetime.timedelta * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_date); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_fromordinal); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_date_from_ordinal, __pyx_t_4) < 0) __PYX_ERR(13, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":15 * utc = datetime.timezone.utc * date_from_ordinal = datetime.date.fromordinal * timedelta = datetime.timedelta # <<<<<<<<<<<<<< * * pg_epoch_datetime = datetime.datetime(2000, 1, 1) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_timedelta, __pyx_t_2) < 0) __PYX_ERR(13, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":17 * timedelta = datetime.timedelta * * pg_epoch_datetime = datetime.datetime(2000, 1, 1) # <<<<<<<<<<<<<< * cdef int32_t pg_epoch_datetime_ts = \ * cpython.PyLong_AsLong(int(pg_epoch_datetime.timestamp())) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_pg_epoch_datetime, __pyx_t_2) < 0) __PYX_ERR(13, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":19 * pg_epoch_datetime = datetime.datetime(2000, 1, 1) * cdef int32_t pg_epoch_datetime_ts = \ * cpython.PyLong_AsLong(int(pg_epoch_datetime.timestamp())) # <<<<<<<<<<<<<< * * pg_epoch_datetime_utc = datetime.datetime(2000, 1, 1, tzinfo=utc) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pg_epoch_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = PyLong_AsLong(__pyx_t_4); if (unlikely(__pyx_t_8 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_7asyncpg_7pgproto_7pgproto_pg_epoch_datetime_ts = ((int32_t)__pyx_t_8); /* "asyncpg/pgproto/codecs/datetime.pyx":21 * cpython.PyLong_AsLong(int(pg_epoch_datetime.timestamp())) * * pg_epoch_datetime_utc = datetime.datetime(2000, 1, 1, tzinfo=utc) # <<<<<<<<<<<<<< * cdef int32_t pg_epoch_datetime_utc_ts = \ * cpython.PyLong_AsLong(int(pg_epoch_datetime_utc.timestamp())) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_utc); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_tzinfo, __pyx_t_5) < 0) __PYX_ERR(13, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__50, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_pg_epoch_datetime_utc, __pyx_t_5) < 0) __PYX_ERR(13, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":23 * pg_epoch_datetime_utc = datetime.datetime(2000, 1, 1, tzinfo=utc) * cdef int32_t pg_epoch_datetime_utc_ts = \ * cpython.PyLong_AsLong(int(pg_epoch_datetime_utc.timestamp())) # <<<<<<<<<<<<<< * * pg_epoch_date = datetime.date(2000, 1, 1) */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pg_epoch_datetime_utc); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = PyLong_AsLong(__pyx_t_4); if (unlikely(__pyx_t_8 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_7asyncpg_7pgproto_7pgproto_pg_epoch_datetime_utc_ts = ((int32_t)__pyx_t_8); /* "asyncpg/pgproto/codecs/datetime.pyx":25 * cpython.PyLong_AsLong(int(pg_epoch_datetime_utc.timestamp())) * * pg_epoch_date = datetime.date(2000, 1, 1) # <<<<<<<<<<<<<< * cdef int32_t pg_date_offset_ord = \ * cpython.PyLong_AsLong(pg_epoch_date.toordinal()) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_date); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_pg_epoch_date, __pyx_t_4) < 0) __PYX_ERR(13, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":27 * pg_epoch_date = datetime.date(2000, 1, 1) * cdef int32_t pg_date_offset_ord = \ * cpython.PyLong_AsLong(pg_epoch_date.toordinal()) # <<<<<<<<<<<<<< * * # Binary representations of infinity for datetimes. */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pg_epoch_date); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = PyLong_AsLong(__pyx_t_4); if (unlikely(__pyx_t_8 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_7asyncpg_7pgproto_7pgproto_pg_date_offset_ord = ((int32_t)__pyx_t_8); /* "asyncpg/pgproto/codecs/datetime.pyx":30 * * # Binary representations of infinity for datetimes. * cdef int64_t pg_time64_infinity = 0x7fffffffffffffff # <<<<<<<<<<<<<< * cdef int64_t pg_time64_negative_infinity = 0x8000000000000000 * cdef int32_t pg_date_infinity = 0x7fffffff */ __pyx_v_7asyncpg_7pgproto_7pgproto_pg_time64_infinity = 0x7fffffffffffffff; /* "asyncpg/pgproto/codecs/datetime.pyx":31 * # Binary representations of infinity for datetimes. * cdef int64_t pg_time64_infinity = 0x7fffffffffffffff * cdef int64_t pg_time64_negative_infinity = 0x8000000000000000 # <<<<<<<<<<<<<< * cdef int32_t pg_date_infinity = 0x7fffffff * cdef int32_t pg_date_negative_infinity = 0x80000000 */ __pyx_v_7asyncpg_7pgproto_7pgproto_pg_time64_negative_infinity = ((int64_t)0x8000000000000000); /* "asyncpg/pgproto/codecs/datetime.pyx":32 * cdef int64_t pg_time64_infinity = 0x7fffffffffffffff * cdef int64_t pg_time64_negative_infinity = 0x8000000000000000 * cdef int32_t pg_date_infinity = 0x7fffffff # <<<<<<<<<<<<<< * cdef int32_t pg_date_negative_infinity = 0x80000000 * */ __pyx_v_7asyncpg_7pgproto_7pgproto_pg_date_infinity = 0x7fffffff; /* "asyncpg/pgproto/codecs/datetime.pyx":33 * cdef int64_t pg_time64_negative_infinity = 0x8000000000000000 * cdef int32_t pg_date_infinity = 0x7fffffff * cdef int32_t pg_date_negative_infinity = 0x80000000 # <<<<<<<<<<<<<< * * infinity_datetime = datetime.datetime( */ __pyx_v_7asyncpg_7pgproto_7pgproto_pg_date_negative_infinity = ((int32_t)0x80000000); /* "asyncpg/pgproto/codecs/datetime.pyx":35 * cdef int32_t pg_date_negative_infinity = 0x80000000 * * infinity_datetime = datetime.datetime( # <<<<<<<<<<<<<< * datetime.MAXYEAR, 12, 31, 23, 59, 59, 999999) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":36 * * infinity_datetime = datetime.datetime( * datetime.MAXYEAR, 12, 31, 23, 59, 59, 999999) # <<<<<<<<<<<<<< * * cdef int32_t infinity_datetime_ord = cpython.PyLong_AsLong( */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_MAXYEAR); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":35 * cdef int32_t pg_date_negative_infinity = 0x80000000 * * infinity_datetime = datetime.datetime( # <<<<<<<<<<<<<< * datetime.MAXYEAR, 12, 31, 23, 59, 59, 999999) * */ __pyx_t_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(13, 35, __pyx_L1_error); __Pyx_INCREF(__pyx_int_12); __Pyx_GIVEREF(__pyx_int_12); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_12)) __PYX_ERR(13, 35, __pyx_L1_error); __Pyx_INCREF(__pyx_int_31); __Pyx_GIVEREF(__pyx_int_31); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_int_31)) __PYX_ERR(13, 35, __pyx_L1_error); __Pyx_INCREF(__pyx_int_23); __Pyx_GIVEREF(__pyx_int_23); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_int_23)) __PYX_ERR(13, 35, __pyx_L1_error); __Pyx_INCREF(__pyx_int_59); __Pyx_GIVEREF(__pyx_int_59); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_int_59)) __PYX_ERR(13, 35, __pyx_L1_error); __Pyx_INCREF(__pyx_int_59); __Pyx_GIVEREF(__pyx_int_59); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_int_59)) __PYX_ERR(13, 35, __pyx_L1_error); __Pyx_INCREF(__pyx_int_999999); __Pyx_GIVEREF(__pyx_int_999999); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_int_999999)) __PYX_ERR(13, 35, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_infinity_datetime, __pyx_t_2) < 0) __PYX_ERR(13, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":39 * * cdef int32_t infinity_datetime_ord = cpython.PyLong_AsLong( * infinity_datetime.toordinal()) # <<<<<<<<<<<<<< * * cdef int64_t infinity_datetime_ts = 252455615999999999 */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_infinity_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":38 * datetime.MAXYEAR, 12, 31, 23, 59, 59, 999999) * * cdef int32_t infinity_datetime_ord = cpython.PyLong_AsLong( # <<<<<<<<<<<<<< * infinity_datetime.toordinal()) * */ __pyx_t_8 = PyLong_AsLong(__pyx_t_2); if (unlikely(__pyx_t_8 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_7asyncpg_7pgproto_7pgproto_infinity_datetime_ord = ((int32_t)__pyx_t_8); /* "asyncpg/pgproto/codecs/datetime.pyx":41 * infinity_datetime.toordinal()) * * cdef int64_t infinity_datetime_ts = 252455615999999999 # <<<<<<<<<<<<<< * * negative_infinity_datetime = datetime.datetime( */ __pyx_v_7asyncpg_7pgproto_7pgproto_infinity_datetime_ts = 0x380E70B913B7FFF; /* "asyncpg/pgproto/codecs/datetime.pyx":43 * cdef int64_t infinity_datetime_ts = 252455615999999999 * * negative_infinity_datetime = datetime.datetime( # <<<<<<<<<<<<<< * datetime.MINYEAR, 1, 1, 0, 0, 0, 0) * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":44 * * negative_infinity_datetime = datetime.datetime( * datetime.MINYEAR, 1, 1, 0, 0, 0, 0) # <<<<<<<<<<<<<< * * cdef int32_t negative_infinity_datetime_ord = cpython.PyLong_AsLong( */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_MINYEAR); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":43 * cdef int64_t infinity_datetime_ts = 252455615999999999 * * negative_infinity_datetime = datetime.datetime( # <<<<<<<<<<<<<< * datetime.MINYEAR, 1, 1, 0, 0, 0, 0) * */ __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5)) __PYX_ERR(13, 43, __pyx_L1_error); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_1)) __PYX_ERR(13, 43, __pyx_L1_error); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_1)) __PYX_ERR(13, 43, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_int_0)) __PYX_ERR(13, 43, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_int_0)) __PYX_ERR(13, 43, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_int_0)) __PYX_ERR(13, 43, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_int_0)) __PYX_ERR(13, 43, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_negative_infinity_datetime, __pyx_t_5) < 0) __PYX_ERR(13, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":47 * * cdef int32_t negative_infinity_datetime_ord = cpython.PyLong_AsLong( * negative_infinity_datetime.toordinal()) # <<<<<<<<<<<<<< * * cdef int64_t negative_infinity_datetime_ts = -63082281600000000 */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_negative_infinity_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":46 * datetime.MINYEAR, 1, 1, 0, 0, 0, 0) * * cdef int32_t negative_infinity_datetime_ord = cpython.PyLong_AsLong( # <<<<<<<<<<<<<< * negative_infinity_datetime.toordinal()) * */ __pyx_t_8 = PyLong_AsLong(__pyx_t_5); if (unlikely(__pyx_t_8 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_7asyncpg_7pgproto_7pgproto_negative_infinity_datetime_ord = ((int32_t)__pyx_t_8); /* "asyncpg/pgproto/codecs/datetime.pyx":49 * negative_infinity_datetime.toordinal()) * * cdef int64_t negative_infinity_datetime_ts = -63082281600000000 # <<<<<<<<<<<<<< * * infinity_date = datetime.date(datetime.MAXYEAR, 12, 31) */ __pyx_v_7asyncpg_7pgproto_7pgproto_negative_infinity_datetime_ts = -63082281600000000L; /* "asyncpg/pgproto/codecs/datetime.pyx":51 * cdef int64_t negative_infinity_datetime_ts = -63082281600000000 * * infinity_date = datetime.date(datetime.MAXYEAR, 12, 31) # <<<<<<<<<<<<<< * * cdef int32_t infinity_date_ord = cpython.PyLong_AsLong( */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_date); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_MAXYEAR); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(13, 51, __pyx_L1_error); __Pyx_INCREF(__pyx_int_12); __Pyx_GIVEREF(__pyx_int_12); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_12)) __PYX_ERR(13, 51, __pyx_L1_error); __Pyx_INCREF(__pyx_int_31); __Pyx_GIVEREF(__pyx_int_31); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_31)) __PYX_ERR(13, 51, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_infinity_date, __pyx_t_4) < 0) __PYX_ERR(13, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":54 * * cdef int32_t infinity_date_ord = cpython.PyLong_AsLong( * infinity_date.toordinal()) # <<<<<<<<<<<<<< * * negative_infinity_date = datetime.date(datetime.MINYEAR, 1, 1) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_infinity_date); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":53 * infinity_date = datetime.date(datetime.MAXYEAR, 12, 31) * * cdef int32_t infinity_date_ord = cpython.PyLong_AsLong( # <<<<<<<<<<<<<< * infinity_date.toordinal()) * */ __pyx_t_8 = PyLong_AsLong(__pyx_t_4); if (unlikely(__pyx_t_8 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_7asyncpg_7pgproto_7pgproto_infinity_date_ord = ((int32_t)__pyx_t_8); /* "asyncpg/pgproto/codecs/datetime.pyx":56 * infinity_date.toordinal()) * * negative_infinity_date = datetime.date(datetime.MINYEAR, 1, 1) # <<<<<<<<<<<<<< * * cdef int32_t negative_infinity_date_ord = cpython.PyLong_AsLong( */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_date); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_MINYEAR); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(13, 56, __pyx_L1_error); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_1)) __PYX_ERR(13, 56, __pyx_L1_error); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_int_1)) __PYX_ERR(13, 56, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_negative_infinity_date, __pyx_t_2) < 0) __PYX_ERR(13, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":59 * * cdef int32_t negative_infinity_date_ord = cpython.PyLong_AsLong( * negative_infinity_date.toordinal()) # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_negative_infinity_date); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_toordinal); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/datetime.pyx":58 * negative_infinity_date = datetime.date(datetime.MINYEAR, 1, 1) * * cdef int32_t negative_infinity_date_ord = cpython.PyLong_AsLong( # <<<<<<<<<<<<<< * negative_infinity_date.toordinal()) * */ __pyx_t_8 = PyLong_AsLong(__pyx_t_2); if (unlikely(__pyx_t_8 == ((long)-1L) && PyErr_Occurred())) __PYX_ERR(13, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_7asyncpg_7pgproto_7pgproto_negative_infinity_date_ord = ((int32_t)__pyx_t_8); /* "asyncpg/pgproto/codecs/numeric.pyx":11 * from libc.stdio cimport snprintf * * import decimal # <<<<<<<<<<<<<< * * # defined in postgresql/src/backend/utils/adt/numeric.c */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_decimal, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_decimal, __pyx_t_2) < 0) __PYX_ERR(18, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/numeric.pyx":22 * DEF NUMERIC_NINF = 0xF000 * * _Dec = decimal.Decimal # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decimal); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Decimal); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_Dec, __pyx_t_4) < 0) __PYX_ERR(18, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/network.pyx":8 * * * import ipaddress # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __Pyx_ImportDottedModule(__pyx_n_s_ipaddress, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ipaddress, __pyx_t_4) < 0) __PYX_ERR(23, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/network.pyx":17 * * * _ipaddr = ipaddress.ip_address # <<<<<<<<<<<<<< * _ipiface = ipaddress.ip_interface * _ipnet = ipaddress.ip_network */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ipaddress); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ip_address); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_ipaddr, __pyx_t_2) < 0) __PYX_ERR(23, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/codecs/network.pyx":18 * * _ipaddr = ipaddress.ip_address * _ipiface = ipaddress.ip_interface # <<<<<<<<<<<<<< * _ipnet = ipaddress.ip_network * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ipaddress); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ip_interface); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_ipiface, __pyx_t_4) < 0) __PYX_ERR(23, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/pgproto/codecs/network.pyx":19 * _ipaddr = ipaddress.ip_address * _ipiface = ipaddress.ip_interface * _ipnet = ipaddress.ip_network # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ipaddress); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ip_network); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_ipnet, __pyx_t_2) < 0) __PYX_ERR(23, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __pyx_unpickle___UUIDReplaceMe(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_1__pyx_unpickle___UUIDReplaceMe, 0, __pyx_n_s_pyx_unpickle___UUIDReplaceMe, NULL, __pyx_n_s_asyncpg_pgproto_pgproto, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle___UUIDReplaceMe, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":11 * __pyx_unpickle___UUIDReplaceMe__set_state(<__UUIDReplaceMe> __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle___UUIDReplaceMe__set_state(__UUIDReplaceMe __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[0]) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_7pgproto_7pgproto_3__pyx_unpickle_CodecContext, 0, __pyx_n_s_pyx_unpickle_CodecContext, NULL, __pyx_n_s_asyncpg_pgproto_pgproto, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_CodecContext, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/pgproto/pgproto.pyx":1 * # Copyright (C) 2016-present the asyncpg authors and contributors # <<<<<<<<<<<<<< * # * # */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(10, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init asyncpg.pgproto.pgproto", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init asyncpg.pgproto.pgproto"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { __Pyx_TypeName obj_type_name; __Pyx_TypeName type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(__Pyx_TypeCheck(obj, type))) return 1; obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_TypeError, "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, obj_type_name, type_name); __Pyx_DECREF_TypeName(obj_type_name); __Pyx_DECREF_TypeName(type_name); return 0; } /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* CIntToDigits */ static const char DIGIT_PAIRS_10[2*10*10+1] = { "00010203040506070809" "10111213141516171819" "20212223242526272829" "30313233343536373839" "40414243444546474849" "50515253545556575859" "60616263646566676869" "70717273747576777879" "80818283848586878889" "90919293949596979899" }; static const char DIGIT_PAIRS_8[2*8*8+1] = { "0001020304050607" "1011121314151617" "2021222324252627" "3031323334353637" "4041424344454647" "5051525354555657" "6061626364656667" "7071727374757677" }; static const char DIGITS_HEX[2*16+1] = { "0123456789abcdef" "0123456789ABCDEF" }; /* BuildPyUnicode */ static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, int prepend_sign, char padding_char) { PyObject *uval; Py_ssize_t uoffset = ulength - clength; #if CYTHON_USE_UNICODE_INTERNALS Py_ssize_t i; #if CYTHON_PEP393_ENABLED void *udata; uval = PyUnicode_New(ulength, 127); if (unlikely(!uval)) return NULL; udata = PyUnicode_DATA(uval); #else Py_UNICODE *udata; uval = PyUnicode_FromUnicode(NULL, ulength); if (unlikely(!uval)) return NULL; udata = PyUnicode_AS_UNICODE(uval); #endif if (uoffset > 0) { i = 0; if (prepend_sign) { __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-'); i++; } for (; i < uoffset; i++) { __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char); } } for (i=0; i < clength; i++) { __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]); } #else { PyObject *sign = NULL, *padding = NULL; uval = NULL; if (uoffset > 0) { prepend_sign = !!prepend_sign; if (uoffset > prepend_sign) { padding = PyUnicode_FromOrdinal(padding_char); if (likely(padding) && uoffset > prepend_sign + 1) { PyObject *tmp; PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign); if (unlikely(!repeat)) goto done_or_error; tmp = PyNumber_Multiply(padding, repeat); Py_DECREF(repeat); Py_DECREF(padding); padding = tmp; } if (unlikely(!padding)) goto done_or_error; } if (prepend_sign) { sign = PyUnicode_FromOrdinal('-'); if (unlikely(!sign)) goto done_or_error; } } uval = PyUnicode_DecodeASCII(chars, clength, NULL); if (likely(uval) && padding) { PyObject *tmp = PyNumber_Add(padding, uval); Py_DECREF(uval); uval = tmp; } if (likely(uval) && sign) { PyObject *tmp = PyNumber_Add(sign, uval); Py_DECREF(uval); uval = tmp; } done_or_error: Py_XDECREF(padding); Py_XDECREF(sign); } #endif return uval; } /* CIntToPyUnicode */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) { char digits[sizeof(Py_ssize_t)*3+2]; char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2; const char *hex_digits = DIGITS_HEX; Py_ssize_t length, ulength; int prepend_sign, last_one_off; Py_ssize_t remaining; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (format_char == 'X') { hex_digits += 16; format_char = 'x'; } remaining = value; last_one_off = 0; dpos = end; do { int digit_pos; switch (format_char) { case 'o': digit_pos = abs((int)(remaining % (8*8))); remaining = (Py_ssize_t) (remaining / (8*8)); dpos -= 2; memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2); last_one_off = (digit_pos < 8); break; case 'd': digit_pos = abs((int)(remaining % (10*10))); remaining = (Py_ssize_t) (remaining / (10*10)); dpos -= 2; memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2); last_one_off = (digit_pos < 10); break; case 'x': *(--dpos) = hex_digits[abs((int)(remaining % 16))]; remaining = (Py_ssize_t) (remaining / 16); break; default: assert(0); break; } } while (unlikely(remaining != 0)); assert(!last_one_off || *dpos == '0'); dpos += last_one_off; length = end - dpos; ulength = length; prepend_sign = 0; if (!is_unsigned && value <= neg_one) { if (padding_char == ' ' || width <= length + 1) { *(--dpos) = '-'; ++length; } else { prepend_sign = 1; } ++ulength; } if (width > ulength) { ulength = width; } if (ulength == 1) { return PyUnicode_FromOrdinal(*dpos); } return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); } /* JoinPyUnicode */ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char) { #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyObject *result_uval; int result_ukind, kind_shift; Py_ssize_t i, char_pos; void *result_udata; CYTHON_MAYBE_UNUSED_VAR(max_char); #if CYTHON_PEP393_ENABLED result_uval = PyUnicode_New(result_ulength, max_char); if (unlikely(!result_uval)) return NULL; result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; result_udata = PyUnicode_DATA(result_uval); #else result_uval = PyUnicode_FromUnicode(NULL, result_ulength); if (unlikely(!result_uval)) return NULL; result_ukind = sizeof(Py_UNICODE); kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1; result_udata = PyUnicode_AS_UNICODE(result_uval); #endif assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); char_pos = 0; for (i=0; i < value_count; i++) { int ukind; Py_ssize_t ulength; void *udata; PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); if (unlikely(__Pyx_PyUnicode_READY(uval))) goto bad; ulength = __Pyx_PyUnicode_GET_LENGTH(uval); if (unlikely(!ulength)) continue; if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) goto overflow; ukind = __Pyx_PyUnicode_KIND(uval); udata = __Pyx_PyUnicode_DATA(uval); if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); } else { #if PY_VERSION_HEX >= 0x030d0000 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); #else Py_ssize_t j; for (j=0; j < ulength; j++) { Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); } #endif } char_pos += ulength; } return result_uval; overflow: PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); bad: Py_DECREF(result_uval); return NULL; #else CYTHON_UNUSED_VAR(max_char); CYTHON_UNUSED_VAR(result_ulength); CYTHON_UNUSED_VAR(value_count); return PyUnicode_Join(__pyx_empty_unicode, value_tuple); #endif } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; itp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* WriteUnraisableException */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_PyThreadState_declare #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); else state = (PyGILState_STATE)0; #endif CYTHON_UNUSED_VAR(clineno); CYTHON_UNUSED_VAR(lineno); CYTHON_UNUSED_VAR(filename); CYTHON_MAYBE_UNUSED_VAR(nogil); __Pyx_PyThreadState_assign __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(0); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } /* RaiseUnexpectedTypeError */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) { __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, expected, obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* decode_c_bytes */ static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { if (unlikely((start < 0) | (stop < 0))) { if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } if (stop > length) stop = length; if (unlikely(stop <= start)) return __Pyx_NewRef(__pyx_empty_unicode); length = stop - start; cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* RaiseUnboundLocalError */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } /* PyObjectFormatAndDecref */ static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { if (unlikely(!s)) return NULL; if (likely(PyUnicode_CheckExact(s))) return s; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(s))) { PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict"); Py_DECREF(s); return result; } #endif return __Pyx_PyObject_FormatAndDecref(s, f); } static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { PyObject *result; if (unlikely(!s)) return NULL; result = PyObject_Format(s, f); Py_DECREF(s); return result; } /* GetAttr3 */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static PyObject *__Pyx_GetAttr3Default(PyObject *d) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(d); return d; } #endif static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 int res = PyObject_GetOptionalAttr(o, n, &r); return (res != 0) ? r : __Pyx_NewRef(d); #else #if CYTHON_USE_TYPE_SLOTS if (likely(PyString_Check(n))) { r = __Pyx_PyObject_GetAttrStrNoError(o, n); if (unlikely(!r) && likely(!PyErr_Occurred())) { r = __Pyx_NewRef(d); } return r; } #endif r = PyObject_GetAttr(o, n); return (likely(r)) ? r : __Pyx_GetAttr3Default(d); #endif } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); __Pyx_DECREF_TypeName(index_type_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif /* SliceObject */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_slice(obj, cstart, cstop); } #else CYTHON_UNUSED_VAR(wraparound); #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #else CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_USE_TYPE_SLOTS result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); bad: return NULL; } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AndObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); return PyInt_FromLong(a & b); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if ((intval & PyLong_MASK) == intval) { long last_digit = (long) __Pyx_PyLong_Digits(op1)[0]; long result = intval & (likely(__Pyx_PyLong_IsPos(op1)) ? last_digit : (PyLong_MASK - last_digit + 1)); return PyLong_FromLong(result); } if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op1); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_and(op1, op2); } } x = a & b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla & llb; return PyLong_FromLongLong(llx); #endif } #endif return (inplace ? PyNumber_InPlaceAnd : PyNumber_And)(op1, op2); } #endif /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_RshiftObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); return PyInt_FromLong(a >> b); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op1); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_rshift(op1, op2); } } x = a >> b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla >> llb; return PyLong_FromLongLong(llx); #endif } #endif return (inplace ? PyNumber_InPlaceRshift : PyNumber_Rshift)(op1, op2); } #endif /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_LshiftObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); if (likely(b < (long) (sizeof(long)*8) && a == (a << b) >> b) || !a) { return PyInt_FromLong(a << b); } } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op1); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_lshift(op1, op2); } } x = a << b; #ifdef HAVE_LONG_LONG if (unlikely(!(b < (long) (sizeof(long)*8) && a == x >> b)) && a) { lla = a; goto long_long; } #else if (likely(b < (long) (sizeof(long)*8) && a == x >> b) || !a) #endif return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla << llb; if (likely(lla == llx >> llb)) return PyLong_FromLongLong(llx); #endif } #endif return (inplace ? PyNumber_InPlaceLshift : PyNumber_Lshift)(op1, op2); } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; tmp_value = exc_info->exc_value; exc_info->exc_value = *value; if (tmp_value == NULL || tmp_value == Py_None) { Py_XDECREF(tmp_value); tmp_value = NULL; tmp_type = NULL; tmp_tb = NULL; } else { tmp_type = (PyObject*) Py_TYPE(tmp_value); Py_INCREF(tmp_type); #if CYTHON_COMPILING_IN_CPYTHON tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; Py_XINCREF(tmp_tb); #else tmp_tb = PyException_GetTraceback(tmp_value); #endif } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* DivInt[int64_t] */ static CYTHON_INLINE int64_t __Pyx_div_int64_t(int64_t a, int64_t b) { int64_t q = a / b; int64_t r = a - q*b; q -= ((r != 0) & ((r ^ b) < 0)); return q; } /* ModInt[int64_t] */ static CYTHON_INLINE int64_t __Pyx_mod_int64_t(int64_t a, int64_t b) { int64_t r = a % b; r += ((r != 0) & ((r ^ b) < 0)) * b; return r; } /* DivInt[long] */ static CYTHON_INLINE long __Pyx_div_long(long a, long b) { long q = a / b; long r = a - q*b; q -= ((r != 0) & ((r ^ b) < 0)); return q; } /* ModInt[long] */ static CYTHON_INLINE long __Pyx_mod_long(long a, long b) { long r = a % b; r += ((r != 0) & ((r ^ b) < 0)) * b; return r; } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* HasAttr */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; if (unlikely(!__Pyx_PyBaseString_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } r = __Pyx_GetAttr(o, n); if (!r) { PyErr_Clear(); return 0; } else { Py_DECREF(r); return 1; } } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); #ifdef HAVE_LONG_LONG if (sizeof(PY_LONG_LONG) > sizeof(long)) { PY_LONG_LONG result = (PY_LONG_LONG)a * (PY_LONG_LONG)b; return (result >= LONG_MIN && result <= LONG_MAX) ? PyInt_FromLong((long)result) : PyLong_FromLongLong(result); } #endif #if CYTHON_USE_TYPE_SLOTS return PyInt_Type.tp_as_number->nb_multiply(op1, op2); #else return PyNumber_Multiply(op1, op2); #endif } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op1); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2); } } CYTHON_UNUSED_VAR(a); CYTHON_UNUSED_VAR(b); #ifdef HAVE_LONG_LONG lla = a; goto long_long; #else return PyLong_Type.tp_as_number->nb_multiply(op1, op2); #endif return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla * llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("multiply", return NULL) result = ((double)a) * (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2); } #endif /* py_abs */ #if CYTHON_USE_PYLONG_INTERNALS static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) { #if PY_VERSION_HEX >= 0x030C00A7 if (likely(__Pyx_PyLong_IsCompact(n))) { return PyLong_FromSize_t(__Pyx_PyLong_CompactValueUnsigned(n)); } #else if (likely(Py_SIZE(n) == -1)) { return PyLong_FromUnsignedLong(__Pyx_PyLong_Digits(n)[0]); } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 { PyObject *copy = _PyLong_Copy((PyLongObject*)n); if (likely(copy)) { #if PY_VERSION_HEX >= 0x030C00A7 ((PyLongObject*)copy)->long_value.lv_tag = ((PyLongObject*)copy)->long_value.lv_tag & ~_PyLong_SIGN_MASK; #else __Pyx_SET_SIZE(copy, -Py_SIZE(copy)); #endif } return copy; } #else return PyNumber_Negative(n); #endif } #endif /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op2))) { const long a = intval; long x; long b = PyInt_AS_LONG(op2); x = (long)((unsigned long)a + (unsigned long)b); if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op2))) { const long a = intval; long b, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG lla = intval; PY_LONG_LONG llb, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op2))) { return __Pyx_NewRef(op1); } if (likely(__Pyx_PyLong_IsCompact(op2))) { b = __Pyx_PyLong_CompactValue(op2); } else { const digit* digits = __Pyx_PyLong_Digits(op2); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla + llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op2)) { const long a = intval; #if CYTHON_COMPILING_IN_LIMITED_API double b = __pyx_PyFloat_AsDouble(op2); #else double b = PyFloat_AS_DOUBLE(op2); #endif double result; PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__33); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* CallNextTpTraverse */ static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { PyTypeObject* type = Py_TYPE(obj); traverseproc tp_traverse = NULL; while (type && __Pyx_PyType_GetSlot(type, tp_traverse, traverseproc) != current_tp_traverse) type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); while (type && (tp_traverse = __Pyx_PyType_GetSlot(type, tp_traverse, traverseproc)) == current_tp_traverse) type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); if (type && tp_traverse) return tp_traverse(obj, v, a); return 0; } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* SetVTable */ static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) { PyObject *ob = PyCapsule_New(vtable, 0, 0); if (unlikely(!ob)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0)) #else if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0)) #endif goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* MergeVTables */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type) { int i; void** base_vtables; __Pyx_TypeName tp_base_name; __Pyx_TypeName base_name; void* unknown = (void*)-1; PyObject* bases = type->tp_bases; int base_depth = 0; { PyTypeObject* base = type->tp_base; while (base) { base_depth += 1; base = base->tp_base; } } base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1)); base_vtables[0] = unknown; for (i = 1; i < PyTuple_GET_SIZE(bases); i++) { void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i))); if (base_vtable != NULL) { int j; PyTypeObject* base = type->tp_base; for (j = 0; j < base_depth; j++) { if (base_vtables[j] == unknown) { base_vtables[j] = __Pyx_GetVtable(base); base_vtables[j + 1] = unknown; } if (base_vtables[j] == base_vtable) { break; } else if (base_vtables[j] == NULL) { goto bad; } base = base->tp_base; } } } PyErr_Clear(); free(base_vtables); return 0; bad: tp_base_name = __Pyx_PyType_GetName(type->tp_base); base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i)); PyErr_Format(PyExc_TypeError, "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name); __Pyx_DECREF_TypeName(tp_base_name); __Pyx_DECREF_TypeName(base_name); free(base_vtables); return -1; } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_11 #define __PYX_HAVE_RT_ImportType_3_0_11 static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_11 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_11 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__34; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* Py3UpdateBases */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; PyObject *base, *meth, *new_base, *result, *new_bases = NULL; size_bases = PyTuple_GET_SIZE(bases); for (i = 0; i < size_bases; i++) { base = PyTuple_GET_ITEM(bases, i); if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } if (!meth) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } new_base = __Pyx_PyObject_CallOneArg(meth, bases); Py_DECREF(meth); if (!new_base) { goto error; } if (!PyTuple_Check(new_base)) { PyErr_SetString(PyExc_TypeError, "__mro_entries__ must return a tuple"); Py_DECREF(new_base); goto error; } if (!new_bases) { if (!(new_bases = PyList_New(i))) { goto error; } for (j = 0; j < i; j++) { base = PyTuple_GET_ITEM(bases, j); PyList_SET_ITEM(new_bases, j, base); Py_INCREF(base); } } j = PyList_GET_SIZE(new_bases); if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } Py_DECREF(new_base); } if (!new_bases) { Py_INCREF(bases); return bases; } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); return result; error: Py_XDECREF(new_bases); return NULL; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_MACROS nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); if (nbases < 0) return NULL; #endif for (i=0; i < nbases; i++) { PyTypeObject *tmptype; #if CYTHON_ASSUME_SAFE_MACROS PyObject *tmp = PyTuple_GET_ITEM(bases, i); #else PyObject *tmp = PyTuple_GetItem(bases, i); if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_DECREF(prep); } else { if (unlikely(PyErr_Occurred())) return NULL; ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; #if PY_VERSION_HEX >= 0x03030000 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; #else CYTHON_MAYBE_UNUSED_VAR(qualname); #endif if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS static int __Pyx_SetNamesPEP487(PyObject *type_obj) { PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *names_to_set, *key, *value, *set_name, *tmp; Py_ssize_t i = 0; #if CYTHON_USE_TYPE_SLOTS names_to_set = PyDict_Copy(type->tp_dict); #else { PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); names_to_set = NULL; if (likely(d)) { PyObject *names_to_set = PyDict_New(); int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; Py_DECREF(d); if (unlikely(ret < 0)) Py_CLEAR(names_to_set); } } #endif if (unlikely(names_to_set == NULL)) goto bad; while (PyDict_Next(names_to_set, &i, &key, &value)) { set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); if (unlikely(set_name != NULL)) { tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); Py_DECREF(set_name); if (unlikely(tmp == NULL)) { __Pyx_TypeName value_type_name = __Pyx_PyType_GetName(Py_TYPE(value)); __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_RuntimeError, #if PY_MAJOR_VERSION >= 3 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", value_type_name, key, type_name); #else "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", value_type_name, PyString_Check(key) ? PyString_AS_STRING(key) : "?", type_name); #endif goto bad; } else { Py_DECREF(tmp); } } else if (unlikely(PyErr_Occurred())) { goto bad; } } Py_DECREF(names_to_set); return 0; bad: Py_XDECREF(names_to_set); return -1; } static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *mro = type->tp_mro; Py_ssize_t i, nbases; if (unlikely(!mro)) goto done; (void) &__Pyx_GetBuiltinName; Py_INCREF(mro); nbases = PyTuple_GET_SIZE(mro); assert(PyTuple_GET_ITEM(mro, 0) == type_obj); for (i = 1; i < nbases-1; i++) { PyObject *base, *dict, *meth; base = PyTuple_GET_ITEM(mro, i); dict = ((PyTypeObject *)base)->tp_dict; meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); if (unlikely(meth)) { descrgetfunc f = Py_TYPE(meth)->tp_descr_get; PyObject *res; Py_INCREF(meth); if (likely(f)) { res = f(meth, NULL, type_obj); Py_DECREF(meth); if (unlikely(!res)) goto bad; meth = res; } res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); Py_DECREF(meth); if (unlikely(!res)) goto bad; Py_DECREF(res); goto done; } else if (unlikely(PyErr_Occurred())) { goto bad; } } done: Py_XDECREF(mro); return type_obj; bad: Py_XDECREF(mro); Py_DECREF(type_obj); return NULL; #else PyObject *super_type, *super, *func, *res; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); #else super_type = (PyObject*) &PySuper_Type; (void) &__Pyx_GetBuiltinName; #endif super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) Py_XDECREF(super_type); #endif if (unlikely(!super)) { Py_CLEAR(type_obj); goto done; } func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); Py_DECREF(super); if (likely(!func)) { if (unlikely(PyErr_Occurred())) Py_CLEAR(type_obj); goto done; } res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); Py_DECREF(func); if (unlikely(!res)) Py_CLEAR(type_obj); Py_XDECREF(res); done: return type_obj; #endif } #endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result; PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, #if PY_VERSION_HEX < 0x030600A4 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw #else mkw #endif ); Py_XDECREF(owned_metaclass); #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS if (likely(result) && likely(PyType_Check(result))) { if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { Py_CLEAR(result); } else { result = __Pyx_InitSubclassPEP487(result, mkw); } } #else (void) &__Pyx_GetBuiltinName; #endif return result; } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int64_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int64_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { int64_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int64_t) -1; val = __Pyx_PyInt_As_int64_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int64_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) >= 2 * PyLong_SHIFT)) { return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; case 3: if ((8 * sizeof(int64_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) >= 3 * PyLong_SHIFT)) { return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; case 4: if ((8 * sizeof(int64_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) >= 4 * PyLong_SHIFT)) { return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int64_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int64_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 2: if ((8 * sizeof(int64_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case -3: if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 3: if ((8 * sizeof(int64_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case -4: if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT)) { return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 4: if ((8 * sizeof(int64_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT)) { return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; } } #endif if ((sizeof(int64_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int64_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int64_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int64_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int64_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int64_t) -1; } else { stepval = v; } v = NULL; val = (int64_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int64_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int64_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int64_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int64_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int64_t) 1) << (sizeof(int64_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int64_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int64_t"); return (int64_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int64_t"); return (int64_t) -1; } /* CIntFromPy */ static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int32_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int32_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { int32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int32_t) -1; val = __Pyx_PyInt_As_int32_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) >= 2 * PyLong_SHIFT)) { return (int32_t) (((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); } } break; case 3: if ((8 * sizeof(int32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) >= 3 * PyLong_SHIFT)) { return (int32_t) (((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); } } break; case 4: if ((8 * sizeof(int32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) >= 4 * PyLong_SHIFT)) { return (int32_t) (((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int32_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int32_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { return (int32_t) (((int32_t)-1)*(((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case 2: if ((8 * sizeof(int32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { return (int32_t) ((((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case -3: if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { return (int32_t) (((int32_t)-1)*(((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case 3: if ((8 * sizeof(int32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { return (int32_t) ((((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case -4: if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT)) { return (int32_t) (((int32_t)-1)*(((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case 4: if ((8 * sizeof(int32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT)) { return (int32_t) ((((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; } } #endif if ((sizeof(int32_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int32_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int32_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int32_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int32_t) -1; } else { stepval = v; } v = NULL; val = (int32_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int32_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int32_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int32_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int32_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int32_t) 1) << (sizeof(int32_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int32_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int32_t"); return (int32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int32_t"); return (int32_t) -1; } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int32_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int32_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const char neg_one = (char) -1, const_zero = (char) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(char) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(char) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(char) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(char), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(char)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(unsigned char) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(unsigned char, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (unsigned char) val; } } #endif if (unlikely(!PyLong_Check(x))) { unsigned char val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (unsigned char) -1; val = __Pyx_PyInt_As_unsigned_char(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(unsigned char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(unsigned char) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) >= 2 * PyLong_SHIFT)) { return (unsigned char) (((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])); } } break; case 3: if ((8 * sizeof(unsigned char) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) >= 3 * PyLong_SHIFT)) { return (unsigned char) (((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])); } } break; case 4: if ((8 * sizeof(unsigned char) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) >= 4 * PyLong_SHIFT)) { return (unsigned char) (((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (unsigned char) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(unsigned char) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(unsigned char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(unsigned char) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT)) { return (unsigned char) (((unsigned char)-1)*(((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); } } break; case 2: if ((8 * sizeof(unsigned char) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT)) { return (unsigned char) ((((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); } } break; case -3: if ((8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT)) { return (unsigned char) (((unsigned char)-1)*(((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); } } break; case 3: if ((8 * sizeof(unsigned char) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT)) { return (unsigned char) ((((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); } } break; case -4: if ((8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT)) { return (unsigned char) (((unsigned char)-1)*(((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); } } break; case 4: if ((8 * sizeof(unsigned char) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT)) { return (unsigned char) ((((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]))); } } break; } } #endif if ((sizeof(unsigned char) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned char, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(unsigned char) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned char, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { unsigned char val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (unsigned char) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (unsigned char) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (unsigned char) -1; } else { stepval = v; } v = NULL; val = (unsigned char) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(unsigned char) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((unsigned char) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(unsigned char) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((unsigned char) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((unsigned char) 1) << (sizeof(unsigned char) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (unsigned char) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned char"); return (unsigned char) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned char"); return (unsigned char) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(unsigned char) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(unsigned char) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(unsigned char) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned char) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(unsigned char), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(unsigned char)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint8_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int64_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int64_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int16_t __Pyx_PyInt_As_int16_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int16_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int16_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int16_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { int16_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int16_t) -1; val = __Pyx_PyInt_As_int16_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int16_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int16_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) >= 2 * PyLong_SHIFT)) { return (int16_t) (((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])); } } break; case 3: if ((8 * sizeof(int16_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) >= 3 * PyLong_SHIFT)) { return (int16_t) (((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])); } } break; case 4: if ((8 * sizeof(int16_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) >= 4 * PyLong_SHIFT)) { return (int16_t) (((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int16_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int16_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int16_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int16_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT)) { return (int16_t) (((int16_t)-1)*(((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case 2: if ((8 * sizeof(int16_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT)) { return (int16_t) ((((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case -3: if ((8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT)) { return (int16_t) (((int16_t)-1)*(((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case 3: if ((8 * sizeof(int16_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT)) { return (int16_t) ((((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case -4: if ((8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) - 1 > 4 * PyLong_SHIFT)) { return (int16_t) (((int16_t)-1)*(((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; case 4: if ((8 * sizeof(int16_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int16_t) - 1 > 4 * PyLong_SHIFT)) { return (int16_t) ((((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]))); } } break; } } #endif if ((sizeof(int16_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int16_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int16_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int16_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int16_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int16_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int16_t) -1; } else { stepval = v; } v = NULL; val = (int16_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int16_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int16_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int16_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int16_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int16_t) 1) << (sizeof(int16_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int16_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int16_t"); return (int16_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int16_t"); return (int16_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(uint16_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint16_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const char neg_one = (char) -1, const_zero = (char) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(char) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (char) val; } } #endif if (unlikely(!PyLong_Check(x))) { char val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (char) -1; val = __Pyx_PyInt_As_char(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(char) >= 2 * PyLong_SHIFT)) { return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); } } break; case 3: if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(char) >= 3 * PyLong_SHIFT)) { return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); } } break; case 4: if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(char) >= 4 * PyLong_SHIFT)) { return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (char) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(char) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(char) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) { return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case 2: if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) { return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case -3: if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) { return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case 3: if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) { return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case -4: if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) { return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case 4: if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) { return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; } } #endif if ((sizeof(char) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { char val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (char) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (char) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (char) -1; } else { stepval = v; } v = NULL; val = (char) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(char) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((char) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((char) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (char) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to char"); return (char) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to char"); return (char) -1; } /* CIntFromPy */ static CYTHON_INLINE int8_t __Pyx_PyInt_As_int8_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int8_t neg_one = (int8_t) -1, const_zero = (int8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int8_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int8_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int8_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { int8_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int8_t) -1; val = __Pyx_PyInt_As_int8_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int8_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int8_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int8_t) >= 2 * PyLong_SHIFT)) { return (int8_t) (((((int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0])); } } break; case 3: if ((8 * sizeof(int8_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int8_t) >= 3 * PyLong_SHIFT)) { return (int8_t) (((((((int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0])); } } break; case 4: if ((8 * sizeof(int8_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int8_t) >= 4 * PyLong_SHIFT)) { return (int8_t) (((((((((int8_t)digits[3]) << PyLong_SHIFT) | (int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int8_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int8_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int8_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int8_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int8_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int8_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int8_t) - 1 > 2 * PyLong_SHIFT)) { return (int8_t) (((int8_t)-1)*(((((int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); } } break; case 2: if ((8 * sizeof(int8_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int8_t) - 1 > 2 * PyLong_SHIFT)) { return (int8_t) ((((((int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); } } break; case -3: if ((8 * sizeof(int8_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int8_t) - 1 > 3 * PyLong_SHIFT)) { return (int8_t) (((int8_t)-1)*(((((((int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); } } break; case 3: if ((8 * sizeof(int8_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int8_t) - 1 > 3 * PyLong_SHIFT)) { return (int8_t) ((((((((int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); } } break; case -4: if ((8 * sizeof(int8_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int8_t) - 1 > 4 * PyLong_SHIFT)) { return (int8_t) (((int8_t)-1)*(((((((((int8_t)digits[3]) << PyLong_SHIFT) | (int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); } } break; case 4: if ((8 * sizeof(int8_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int8_t) - 1 > 4 * PyLong_SHIFT)) { return (int8_t) ((((((((((int8_t)digits[3]) << PyLong_SHIFT) | (int8_t)digits[2]) << PyLong_SHIFT) | (int8_t)digits[1]) << PyLong_SHIFT) | (int8_t)digits[0]))); } } break; } } #endif if ((sizeof(int8_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int8_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int8_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int8_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int8_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int8_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int8_t) -1; } else { stepval = v; } v = NULL; val = (int8_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int8_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int8_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int8_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int8_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int8_t) 1) << (sizeof(int8_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int8_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int8_t"); return (int8_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int8_t"); return (int8_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint32_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint32_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT)) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT)) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT)) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint32_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } } #endif if ((sizeof(uint32_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint32_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (uint32_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (uint32_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (uint32_t) -1; } else { stepval = v; } v = NULL; val = (uint32_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint32_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((uint32_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint32_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint32_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((uint32_t) 1) << (sizeof(uint32_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (uint32_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* CIntFromPy */ static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint64_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint64_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint64_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { uint64_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint64_t) -1; val = __Pyx_PyInt_As_uint64_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint64_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint64_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint64_t) >= 2 * PyLong_SHIFT)) { return (uint64_t) (((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint64_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint64_t) >= 3 * PyLong_SHIFT)) { return (uint64_t) (((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint64_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint64_t) >= 4 * PyLong_SHIFT)) { return (uint64_t) (((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint64_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint64_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint64_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint64_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT)) { return (uint64_t) (((uint64_t)-1)*(((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint64_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT)) { return (uint64_t) ((((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT)) { return (uint64_t) (((uint64_t)-1)*(((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint64_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT)) { return (uint64_t) ((((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT)) { return (uint64_t) (((uint64_t)-1)*(((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint64_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT)) { return (uint64_t) ((((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); } } break; } } #endif if ((sizeof(uint64_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint64_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint64_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint64_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (uint64_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (uint64_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (uint64_t) -1; } else { stepval = v; } v = NULL; val = (uint64_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint64_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((uint64_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint64_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint64_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((uint64_t) 1) << (sizeof(uint64_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (uint64_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint64_t"); return (uint64_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint64_t"); return (uint64_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(uint64_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint64_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__54); } return name; } #endif /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* FunctionExport */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; cobj = PyCapsule_New(tmp.p, sig, 0); if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/pgproto.pxd0000644000175100001770000000065614705014413020216 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cimport cython cimport cpython from libc.stdint cimport int16_t, int32_t, uint16_t, uint32_t, int64_t, uint64_t include "./consts.pxi" include "./frb.pxd" include "./buffer.pxd" include "./codecs/__init__.pxd" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/pgproto.pyi0000644000175100001770000000042314705014413020214 0ustar00runnerdockerimport codecs import typing import uuid class CodecContext: def get_text_codec(self) -> codecs.CodecInfo: ... class ReadBuffer: ... class WriteBuffer: ... class BufferError(Exception): ... class UUID(uuid.UUID): def __init__(self, inp: typing.AnyStr) -> None: ... ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/pgproto.pyx0000644000175100001770000000234114705014413020234 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cimport cython cimport cpython from . cimport cpythonx from libc.stdint cimport int8_t, uint8_t, int16_t, uint16_t, \ int32_t, uint32_t, int64_t, uint64_t, \ INT16_MIN, INT16_MAX, INT32_MIN, INT32_MAX, \ UINT32_MAX, INT64_MIN, INT64_MAX, UINT64_MAX from . cimport hton from . cimport tohex from .debug cimport PG_DEBUG from . import types as pgproto_types include "./consts.pxi" include "./frb.pyx" include "./buffer.pyx" include "./uuid.pyx" include "./codecs/context.pyx" include "./codecs/bytea.pyx" include "./codecs/text.pyx" include "./codecs/datetime.pyx" include "./codecs/float.pyx" include "./codecs/int.pyx" include "./codecs/json.pyx" include "./codecs/jsonpath.pyx" include "./codecs/uuid.pyx" include "./codecs/numeric.pyx" include "./codecs/bits.pyx" include "./codecs/geometry.pyx" include "./codecs/hstore.pyx" include "./codecs/misc.pyx" include "./codecs/network.pyx" include "./codecs/tid.pyx" include "./codecs/pg_snapshot.pyx" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/tohex.h0000644000175100001770000000272214705014413017303 0ustar00runnerdocker#define HEX_PRELUDE \ const char *__hexm = "0123456789abcdef"; #define HEX_1_BYTE(buf, dest) \ { \ char byte = (buf)[0]; \ (dest)[0] = __hexm[(byte >> 4) & 0x0F]; \ (dest)[1] = __hexm[byte & 0x0F]; \ } #define HEX_2_BYTES(buf, dest) \ { \ HEX_1_BYTE(buf, dest) \ HEX_1_BYTE(buf + 1, dest + 2) \ } #define HEX_4_BYTES(buf, dest) \ { \ HEX_2_BYTES(buf, dest) \ HEX_2_BYTES(buf + 2, dest + 4) \ } #define HEX_8_BYTES(buf, dest) \ { \ HEX_4_BYTES(buf, dest) \ HEX_4_BYTES(buf + 4, dest + 8) \ } static inline void uuid_to_str(const char *source, char *dest) { HEX_PRELUDE HEX_4_BYTES(source, dest) dest[8] = '-'; HEX_2_BYTES(source + 4, dest + 9) dest[13] = '-'; HEX_2_BYTES(source + 6, dest + 14) dest[18] = '-'; HEX_2_BYTES(source + 8, dest + 19) dest[23] = '-'; HEX_4_BYTES(source + 10, dest + 24) HEX_2_BYTES(source + 14, dest + 32) } static inline void uuid_to_hex(const char *source, char *dest) { HEX_PRELUDE HEX_8_BYTES(source, dest) HEX_8_BYTES(source + 8, dest + 16) } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/tohex.pxd0000644000175100001770000000055114705014413017645 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef extern from "./tohex.h": cdef void uuid_to_str(const char *source, char *dest) cdef void uuid_to_hex(const char *source, char *dest) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/types.py0000644000175100001770000003132614705014413017523 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import builtins import sys import typing if sys.version_info >= (3, 8): from typing import Literal, SupportsIndex else: from typing_extensions import Literal, SupportsIndex __all__ = ( 'BitString', 'Point', 'Path', 'Polygon', 'Box', 'Line', 'LineSegment', 'Circle', ) _BitString = typing.TypeVar('_BitString', bound='BitString') _BitOrderType = Literal['big', 'little'] class BitString: """Immutable representation of PostgreSQL `bit` and `varbit` types.""" __slots__ = '_bytes', '_bitlength' def __init__(self, bitstring: typing.Optional[builtins.bytes] = None) -> None: if not bitstring: self._bytes = bytes() self._bitlength = 0 else: bytelen = len(bitstring) // 8 + 1 bytes_ = bytearray(bytelen) byte = 0 byte_pos = 0 bit_pos = 0 for i, bit in enumerate(bitstring): if bit == ' ': # type: ignore continue bit = int(bit) if bit != 0 and bit != 1: raise ValueError( 'invalid bit value at position {}'.format(i)) byte |= bit << (8 - bit_pos - 1) bit_pos += 1 if bit_pos == 8: bytes_[byte_pos] = byte byte = 0 byte_pos += 1 bit_pos = 0 if bit_pos != 0: bytes_[byte_pos] = byte bitlen = byte_pos * 8 + bit_pos bytelen = byte_pos + (1 if bit_pos else 0) self._bytes = bytes(bytes_[:bytelen]) self._bitlength = bitlen @classmethod def frombytes(cls: typing.Type[_BitString], bytes_: typing.Optional[builtins.bytes] = None, bitlength: typing.Optional[int] = None) -> _BitString: if bitlength is None: if bytes_ is None: bytes_ = bytes() bitlength = 0 else: bitlength = len(bytes_) * 8 else: if bytes_ is None: bytes_ = bytes(bitlength // 8 + 1) bitlength = bitlength else: bytes_len = len(bytes_) * 8 if bytes_len == 0 and bitlength != 0: raise ValueError('invalid bit length specified') if bytes_len != 0 and bitlength == 0: raise ValueError('invalid bit length specified') if bitlength < bytes_len - 8: raise ValueError('invalid bit length specified') if bitlength > bytes_len: raise ValueError('invalid bit length specified') result = cls() result._bytes = bytes_ result._bitlength = bitlength return result @property def bytes(self) -> builtins.bytes: return self._bytes def as_string(self) -> str: s = '' for i in range(self._bitlength): s += str(self._getitem(i)) if i % 4 == 3: s += ' ' return s.strip() def to_int(self, bitorder: _BitOrderType = 'big', *, signed: bool = False) -> int: """Interpret the BitString as a Python int. Acts similarly to int.from_bytes. :param bitorder: Determines the bit order used to interpret the BitString. By default, this function uses Postgres conventions for casting bits to ints. If bitorder is 'big', the most significant bit is at the start of the string (this is the same as the default). If bitorder is 'little', the most significant bit is at the end of the string. :param bool signed: Determines whether two's complement is used to interpret the BitString. If signed is False, the returned value is always non-negative. :return int: An integer representing the BitString. Information about the BitString's exact length is lost. .. versionadded:: 0.18.0 """ x = int.from_bytes(self._bytes, byteorder='big') x >>= -self._bitlength % 8 if bitorder == 'big': pass elif bitorder == 'little': x = int(bin(x)[:1:-1].ljust(self._bitlength, '0'), 2) else: raise ValueError("bitorder must be either 'big' or 'little'") if signed and self._bitlength > 0 and x & (1 << (self._bitlength - 1)): x -= 1 << self._bitlength return x @classmethod def from_int(cls: typing.Type[_BitString], x: int, length: int, bitorder: _BitOrderType = 'big', *, signed: bool = False) \ -> _BitString: """Represent the Python int x as a BitString. Acts similarly to int.to_bytes. :param int x: An integer to represent. Negative integers are represented in two's complement form, unless the argument signed is False, in which case negative integers raise an OverflowError. :param int length: The length of the resulting BitString. An OverflowError is raised if the integer is not representable in this many bits. :param bitorder: Determines the bit order used in the BitString representation. By default, this function uses Postgres conventions for casting ints to bits. If bitorder is 'big', the most significant bit is at the start of the string (this is the same as the default). If bitorder is 'little', the most significant bit is at the end of the string. :param bool signed: Determines whether two's complement is used in the BitString representation. If signed is False and a negative integer is given, an OverflowError is raised. :return BitString: A BitString representing the input integer, in the form specified by the other input args. .. versionadded:: 0.18.0 """ # Exception types are by analogy to int.to_bytes if length < 0: raise ValueError("length argument must be non-negative") elif length < x.bit_length(): raise OverflowError("int too big to convert") if x < 0: if not signed: raise OverflowError("can't convert negative int to unsigned") x &= (1 << length) - 1 if bitorder == 'big': pass elif bitorder == 'little': x = int(bin(x)[:1:-1].ljust(length, '0'), 2) else: raise ValueError("bitorder must be either 'big' or 'little'") x <<= (-length % 8) bytes_ = x.to_bytes((length + 7) // 8, byteorder='big') return cls.frombytes(bytes_, length) def __repr__(self) -> str: return ''.format(self.as_string()) __str__: typing.Callable[['BitString'], str] = __repr__ def __eq__(self, other: object) -> bool: if not isinstance(other, BitString): return NotImplemented return (self._bytes == other._bytes and self._bitlength == other._bitlength) def __hash__(self) -> int: return hash((self._bytes, self._bitlength)) def _getitem(self, i: int) -> int: byte = self._bytes[i // 8] shift = 8 - i % 8 - 1 return (byte >> shift) & 0x1 def __getitem__(self, i: int) -> int: if isinstance(i, slice): raise NotImplementedError('BitString does not support slices') if i >= self._bitlength: raise IndexError('index out of range') return self._getitem(i) def __len__(self) -> int: return self._bitlength class Point(typing.Tuple[float, float]): """Immutable representation of PostgreSQL `point` type.""" __slots__ = () def __new__(cls, x: typing.Union[typing.SupportsFloat, SupportsIndex, typing.Text, builtins.bytes, builtins.bytearray], y: typing.Union[typing.SupportsFloat, SupportsIndex, typing.Text, builtins.bytes, builtins.bytearray]) -> 'Point': return super().__new__(cls, typing.cast(typing.Any, (float(x), float(y)))) def __repr__(self) -> str: return '{}.{}({})'.format( type(self).__module__, type(self).__name__, tuple.__repr__(self) ) @property def x(self) -> float: return self[0] @property def y(self) -> float: return self[1] class Box(typing.Tuple[Point, Point]): """Immutable representation of PostgreSQL `box` type.""" __slots__ = () def __new__(cls, high: typing.Sequence[float], low: typing.Sequence[float]) -> 'Box': return super().__new__(cls, typing.cast(typing.Any, (Point(*high), Point(*low)))) def __repr__(self) -> str: return '{}.{}({})'.format( type(self).__module__, type(self).__name__, tuple.__repr__(self) ) @property def high(self) -> Point: return self[0] @property def low(self) -> Point: return self[1] class Line(typing.Tuple[float, float, float]): """Immutable representation of PostgreSQL `line` type.""" __slots__ = () def __new__(cls, A: float, B: float, C: float) -> 'Line': return super().__new__(cls, typing.cast(typing.Any, (A, B, C))) @property def A(self) -> float: return self[0] @property def B(self) -> float: return self[1] @property def C(self) -> float: return self[2] class LineSegment(typing.Tuple[Point, Point]): """Immutable representation of PostgreSQL `lseg` type.""" __slots__ = () def __new__(cls, p1: typing.Sequence[float], p2: typing.Sequence[float]) -> 'LineSegment': return super().__new__(cls, typing.cast(typing.Any, (Point(*p1), Point(*p2)))) def __repr__(self) -> str: return '{}.{}({})'.format( type(self).__module__, type(self).__name__, tuple.__repr__(self) ) @property def p1(self) -> Point: return self[0] @property def p2(self) -> Point: return self[1] class Path: """Immutable representation of PostgreSQL `path` type.""" __slots__ = '_is_closed', 'points' points: typing.Tuple[Point, ...] def __init__(self, *points: typing.Sequence[float], is_closed: bool = False) -> None: self.points = tuple(Point(*p) for p in points) self._is_closed = is_closed @property def is_closed(self) -> bool: return self._is_closed def __eq__(self, other: object) -> bool: if not isinstance(other, Path): return NotImplemented return (self.points == other.points and self._is_closed == other._is_closed) def __hash__(self) -> int: return hash((self.points, self.is_closed)) def __iter__(self) -> typing.Iterator[Point]: return iter(self.points) def __len__(self) -> int: return len(self.points) @typing.overload def __getitem__(self, i: int) -> Point: ... @typing.overload def __getitem__(self, i: slice) -> typing.Tuple[Point, ...]: ... def __getitem__(self, i: typing.Union[int, slice]) \ -> typing.Union[Point, typing.Tuple[Point, ...]]: return self.points[i] def __contains__(self, point: object) -> bool: return point in self.points class Polygon(Path): """Immutable representation of PostgreSQL `polygon` type.""" __slots__ = () def __init__(self, *points: typing.Sequence[float]) -> None: # polygon is always closed super().__init__(*points, is_closed=True) class Circle(typing.Tuple[Point, float]): """Immutable representation of PostgreSQL `circle` type.""" __slots__ = () def __new__(cls, center: Point, radius: float) -> 'Circle': return super().__new__(cls, typing.cast(typing.Any, (center, radius))) @property def center(self) -> Point: return self[0] @property def radius(self) -> float: return self[1] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pgproto/uuid.pyx0000644000175100001770000002332714705014413017517 0ustar00runnerdockerimport functools import uuid cimport cython cimport cpython from libc.stdint cimport uint8_t, int8_t from libc.string cimport memcpy, memcmp cdef extern from "Python.h": int PyUnicode_1BYTE_KIND const char* PyUnicode_AsUTF8AndSize( object unicode, Py_ssize_t *size) except NULL object PyUnicode_FromKindAndData( int kind, const void *buffer, Py_ssize_t size) cdef extern from "./tohex.h": cdef void uuid_to_str(const char *source, char *dest) cdef void uuid_to_hex(const char *source, char *dest) # A more efficient UUID type implementation # (6-7x faster than the starndard uuid.UUID): # # -= Benchmark results (less is better): =- # # std_UUID(bytes): 1.2368 # c_UUID(bytes): * 0.1645 (7.52x) # object(): 0.1483 # # std_UUID(str): 1.8038 # c_UUID(str): * 0.2313 (7.80x) # # str(std_UUID()): 1.4625 # str(c_UUID()): * 0.2681 (5.46x) # str(object()): 0.5975 # # std_UUID().bytes: 0.3508 # c_UUID().bytes: * 0.1068 (3.28x) # # std_UUID().int: 0.0871 # c_UUID().int: * 0.0856 # # std_UUID().hex: 0.4871 # c_UUID().hex: * 0.1405 # # hash(std_UUID()): 0.3635 # hash(c_UUID()): * 0.1564 (2.32x) # # dct[std_UUID()]: 0.3319 # dct[c_UUID()]: * 0.1570 (2.11x) # # std_UUID() ==: 0.3478 # c_UUID() ==: * 0.0915 (3.80x) cdef char _hextable[256] _hextable[:] = [ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1, 0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 ] cdef std_UUID = uuid.UUID cdef pg_uuid_bytes_from_str(str u, char *out): cdef: const char *orig_buf Py_ssize_t size unsigned char ch uint8_t acc, part, acc_set int i, j orig_buf = PyUnicode_AsUTF8AndSize(u, &size) if size > 36 or size < 32: raise ValueError( f'invalid UUID {u!r}: ' f'length must be between 32..36 characters, got {size}') acc_set = 0 j = 0 for i in range(size): ch = orig_buf[i] if ch == b'-': continue part = _hextable[ch] if part == -1: if ch >= 0x20 and ch <= 0x7e: raise ValueError( f'invalid UUID {u!r}: unexpected character {chr(ch)!r}') else: raise ValueError('invalid UUID {u!r}: unexpected character') if acc_set: acc |= part out[j] = acc acc_set = 0 j += 1 else: acc = (part << 4) acc_set = 1 if j > 16 or (j == 16 and acc_set): raise ValueError( f'invalid UUID {u!r}: decodes to more than 16 bytes') if j != 16: raise ValueError( f'invalid UUID {u!r}: decodes to less than 16 bytes') cdef class __UUIDReplaceMe: pass cdef pg_uuid_from_buf(const char *buf): cdef: UUID u = UUID.__new__(UUID) memcpy(u._data, buf, 16) return u @cython.final @cython.no_gc_clear cdef class UUID(__UUIDReplaceMe): cdef: char _data[16] object _int object _hash object __weakref__ def __cinit__(self): self._int = None self._hash = None def __init__(self, inp): cdef: char *buf Py_ssize_t size if cpython.PyBytes_Check(inp): cpython.PyBytes_AsStringAndSize(inp, &buf, &size) if size != 16: raise ValueError(f'16 bytes were expected, got {size}') memcpy(self._data, buf, 16) elif cpython.PyUnicode_Check(inp): pg_uuid_bytes_from_str(inp, self._data) else: raise TypeError(f'a bytes or str object expected, got {inp!r}') @property def bytes(self): return cpython.PyBytes_FromStringAndSize(self._data, 16) @property def int(self): if self._int is None: # The cache is important because `self.int` can be # used multiple times by __hash__ etc. self._int = int.from_bytes(self.bytes, 'big') return self._int @property def is_safe(self): return uuid.SafeUUID.unknown def __str__(self): cdef char out[36] uuid_to_str(self._data, out) return PyUnicode_FromKindAndData(PyUnicode_1BYTE_KIND, out, 36) @property def hex(self): cdef char out[32] uuid_to_hex(self._data, out) return PyUnicode_FromKindAndData(PyUnicode_1BYTE_KIND, out, 32) def __repr__(self): return f"UUID('{self}')" def __reduce__(self): return (type(self), (self.bytes,)) def __eq__(self, other): if type(other) is UUID: return memcmp(self._data, (other)._data, 16) == 0 if isinstance(other, std_UUID): return self.int == other.int return NotImplemented def __ne__(self, other): if type(other) is UUID: return memcmp(self._data, (other)._data, 16) != 0 if isinstance(other, std_UUID): return self.int != other.int return NotImplemented def __lt__(self, other): if type(other) is UUID: return memcmp(self._data, (other)._data, 16) < 0 if isinstance(other, std_UUID): return self.int < other.int return NotImplemented def __gt__(self, other): if type(other) is UUID: return memcmp(self._data, (other)._data, 16) > 0 if isinstance(other, std_UUID): return self.int > other.int return NotImplemented def __le__(self, other): if type(other) is UUID: return memcmp(self._data, (other)._data, 16) <= 0 if isinstance(other, std_UUID): return self.int <= other.int return NotImplemented def __ge__(self, other): if type(other) is UUID: return memcmp(self._data, (other)._data, 16) >= 0 if isinstance(other, std_UUID): return self.int >= other.int return NotImplemented def __hash__(self): # In EdgeDB every schema object has a uuid and there are # huge hash-maps of them. We want UUID.__hash__ to be # as fast as possible. if self._hash is not None: return self._hash self._hash = hash(self.int) return self._hash def __int__(self): return self.int @property def bytes_le(self): bytes = self.bytes return (bytes[4-1::-1] + bytes[6-1:4-1:-1] + bytes[8-1:6-1:-1] + bytes[8:]) @property def fields(self): return (self.time_low, self.time_mid, self.time_hi_version, self.clock_seq_hi_variant, self.clock_seq_low, self.node) @property def time_low(self): return self.int >> 96 @property def time_mid(self): return (self.int >> 80) & 0xffff @property def time_hi_version(self): return (self.int >> 64) & 0xffff @property def clock_seq_hi_variant(self): return (self.int >> 56) & 0xff @property def clock_seq_low(self): return (self.int >> 48) & 0xff @property def time(self): return (((self.time_hi_version & 0x0fff) << 48) | (self.time_mid << 32) | self.time_low) @property def clock_seq(self): return (((self.clock_seq_hi_variant & 0x3f) << 8) | self.clock_seq_low) @property def node(self): return self.int & 0xffffffffffff @property def urn(self): return 'urn:uuid:' + str(self) @property def variant(self): if not self.int & (0x8000 << 48): return uuid.RESERVED_NCS elif not self.int & (0x4000 << 48): return uuid.RFC_4122 elif not self.int & (0x2000 << 48): return uuid.RESERVED_MICROSOFT else: return uuid.RESERVED_FUTURE @property def version(self): # The version bits are only meaningful for RFC 4122 UUIDs. if self.variant == uuid.RFC_4122: return int((self.int >> 76) & 0xf) # # In order for `isinstance(pgproto.UUID, uuid.UUID)` to work, # patch __bases__ and __mro__ by injecting `uuid.UUID`. # # We apply brute-force here because the following pattern stopped # working with Python 3.8: # # cdef class OurUUID: # ... # # class UUID(OurUUID, uuid.UUID): # ... # # With Python 3.8 it now produces # # "TypeError: multiple bases have instance lay-out conflict" # # error. Maybe it's possible to fix this some other way, but # the best solution possible would be to just contribute our # faster UUID to the standard library and not have this problem # at all. For now this hack is pretty safe and should be # compatible with future Pythons for long enough. # assert UUID.__bases__[0] is __UUIDReplaceMe assert UUID.__mro__[1] is __UUIDReplaceMe cpython.Py_INCREF(std_UUID) cpython.PyTuple_SET_ITEM(UUID.__bases__, 0, std_UUID) cpython.Py_INCREF(std_UUID) cpython.PyTuple_SET_ITEM(UUID.__mro__, 1, std_UUID) # cdef pg_UUID = UUID ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/pool.py0000644000175100001770000012052014705014413015631 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncio import functools import inspect import logging import time import warnings from . import compat from . import connection from . import exceptions from . import protocol logger = logging.getLogger(__name__) class PoolConnectionProxyMeta(type): def __new__(mcls, name, bases, dct, *, wrap=False): if wrap: for attrname in dir(connection.Connection): if attrname.startswith('_') or attrname in dct: continue meth = getattr(connection.Connection, attrname) if not inspect.isfunction(meth): continue iscoroutine = inspect.iscoroutinefunction(meth) wrapper = mcls._wrap_connection_method(attrname, iscoroutine) wrapper = functools.update_wrapper(wrapper, meth) dct[attrname] = wrapper if '__doc__' not in dct: dct['__doc__'] = connection.Connection.__doc__ return super().__new__(mcls, name, bases, dct) @staticmethod def _wrap_connection_method(meth_name, iscoroutine): def call_con_method(self, *args, **kwargs): # This method will be owned by PoolConnectionProxy class. if self._con is None: raise exceptions.InterfaceError( 'cannot call Connection.{}(): ' 'connection has been released back to the pool'.format( meth_name)) meth = getattr(self._con.__class__, meth_name) return meth(self._con, *args, **kwargs) if iscoroutine: compat.markcoroutinefunction(call_con_method) return call_con_method class PoolConnectionProxy(connection._ConnectionProxy, metaclass=PoolConnectionProxyMeta, wrap=True): __slots__ = ('_con', '_holder') def __init__(self, holder: 'PoolConnectionHolder', con: connection.Connection): self._con = con self._holder = holder con._set_proxy(self) def __getattr__(self, attr): # Proxy all unresolved attributes to the wrapped Connection object. return getattr(self._con, attr) def _detach(self) -> connection.Connection: if self._con is None: return con, self._con = self._con, None con._set_proxy(None) return con def __repr__(self): if self._con is None: return '<{classname} [released] {id:#x}>'.format( classname=self.__class__.__name__, id=id(self)) else: return '<{classname} {con!r} {id:#x}>'.format( classname=self.__class__.__name__, con=self._con, id=id(self)) class PoolConnectionHolder: __slots__ = ('_con', '_pool', '_loop', '_proxy', '_max_queries', '_setup', '_max_inactive_time', '_in_use', '_inactive_callback', '_timeout', '_generation') def __init__(self, pool, *, max_queries, setup, max_inactive_time): self._pool = pool self._con = None self._proxy = None self._max_queries = max_queries self._max_inactive_time = max_inactive_time self._setup = setup self._inactive_callback = None self._in_use = None # type: asyncio.Future self._timeout = None self._generation = None def is_connected(self): return self._con is not None and not self._con.is_closed() def is_idle(self): return not self._in_use async def connect(self): if self._con is not None: raise exceptions.InternalClientError( 'PoolConnectionHolder.connect() called while another ' 'connection already exists') self._con = await self._pool._get_new_connection() self._generation = self._pool._generation self._maybe_cancel_inactive_callback() self._setup_inactive_callback() async def acquire(self) -> PoolConnectionProxy: if self._con is None or self._con.is_closed(): self._con = None await self.connect() elif self._generation != self._pool._generation: # Connections have been expired, re-connect the holder. self._pool._loop.create_task( self._con.close(timeout=self._timeout)) self._con = None await self.connect() self._maybe_cancel_inactive_callback() self._proxy = proxy = PoolConnectionProxy(self, self._con) if self._setup is not None: try: await self._setup(proxy) except (Exception, asyncio.CancelledError) as ex: # If a user-defined `setup` function fails, we don't # know if the connection is safe for re-use, hence # we close it. A new connection will be created # when `acquire` is called again. try: # Use `close()` to close the connection gracefully. # An exception in `setup` isn't necessarily caused # by an IO or a protocol error. close() will # do the necessary cleanup via _release_on_close(). await self._con.close() finally: raise ex self._in_use = self._pool._loop.create_future() return proxy async def release(self, timeout): if self._in_use is None: raise exceptions.InternalClientError( 'PoolConnectionHolder.release() called on ' 'a free connection holder') if self._con.is_closed(): # When closing, pool connections perform the necessary # cleanup, so we don't have to do anything else here. return self._timeout = None if self._con._protocol.queries_count >= self._max_queries: # The connection has reached its maximum utilization limit, # so close it. Connection.close() will call _release(). await self._con.close(timeout=timeout) return if self._generation != self._pool._generation: # The connection has expired because it belongs to # an older generation (Pool.expire_connections() has # been called.) await self._con.close(timeout=timeout) return try: budget = timeout if self._con._protocol._is_cancelling(): # If the connection is in cancellation state, # wait for the cancellation started = time.monotonic() await compat.wait_for( self._con._protocol._wait_for_cancellation(), budget) if budget is not None: budget -= time.monotonic() - started if self._pool._reset is not None: async with compat.timeout(budget): await self._con._reset() await self._pool._reset(self._con) else: await self._con.reset(timeout=budget) except (Exception, asyncio.CancelledError) as ex: # If the `reset` call failed, terminate the connection. # A new one will be created when `acquire` is called # again. try: # An exception in `reset` is most likely caused by # an IO error, so terminate the connection. self._con.terminate() finally: raise ex # Free this connection holder and invalidate the # connection proxy. self._release() # Rearm the connection inactivity timer. self._setup_inactive_callback() async def wait_until_released(self): if self._in_use is None: return else: await self._in_use async def close(self): if self._con is not None: # Connection.close() will call _release_on_close() to # finish holder cleanup. await self._con.close() def terminate(self): if self._con is not None: # Connection.terminate() will call _release_on_close() to # finish holder cleanup. self._con.terminate() def _setup_inactive_callback(self): if self._inactive_callback is not None: raise exceptions.InternalClientError( 'pool connection inactivity timer already exists') if self._max_inactive_time: self._inactive_callback = self._pool._loop.call_later( self._max_inactive_time, self._deactivate_inactive_connection) def _maybe_cancel_inactive_callback(self): if self._inactive_callback is not None: self._inactive_callback.cancel() self._inactive_callback = None def _deactivate_inactive_connection(self): if self._in_use is not None: raise exceptions.InternalClientError( 'attempting to deactivate an acquired connection') if self._con is not None: # The connection is idle and not in use, so it's fine to # use terminate() instead of close(). self._con.terminate() # Must call clear_connection, because _deactivate_connection # is called when the connection is *not* checked out, and # so terminate() above will not call the below. self._release_on_close() def _release_on_close(self): self._maybe_cancel_inactive_callback() self._release() self._con = None def _release(self): """Release this connection holder.""" if self._in_use is None: # The holder is not checked out. return if not self._in_use.done(): self._in_use.set_result(None) self._in_use = None # Deinitialize the connection proxy. All subsequent # operations on it will fail. if self._proxy is not None: self._proxy._detach() self._proxy = None # Put ourselves back to the pool queue. self._pool._queue.put_nowait(self) class Pool: """A connection pool. Connection pool can be used to manage a set of connections to the database. Connections are first acquired from the pool, then used, and then released back to the pool. Once a connection is released, it's reset to close all open cursors and other resources *except* prepared statements. Pools are created by calling :func:`~asyncpg.pool.create_pool`. """ __slots__ = ( '_queue', '_loop', '_minsize', '_maxsize', '_init', '_connect', '_reset', '_connect_args', '_connect_kwargs', '_holders', '_initialized', '_initializing', '_closing', '_closed', '_connection_class', '_record_class', '_generation', '_setup', '_max_queries', '_max_inactive_connection_lifetime' ) def __init__(self, *connect_args, min_size, max_size, max_queries, max_inactive_connection_lifetime, connect=None, setup=None, init=None, reset=None, loop, connection_class, record_class, **connect_kwargs): if len(connect_args) > 1: warnings.warn( "Passing multiple positional arguments to asyncpg.Pool " "constructor is deprecated and will be removed in " "asyncpg 0.17.0. The non-deprecated form is " "asyncpg.Pool(, **kwargs)", DeprecationWarning, stacklevel=2) if loop is None: loop = asyncio.get_event_loop() self._loop = loop if max_size <= 0: raise ValueError('max_size is expected to be greater than zero') if min_size < 0: raise ValueError( 'min_size is expected to be greater or equal to zero') if min_size > max_size: raise ValueError('min_size is greater than max_size') if max_queries <= 0: raise ValueError('max_queries is expected to be greater than zero') if max_inactive_connection_lifetime < 0: raise ValueError( 'max_inactive_connection_lifetime is expected to be greater ' 'or equal to zero') if not issubclass(connection_class, connection.Connection): raise TypeError( 'connection_class is expected to be a subclass of ' 'asyncpg.Connection, got {!r}'.format(connection_class)) if not issubclass(record_class, protocol.Record): raise TypeError( 'record_class is expected to be a subclass of ' 'asyncpg.Record, got {!r}'.format(record_class)) self._minsize = min_size self._maxsize = max_size self._holders = [] self._initialized = False self._initializing = False self._queue = None self._connection_class = connection_class self._record_class = record_class self._closing = False self._closed = False self._generation = 0 self._connect = connect if connect is not None else connection.connect self._connect_args = connect_args self._connect_kwargs = connect_kwargs self._setup = setup self._init = init self._reset = reset self._max_queries = max_queries self._max_inactive_connection_lifetime = \ max_inactive_connection_lifetime async def _async__init__(self): if self._initialized: return self if self._initializing: raise exceptions.InterfaceError( 'pool is being initialized in another task') if self._closed: raise exceptions.InterfaceError('pool is closed') self._initializing = True try: await self._initialize() return self finally: self._initializing = False self._initialized = True async def _initialize(self): self._queue = asyncio.LifoQueue(maxsize=self._maxsize) for _ in range(self._maxsize): ch = PoolConnectionHolder( self, max_queries=self._max_queries, max_inactive_time=self._max_inactive_connection_lifetime, setup=self._setup) self._holders.append(ch) self._queue.put_nowait(ch) if self._minsize: # Since we use a LIFO queue, the first items in the queue will be # the last ones in `self._holders`. We want to pre-connect the # first few connections in the queue, therefore we want to walk # `self._holders` in reverse. # Connect the first connection holder in the queue so that # any connection issues are visible early. first_ch = self._holders[-1] # type: PoolConnectionHolder await first_ch.connect() if self._minsize > 1: connect_tasks = [] for i, ch in enumerate(reversed(self._holders[:-1])): # `minsize - 1` because we already have first_ch if i >= self._minsize - 1: break connect_tasks.append(ch.connect()) await asyncio.gather(*connect_tasks) def is_closing(self): """Return ``True`` if the pool is closing or is closed. .. versionadded:: 0.28.0 """ return self._closed or self._closing def get_size(self): """Return the current number of connections in this pool. .. versionadded:: 0.25.0 """ return sum(h.is_connected() for h in self._holders) def get_min_size(self): """Return the minimum number of connections in this pool. .. versionadded:: 0.25.0 """ return self._minsize def get_max_size(self): """Return the maximum allowed number of connections in this pool. .. versionadded:: 0.25.0 """ return self._maxsize def get_idle_size(self): """Return the current number of idle connections in this pool. .. versionadded:: 0.25.0 """ return sum(h.is_connected() and h.is_idle() for h in self._holders) def set_connect_args(self, dsn=None, **connect_kwargs): r"""Set the new connection arguments for this pool. The new connection arguments will be used for all subsequent new connection attempts. Existing connections will remain until they expire. Use :meth:`Pool.expire_connections() ` to expedite the connection expiry. :param str dsn: Connection arguments specified using as a single string in the following format: ``postgres://user:pass@host:port/database?option=value``. :param \*\*connect_kwargs: Keyword arguments for the :func:`~asyncpg.connection.connect` function. .. versionadded:: 0.16.0 """ self._connect_args = [dsn] self._connect_kwargs = connect_kwargs async def _get_new_connection(self): con = await self._connect( *self._connect_args, loop=self._loop, connection_class=self._connection_class, record_class=self._record_class, **self._connect_kwargs, ) if not isinstance(con, self._connection_class): good = self._connection_class good_n = f'{good.__module__}.{good.__name__}' bad = type(con) if bad.__module__ == "builtins": bad_n = bad.__name__ else: bad_n = f'{bad.__module__}.{bad.__name__}' raise exceptions.InterfaceError( "expected pool connect callback to return an instance of " f"'{good_n}', got " f"'{bad_n}'" ) if self._init is not None: try: await self._init(con) except (Exception, asyncio.CancelledError) as ex: # If a user-defined `init` function fails, we don't # know if the connection is safe for re-use, hence # we close it. A new connection will be created # when `acquire` is called again. try: # Use `close()` to close the connection gracefully. # An exception in `init` isn't necessarily caused # by an IO or a protocol error. close() will # do the necessary cleanup via _release_on_close(). await con.close() finally: raise ex return con async def execute(self, query: str, *args, timeout: float=None) -> str: """Execute an SQL command (or commands). Pool performs this operation using one of its connections. Other than that, it behaves identically to :meth:`Connection.execute() `. .. versionadded:: 0.10.0 """ async with self.acquire() as con: return await con.execute(query, *args, timeout=timeout) async def executemany(self, command: str, args, *, timeout: float=None): """Execute an SQL *command* for each sequence of arguments in *args*. Pool performs this operation using one of its connections. Other than that, it behaves identically to :meth:`Connection.executemany() `. .. versionadded:: 0.10.0 """ async with self.acquire() as con: return await con.executemany(command, args, timeout=timeout) async def fetch( self, query, *args, timeout=None, record_class=None ) -> list: """Run a query and return the results as a list of :class:`Record`. Pool performs this operation using one of its connections. Other than that, it behaves identically to :meth:`Connection.fetch() `. .. versionadded:: 0.10.0 """ async with self.acquire() as con: return await con.fetch( query, *args, timeout=timeout, record_class=record_class ) async def fetchval(self, query, *args, column=0, timeout=None): """Run a query and return a value in the first row. Pool performs this operation using one of its connections. Other than that, it behaves identically to :meth:`Connection.fetchval() `. .. versionadded:: 0.10.0 """ async with self.acquire() as con: return await con.fetchval( query, *args, column=column, timeout=timeout) async def fetchrow(self, query, *args, timeout=None, record_class=None): """Run a query and return the first row. Pool performs this operation using one of its connections. Other than that, it behaves identically to :meth:`Connection.fetchrow() `. .. versionadded:: 0.10.0 """ async with self.acquire() as con: return await con.fetchrow( query, *args, timeout=timeout, record_class=record_class ) async def fetchmany(self, query, args, *, timeout=None, record_class=None): """Run a query for each sequence of arguments in *args* and return the results as a list of :class:`Record`. Pool performs this operation using one of its connections. Other than that, it behaves identically to :meth:`Connection.fetchmany() `. .. versionadded:: 0.30.0 """ async with self.acquire() as con: return await con.fetchmany( query, args, timeout=timeout, record_class=record_class ) async def copy_from_table( self, table_name, *, output, columns=None, schema_name=None, timeout=None, format=None, oids=None, delimiter=None, null=None, header=None, quote=None, escape=None, force_quote=None, encoding=None ): """Copy table contents to a file or file-like object. Pool performs this operation using one of its connections. Other than that, it behaves identically to :meth:`Connection.copy_from_table() `. .. versionadded:: 0.24.0 """ async with self.acquire() as con: return await con.copy_from_table( table_name, output=output, columns=columns, schema_name=schema_name, timeout=timeout, format=format, oids=oids, delimiter=delimiter, null=null, header=header, quote=quote, escape=escape, force_quote=force_quote, encoding=encoding ) async def copy_from_query( self, query, *args, output, timeout=None, format=None, oids=None, delimiter=None, null=None, header=None, quote=None, escape=None, force_quote=None, encoding=None ): """Copy the results of a query to a file or file-like object. Pool performs this operation using one of its connections. Other than that, it behaves identically to :meth:`Connection.copy_from_query() `. .. versionadded:: 0.24.0 """ async with self.acquire() as con: return await con.copy_from_query( query, *args, output=output, timeout=timeout, format=format, oids=oids, delimiter=delimiter, null=null, header=header, quote=quote, escape=escape, force_quote=force_quote, encoding=encoding ) async def copy_to_table( self, table_name, *, source, columns=None, schema_name=None, timeout=None, format=None, oids=None, freeze=None, delimiter=None, null=None, header=None, quote=None, escape=None, force_quote=None, force_not_null=None, force_null=None, encoding=None, where=None ): """Copy data to the specified table. Pool performs this operation using one of its connections. Other than that, it behaves identically to :meth:`Connection.copy_to_table() `. .. versionadded:: 0.24.0 """ async with self.acquire() as con: return await con.copy_to_table( table_name, source=source, columns=columns, schema_name=schema_name, timeout=timeout, format=format, oids=oids, freeze=freeze, delimiter=delimiter, null=null, header=header, quote=quote, escape=escape, force_quote=force_quote, force_not_null=force_not_null, force_null=force_null, encoding=encoding, where=where ) async def copy_records_to_table( self, table_name, *, records, columns=None, schema_name=None, timeout=None, where=None ): """Copy a list of records to the specified table using binary COPY. Pool performs this operation using one of its connections. Other than that, it behaves identically to :meth:`Connection.copy_records_to_table() `. .. versionadded:: 0.24.0 """ async with self.acquire() as con: return await con.copy_records_to_table( table_name, records=records, columns=columns, schema_name=schema_name, timeout=timeout, where=where ) def acquire(self, *, timeout=None): """Acquire a database connection from the pool. :param float timeout: A timeout for acquiring a Connection. :return: An instance of :class:`~asyncpg.connection.Connection`. Can be used in an ``await`` expression or with an ``async with`` block. .. code-block:: python async with pool.acquire() as con: await con.execute(...) Or: .. code-block:: python con = await pool.acquire() try: await con.execute(...) finally: await pool.release(con) """ return PoolAcquireContext(self, timeout) async def _acquire(self, timeout): async def _acquire_impl(): ch = await self._queue.get() # type: PoolConnectionHolder try: proxy = await ch.acquire() # type: PoolConnectionProxy except (Exception, asyncio.CancelledError): self._queue.put_nowait(ch) raise else: # Record the timeout, as we will apply it by default # in release(). ch._timeout = timeout return proxy if self._closing: raise exceptions.InterfaceError('pool is closing') self._check_init() if timeout is None: return await _acquire_impl() else: return await compat.wait_for( _acquire_impl(), timeout=timeout) async def release(self, connection, *, timeout=None): """Release a database connection back to the pool. :param Connection connection: A :class:`~asyncpg.connection.Connection` object to release. :param float timeout: A timeout for releasing the connection. If not specified, defaults to the timeout provided in the corresponding call to the :meth:`Pool.acquire() ` method. .. versionchanged:: 0.14.0 Added the *timeout* parameter. """ if (type(connection) is not PoolConnectionProxy or connection._holder._pool is not self): raise exceptions.InterfaceError( 'Pool.release() received invalid connection: ' '{connection!r} is not a member of this pool'.format( connection=connection)) if connection._con is None: # Already released, do nothing. return self._check_init() # Let the connection do its internal housekeeping when its released. connection._con._on_release() ch = connection._holder if timeout is None: timeout = ch._timeout # Use asyncio.shield() to guarantee that task cancellation # does not prevent the connection from being returned to the # pool properly. return await asyncio.shield(ch.release(timeout)) async def close(self): """Attempt to gracefully close all connections in the pool. Wait until all pool connections are released, close them and shut down the pool. If any error (including cancellation) occurs in ``close()`` the pool will terminate by calling :meth:`Pool.terminate() `. It is advisable to use :func:`python:asyncio.wait_for` to set a timeout. .. versionchanged:: 0.16.0 ``close()`` now waits until all pool connections are released before closing them and the pool. Errors raised in ``close()`` will cause immediate pool termination. """ if self._closed: return self._check_init() self._closing = True warning_callback = None try: warning_callback = self._loop.call_later( 60, self._warn_on_long_close) release_coros = [ ch.wait_until_released() for ch in self._holders] await asyncio.gather(*release_coros) close_coros = [ ch.close() for ch in self._holders] await asyncio.gather(*close_coros) except (Exception, asyncio.CancelledError): self.terminate() raise finally: if warning_callback is not None: warning_callback.cancel() self._closed = True self._closing = False def _warn_on_long_close(self): logger.warning('Pool.close() is taking over 60 seconds to complete. ' 'Check if you have any unreleased connections left. ' 'Use asyncio.wait_for() to set a timeout for ' 'Pool.close().') def terminate(self): """Terminate all connections in the pool.""" if self._closed: return self._check_init() for ch in self._holders: ch.terminate() self._closed = True async def expire_connections(self): """Expire all currently open connections. Cause all currently open connections to get replaced on the next :meth:`~asyncpg.pool.Pool.acquire()` call. .. versionadded:: 0.16.0 """ self._generation += 1 def _check_init(self): if not self._initialized: if self._initializing: raise exceptions.InterfaceError( 'pool is being initialized, but not yet ready: ' 'likely there is a race between creating a pool and ' 'using it') raise exceptions.InterfaceError('pool is not initialized') if self._closed: raise exceptions.InterfaceError('pool is closed') def _drop_statement_cache(self): # Drop statement cache for all connections in the pool. for ch in self._holders: if ch._con is not None: ch._con._drop_local_statement_cache() def _drop_type_cache(self): # Drop type codec cache for all connections in the pool. for ch in self._holders: if ch._con is not None: ch._con._drop_local_type_cache() def __await__(self): return self._async__init__().__await__() async def __aenter__(self): await self._async__init__() return self async def __aexit__(self, *exc): await self.close() class PoolAcquireContext: __slots__ = ('timeout', 'connection', 'done', 'pool') def __init__(self, pool, timeout): self.pool = pool self.timeout = timeout self.connection = None self.done = False async def __aenter__(self): if self.connection is not None or self.done: raise exceptions.InterfaceError('a connection is already acquired') self.connection = await self.pool._acquire(self.timeout) return self.connection async def __aexit__(self, *exc): self.done = True con = self.connection self.connection = None await self.pool.release(con) def __await__(self): self.done = True return self.pool._acquire(self.timeout).__await__() def create_pool(dsn=None, *, min_size=10, max_size=10, max_queries=50000, max_inactive_connection_lifetime=300.0, connect=None, setup=None, init=None, reset=None, loop=None, connection_class=connection.Connection, record_class=protocol.Record, **connect_kwargs): r"""Create a connection pool. Can be used either with an ``async with`` block: .. code-block:: python async with asyncpg.create_pool(user='postgres', command_timeout=60) as pool: await pool.fetch('SELECT 1') Or to perform multiple operations on a single connection: .. code-block:: python async with asyncpg.create_pool(user='postgres', command_timeout=60) as pool: async with pool.acquire() as con: await con.execute(''' CREATE TABLE names ( id serial PRIMARY KEY, name VARCHAR (255) NOT NULL) ''') await con.fetch('SELECT 1') Or directly with ``await`` (not recommended): .. code-block:: python pool = await asyncpg.create_pool(user='postgres', command_timeout=60) con = await pool.acquire() try: await con.fetch('SELECT 1') finally: await pool.release(con) .. warning:: Prepared statements and cursors returned by :meth:`Connection.prepare() ` and :meth:`Connection.cursor() ` become invalid once the connection is released. Likewise, all notification and log listeners are removed, and ``asyncpg`` will issue a warning if there are any listener callbacks registered on a connection that is being released to the pool. :param str dsn: Connection arguments specified using as a single string in the following format: ``postgres://user:pass@host:port/database?option=value``. :param \*\*connect_kwargs: Keyword arguments for the :func:`~asyncpg.connection.connect` function. :param Connection connection_class: The class to use for connections. Must be a subclass of :class:`~asyncpg.connection.Connection`. :param type record_class: If specified, the class to use for records returned by queries on the connections in this pool. Must be a subclass of :class:`~asyncpg.Record`. :param int min_size: Number of connection the pool will be initialized with. :param int max_size: Max number of connections in the pool. :param int max_queries: Number of queries after a connection is closed and replaced with a new connection. :param float max_inactive_connection_lifetime: Number of seconds after which inactive connections in the pool will be closed. Pass ``0`` to disable this mechanism. :param coroutine connect: A coroutine that is called instead of :func:`~asyncpg.connection.connect` whenever the pool needs to make a new connection. Must return an instance of type specified by *connection_class* or :class:`~asyncpg.connection.Connection` if *connection_class* was not specified. :param coroutine setup: A coroutine to prepare a connection right before it is returned from :meth:`Pool.acquire()`. An example use case would be to automatically set up notifications listeners for all connections of a pool. :param coroutine init: A coroutine to initialize a connection when it is created. An example use case would be to setup type codecs with :meth:`Connection.set_builtin_type_codec() <\ asyncpg.connection.Connection.set_builtin_type_codec>` or :meth:`Connection.set_type_codec() <\ asyncpg.connection.Connection.set_type_codec>`. :param coroutine reset: A coroutine to reset a connection before it is returned to the pool by :meth:`Pool.release()`. The function is supposed to reset any changes made to the database session so that the next acquirer gets the connection in a well-defined state. The default implementation calls :meth:`Connection.reset() <\ asyncpg.connection.Connection.reset>`, which runs the following:: SELECT pg_advisory_unlock_all(); CLOSE ALL; UNLISTEN *; RESET ALL; The exact reset query is determined by detected server capabilities, and a custom *reset* implementation can obtain the default query by calling :meth:`Connection.get_reset_query() <\ asyncpg.connection.Connection.get_reset_query>`. :param loop: An asyncio event loop instance. If ``None``, the default event loop will be used. :return: An instance of :class:`~asyncpg.pool.Pool`. .. versionchanged:: 0.10.0 An :exc:`~asyncpg.exceptions.InterfaceError` will be raised on any attempted operation on a released connection. .. versionchanged:: 0.13.0 An :exc:`~asyncpg.exceptions.InterfaceError` will be raised on any attempted operation on a prepared statement or a cursor created on a connection that has been released to the pool. .. versionchanged:: 0.13.0 An :exc:`~asyncpg.exceptions.InterfaceWarning` will be produced if there are any active listeners (added via :meth:`Connection.add_listener() ` or :meth:`Connection.add_log_listener() `) present on the connection at the moment of its release to the pool. .. versionchanged:: 0.22.0 Added the *record_class* parameter. .. versionchanged:: 0.30.0 Added the *connect* and *reset* parameters. """ return Pool( dsn, connection_class=connection_class, record_class=record_class, min_size=min_size, max_size=max_size, max_queries=max_queries, loop=loop, connect=connect, setup=setup, init=init, reset=reset, max_inactive_connection_lifetime=max_inactive_connection_lifetime, **connect_kwargs, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/prepared_stmt.py0000644000175100001770000002303014705014413017527 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import json from . import connresource from . import cursor from . import exceptions class PreparedStatement(connresource.ConnectionResource): """A representation of a prepared statement.""" __slots__ = ('_state', '_query', '_last_status') def __init__(self, connection, query, state): super().__init__(connection) self._state = state self._query = query state.attach() self._last_status = None @connresource.guarded def get_name(self) -> str: """Return the name of this prepared statement. .. versionadded:: 0.25.0 """ return self._state.name @connresource.guarded def get_query(self) -> str: """Return the text of the query for this prepared statement. Example:: stmt = await connection.prepare('SELECT $1::int') assert stmt.get_query() == "SELECT $1::int" """ return self._query @connresource.guarded def get_statusmsg(self) -> str: """Return the status of the executed command. Example:: stmt = await connection.prepare('CREATE TABLE mytab (a int)') await stmt.fetch() assert stmt.get_statusmsg() == "CREATE TABLE" """ if self._last_status is None: return self._last_status return self._last_status.decode() @connresource.guarded def get_parameters(self): """Return a description of statement parameters types. :return: A tuple of :class:`asyncpg.types.Type`. Example:: stmt = await connection.prepare('SELECT ($1::int, $2::text)') print(stmt.get_parameters()) # Will print: # (Type(oid=23, name='int4', kind='scalar', schema='pg_catalog'), # Type(oid=25, name='text', kind='scalar', schema='pg_catalog')) """ return self._state._get_parameters() @connresource.guarded def get_attributes(self): """Return a description of relation attributes (columns). :return: A tuple of :class:`asyncpg.types.Attribute`. Example:: st = await self.con.prepare(''' SELECT typname, typnamespace FROM pg_type ''') print(st.get_attributes()) # Will print: # (Attribute( # name='typname', # type=Type(oid=19, name='name', kind='scalar', # schema='pg_catalog')), # Attribute( # name='typnamespace', # type=Type(oid=26, name='oid', kind='scalar', # schema='pg_catalog'))) """ return self._state._get_attributes() @connresource.guarded def cursor(self, *args, prefetch=None, timeout=None) -> cursor.CursorFactory: """Return a *cursor factory* for the prepared statement. :param args: Query arguments. :param int prefetch: The number of rows the *cursor iterator* will prefetch (defaults to ``50``.) :param float timeout: Optional timeout in seconds. :return: A :class:`~cursor.CursorFactory` object. """ return cursor.CursorFactory( self._connection, self._query, self._state, args, prefetch, timeout, self._state.record_class, ) @connresource.guarded async def explain(self, *args, analyze=False): """Return the execution plan of the statement. :param args: Query arguments. :param analyze: If ``True``, the statement will be executed and the run time statitics added to the return value. :return: An object representing the execution plan. This value is actually a deserialized JSON output of the SQL ``EXPLAIN`` command. """ query = 'EXPLAIN (FORMAT JSON, VERBOSE' if analyze: query += ', ANALYZE) ' else: query += ') ' query += self._state.query if analyze: # From PostgreSQL docs: # Important: Keep in mind that the statement is actually # executed when the ANALYZE option is used. Although EXPLAIN # will discard any output that a SELECT would return, other # side effects of the statement will happen as usual. If you # wish to use EXPLAIN ANALYZE on an INSERT, UPDATE, DELETE, # MERGE, CREATE TABLE AS, or EXECUTE statement without letting # the command affect your data, use this approach: # BEGIN; # EXPLAIN ANALYZE ...; # ROLLBACK; tr = self._connection.transaction() await tr.start() try: data = await self._connection.fetchval(query, *args) finally: await tr.rollback() else: data = await self._connection.fetchval(query, *args) return json.loads(data) @connresource.guarded async def fetch(self, *args, timeout=None): r"""Execute the statement and return a list of :class:`Record` objects. :param str query: Query text :param args: Query arguments :param float timeout: Optional timeout value in seconds. :return: A list of :class:`Record` instances. """ data = await self.__bind_execute(args, 0, timeout) return data @connresource.guarded async def fetchval(self, *args, column=0, timeout=None): """Execute the statement and return a value in the first row. :param args: Query arguments. :param int column: Numeric index within the record of the value to return (defaults to 0). :param float timeout: Optional timeout value in seconds. If not specified, defaults to the value of ``command_timeout`` argument to the ``Connection`` instance constructor. :return: The value of the specified column of the first record. """ data = await self.__bind_execute(args, 1, timeout) if not data: return None return data[0][column] @connresource.guarded async def fetchrow(self, *args, timeout=None): """Execute the statement and return the first row. :param str query: Query text :param args: Query arguments :param float timeout: Optional timeout value in seconds. :return: The first row as a :class:`Record` instance. """ data = await self.__bind_execute(args, 1, timeout) if not data: return None return data[0] @connresource.guarded async def fetchmany(self, args, *, timeout=None): """Execute the statement and return a list of :class:`Record` objects. :param args: Query arguments. :param float timeout: Optional timeout value in seconds. :return: A list of :class:`Record` instances. .. versionadded:: 0.30.0 """ return await self.__do_execute( lambda protocol: protocol.bind_execute_many( self._state, args, portal_name='', timeout=timeout, return_rows=True, ) ) @connresource.guarded async def executemany(self, args, *, timeout: float=None): """Execute the statement for each sequence of arguments in *args*. :param args: An iterable containing sequences of arguments. :param float timeout: Optional timeout value in seconds. :return None: This method discards the results of the operations. .. versionadded:: 0.22.0 """ return await self.__do_execute( lambda protocol: protocol.bind_execute_many( self._state, args, portal_name='', timeout=timeout, return_rows=False, )) async def __do_execute(self, executor): protocol = self._connection._protocol try: return await executor(protocol) except exceptions.OutdatedSchemaCacheError: await self._connection.reload_schema_state() # We can not find all manually created prepared statements, so just # drop known cached ones in the `self._connection`. # Other manually created prepared statements will fail and # invalidate themselves (unfortunately, clearing caches again). self._state.mark_closed() raise async def __bind_execute(self, args, limit, timeout): data, status, _ = await self.__do_execute( lambda protocol: protocol.bind_execute( self._state, args, '', limit, True, timeout)) self._last_status = status return data def _check_open(self, meth_name): if self._state.closed: raise exceptions.InterfaceError( 'cannot call PreparedStmt.{}(): ' 'the prepared statement is closed'.format(meth_name)) def _check_conn_validity(self, meth_name): self._check_open(meth_name) super()._check_conn_validity(meth_name) def __del__(self): self._state.detach() self._connection._maybe_gc_stmt(self._state) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1729370387.4935544 asyncpg-0.30.0/asyncpg/protocol/0000755000175100001770000000000014705014423016150 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/__init__.py0000644000175100001770000000052414705014413020261 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 # flake8: NOQA from __future__ import annotations from .protocol import Protocol, Record, NO_TIMEOUT, BUILTIN_TYPE_NAME_MAP ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1729370387.4975543 asyncpg-0.30.0/asyncpg/protocol/codecs/0000755000175100001770000000000014705014423017410 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/codecs/__init__.py0000644000175100001770000000000014705014413021506 0ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/codecs/array.pyx0000644000175100001770000007145614705014413021304 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 from collections.abc import (Iterable as IterableABC, Mapping as MappingABC, Sized as SizedABC) from asyncpg import exceptions DEF ARRAY_MAXDIM = 6 # defined in postgresql/src/includes/c.h # "NULL" cdef Py_UCS4 *APG_NULL = [0x004E, 0x0055, 0x004C, 0x004C, 0x0000] ctypedef object (*encode_func_ex)(ConnectionSettings settings, WriteBuffer buf, object obj, const void *arg) ctypedef object (*decode_func_ex)(ConnectionSettings settings, FRBuffer *buf, const void *arg) cdef inline bint _is_trivial_container(object obj): return cpython.PyUnicode_Check(obj) or cpython.PyBytes_Check(obj) or \ cpythonx.PyByteArray_Check(obj) or cpythonx.PyMemoryView_Check(obj) cdef inline _is_array_iterable(object obj): return ( isinstance(obj, IterableABC) and isinstance(obj, SizedABC) and not _is_trivial_container(obj) and not isinstance(obj, MappingABC) ) cdef inline _is_sub_array_iterable(object obj): # Sub-arrays have a specialized check, because we treat # nested tuples as records. return _is_array_iterable(obj) and not cpython.PyTuple_Check(obj) cdef _get_array_shape(object obj, int32_t *dims, int32_t *ndims): cdef: ssize_t mylen = len(obj) ssize_t elemlen = -2 object it if mylen > _MAXINT32: raise ValueError('too many elements in array value') if ndims[0] > ARRAY_MAXDIM: raise ValueError( 'number of array dimensions ({}) exceed the maximum expected ({})'. format(ndims[0], ARRAY_MAXDIM)) dims[ndims[0] - 1] = mylen for elem in obj: if _is_sub_array_iterable(elem): if elemlen == -2: elemlen = len(elem) if elemlen > _MAXINT32: raise ValueError('too many elements in array value') ndims[0] += 1 _get_array_shape(elem, dims, ndims) else: if len(elem) != elemlen: raise ValueError('non-homogeneous array') else: if elemlen >= 0: raise ValueError('non-homogeneous array') else: elemlen = -1 cdef _write_array_data(ConnectionSettings settings, object obj, int32_t ndims, int32_t dim, WriteBuffer elem_data, encode_func_ex encoder, const void *encoder_arg): if dim < ndims - 1: for item in obj: _write_array_data(settings, item, ndims, dim + 1, elem_data, encoder, encoder_arg) else: for item in obj: if item is None: elem_data.write_int32(-1) else: try: encoder(settings, elem_data, item, encoder_arg) except TypeError as e: raise ValueError( 'invalid array element: {}'.format(e.args[0])) from None cdef inline array_encode(ConnectionSettings settings, WriteBuffer buf, object obj, uint32_t elem_oid, encode_func_ex encoder, const void *encoder_arg): cdef: WriteBuffer elem_data int32_t dims[ARRAY_MAXDIM] int32_t ndims = 1 int32_t i if not _is_array_iterable(obj): raise TypeError( 'a sized iterable container expected (got type {!r})'.format( type(obj).__name__)) _get_array_shape(obj, dims, &ndims) elem_data = WriteBuffer.new() if ndims > 1: _write_array_data(settings, obj, ndims, 0, elem_data, encoder, encoder_arg) else: for i, item in enumerate(obj): if item is None: elem_data.write_int32(-1) else: try: encoder(settings, elem_data, item, encoder_arg) except TypeError as e: raise ValueError( 'invalid array element at index {}: {}'.format( i, e.args[0])) from None buf.write_int32(12 + 8 * ndims + elem_data.len()) # Number of dimensions buf.write_int32(ndims) # flags buf.write_int32(0) # element type buf.write_int32(elem_oid) # upper / lower bounds for i in range(ndims): buf.write_int32(dims[i]) buf.write_int32(1) # element data buf.write_buffer(elem_data) cdef _write_textarray_data(ConnectionSettings settings, object obj, int32_t ndims, int32_t dim, WriteBuffer array_data, encode_func_ex encoder, const void *encoder_arg, Py_UCS4 typdelim): cdef: ssize_t i = 0 int8_t delim = typdelim WriteBuffer elem_data Py_buffer pybuf const char *elem_str char ch ssize_t elem_len ssize_t quoted_elem_len bint need_quoting array_data.write_byte(b'{') if dim < ndims - 1: for item in obj: if i > 0: array_data.write_byte(delim) array_data.write_byte(b' ') _write_textarray_data(settings, item, ndims, dim + 1, array_data, encoder, encoder_arg, typdelim) i += 1 else: for item in obj: elem_data = WriteBuffer.new() if i > 0: array_data.write_byte(delim) array_data.write_byte(b' ') if item is None: array_data.write_bytes(b'NULL') i += 1 continue else: try: encoder(settings, elem_data, item, encoder_arg) except TypeError as e: raise ValueError( 'invalid array element: {}'.format( e.args[0])) from None # element string length (first four bytes are the encoded length.) elem_len = elem_data.len() - 4 if elem_len == 0: # Empty string array_data.write_bytes(b'""') else: cpython.PyObject_GetBuffer( elem_data, &pybuf, cpython.PyBUF_SIMPLE) elem_str = (pybuf.buf) + 4 try: if not apg_strcasecmp_char(elem_str, b'NULL'): array_data.write_byte(b'"') array_data.write_cstr(elem_str, 4) array_data.write_byte(b'"') else: quoted_elem_len = elem_len need_quoting = False for i in range(elem_len): ch = elem_str[i] if ch == b'"' or ch == b'\\': # Quotes and backslashes need escaping. quoted_elem_len += 1 need_quoting = True elif (ch == b'{' or ch == b'}' or ch == delim or apg_ascii_isspace(ch)): need_quoting = True if need_quoting: array_data.write_byte(b'"') if quoted_elem_len == elem_len: array_data.write_cstr(elem_str, elem_len) else: # Escaping required. for i in range(elem_len): ch = elem_str[i] if ch == b'"' or ch == b'\\': array_data.write_byte(b'\\') array_data.write_byte(ch) array_data.write_byte(b'"') else: array_data.write_cstr(elem_str, elem_len) finally: cpython.PyBuffer_Release(&pybuf) i += 1 array_data.write_byte(b'}') cdef inline textarray_encode(ConnectionSettings settings, WriteBuffer buf, object obj, encode_func_ex encoder, const void *encoder_arg, Py_UCS4 typdelim): cdef: WriteBuffer array_data int32_t dims[ARRAY_MAXDIM] int32_t ndims = 1 int32_t i if not _is_array_iterable(obj): raise TypeError( 'a sized iterable container expected (got type {!r})'.format( type(obj).__name__)) _get_array_shape(obj, dims, &ndims) array_data = WriteBuffer.new() _write_textarray_data(settings, obj, ndims, 0, array_data, encoder, encoder_arg, typdelim) buf.write_int32(array_data.len()) buf.write_buffer(array_data) cdef inline array_decode(ConnectionSettings settings, FRBuffer *buf, decode_func_ex decoder, const void *decoder_arg): cdef: int32_t ndims = hton.unpack_int32(frb_read(buf, 4)) int32_t flags = hton.unpack_int32(frb_read(buf, 4)) uint32_t elem_oid = hton.unpack_int32(frb_read(buf, 4)) list result int i int32_t elem_len int32_t elem_count = 1 FRBuffer elem_buf int32_t dims[ARRAY_MAXDIM] Codec elem_codec if ndims == 0: return [] if ndims > ARRAY_MAXDIM: raise exceptions.ProtocolError( 'number of array dimensions ({}) exceed the maximum expected ({})'. format(ndims, ARRAY_MAXDIM)) elif ndims < 0: raise exceptions.ProtocolError( 'unexpected array dimensions value: {}'.format(ndims)) for i in range(ndims): dims[i] = hton.unpack_int32(frb_read(buf, 4)) if dims[i] < 0: raise exceptions.ProtocolError( 'unexpected array dimension size: {}'.format(dims[i])) # Ignore the lower bound information frb_read(buf, 4) if ndims == 1: # Fast path for flat arrays elem_count = dims[0] result = cpython.PyList_New(elem_count) for i in range(elem_count): elem_len = hton.unpack_int32(frb_read(buf, 4)) if elem_len == -1: elem = None else: frb_slice_from(&elem_buf, buf, elem_len) elem = decoder(settings, &elem_buf, decoder_arg) cpython.Py_INCREF(elem) cpython.PyList_SET_ITEM(result, i, elem) else: result = _nested_array_decode(settings, buf, decoder, decoder_arg, ndims, dims, &elem_buf) return result cdef _nested_array_decode(ConnectionSettings settings, FRBuffer *buf, decode_func_ex decoder, const void *decoder_arg, int32_t ndims, int32_t *dims, FRBuffer *elem_buf): cdef: int32_t elem_len int64_t i, j int64_t array_len = 1 object elem, stride # An array of pointers to lists for each current array level. void *strides[ARRAY_MAXDIM] # An array of current positions at each array level. int32_t indexes[ARRAY_MAXDIM] for i in range(ndims): array_len *= dims[i] indexes[i] = 0 strides[i] = NULL if array_len == 0: # A multidimensional array with a zero-sized dimension? return [] elif array_len < 0: # Array length overflow raise exceptions.ProtocolError('array length overflow') for i in range(array_len): # Decode the element. elem_len = hton.unpack_int32(frb_read(buf, 4)) if elem_len == -1: elem = None else: elem = decoder(settings, frb_slice_from(elem_buf, buf, elem_len), decoder_arg) # Take an explicit reference for PyList_SET_ITEM in the below # loop expects this. cpython.Py_INCREF(elem) # Iterate over array dimentions and put the element in # the correctly nested sublist. for j in reversed(range(ndims)): if indexes[j] == 0: # Allocate the list for this array level. stride = cpython.PyList_New(dims[j]) strides[j] = stride # Take an explicit reference for PyList_SET_ITEM below # expects this. cpython.Py_INCREF(stride) stride = strides[j] cpython.PyList_SET_ITEM(stride, indexes[j], elem) indexes[j] += 1 if indexes[j] == dims[j] and j != 0: # This array level is full, continue the # ascent in the dimensions so that this level # sublist will be appened to the parent list. elem = stride # Reset the index, this will cause the # new list to be allocated on the next # iteration on this array axis. indexes[j] = 0 else: break stride = strides[0] # Since each element in strides has a refcount of 1, # returning strides[0] will increment it to 2, so # balance that. cpython.Py_DECREF(stride) return stride cdef textarray_decode(ConnectionSettings settings, FRBuffer *buf, decode_func_ex decoder, const void *decoder_arg, Py_UCS4 typdelim): cdef: Py_UCS4 *array_text str s # Make a copy of array data since we will be mutating it for # the purposes of element decoding. s = pgproto.text_decode(settings, buf) array_text = cpythonx.PyUnicode_AsUCS4Copy(s) try: return _textarray_decode( settings, array_text, decoder, decoder_arg, typdelim) except ValueError as e: raise exceptions.ProtocolError( 'malformed array literal {!r}: {}'.format(s, e.args[0])) finally: cpython.PyMem_Free(array_text) cdef _textarray_decode(ConnectionSettings settings, Py_UCS4 *array_text, decode_func_ex decoder, const void *decoder_arg, Py_UCS4 typdelim): cdef: bytearray array_bytes list result list new_stride Py_UCS4 *ptr int32_t ndims = 0 int32_t ubound = 0 int32_t lbound = 0 int32_t dims[ARRAY_MAXDIM] int32_t inferred_dims[ARRAY_MAXDIM] int32_t inferred_ndims = 0 void *strides[ARRAY_MAXDIM] int32_t indexes[ARRAY_MAXDIM] int32_t nest_level = 0 int32_t item_level = 0 bint end_of_array = False bint end_of_item = False bint has_quoting = False bint strip_spaces = False bint in_quotes = False Py_UCS4 *item_start Py_UCS4 *item_ptr Py_UCS4 *item_end int i object item str item_text FRBuffer item_buf char *pg_item_str ssize_t pg_item_len ptr = array_text while True: while apg_ascii_isspace(ptr[0]): ptr += 1 if ptr[0] != '[': # Finished parsing dimensions spec. break ptr += 1 # '[' if ndims > ARRAY_MAXDIM: raise ValueError( 'number of array dimensions ({}) exceed the ' 'maximum expected ({})'.format(ndims, ARRAY_MAXDIM)) ptr = apg_parse_int32(ptr, &ubound) if ptr == NULL: raise ValueError('missing array dimension value') if ptr[0] == ':': ptr += 1 lbound = ubound # [lower:upper] spec. We disregard the lbound for decoding. ptr = apg_parse_int32(ptr, &ubound) if ptr == NULL: raise ValueError('missing array dimension value') else: lbound = 1 if ptr[0] != ']': raise ValueError('missing \']\' after array dimensions') ptr += 1 # ']' dims[ndims] = ubound - lbound + 1 ndims += 1 if ndims != 0: # If dimensions were given, the '=' token is expected. if ptr[0] != '=': raise ValueError('missing \'=\' after array dimensions') ptr += 1 # '=' # Skip any whitespace after the '=', whitespace # before was consumed in the above loop. while apg_ascii_isspace(ptr[0]): ptr += 1 # Infer the dimensions from the brace structure in the # array literal body, and check that it matches the explicit # spec. This also validates that the array literal is sane. _infer_array_dims(ptr, typdelim, inferred_dims, &inferred_ndims) if inferred_ndims != ndims: raise ValueError( 'specified array dimensions do not match array content') for i in range(ndims): if inferred_dims[i] != dims[i]: raise ValueError( 'specified array dimensions do not match array content') else: # Infer the dimensions from the brace structure in the array literal # body. This also validates that the array literal is sane. _infer_array_dims(ptr, typdelim, dims, &ndims) while not end_of_array: # We iterate over the literal character by character # and modify the string in-place removing the array-specific # quoting and determining the boundaries of each element. end_of_item = has_quoting = in_quotes = False strip_spaces = True # Pointers to array element start, end, and the current pointer # tracking the position where characters are written when # escaping is folded. item_start = item_end = item_ptr = ptr item_level = 0 while not end_of_item: if ptr[0] == '"': in_quotes = not in_quotes if in_quotes: strip_spaces = False else: item_end = item_ptr has_quoting = True elif ptr[0] == '\\': # Quoted character, collapse the backslash. ptr += 1 has_quoting = True item_ptr[0] = ptr[0] item_ptr += 1 strip_spaces = False item_end = item_ptr elif in_quotes: # Consume the string until we see the closing quote. item_ptr[0] = ptr[0] item_ptr += 1 elif ptr[0] == '{': # Nesting level increase. nest_level += 1 indexes[nest_level - 1] = 0 new_stride = cpython.PyList_New(dims[nest_level - 1]) strides[nest_level - 1] = \ (new_stride) if nest_level > 1: cpython.Py_INCREF(new_stride) cpython.PyList_SET_ITEM( strides[nest_level - 2], indexes[nest_level - 2], new_stride) else: result = new_stride elif ptr[0] == '}': if item_level == 0: # Make sure we keep track of which nesting # level the item belongs to, as the loop # will continue to consume closing braces # until the delimiter or the end of input. item_level = nest_level nest_level -= 1 if nest_level == 0: end_of_array = end_of_item = True elif ptr[0] == typdelim: # Array element delimiter, end_of_item = True if item_level == 0: item_level = nest_level elif apg_ascii_isspace(ptr[0]): if not strip_spaces: item_ptr[0] = ptr[0] item_ptr += 1 # Ignore the leading literal whitespace. else: item_ptr[0] = ptr[0] item_ptr += 1 strip_spaces = False item_end = item_ptr ptr += 1 # end while not end_of_item if item_end == item_start: # Empty array continue item_end[0] = '\0' if not has_quoting and apg_strcasecmp(item_start, APG_NULL) == 0: # NULL element. item = None else: # XXX: find a way to avoid the redundant encode/decode # cycle here. item_text = cpythonx.PyUnicode_FromKindAndData( cpythonx.PyUnicode_4BYTE_KIND, item_start, item_end - item_start) # Prepare the element buffer and call the text decoder # for the element type. pgproto.as_pg_string_and_size( settings, item_text, &pg_item_str, &pg_item_len) frb_init(&item_buf, pg_item_str, pg_item_len) item = decoder(settings, &item_buf, decoder_arg) # Place the decoded element in the array. cpython.Py_INCREF(item) cpython.PyList_SET_ITEM( strides[item_level - 1], indexes[item_level - 1], item) if nest_level > 0: indexes[nest_level - 1] += 1 return result cdef enum _ArrayParseState: APS_START = 1 APS_STRIDE_STARTED = 2 APS_STRIDE_DONE = 3 APS_STRIDE_DELIMITED = 4 APS_ELEM_STARTED = 5 APS_ELEM_DELIMITED = 6 cdef _UnexpectedCharacter(const Py_UCS4 *array_text, const Py_UCS4 *ptr): return ValueError('unexpected character {!r} at position {}'.format( cpython.PyUnicode_FromOrdinal(ptr[0]), ptr - array_text + 1)) cdef _infer_array_dims(const Py_UCS4 *array_text, Py_UCS4 typdelim, int32_t *dims, int32_t *ndims): cdef: const Py_UCS4 *ptr = array_text int i int nest_level = 0 bint end_of_array = False bint end_of_item = False bint in_quotes = False bint array_is_empty = True int stride_len[ARRAY_MAXDIM] int prev_stride_len[ARRAY_MAXDIM] _ArrayParseState parse_state = APS_START for i in range(ARRAY_MAXDIM): dims[i] = prev_stride_len[i] = 0 stride_len[i] = 1 while not end_of_array: end_of_item = False while not end_of_item: if ptr[0] == '\0': raise ValueError('unexpected end of string') elif ptr[0] == '"': if (parse_state not in (APS_STRIDE_STARTED, APS_ELEM_DELIMITED) and not (parse_state == APS_ELEM_STARTED and in_quotes)): raise _UnexpectedCharacter(array_text, ptr) in_quotes = not in_quotes if in_quotes: parse_state = APS_ELEM_STARTED array_is_empty = False elif ptr[0] == '\\': if parse_state not in (APS_STRIDE_STARTED, APS_ELEM_STARTED, APS_ELEM_DELIMITED): raise _UnexpectedCharacter(array_text, ptr) parse_state = APS_ELEM_STARTED array_is_empty = False if ptr[1] != '\0': ptr += 1 else: raise ValueError('unexpected end of string') elif in_quotes: # Ignore everything inside the quotes. pass elif ptr[0] == '{': if parse_state not in (APS_START, APS_STRIDE_STARTED, APS_STRIDE_DELIMITED): raise _UnexpectedCharacter(array_text, ptr) parse_state = APS_STRIDE_STARTED if nest_level >= ARRAY_MAXDIM: raise ValueError( 'number of array dimensions ({}) exceed the ' 'maximum expected ({})'.format( nest_level, ARRAY_MAXDIM)) dims[nest_level] = 0 nest_level += 1 if ndims[0] < nest_level: ndims[0] = nest_level elif ptr[0] == '}': if (parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE) and not (nest_level == 1 and parse_state == APS_STRIDE_STARTED)): raise _UnexpectedCharacter(array_text, ptr) parse_state = APS_STRIDE_DONE if nest_level == 0: raise _UnexpectedCharacter(array_text, ptr) nest_level -= 1 if (prev_stride_len[nest_level] != 0 and stride_len[nest_level] != prev_stride_len[nest_level]): raise ValueError( 'inconsistent sub-array dimensions' ' at position {}'.format( ptr - array_text + 1)) prev_stride_len[nest_level] = stride_len[nest_level] stride_len[nest_level] = 1 if nest_level == 0: end_of_array = end_of_item = True else: dims[nest_level - 1] += 1 elif ptr[0] == typdelim: if parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE): raise _UnexpectedCharacter(array_text, ptr) if parse_state == APS_STRIDE_DONE: parse_state = APS_STRIDE_DELIMITED else: parse_state = APS_ELEM_DELIMITED end_of_item = True stride_len[nest_level - 1] += 1 elif not apg_ascii_isspace(ptr[0]): if parse_state not in (APS_STRIDE_STARTED, APS_ELEM_STARTED, APS_ELEM_DELIMITED): raise _UnexpectedCharacter(array_text, ptr) parse_state = APS_ELEM_STARTED array_is_empty = False if not end_of_item: ptr += 1 if not array_is_empty: dims[ndims[0] - 1] += 1 ptr += 1 # only whitespace is allowed after the closing brace while ptr[0] != '\0': if not apg_ascii_isspace(ptr[0]): raise _UnexpectedCharacter(array_text, ptr) ptr += 1 if array_is_empty: ndims[0] = 0 cdef uint4_encode_ex(ConnectionSettings settings, WriteBuffer buf, object obj, const void *arg): return pgproto.uint4_encode(settings, buf, obj) cdef uint4_decode_ex(ConnectionSettings settings, FRBuffer *buf, const void *arg): return pgproto.uint4_decode(settings, buf) cdef arrayoid_encode(ConnectionSettings settings, WriteBuffer buf, items): array_encode(settings, buf, items, OIDOID, &uint4_encode_ex, NULL) cdef arrayoid_decode(ConnectionSettings settings, FRBuffer *buf): return array_decode(settings, buf, &uint4_decode_ex, NULL) cdef text_encode_ex(ConnectionSettings settings, WriteBuffer buf, object obj, const void *arg): return pgproto.text_encode(settings, buf, obj) cdef text_decode_ex(ConnectionSettings settings, FRBuffer *buf, const void *arg): return pgproto.text_decode(settings, buf) cdef arraytext_encode(ConnectionSettings settings, WriteBuffer buf, items): array_encode(settings, buf, items, TEXTOID, &text_encode_ex, NULL) cdef arraytext_decode(ConnectionSettings settings, FRBuffer *buf): return array_decode(settings, buf, &text_decode_ex, NULL) cdef init_array_codecs(): # oid[] and text[] are registered as core codecs # to make type introspection query work # register_core_codec(_OIDOID, &arrayoid_encode, &arrayoid_decode, PG_FORMAT_BINARY) register_core_codec(_TEXTOID, &arraytext_encode, &arraytext_decode, PG_FORMAT_BINARY) init_array_codecs() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/codecs/base.pxd0000644000175100001770000001412014705014413021034 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 ctypedef object (*encode_func)(ConnectionSettings settings, WriteBuffer buf, object obj) ctypedef object (*decode_func)(ConnectionSettings settings, FRBuffer *buf) ctypedef object (*codec_encode_func)(Codec codec, ConnectionSettings settings, WriteBuffer buf, object obj) ctypedef object (*codec_decode_func)(Codec codec, ConnectionSettings settings, FRBuffer *buf) cdef enum CodecType: CODEC_UNDEFINED = 0 CODEC_C = 1 CODEC_PY = 2 CODEC_ARRAY = 3 CODEC_COMPOSITE = 4 CODEC_RANGE = 5 CODEC_MULTIRANGE = 6 cdef enum ServerDataFormat: PG_FORMAT_ANY = -1 PG_FORMAT_TEXT = 0 PG_FORMAT_BINARY = 1 cdef enum ClientExchangeFormat: PG_XFORMAT_OBJECT = 1 PG_XFORMAT_TUPLE = 2 cdef class Codec: cdef: uint32_t oid str name str schema str kind CodecType type ServerDataFormat format ClientExchangeFormat xformat encode_func c_encoder decode_func c_decoder Codec base_codec object py_encoder object py_decoder # arrays Codec element_codec Py_UCS4 element_delimiter # composite types tuple element_type_oids object element_names object record_desc list element_codecs # Pointers to actual encoder/decoder functions for this codec codec_encode_func encoder codec_decode_func decoder cdef init(self, str name, str schema, str kind, CodecType type, ServerDataFormat format, ClientExchangeFormat xformat, encode_func c_encoder, decode_func c_decoder, Codec base_codec, object py_encoder, object py_decoder, Codec element_codec, tuple element_type_oids, object element_names, list element_codecs, Py_UCS4 element_delimiter) cdef encode_scalar(self, ConnectionSettings settings, WriteBuffer buf, object obj) cdef encode_array(self, ConnectionSettings settings, WriteBuffer buf, object obj) cdef encode_array_text(self, ConnectionSettings settings, WriteBuffer buf, object obj) cdef encode_range(self, ConnectionSettings settings, WriteBuffer buf, object obj) cdef encode_multirange(self, ConnectionSettings settings, WriteBuffer buf, object obj) cdef encode_composite(self, ConnectionSettings settings, WriteBuffer buf, object obj) cdef encode_in_python(self, ConnectionSettings settings, WriteBuffer buf, object obj) cdef decode_scalar(self, ConnectionSettings settings, FRBuffer *buf) cdef decode_array(self, ConnectionSettings settings, FRBuffer *buf) cdef decode_array_text(self, ConnectionSettings settings, FRBuffer *buf) cdef decode_range(self, ConnectionSettings settings, FRBuffer *buf) cdef decode_multirange(self, ConnectionSettings settings, FRBuffer *buf) cdef decode_composite(self, ConnectionSettings settings, FRBuffer *buf) cdef decode_in_python(self, ConnectionSettings settings, FRBuffer *buf) cdef inline encode(self, ConnectionSettings settings, WriteBuffer buf, object obj) cdef inline decode(self, ConnectionSettings settings, FRBuffer *buf) cdef has_encoder(self) cdef has_decoder(self) cdef is_binary(self) cdef inline Codec copy(self) @staticmethod cdef Codec new_array_codec(uint32_t oid, str name, str schema, Codec element_codec, Py_UCS4 element_delimiter) @staticmethod cdef Codec new_range_codec(uint32_t oid, str name, str schema, Codec element_codec) @staticmethod cdef Codec new_multirange_codec(uint32_t oid, str name, str schema, Codec element_codec) @staticmethod cdef Codec new_composite_codec(uint32_t oid, str name, str schema, ServerDataFormat format, list element_codecs, tuple element_type_oids, object element_names) @staticmethod cdef Codec new_python_codec(uint32_t oid, str name, str schema, str kind, object encoder, object decoder, encode_func c_encoder, decode_func c_decoder, Codec base_codec, ServerDataFormat format, ClientExchangeFormat xformat) cdef class DataCodecConfig: cdef: dict _derived_type_codecs dict _custom_type_codecs cdef inline Codec get_codec(self, uint32_t oid, ServerDataFormat format, bint ignore_custom_codec=*) cdef inline Codec get_custom_codec(self, uint32_t oid, ServerDataFormat format) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/codecs/base.pyx0000644000175100001770000010127014705014413021064 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 from collections.abc import Mapping as MappingABC import asyncpg from asyncpg import exceptions cdef void* binary_codec_map[(MAXSUPPORTEDOID + 1) * 2] cdef void* text_codec_map[(MAXSUPPORTEDOID + 1) * 2] cdef dict EXTRA_CODECS = {} @cython.final cdef class Codec: def __cinit__(self, uint32_t oid): self.oid = oid self.type = CODEC_UNDEFINED cdef init( self, str name, str schema, str kind, CodecType type, ServerDataFormat format, ClientExchangeFormat xformat, encode_func c_encoder, decode_func c_decoder, Codec base_codec, object py_encoder, object py_decoder, Codec element_codec, tuple element_type_oids, object element_names, list element_codecs, Py_UCS4 element_delimiter, ): self.name = name self.schema = schema self.kind = kind self.type = type self.format = format self.xformat = xformat self.c_encoder = c_encoder self.c_decoder = c_decoder self.base_codec = base_codec self.py_encoder = py_encoder self.py_decoder = py_decoder self.element_codec = element_codec self.element_type_oids = element_type_oids self.element_codecs = element_codecs self.element_delimiter = element_delimiter self.element_names = element_names if base_codec is not None: if c_encoder != NULL or c_decoder != NULL: raise exceptions.InternalClientError( 'base_codec is mutually exclusive with c_encoder/c_decoder' ) if element_names is not None: self.record_desc = record.ApgRecordDesc_New( element_names, tuple(element_names)) else: self.record_desc = None if type == CODEC_C: self.encoder = &self.encode_scalar self.decoder = &self.decode_scalar elif type == CODEC_ARRAY: if format == PG_FORMAT_BINARY: self.encoder = &self.encode_array self.decoder = &self.decode_array else: self.encoder = &self.encode_array_text self.decoder = &self.decode_array_text elif type == CODEC_RANGE: if format != PG_FORMAT_BINARY: raise exceptions.UnsupportedClientFeatureError( 'cannot decode type "{}"."{}": text encoding of ' 'range types is not supported'.format(schema, name)) self.encoder = &self.encode_range self.decoder = &self.decode_range elif type == CODEC_MULTIRANGE: if format != PG_FORMAT_BINARY: raise exceptions.UnsupportedClientFeatureError( 'cannot decode type "{}"."{}": text encoding of ' 'range types is not supported'.format(schema, name)) self.encoder = &self.encode_multirange self.decoder = &self.decode_multirange elif type == CODEC_COMPOSITE: if format != PG_FORMAT_BINARY: raise exceptions.UnsupportedClientFeatureError( 'cannot decode type "{}"."{}": text encoding of ' 'composite types is not supported'.format(schema, name)) self.encoder = &self.encode_composite self.decoder = &self.decode_composite elif type == CODEC_PY: self.encoder = &self.encode_in_python self.decoder = &self.decode_in_python else: raise exceptions.InternalClientError( 'unexpected codec type: {}'.format(type)) cdef Codec copy(self): cdef Codec codec codec = Codec(self.oid) codec.init(self.name, self.schema, self.kind, self.type, self.format, self.xformat, self.c_encoder, self.c_decoder, self.base_codec, self.py_encoder, self.py_decoder, self.element_codec, self.element_type_oids, self.element_names, self.element_codecs, self.element_delimiter) return codec cdef encode_scalar(self, ConnectionSettings settings, WriteBuffer buf, object obj): self.c_encoder(settings, buf, obj) cdef encode_array(self, ConnectionSettings settings, WriteBuffer buf, object obj): array_encode(settings, buf, obj, self.element_codec.oid, codec_encode_func_ex, (self.element_codec)) cdef encode_array_text(self, ConnectionSettings settings, WriteBuffer buf, object obj): return textarray_encode(settings, buf, obj, codec_encode_func_ex, (self.element_codec), self.element_delimiter) cdef encode_range(self, ConnectionSettings settings, WriteBuffer buf, object obj): range_encode(settings, buf, obj, self.element_codec.oid, codec_encode_func_ex, (self.element_codec)) cdef encode_multirange(self, ConnectionSettings settings, WriteBuffer buf, object obj): multirange_encode(settings, buf, obj, self.element_codec.oid, codec_encode_func_ex, (self.element_codec)) cdef encode_composite(self, ConnectionSettings settings, WriteBuffer buf, object obj): cdef: WriteBuffer elem_data int i list elem_codecs = self.element_codecs ssize_t count ssize_t composite_size tuple rec if isinstance(obj, MappingABC): # Input is dict-like, form a tuple composite_size = len(self.element_type_oids) rec = cpython.PyTuple_New(composite_size) for i in range(composite_size): cpython.Py_INCREF(None) cpython.PyTuple_SET_ITEM(rec, i, None) for field in obj: try: i = self.element_names[field] except KeyError: raise ValueError( '{!r} is not a valid element of composite ' 'type {}'.format(field, self.name)) from None item = obj[field] cpython.Py_INCREF(item) cpython.PyTuple_SET_ITEM(rec, i, item) obj = rec count = len(obj) if count > _MAXINT32: raise ValueError('too many elements in composite type record') elem_data = WriteBuffer.new() i = 0 for item in obj: elem_data.write_int32(self.element_type_oids[i]) if item is None: elem_data.write_int32(-1) else: (elem_codecs[i]).encode(settings, elem_data, item) i += 1 record_encode_frame(settings, buf, elem_data, count) cdef encode_in_python(self, ConnectionSettings settings, WriteBuffer buf, object obj): data = self.py_encoder(obj) if self.xformat == PG_XFORMAT_OBJECT: if self.format == PG_FORMAT_BINARY: pgproto.bytea_encode(settings, buf, data) elif self.format == PG_FORMAT_TEXT: pgproto.text_encode(settings, buf, data) else: raise exceptions.InternalClientError( 'unexpected data format: {}'.format(self.format)) elif self.xformat == PG_XFORMAT_TUPLE: if self.base_codec is not None: self.base_codec.encode(settings, buf, data) else: self.c_encoder(settings, buf, data) else: raise exceptions.InternalClientError( 'unexpected exchange format: {}'.format(self.xformat)) cdef encode(self, ConnectionSettings settings, WriteBuffer buf, object obj): return self.encoder(self, settings, buf, obj) cdef decode_scalar(self, ConnectionSettings settings, FRBuffer *buf): return self.c_decoder(settings, buf) cdef decode_array(self, ConnectionSettings settings, FRBuffer *buf): return array_decode(settings, buf, codec_decode_func_ex, (self.element_codec)) cdef decode_array_text(self, ConnectionSettings settings, FRBuffer *buf): return textarray_decode(settings, buf, codec_decode_func_ex, (self.element_codec), self.element_delimiter) cdef decode_range(self, ConnectionSettings settings, FRBuffer *buf): return range_decode(settings, buf, codec_decode_func_ex, (self.element_codec)) cdef decode_multirange(self, ConnectionSettings settings, FRBuffer *buf): return multirange_decode(settings, buf, codec_decode_func_ex, (self.element_codec)) cdef decode_composite(self, ConnectionSettings settings, FRBuffer *buf): cdef: object result ssize_t elem_count ssize_t i int32_t elem_len uint32_t elem_typ uint32_t received_elem_typ Codec elem_codec FRBuffer elem_buf elem_count = hton.unpack_int32(frb_read(buf, 4)) if elem_count != len(self.element_type_oids): raise exceptions.OutdatedSchemaCacheError( 'unexpected number of attributes of composite type: ' '{}, expected {}' .format( elem_count, len(self.element_type_oids), ), schema=self.schema, data_type=self.name, ) result = record.ApgRecord_New(asyncpg.Record, self.record_desc, elem_count) for i in range(elem_count): elem_typ = self.element_type_oids[i] received_elem_typ = hton.unpack_int32(frb_read(buf, 4)) if received_elem_typ != elem_typ: raise exceptions.OutdatedSchemaCacheError( 'unexpected data type of composite type attribute {}: ' '{!r}, expected {!r}' .format( i, BUILTIN_TYPE_OID_MAP.get( received_elem_typ, received_elem_typ), BUILTIN_TYPE_OID_MAP.get( elem_typ, elem_typ) ), schema=self.schema, data_type=self.name, position=i, ) elem_len = hton.unpack_int32(frb_read(buf, 4)) if elem_len == -1: elem = None else: elem_codec = self.element_codecs[i] elem = elem_codec.decode( settings, frb_slice_from(&elem_buf, buf, elem_len)) cpython.Py_INCREF(elem) record.ApgRecord_SET_ITEM(result, i, elem) return result cdef decode_in_python(self, ConnectionSettings settings, FRBuffer *buf): if self.xformat == PG_XFORMAT_OBJECT: if self.format == PG_FORMAT_BINARY: data = pgproto.bytea_decode(settings, buf) elif self.format == PG_FORMAT_TEXT: data = pgproto.text_decode(settings, buf) else: raise exceptions.InternalClientError( 'unexpected data format: {}'.format(self.format)) elif self.xformat == PG_XFORMAT_TUPLE: if self.base_codec is not None: data = self.base_codec.decode(settings, buf) else: data = self.c_decoder(settings, buf) else: raise exceptions.InternalClientError( 'unexpected exchange format: {}'.format(self.xformat)) return self.py_decoder(data) cdef inline decode(self, ConnectionSettings settings, FRBuffer *buf): return self.decoder(self, settings, buf) cdef inline has_encoder(self): cdef Codec elem_codec if self.c_encoder is not NULL or self.py_encoder is not None: return True elif ( self.type == CODEC_ARRAY or self.type == CODEC_RANGE or self.type == CODEC_MULTIRANGE ): return self.element_codec.has_encoder() elif self.type == CODEC_COMPOSITE: for elem_codec in self.element_codecs: if not elem_codec.has_encoder(): return False return True else: return False cdef has_decoder(self): cdef Codec elem_codec if self.c_decoder is not NULL or self.py_decoder is not None: return True elif ( self.type == CODEC_ARRAY or self.type == CODEC_RANGE or self.type == CODEC_MULTIRANGE ): return self.element_codec.has_decoder() elif self.type == CODEC_COMPOSITE: for elem_codec in self.element_codecs: if not elem_codec.has_decoder(): return False return True else: return False cdef is_binary(self): return self.format == PG_FORMAT_BINARY def __repr__(self): return ''.format( self.oid, 'NA' if self.element_codec is None else self.element_codec.oid, has_core_codec(self.oid)) @staticmethod cdef Codec new_array_codec(uint32_t oid, str name, str schema, Codec element_codec, Py_UCS4 element_delimiter): cdef Codec codec codec = Codec(oid) codec.init(name, schema, 'array', CODEC_ARRAY, element_codec.format, PG_XFORMAT_OBJECT, NULL, NULL, None, None, None, element_codec, None, None, None, element_delimiter) return codec @staticmethod cdef Codec new_range_codec(uint32_t oid, str name, str schema, Codec element_codec): cdef Codec codec codec = Codec(oid) codec.init(name, schema, 'range', CODEC_RANGE, element_codec.format, PG_XFORMAT_OBJECT, NULL, NULL, None, None, None, element_codec, None, None, None, 0) return codec @staticmethod cdef Codec new_multirange_codec(uint32_t oid, str name, str schema, Codec element_codec): cdef Codec codec codec = Codec(oid) codec.init(name, schema, 'multirange', CODEC_MULTIRANGE, element_codec.format, PG_XFORMAT_OBJECT, NULL, NULL, None, None, None, element_codec, None, None, None, 0) return codec @staticmethod cdef Codec new_composite_codec(uint32_t oid, str name, str schema, ServerDataFormat format, list element_codecs, tuple element_type_oids, object element_names): cdef Codec codec codec = Codec(oid) codec.init(name, schema, 'composite', CODEC_COMPOSITE, format, PG_XFORMAT_OBJECT, NULL, NULL, None, None, None, None, element_type_oids, element_names, element_codecs, 0) return codec @staticmethod cdef Codec new_python_codec(uint32_t oid, str name, str schema, str kind, object encoder, object decoder, encode_func c_encoder, decode_func c_decoder, Codec base_codec, ServerDataFormat format, ClientExchangeFormat xformat): cdef Codec codec codec = Codec(oid) codec.init(name, schema, kind, CODEC_PY, format, xformat, c_encoder, c_decoder, base_codec, encoder, decoder, None, None, None, None, 0) return codec # Encode callback for arrays cdef codec_encode_func_ex(ConnectionSettings settings, WriteBuffer buf, object obj, const void *arg): return (arg).encode(settings, buf, obj) # Decode callback for arrays cdef codec_decode_func_ex(ConnectionSettings settings, FRBuffer *buf, const void *arg): return (arg).decode(settings, buf) cdef uint32_t pylong_as_oid(val) except? 0xFFFFFFFFl: cdef: int64_t oid = 0 bint overflow = False try: oid = cpython.PyLong_AsLongLong(val) except OverflowError: overflow = True if overflow or (oid < 0 or oid > UINT32_MAX): raise OverflowError('OID value too large: {!r}'.format(val)) return val cdef class DataCodecConfig: def __init__(self): # Codec instance cache for derived types: # composites, arrays, ranges, domains and their combinations. self._derived_type_codecs = {} # Codec instances set up by the user for the connection. self._custom_type_codecs = {} def add_types(self, types): cdef: Codec elem_codec list comp_elem_codecs ServerDataFormat format ServerDataFormat elem_format bint has_text_elements Py_UCS4 elem_delim for ti in types: oid = ti['oid'] if self.get_codec(oid, PG_FORMAT_ANY) is not None: continue name = ti['name'] schema = ti['ns'] array_element_oid = ti['elemtype'] range_subtype_oid = ti['range_subtype'] if ti['attrtypoids']: comp_type_attrs = tuple(ti['attrtypoids']) else: comp_type_attrs = None base_type = ti['basetype'] if array_element_oid: # Array type (note, there is no separate 'kind' for arrays) # Canonicalize type name to "elemtype[]" if name.startswith('_'): name = name[1:] name = '{}[]'.format(name) elem_codec = self.get_codec(array_element_oid, PG_FORMAT_ANY) if elem_codec is None: elem_codec = self.declare_fallback_codec( array_element_oid, ti['elemtype_name'], schema) elem_delim = ti['elemdelim'][0] self._derived_type_codecs[oid, elem_codec.format] = \ Codec.new_array_codec( oid, name, schema, elem_codec, elem_delim) elif ti['kind'] == b'c': # Composite type if not comp_type_attrs: raise exceptions.InternalClientError( f'type record missing field types for composite {oid}') comp_elem_codecs = [] has_text_elements = False for typoid in comp_type_attrs: elem_codec = self.get_codec(typoid, PG_FORMAT_ANY) if elem_codec is None: raise exceptions.InternalClientError( f'no codec for composite attribute type {typoid}') if elem_codec.format is PG_FORMAT_TEXT: has_text_elements = True comp_elem_codecs.append(elem_codec) element_names = collections.OrderedDict() for i, attrname in enumerate(ti['attrnames']): element_names[attrname] = i # If at least one element is text-encoded, we must # encode the whole composite as text. if has_text_elements: elem_format = PG_FORMAT_TEXT else: elem_format = PG_FORMAT_BINARY self._derived_type_codecs[oid, elem_format] = \ Codec.new_composite_codec( oid, name, schema, elem_format, comp_elem_codecs, comp_type_attrs, element_names) elif ti['kind'] == b'd': # Domain type if not base_type: raise exceptions.InternalClientError( f'type record missing base type for domain {oid}') elem_codec = self.get_codec(base_type, PG_FORMAT_ANY) if elem_codec is None: elem_codec = self.declare_fallback_codec( base_type, ti['basetype_name'], schema) self._derived_type_codecs[oid, elem_codec.format] = elem_codec elif ti['kind'] == b'r': # Range type if not range_subtype_oid: raise exceptions.InternalClientError( f'type record missing base type for range {oid}') elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY) if elem_codec is None: elem_codec = self.declare_fallback_codec( range_subtype_oid, ti['range_subtype_name'], schema) self._derived_type_codecs[oid, elem_codec.format] = \ Codec.new_range_codec(oid, name, schema, elem_codec) elif ti['kind'] == b'm': # Multirange type if not range_subtype_oid: raise exceptions.InternalClientError( f'type record missing base type for multirange {oid}') elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY) if elem_codec is None: elem_codec = self.declare_fallback_codec( range_subtype_oid, ti['range_subtype_name'], schema) self._derived_type_codecs[oid, elem_codec.format] = \ Codec.new_multirange_codec(oid, name, schema, elem_codec) elif ti['kind'] == b'e': # Enum types are essentially text self._set_builtin_type_codec(oid, name, schema, 'scalar', TEXTOID, PG_FORMAT_ANY) else: self.declare_fallback_codec(oid, name, schema) def add_python_codec(self, typeoid, typename, typeschema, typekind, typeinfos, encoder, decoder, format, xformat): cdef: Codec core_codec = None encode_func c_encoder = NULL decode_func c_decoder = NULL Codec base_codec = None uint32_t oid = pylong_as_oid(typeoid) bint codec_set = False # Clear all previous overrides (this also clears type cache). self.remove_python_codec(typeoid, typename, typeschema) if typeinfos: self.add_types(typeinfos) if format == PG_FORMAT_ANY: formats = (PG_FORMAT_TEXT, PG_FORMAT_BINARY) else: formats = (format,) for fmt in formats: if xformat == PG_XFORMAT_TUPLE: if typekind == "scalar": core_codec = get_core_codec(oid, fmt, xformat) if core_codec is None: continue c_encoder = core_codec.c_encoder c_decoder = core_codec.c_decoder elif typekind == "composite": base_codec = self.get_codec(oid, fmt) if base_codec is None: continue self._custom_type_codecs[typeoid, fmt] = \ Codec.new_python_codec(oid, typename, typeschema, typekind, encoder, decoder, c_encoder, c_decoder, base_codec, fmt, xformat) codec_set = True if not codec_set: raise exceptions.InterfaceError( "{} type does not support the 'tuple' exchange format".format( typename)) def remove_python_codec(self, typeoid, typename, typeschema): for fmt in (PG_FORMAT_BINARY, PG_FORMAT_TEXT): self._custom_type_codecs.pop((typeoid, fmt), None) self.clear_type_cache() def _set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, alias_to, format=PG_FORMAT_ANY): cdef: Codec codec Codec target_codec uint32_t oid = pylong_as_oid(typeoid) uint32_t alias_oid = 0 bint codec_set = False if format == PG_FORMAT_ANY: formats = (PG_FORMAT_BINARY, PG_FORMAT_TEXT) else: formats = (format,) if isinstance(alias_to, int): alias_oid = pylong_as_oid(alias_to) else: alias_oid = BUILTIN_TYPE_NAME_MAP.get(alias_to, 0) for format in formats: if alias_oid != 0: target_codec = self.get_codec(alias_oid, format) else: target_codec = get_extra_codec(alias_to, format) if target_codec is None: continue codec = target_codec.copy() codec.oid = typeoid codec.name = typename codec.schema = typeschema codec.kind = typekind self._custom_type_codecs[typeoid, format] = codec codec_set = True if not codec_set: if format == PG_FORMAT_BINARY: codec_str = 'binary' elif format == PG_FORMAT_TEXT: codec_str = 'text' else: codec_str = 'text or binary' raise exceptions.InterfaceError( f'cannot alias {typename} to {alias_to}: ' f'there is no {codec_str} codec for {alias_to}') def set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, alias_to, format=PG_FORMAT_ANY): self._set_builtin_type_codec(typeoid, typename, typeschema, typekind, alias_to, format) self.clear_type_cache() def clear_type_cache(self): self._derived_type_codecs.clear() def declare_fallback_codec(self, uint32_t oid, str name, str schema): cdef Codec codec if oid <= MAXBUILTINOID: # This is a BKI type, for which asyncpg has no # defined codec. This should only happen for newly # added builtin types, for which this version of # asyncpg is lacking support. # raise exceptions.UnsupportedClientFeatureError( f'unhandled standard data type {name!r} (OID {oid})') else: # This is a non-BKI type, and as such, has no # stable OID, so no possibility of a builtin codec. # In this case, fallback to text format. Applications # can avoid this by specifying a codec for this type # using Connection.set_type_codec(). # self._set_builtin_type_codec(oid, name, schema, 'scalar', TEXTOID, PG_FORMAT_TEXT) codec = self.get_codec(oid, PG_FORMAT_TEXT) return codec cdef inline Codec get_codec(self, uint32_t oid, ServerDataFormat format, bint ignore_custom_codec=False): cdef Codec codec if format == PG_FORMAT_ANY: codec = self.get_codec( oid, PG_FORMAT_BINARY, ignore_custom_codec) if codec is None: codec = self.get_codec( oid, PG_FORMAT_TEXT, ignore_custom_codec) return codec else: if not ignore_custom_codec: codec = self.get_custom_codec(oid, PG_FORMAT_ANY) if codec is not None: if codec.format != format: # The codec for this OID has been overridden by # set_{builtin}_type_codec with a different format. # We must respect that and not return a core codec. return None else: return codec codec = get_core_codec(oid, format) if codec is not None: return codec else: try: return self._derived_type_codecs[oid, format] except KeyError: return None cdef inline Codec get_custom_codec( self, uint32_t oid, ServerDataFormat format ): cdef Codec codec if format == PG_FORMAT_ANY: codec = self.get_custom_codec(oid, PG_FORMAT_BINARY) if codec is None: codec = self.get_custom_codec(oid, PG_FORMAT_TEXT) else: codec = self._custom_type_codecs.get((oid, format)) return codec cdef inline Codec get_core_codec( uint32_t oid, ServerDataFormat format, ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): cdef: void *ptr = NULL if oid > MAXSUPPORTEDOID: return None if format == PG_FORMAT_BINARY: ptr = binary_codec_map[oid * xformat] elif format == PG_FORMAT_TEXT: ptr = text_codec_map[oid * xformat] if ptr is NULL: return None else: return ptr cdef inline Codec get_any_core_codec( uint32_t oid, ServerDataFormat format, ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): """A version of get_core_codec that accepts PG_FORMAT_ANY.""" cdef: Codec codec if format == PG_FORMAT_ANY: codec = get_core_codec(oid, PG_FORMAT_BINARY, xformat) if codec is None: codec = get_core_codec(oid, PG_FORMAT_TEXT, xformat) else: codec = get_core_codec(oid, format, xformat) return codec cdef inline int has_core_codec(uint32_t oid): return binary_codec_map[oid] != NULL or text_codec_map[oid] != NULL cdef register_core_codec(uint32_t oid, encode_func encode, decode_func decode, ServerDataFormat format, ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): if oid > MAXSUPPORTEDOID: raise exceptions.InternalClientError( 'cannot register core codec for OID {}: it is greater ' 'than MAXSUPPORTEDOID ({})'.format(oid, MAXSUPPORTEDOID)) cdef: Codec codec str name str kind name = BUILTIN_TYPE_OID_MAP[oid] kind = 'array' if oid in ARRAY_TYPES else 'scalar' codec = Codec(oid) codec.init(name, 'pg_catalog', kind, CODEC_C, format, xformat, encode, decode, None, None, None, None, None, None, None, 0) cpython.Py_INCREF(codec) # immortalize if format == PG_FORMAT_BINARY: binary_codec_map[oid * xformat] = codec elif format == PG_FORMAT_TEXT: text_codec_map[oid * xformat] = codec else: raise exceptions.InternalClientError( 'invalid data format: {}'.format(format)) cdef register_extra_codec(str name, encode_func encode, decode_func decode, ServerDataFormat format): cdef: Codec codec str kind kind = 'scalar' codec = Codec(INVALIDOID) codec.init(name, None, kind, CODEC_C, format, PG_XFORMAT_OBJECT, encode, decode, None, None, None, None, None, None, None, 0) EXTRA_CODECS[name, format] = codec cdef inline Codec get_extra_codec(str name, ServerDataFormat format): return EXTRA_CODECS.get((name, format)) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/codecs/pgproto.pyx0000644000175100001770000004142714705014413021653 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef init_bits_codecs(): register_core_codec(BITOID, pgproto.bits_encode, pgproto.bits_decode, PG_FORMAT_BINARY) register_core_codec(VARBITOID, pgproto.bits_encode, pgproto.bits_decode, PG_FORMAT_BINARY) cdef init_bytea_codecs(): register_core_codec(BYTEAOID, pgproto.bytea_encode, pgproto.bytea_decode, PG_FORMAT_BINARY) register_core_codec(CHAROID, pgproto.bytea_encode, pgproto.bytea_decode, PG_FORMAT_BINARY) cdef init_datetime_codecs(): register_core_codec(DATEOID, pgproto.date_encode, pgproto.date_decode, PG_FORMAT_BINARY) register_core_codec(DATEOID, pgproto.date_encode_tuple, pgproto.date_decode_tuple, PG_FORMAT_BINARY, PG_XFORMAT_TUPLE) register_core_codec(TIMEOID, pgproto.time_encode, pgproto.time_decode, PG_FORMAT_BINARY) register_core_codec(TIMEOID, pgproto.time_encode_tuple, pgproto.time_decode_tuple, PG_FORMAT_BINARY, PG_XFORMAT_TUPLE) register_core_codec(TIMETZOID, pgproto.timetz_encode, pgproto.timetz_decode, PG_FORMAT_BINARY) register_core_codec(TIMETZOID, pgproto.timetz_encode_tuple, pgproto.timetz_decode_tuple, PG_FORMAT_BINARY, PG_XFORMAT_TUPLE) register_core_codec(TIMESTAMPOID, pgproto.timestamp_encode, pgproto.timestamp_decode, PG_FORMAT_BINARY) register_core_codec(TIMESTAMPOID, pgproto.timestamp_encode_tuple, pgproto.timestamp_decode_tuple, PG_FORMAT_BINARY, PG_XFORMAT_TUPLE) register_core_codec(TIMESTAMPTZOID, pgproto.timestamptz_encode, pgproto.timestamptz_decode, PG_FORMAT_BINARY) register_core_codec(TIMESTAMPTZOID, pgproto.timestamp_encode_tuple, pgproto.timestamp_decode_tuple, PG_FORMAT_BINARY, PG_XFORMAT_TUPLE) register_core_codec(INTERVALOID, pgproto.interval_encode, pgproto.interval_decode, PG_FORMAT_BINARY) register_core_codec(INTERVALOID, pgproto.interval_encode_tuple, pgproto.interval_decode_tuple, PG_FORMAT_BINARY, PG_XFORMAT_TUPLE) # For obsolete abstime/reltime/tinterval, we do not bother to # interpret the value, and simply return and pass it as text. # register_core_codec(ABSTIMEOID, pgproto.text_encode, pgproto.text_decode, PG_FORMAT_TEXT) register_core_codec(RELTIMEOID, pgproto.text_encode, pgproto.text_decode, PG_FORMAT_TEXT) register_core_codec(TINTERVALOID, pgproto.text_encode, pgproto.text_decode, PG_FORMAT_TEXT) cdef init_float_codecs(): register_core_codec(FLOAT4OID, pgproto.float4_encode, pgproto.float4_decode, PG_FORMAT_BINARY) register_core_codec(FLOAT8OID, pgproto.float8_encode, pgproto.float8_decode, PG_FORMAT_BINARY) cdef init_geometry_codecs(): register_core_codec(BOXOID, pgproto.box_encode, pgproto.box_decode, PG_FORMAT_BINARY) register_core_codec(LINEOID, pgproto.line_encode, pgproto.line_decode, PG_FORMAT_BINARY) register_core_codec(LSEGOID, pgproto.lseg_encode, pgproto.lseg_decode, PG_FORMAT_BINARY) register_core_codec(POINTOID, pgproto.point_encode, pgproto.point_decode, PG_FORMAT_BINARY) register_core_codec(PATHOID, pgproto.path_encode, pgproto.path_decode, PG_FORMAT_BINARY) register_core_codec(POLYGONOID, pgproto.poly_encode, pgproto.poly_decode, PG_FORMAT_BINARY) register_core_codec(CIRCLEOID, pgproto.circle_encode, pgproto.circle_decode, PG_FORMAT_BINARY) cdef init_hstore_codecs(): register_extra_codec('pg_contrib.hstore', pgproto.hstore_encode, pgproto.hstore_decode, PG_FORMAT_BINARY) cdef init_json_codecs(): register_core_codec(JSONOID, pgproto.text_encode, pgproto.text_decode, PG_FORMAT_BINARY) register_core_codec(JSONBOID, pgproto.jsonb_encode, pgproto.jsonb_decode, PG_FORMAT_BINARY) register_core_codec(JSONPATHOID, pgproto.jsonpath_encode, pgproto.jsonpath_decode, PG_FORMAT_BINARY) cdef init_int_codecs(): register_core_codec(BOOLOID, pgproto.bool_encode, pgproto.bool_decode, PG_FORMAT_BINARY) register_core_codec(INT2OID, pgproto.int2_encode, pgproto.int2_decode, PG_FORMAT_BINARY) register_core_codec(INT4OID, pgproto.int4_encode, pgproto.int4_decode, PG_FORMAT_BINARY) register_core_codec(INT8OID, pgproto.int8_encode, pgproto.int8_decode, PG_FORMAT_BINARY) cdef init_pseudo_codecs(): # Void type is returned by SELECT void_returning_function() register_core_codec(VOIDOID, pgproto.void_encode, pgproto.void_decode, PG_FORMAT_BINARY) # Unknown type, always decoded as text register_core_codec(UNKNOWNOID, pgproto.text_encode, pgproto.text_decode, PG_FORMAT_TEXT) # OID and friends oid_types = [ OIDOID, XIDOID, CIDOID ] for oid_type in oid_types: register_core_codec(oid_type, pgproto.uint4_encode, pgproto.uint4_decode, PG_FORMAT_BINARY) # 64-bit OID types oid8_types = [ XID8OID, ] for oid_type in oid8_types: register_core_codec(oid_type, pgproto.uint8_encode, pgproto.uint8_decode, PG_FORMAT_BINARY) # reg* types -- these are really system catalog OIDs, but # allow the catalog object name as an input. We could just # decode these as OIDs, but handling them as text seems more # useful. # reg_types = [ REGPROCOID, REGPROCEDUREOID, REGOPEROID, REGOPERATOROID, REGCLASSOID, REGTYPEOID, REGCONFIGOID, REGDICTIONARYOID, REGNAMESPACEOID, REGROLEOID, REFCURSOROID, REGCOLLATIONOID, ] for reg_type in reg_types: register_core_codec(reg_type, pgproto.text_encode, pgproto.text_decode, PG_FORMAT_TEXT) # cstring type is used by Postgres' I/O functions register_core_codec(CSTRINGOID, pgproto.text_encode, pgproto.text_decode, PG_FORMAT_BINARY) # various system pseudotypes with no I/O no_io_types = [ ANYOID, TRIGGEROID, EVENT_TRIGGEROID, LANGUAGE_HANDLEROID, FDW_HANDLEROID, TSM_HANDLEROID, INTERNALOID, OPAQUEOID, ANYELEMENTOID, ANYNONARRAYOID, ANYCOMPATIBLEOID, ANYCOMPATIBLEARRAYOID, ANYCOMPATIBLENONARRAYOID, ANYCOMPATIBLERANGEOID, ANYCOMPATIBLEMULTIRANGEOID, ANYRANGEOID, ANYMULTIRANGEOID, ANYARRAYOID, PG_DDL_COMMANDOID, INDEX_AM_HANDLEROID, TABLE_AM_HANDLEROID, ] register_core_codec(ANYENUMOID, NULL, pgproto.text_decode, PG_FORMAT_TEXT) for no_io_type in no_io_types: register_core_codec(no_io_type, NULL, NULL, PG_FORMAT_BINARY) # ACL specification string register_core_codec(ACLITEMOID, pgproto.text_encode, pgproto.text_decode, PG_FORMAT_TEXT) # Postgres' serialized expression tree type register_core_codec(PG_NODE_TREEOID, NULL, pgproto.text_decode, PG_FORMAT_TEXT) # pg_lsn type -- a pointer to a location in the XLOG. register_core_codec(PG_LSNOID, pgproto.int8_encode, pgproto.int8_decode, PG_FORMAT_BINARY) register_core_codec(SMGROID, pgproto.text_encode, pgproto.text_decode, PG_FORMAT_TEXT) # pg_dependencies and pg_ndistinct are special types # used in pg_statistic_ext columns. register_core_codec(PG_DEPENDENCIESOID, pgproto.text_encode, pgproto.text_decode, PG_FORMAT_TEXT) register_core_codec(PG_NDISTINCTOID, pgproto.text_encode, pgproto.text_decode, PG_FORMAT_TEXT) # pg_mcv_list is a special type used in pg_statistic_ext_data # system catalog register_core_codec(PG_MCV_LISTOID, pgproto.bytea_encode, pgproto.bytea_decode, PG_FORMAT_BINARY) # These two are internal to BRIN index support and are unlikely # to be sent, but since I/O functions for these exist, add decoders # nonetheless. register_core_codec(PG_BRIN_BLOOM_SUMMARYOID, NULL, pgproto.bytea_decode, PG_FORMAT_BINARY) register_core_codec(PG_BRIN_MINMAX_MULTI_SUMMARYOID, NULL, pgproto.bytea_decode, PG_FORMAT_BINARY) cdef init_text_codecs(): textoids = [ NAMEOID, BPCHAROID, VARCHAROID, TEXTOID, XMLOID ] for oid in textoids: register_core_codec(oid, pgproto.text_encode, pgproto.text_decode, PG_FORMAT_BINARY) register_core_codec(oid, pgproto.text_encode, pgproto.text_decode, PG_FORMAT_TEXT) cdef init_tid_codecs(): register_core_codec(TIDOID, pgproto.tid_encode, pgproto.tid_decode, PG_FORMAT_BINARY) cdef init_txid_codecs(): register_core_codec(TXID_SNAPSHOTOID, pgproto.pg_snapshot_encode, pgproto.pg_snapshot_decode, PG_FORMAT_BINARY) register_core_codec(PG_SNAPSHOTOID, pgproto.pg_snapshot_encode, pgproto.pg_snapshot_decode, PG_FORMAT_BINARY) cdef init_tsearch_codecs(): ts_oids = [ TSQUERYOID, TSVECTOROID, ] for oid in ts_oids: register_core_codec(oid, pgproto.text_encode, pgproto.text_decode, PG_FORMAT_TEXT) register_core_codec(GTSVECTOROID, NULL, pgproto.text_decode, PG_FORMAT_TEXT) cdef init_uuid_codecs(): register_core_codec(UUIDOID, pgproto.uuid_encode, pgproto.uuid_decode, PG_FORMAT_BINARY) cdef init_numeric_codecs(): register_core_codec(NUMERICOID, pgproto.numeric_encode_text, pgproto.numeric_decode_text, PG_FORMAT_TEXT) register_core_codec(NUMERICOID, pgproto.numeric_encode_binary, pgproto.numeric_decode_binary, PG_FORMAT_BINARY) cdef init_network_codecs(): register_core_codec(CIDROID, pgproto.cidr_encode, pgproto.cidr_decode, PG_FORMAT_BINARY) register_core_codec(INETOID, pgproto.inet_encode, pgproto.inet_decode, PG_FORMAT_BINARY) register_core_codec(MACADDROID, pgproto.text_encode, pgproto.text_decode, PG_FORMAT_TEXT) register_core_codec(MACADDR8OID, pgproto.text_encode, pgproto.text_decode, PG_FORMAT_TEXT) cdef init_monetary_codecs(): moneyoids = [ MONEYOID, ] for oid in moneyoids: register_core_codec(oid, pgproto.text_encode, pgproto.text_decode, PG_FORMAT_TEXT) cdef init_all_pgproto_codecs(): # Builtin types, in lexicographical order. init_bits_codecs() init_bytea_codecs() init_datetime_codecs() init_float_codecs() init_geometry_codecs() init_int_codecs() init_json_codecs() init_monetary_codecs() init_network_codecs() init_numeric_codecs() init_text_codecs() init_tid_codecs() init_tsearch_codecs() init_txid_codecs() init_uuid_codecs() # Various pseudotypes and system types init_pseudo_codecs() # contrib init_hstore_codecs() init_all_pgproto_codecs() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/codecs/range.pyx0000644000175100001770000001432714705014413021254 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 from asyncpg import types as apg_types from collections.abc import Sequence as SequenceABC # defined in postgresql/src/include/utils/rangetypes.h DEF RANGE_EMPTY = 0x01 # range is empty DEF RANGE_LB_INC = 0x02 # lower bound is inclusive DEF RANGE_UB_INC = 0x04 # upper bound is inclusive DEF RANGE_LB_INF = 0x08 # lower bound is -infinity DEF RANGE_UB_INF = 0x10 # upper bound is +infinity cdef enum _RangeArgumentType: _RANGE_ARGUMENT_INVALID = 0 _RANGE_ARGUMENT_TUPLE = 1 _RANGE_ARGUMENT_RANGE = 2 cdef inline bint _range_has_lbound(uint8_t flags): return not (flags & (RANGE_EMPTY | RANGE_LB_INF)) cdef inline bint _range_has_ubound(uint8_t flags): return not (flags & (RANGE_EMPTY | RANGE_UB_INF)) cdef inline _RangeArgumentType _range_type(object obj): if cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj): return _RANGE_ARGUMENT_TUPLE elif isinstance(obj, apg_types.Range): return _RANGE_ARGUMENT_RANGE else: return _RANGE_ARGUMENT_INVALID cdef range_encode(ConnectionSettings settings, WriteBuffer buf, object obj, uint32_t elem_oid, encode_func_ex encoder, const void *encoder_arg): cdef: ssize_t obj_len uint8_t flags = 0 object lower = None object upper = None WriteBuffer bounds_data = WriteBuffer.new() _RangeArgumentType arg_type = _range_type(obj) if arg_type == _RANGE_ARGUMENT_INVALID: raise TypeError( 'list, tuple or Range object expected (got type {})'.format( type(obj))) elif arg_type == _RANGE_ARGUMENT_TUPLE: obj_len = len(obj) if obj_len == 2: lower = obj[0] upper = obj[1] if lower is None: flags |= RANGE_LB_INF if upper is None: flags |= RANGE_UB_INF flags |= RANGE_LB_INC | RANGE_UB_INC elif obj_len == 1: lower = obj[0] flags |= RANGE_LB_INC | RANGE_UB_INF elif obj_len == 0: flags |= RANGE_EMPTY else: raise ValueError( 'expected 0, 1 or 2 elements in range (got {})'.format( obj_len)) else: if obj.isempty: flags |= RANGE_EMPTY else: lower = obj.lower upper = obj.upper if obj.lower_inc: flags |= RANGE_LB_INC elif lower is None: flags |= RANGE_LB_INF if obj.upper_inc: flags |= RANGE_UB_INC elif upper is None: flags |= RANGE_UB_INF if _range_has_lbound(flags): encoder(settings, bounds_data, lower, encoder_arg) if _range_has_ubound(flags): encoder(settings, bounds_data, upper, encoder_arg) buf.write_int32(1 + bounds_data.len()) buf.write_byte(flags) buf.write_buffer(bounds_data) cdef range_decode(ConnectionSettings settings, FRBuffer *buf, decode_func_ex decoder, const void *decoder_arg): cdef: uint8_t flags = frb_read(buf, 1)[0] int32_t bound_len object lower = None object upper = None FRBuffer bound_buf if _range_has_lbound(flags): bound_len = hton.unpack_int32(frb_read(buf, 4)) if bound_len == -1: lower = None else: frb_slice_from(&bound_buf, buf, bound_len) lower = decoder(settings, &bound_buf, decoder_arg) if _range_has_ubound(flags): bound_len = hton.unpack_int32(frb_read(buf, 4)) if bound_len == -1: upper = None else: frb_slice_from(&bound_buf, buf, bound_len) upper = decoder(settings, &bound_buf, decoder_arg) return apg_types.Range(lower=lower, upper=upper, lower_inc=(flags & RANGE_LB_INC) != 0, upper_inc=(flags & RANGE_UB_INC) != 0, empty=(flags & RANGE_EMPTY) != 0) cdef multirange_encode(ConnectionSettings settings, WriteBuffer buf, object obj, uint32_t elem_oid, encode_func_ex encoder, const void *encoder_arg): cdef: WriteBuffer elem_data ssize_t elem_data_len ssize_t elem_count if not isinstance(obj, SequenceABC): raise TypeError( 'expected a sequence (got type {!r})'.format(type(obj).__name__) ) elem_data = WriteBuffer.new() for elem in obj: range_encode(settings, elem_data, elem, elem_oid, encoder, encoder_arg) elem_count = len(obj) if elem_count > INT32_MAX: raise OverflowError(f'too many elements in multirange value') elem_data_len = elem_data.len() if elem_data_len > INT32_MAX - 4: raise OverflowError( f'size of encoded multirange datum exceeds the maximum allowed' f' {INT32_MAX - 4} bytes') # Datum length buf.write_int32(4 + elem_data_len) # Number of elements in multirange buf.write_int32(elem_count) buf.write_buffer(elem_data) cdef multirange_decode(ConnectionSettings settings, FRBuffer *buf, decode_func_ex decoder, const void *decoder_arg): cdef: int32_t nelems = hton.unpack_int32(frb_read(buf, 4)) FRBuffer elem_buf int32_t elem_len int i list result if nelems == 0: return [] if nelems < 0: raise exceptions.ProtocolError( 'unexpected multirange size value: {}'.format(nelems)) result = cpython.PyList_New(nelems) for i in range(nelems): elem_len = hton.unpack_int32(frb_read(buf, 4)) if elem_len == -1: raise exceptions.ProtocolError( 'unexpected NULL element in multirange value') else: frb_slice_from(&elem_buf, buf, elem_len) elem = range_decode(settings, &elem_buf, decoder, decoder_arg) cpython.Py_INCREF(elem) cpython.PyList_SET_ITEM(result, i, elem) return result ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/codecs/record.pyx0000644000175100001770000000447214705014413021436 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 from asyncpg import exceptions cdef inline record_encode_frame(ConnectionSettings settings, WriteBuffer buf, WriteBuffer elem_data, int32_t elem_count): buf.write_int32(4 + elem_data.len()) # attribute count buf.write_int32(elem_count) # encoded attribute data buf.write_buffer(elem_data) cdef anonymous_record_decode(ConnectionSettings settings, FRBuffer *buf): cdef: tuple result ssize_t elem_count ssize_t i int32_t elem_len uint32_t elem_typ Codec elem_codec FRBuffer elem_buf elem_count = hton.unpack_int32(frb_read(buf, 4)) result = cpython.PyTuple_New(elem_count) for i in range(elem_count): elem_typ = hton.unpack_int32(frb_read(buf, 4)) elem_len = hton.unpack_int32(frb_read(buf, 4)) if elem_len == -1: elem = None else: elem_codec = settings.get_data_codec(elem_typ) if elem_codec is None or not elem_codec.has_decoder(): raise exceptions.InternalClientError( 'no decoder for composite type element in ' 'position {} of type OID {}'.format(i, elem_typ)) elem = elem_codec.decode(settings, frb_slice_from(&elem_buf, buf, elem_len)) cpython.Py_INCREF(elem) cpython.PyTuple_SET_ITEM(result, i, elem) return result cdef anonymous_record_encode(ConnectionSettings settings, WriteBuffer buf, obj): raise exceptions.UnsupportedClientFeatureError( 'input of anonymous composite types is not supported', hint=( 'Consider declaring an explicit composite type and ' 'using it to cast the argument.' ), detail='PostgreSQL does not implement anonymous composite type input.' ) cdef init_record_codecs(): register_core_codec(RECORDOID, anonymous_record_encode, anonymous_record_decode, PG_FORMAT_BINARY) init_record_codecs() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/codecs/textutils.pyx0000644000175100001770000000373314705014413022224 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef inline uint32_t _apg_tolower(uint32_t c): if c >= 'A' and c <= 'Z': return c + 'a' - 'A' else: return c cdef int apg_strcasecmp(const Py_UCS4 *s1, const Py_UCS4 *s2): cdef: uint32_t c1 uint32_t c2 int i = 0 while True: c1 = s1[i] c2 = s2[i] if c1 != c2: c1 = _apg_tolower(c1) c2 = _apg_tolower(c2) if c1 != c2: return c1 - c2 if c1 == 0 or c2 == 0: break i += 1 return 0 cdef int apg_strcasecmp_char(const char *s1, const char *s2): cdef: uint8_t c1 uint8_t c2 int i = 0 while True: c1 = s1[i] c2 = s2[i] if c1 != c2: c1 = _apg_tolower(c1) c2 = _apg_tolower(c2) if c1 != c2: return c1 - c2 if c1 == 0 or c2 == 0: break i += 1 return 0 cdef inline bint apg_ascii_isspace(Py_UCS4 ch): return ( ch == ' ' or ch == '\n' or ch == '\r' or ch == '\t' or ch == '\v' or ch == '\f' ) cdef Py_UCS4 *apg_parse_int32(Py_UCS4 *buf, int32_t *num): cdef: Py_UCS4 *p int32_t n = 0 int32_t neg = 0 if buf[0] == '-': neg = 1 buf += 1 elif buf[0] == '+': buf += 1 p = buf while p[0] >= '0' and p[0] <= '9': n = 10 * n - (p[0] - '0') p += 1 if p == buf: return NULL if not neg: n = -n num[0] = n return p ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/consts.pxi0000644000175100001770000000057514705014413020211 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 DEF _MAXINT32 = 2**31 - 1 DEF _COPY_BUFFER_SIZE = 524288 DEF _COPY_SIGNATURE = b"PGCOPY\n\377\r\n\0" DEF _EXECUTE_MANY_BUF_NUM = 4 DEF _EXECUTE_MANY_BUF_SIZE = 32768 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/coreproto.pxd0000644000175100001770000001410714705014413020703 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 include "scram.pxd" cdef enum ConnectionStatus: CONNECTION_OK = 1 CONNECTION_BAD = 2 CONNECTION_STARTED = 3 # Waiting for connection to be made. cdef enum ProtocolState: PROTOCOL_IDLE = 0 PROTOCOL_FAILED = 1 PROTOCOL_ERROR_CONSUME = 2 PROTOCOL_CANCELLED = 3 PROTOCOL_TERMINATING = 4 PROTOCOL_AUTH = 10 PROTOCOL_PREPARE = 11 PROTOCOL_BIND_EXECUTE = 12 PROTOCOL_BIND_EXECUTE_MANY = 13 PROTOCOL_CLOSE_STMT_PORTAL = 14 PROTOCOL_SIMPLE_QUERY = 15 PROTOCOL_EXECUTE = 16 PROTOCOL_BIND = 17 PROTOCOL_COPY_OUT = 18 PROTOCOL_COPY_OUT_DATA = 19 PROTOCOL_COPY_OUT_DONE = 20 PROTOCOL_COPY_IN = 21 PROTOCOL_COPY_IN_DATA = 22 cdef enum AuthenticationMessage: AUTH_SUCCESSFUL = 0 AUTH_REQUIRED_KERBEROS = 2 AUTH_REQUIRED_PASSWORD = 3 AUTH_REQUIRED_PASSWORDMD5 = 5 AUTH_REQUIRED_SCMCRED = 6 AUTH_REQUIRED_GSS = 7 AUTH_REQUIRED_GSS_CONTINUE = 8 AUTH_REQUIRED_SSPI = 9 AUTH_REQUIRED_SASL = 10 AUTH_SASL_CONTINUE = 11 AUTH_SASL_FINAL = 12 cdef enum ResultType: RESULT_OK = 1 RESULT_FAILED = 2 cdef enum TransactionStatus: PQTRANS_IDLE = 0 # connection idle PQTRANS_ACTIVE = 1 # command in progress PQTRANS_INTRANS = 2 # idle, within transaction block PQTRANS_INERROR = 3 # idle, within failed transaction PQTRANS_UNKNOWN = 4 # cannot determine status ctypedef object (*decode_row_method)(object, const char*, ssize_t) cdef class CoreProtocol: cdef: ReadBuffer buffer bint _skip_discard bint _discard_data # executemany support data object _execute_iter str _execute_portal_name str _execute_stmt_name ConnectionStatus con_status ProtocolState state TransactionStatus xact_status str encoding object transport object address # Instance of _ConnectionParameters object con_params # Instance of SCRAMAuthentication SCRAMAuthentication scram # Instance of gssapi.SecurityContext or sspilib.SecurityContext object gss_ctx readonly int32_t backend_pid readonly int32_t backend_secret ## Result ResultType result_type object result bytes result_param_desc bytes result_row_desc bytes result_status_msg # True - completed, False - suspended bint result_execute_completed cpdef is_in_transaction(self) cdef _process__auth(self, char mtype) cdef _process__prepare(self, char mtype) cdef _process__bind_execute(self, char mtype) cdef _process__bind_execute_many(self, char mtype) cdef _process__close_stmt_portal(self, char mtype) cdef _process__simple_query(self, char mtype) cdef _process__bind(self, char mtype) cdef _process__copy_out(self, char mtype) cdef _process__copy_out_data(self, char mtype) cdef _process__copy_in(self, char mtype) cdef _process__copy_in_data(self, char mtype) cdef _parse_msg_authentication(self) cdef _parse_msg_parameter_status(self) cdef _parse_msg_notification(self) cdef _parse_msg_backend_key_data(self) cdef _parse_msg_ready_for_query(self) cdef _parse_data_msgs(self) cdef _parse_copy_data_msgs(self) cdef _parse_msg_error_response(self, is_error) cdef _parse_msg_command_complete(self) cdef _write_copy_data_msg(self, object data) cdef _write_copy_done_msg(self) cdef _write_copy_fail_msg(self, str cause) cdef _auth_password_message_cleartext(self) cdef _auth_password_message_md5(self, bytes salt) cdef _auth_password_message_sasl_initial(self, list sasl_auth_methods) cdef _auth_password_message_sasl_continue(self, bytes server_response) cdef _auth_gss_init_gssapi(self) cdef _auth_gss_init_sspi(self, bint negotiate) cdef _auth_gss_get_service(self) cdef _auth_gss_step(self, bytes server_response) cdef _write(self, buf) cdef _writelines(self, list buffers) cdef _read_server_messages(self) cdef _push_result(self) cdef _reset_result(self) cdef _set_state(self, ProtocolState new_state) cdef _ensure_connected(self) cdef WriteBuffer _build_parse_message(self, str stmt_name, str query) cdef WriteBuffer _build_bind_message(self, str portal_name, str stmt_name, WriteBuffer bind_data) cdef WriteBuffer _build_empty_bind_data(self) cdef WriteBuffer _build_execute_message(self, str portal_name, int32_t limit) cdef _connect(self) cdef _prepare_and_describe(self, str stmt_name, str query) cdef _send_parse_message(self, str stmt_name, str query) cdef _send_bind_message(self, str portal_name, str stmt_name, WriteBuffer bind_data, int32_t limit) cdef _bind_execute(self, str portal_name, str stmt_name, WriteBuffer bind_data, int32_t limit) cdef bint _bind_execute_many(self, str portal_name, str stmt_name, object bind_data, bint return_rows) cdef bint _bind_execute_many_more(self, bint first=*) cdef _bind_execute_many_fail(self, object error, bint first=*) cdef _bind(self, str portal_name, str stmt_name, WriteBuffer bind_data) cdef _execute(self, str portal_name, int32_t limit) cdef _close(self, str name, bint is_portal) cdef _simple_query(self, str query) cdef _copy_out(self, str copy_stmt) cdef _copy_in(self, str copy_stmt) cdef _terminate(self) cdef _decode_row(self, const char* buf, ssize_t buf_len) cdef _on_result(self) cdef _on_notification(self, pid, channel, payload) cdef _on_notice(self, parsed) cdef _set_server_parameter(self, name, val) cdef _on_connection_lost(self, exc) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/coreproto.pyx0000644000175100001770000012011514705014413020725 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import hashlib include "scram.pyx" cdef dict AUTH_METHOD_NAME = { AUTH_REQUIRED_KERBEROS: 'kerberosv5', AUTH_REQUIRED_PASSWORD: 'password', AUTH_REQUIRED_PASSWORDMD5: 'md5', AUTH_REQUIRED_GSS: 'gss', AUTH_REQUIRED_SASL: 'scram-sha-256', AUTH_REQUIRED_SSPI: 'sspi', } cdef class CoreProtocol: def __init__(self, addr, con_params): self.address = addr # type of `con_params` is `_ConnectionParameters` self.buffer = ReadBuffer() self.user = con_params.user self.password = con_params.password self.auth_msg = None self.con_params = con_params self.con_status = CONNECTION_BAD self.state = PROTOCOL_IDLE self.xact_status = PQTRANS_IDLE self.encoding = 'utf-8' # type of `scram` is `SCRAMAuthentcation` self.scram = None # type of `gss_ctx` is `gssapi.SecurityContext` or # `sspilib.SecurityContext` self.gss_ctx = None self._reset_result() cpdef is_in_transaction(self): # PQTRANS_INTRANS = idle, within transaction block # PQTRANS_INERROR = idle, within failed transaction return self.xact_status in (PQTRANS_INTRANS, PQTRANS_INERROR) cdef _read_server_messages(self): cdef: char mtype ProtocolState state pgproto.take_message_method take_message = \ self.buffer.take_message pgproto.get_message_type_method get_message_type= \ self.buffer.get_message_type while take_message(self.buffer) == 1: mtype = get_message_type(self.buffer) state = self.state try: if mtype == b'S': # ParameterStatus self._parse_msg_parameter_status() elif mtype == b'A': # NotificationResponse self._parse_msg_notification() elif mtype == b'N': # 'N' - NoticeResponse self._on_notice(self._parse_msg_error_response(False)) elif state == PROTOCOL_AUTH: self._process__auth(mtype) elif state == PROTOCOL_PREPARE: self._process__prepare(mtype) elif state == PROTOCOL_BIND_EXECUTE: self._process__bind_execute(mtype) elif state == PROTOCOL_BIND_EXECUTE_MANY: self._process__bind_execute_many(mtype) elif state == PROTOCOL_EXECUTE: self._process__bind_execute(mtype) elif state == PROTOCOL_BIND: self._process__bind(mtype) elif state == PROTOCOL_CLOSE_STMT_PORTAL: self._process__close_stmt_portal(mtype) elif state == PROTOCOL_SIMPLE_QUERY: self._process__simple_query(mtype) elif state == PROTOCOL_COPY_OUT: self._process__copy_out(mtype) elif (state == PROTOCOL_COPY_OUT_DATA or state == PROTOCOL_COPY_OUT_DONE): self._process__copy_out_data(mtype) elif state == PROTOCOL_COPY_IN: self._process__copy_in(mtype) elif state == PROTOCOL_COPY_IN_DATA: self._process__copy_in_data(mtype) elif state == PROTOCOL_CANCELLED: # discard all messages until the sync message if mtype == b'E': self._parse_msg_error_response(True) elif mtype == b'Z': self._parse_msg_ready_for_query() self._push_result() else: self.buffer.discard_message() elif state == PROTOCOL_ERROR_CONSUME: # Error in protocol (on asyncpg side); # discard all messages until sync message if mtype == b'Z': # Sync point, self to push the result if self.result_type != RESULT_FAILED: self.result_type = RESULT_FAILED self.result = apg_exc.InternalClientError( 'unknown error in protocol implementation') self._parse_msg_ready_for_query() self._push_result() else: self.buffer.discard_message() elif state == PROTOCOL_TERMINATING: # The connection is being terminated. # discard all messages until connection # termination. self.buffer.discard_message() else: raise apg_exc.InternalClientError( f'cannot process message {chr(mtype)!r}: ' f'protocol is in an unexpected state {state!r}.') except Exception as ex: self.result_type = RESULT_FAILED self.result = ex if mtype == b'Z': self._push_result() else: self.state = PROTOCOL_ERROR_CONSUME finally: self.buffer.finish_message() cdef _process__auth(self, char mtype): if mtype == b'R': # Authentication... try: self._parse_msg_authentication() except Exception as ex: # Exception in authentication parsing code # is usually either malformed authentication data # or missing support for cryptographic primitives # in the hashlib module. self.result_type = RESULT_FAILED self.result = apg_exc.InternalClientError( f"unexpected error while performing authentication: {ex}") self.result.__cause__ = ex self.con_status = CONNECTION_BAD self._push_result() else: if self.result_type != RESULT_OK: self.con_status = CONNECTION_BAD self._push_result() elif self.auth_msg is not None: # Server wants us to send auth data, so do that. self._write(self.auth_msg) self.auth_msg = None elif mtype == b'K': # BackendKeyData self._parse_msg_backend_key_data() elif mtype == b'E': # ErrorResponse self.con_status = CONNECTION_BAD self._parse_msg_error_response(True) self._push_result() elif mtype == b'Z': # ReadyForQuery self._parse_msg_ready_for_query() self.con_status = CONNECTION_OK self._push_result() cdef _process__prepare(self, char mtype): if mtype == b't': # Parameters description self.result_param_desc = self.buffer.consume_message() elif mtype == b'1': # ParseComplete self.buffer.discard_message() elif mtype == b'T': # Row description self.result_row_desc = self.buffer.consume_message() self._push_result() elif mtype == b'E': # ErrorResponse self._parse_msg_error_response(True) # we don't send a sync during the parse/describe sequence # but send a FLUSH instead. If an error happens we need to # send a SYNC explicitly in order to mark the end of the transaction. # this effectively clears the error and we then wait until we get a # ready for new query message self._write(SYNC_MESSAGE) self.state = PROTOCOL_ERROR_CONSUME elif mtype == b'n': # NoData self.buffer.discard_message() self._push_result() cdef _process__bind_execute(self, char mtype): if mtype == b'D': # DataRow self._parse_data_msgs() elif mtype == b's': # PortalSuspended self.buffer.discard_message() elif mtype == b'C': # CommandComplete self.result_execute_completed = True self._parse_msg_command_complete() elif mtype == b'E': # ErrorResponse self._parse_msg_error_response(True) elif mtype == b'1': # ParseComplete, in case `_bind_execute()` is reparsing self.buffer.discard_message() elif mtype == b'2': # BindComplete self.buffer.discard_message() elif mtype == b'Z': # ReadyForQuery self._parse_msg_ready_for_query() self._push_result() elif mtype == b'I': # EmptyQueryResponse self.buffer.discard_message() cdef _process__bind_execute_many(self, char mtype): cdef WriteBuffer buf if mtype == b'D': # DataRow self._parse_data_msgs() elif mtype == b's': # PortalSuspended self.buffer.discard_message() elif mtype == b'C': # CommandComplete self._parse_msg_command_complete() elif mtype == b'E': # ErrorResponse self._parse_msg_error_response(True) elif mtype == b'1': # ParseComplete, in case `_bind_execute_many()` is reparsing self.buffer.discard_message() elif mtype == b'2': # BindComplete self.buffer.discard_message() elif mtype == b'Z': # ReadyForQuery self._parse_msg_ready_for_query() self._push_result() elif mtype == b'I': # EmptyQueryResponse self.buffer.discard_message() elif mtype == b'1': # ParseComplete self.buffer.discard_message() cdef _process__bind(self, char mtype): if mtype == b'E': # ErrorResponse self._parse_msg_error_response(True) elif mtype == b'2': # BindComplete self.buffer.discard_message() elif mtype == b'Z': # ReadyForQuery self._parse_msg_ready_for_query() self._push_result() cdef _process__close_stmt_portal(self, char mtype): if mtype == b'E': # ErrorResponse self._parse_msg_error_response(True) elif mtype == b'3': # CloseComplete self.buffer.discard_message() elif mtype == b'Z': # ReadyForQuery self._parse_msg_ready_for_query() self._push_result() cdef _process__simple_query(self, char mtype): if mtype in {b'D', b'I', b'T'}: # 'D' - DataRow # 'I' - EmptyQueryResponse # 'T' - RowDescription self.buffer.discard_message() elif mtype == b'E': # ErrorResponse self._parse_msg_error_response(True) elif mtype == b'Z': # ReadyForQuery self._parse_msg_ready_for_query() self._push_result() elif mtype == b'C': # CommandComplete self._parse_msg_command_complete() else: # We don't really care about COPY IN etc self.buffer.discard_message() cdef _process__copy_out(self, char mtype): if mtype == b'E': self._parse_msg_error_response(True) elif mtype == b'H': # CopyOutResponse self._set_state(PROTOCOL_COPY_OUT_DATA) self.buffer.discard_message() elif mtype == b'Z': # ReadyForQuery self._parse_msg_ready_for_query() self._push_result() cdef _process__copy_out_data(self, char mtype): if mtype == b'E': self._parse_msg_error_response(True) elif mtype == b'd': # CopyData self._parse_copy_data_msgs() elif mtype == b'c': # CopyDone self.buffer.discard_message() self._set_state(PROTOCOL_COPY_OUT_DONE) elif mtype == b'C': # CommandComplete self._parse_msg_command_complete() elif mtype == b'Z': # ReadyForQuery self._parse_msg_ready_for_query() self._push_result() cdef _process__copy_in(self, char mtype): if mtype == b'E': self._parse_msg_error_response(True) elif mtype == b'G': # CopyInResponse self._set_state(PROTOCOL_COPY_IN_DATA) self.buffer.discard_message() elif mtype == b'Z': # ReadyForQuery self._parse_msg_ready_for_query() self._push_result() cdef _process__copy_in_data(self, char mtype): if mtype == b'E': self._parse_msg_error_response(True) elif mtype == b'C': # CommandComplete self._parse_msg_command_complete() elif mtype == b'Z': # ReadyForQuery self._parse_msg_ready_for_query() self._push_result() cdef _parse_msg_command_complete(self): cdef: const char* cbuf ssize_t cbuf_len cbuf = self.buffer.try_consume_message(&cbuf_len) if cbuf != NULL and cbuf_len > 0: msg = cpython.PyBytes_FromStringAndSize(cbuf, cbuf_len - 1) else: msg = self.buffer.read_null_str() self.result_status_msg = msg cdef _parse_copy_data_msgs(self): cdef: ReadBuffer buf = self.buffer self.result = buf.consume_messages(b'd') # By this point we have consumed all CopyData messages # in the inbound buffer. If there are no messages left # in the buffer, we need to push the accumulated data # out to the caller in anticipation of the new CopyData # batch. If there _are_ non-CopyData messages left, # we must not push the result here and let the # _process__copy_out_data subprotocol do the job. if not buf.take_message(): self._on_result() self.result = None else: # If there is a message in the buffer, put it back to # be processed by the next protocol iteration. buf.put_message() cdef _write_copy_data_msg(self, object data): cdef: WriteBuffer buf object mview Py_buffer *pybuf mview = cpythonx.PyMemoryView_GetContiguous( data, cpython.PyBUF_READ, b'C') try: pybuf = cpythonx.PyMemoryView_GET_BUFFER(mview) buf = WriteBuffer.new_message(b'd') buf.write_cstr(pybuf.buf, pybuf.len) buf.end_message() finally: mview.release() self._write(buf) cdef _write_copy_done_msg(self): cdef: WriteBuffer buf buf = WriteBuffer.new_message(b'c') buf.end_message() self._write(buf) cdef _write_copy_fail_msg(self, str cause): cdef: WriteBuffer buf buf = WriteBuffer.new_message(b'f') buf.write_str(cause or '', self.encoding) buf.end_message() self._write(buf) cdef _parse_data_msgs(self): cdef: ReadBuffer buf = self.buffer list rows decode_row_method decoder = self._decode_row pgproto.try_consume_message_method try_consume_message = \ buf.try_consume_message pgproto.take_message_type_method take_message_type = \ buf.take_message_type const char* cbuf ssize_t cbuf_len object row bytes mem if PG_DEBUG: if buf.get_message_type() != b'D': raise apg_exc.InternalClientError( '_parse_data_msgs: first message is not "D"') if self._discard_data: while take_message_type(buf, b'D'): buf.discard_message() return if PG_DEBUG: if type(self.result) is not list: raise apg_exc.InternalClientError( '_parse_data_msgs: result is not a list, but {!r}'. format(self.result)) rows = self.result while take_message_type(buf, b'D'): cbuf = try_consume_message(buf, &cbuf_len) if cbuf != NULL: row = decoder(self, cbuf, cbuf_len) else: mem = buf.consume_message() row = decoder( self, cpython.PyBytes_AS_STRING(mem), cpython.PyBytes_GET_SIZE(mem)) cpython.PyList_Append(rows, row) cdef _parse_msg_backend_key_data(self): self.backend_pid = self.buffer.read_int32() self.backend_secret = self.buffer.read_int32() cdef _parse_msg_parameter_status(self): name = self.buffer.read_null_str() name = name.decode(self.encoding) val = self.buffer.read_null_str() val = val.decode(self.encoding) self._set_server_parameter(name, val) cdef _parse_msg_notification(self): pid = self.buffer.read_int32() channel = self.buffer.read_null_str().decode(self.encoding) payload = self.buffer.read_null_str().decode(self.encoding) self._on_notification(pid, channel, payload) cdef _parse_msg_authentication(self): cdef: int32_t status bytes md5_salt list sasl_auth_methods list unsupported_sasl_auth_methods status = self.buffer.read_int32() if status == AUTH_SUCCESSFUL: # AuthenticationOk self.result_type = RESULT_OK elif status == AUTH_REQUIRED_PASSWORD: # AuthenticationCleartextPassword self.result_type = RESULT_OK self.auth_msg = self._auth_password_message_cleartext() elif status == AUTH_REQUIRED_PASSWORDMD5: # AuthenticationMD5Password # Note: MD5 salt is passed as a four-byte sequence md5_salt = self.buffer.read_bytes(4) self.auth_msg = self._auth_password_message_md5(md5_salt) elif status == AUTH_REQUIRED_SASL: # AuthenticationSASL # This requires making additional requests to the server in order # to follow the SCRAM protocol defined in RFC 5802. # get the SASL authentication methods that the server is providing sasl_auth_methods = [] unsupported_sasl_auth_methods = [] # determine if the advertised authentication methods are supported, # and if so, add them to the list auth_method = self.buffer.read_null_str() while auth_method: if auth_method in SCRAMAuthentication.AUTHENTICATION_METHODS: sasl_auth_methods.append(auth_method) else: unsupported_sasl_auth_methods.append(auth_method) auth_method = self.buffer.read_null_str() # if none of the advertised authentication methods are supported, # raise an error # otherwise, initialize the SASL authentication exchange if not sasl_auth_methods: unsupported_sasl_auth_methods = [m.decode("ascii") for m in unsupported_sasl_auth_methods] self.result_type = RESULT_FAILED self.result = apg_exc.InterfaceError( 'unsupported SASL Authentication methods requested by the ' 'server: {!r}'.format( ", ".join(unsupported_sasl_auth_methods))) else: self.auth_msg = self._auth_password_message_sasl_initial( sasl_auth_methods) elif status == AUTH_SASL_CONTINUE: # AUTH_SASL_CONTINUE # this requeires sending the second part of the SASL exchange, where # the client parses information back from the server and determines # if this is valid. # The client builds a challenge response to the server server_response = self.buffer.consume_message() self.auth_msg = self._auth_password_message_sasl_continue( server_response) elif status == AUTH_SASL_FINAL: # AUTH_SASL_FINAL server_response = self.buffer.consume_message() if not self.scram.verify_server_final_message(server_response): self.result_type = RESULT_FAILED self.result = apg_exc.InterfaceError( 'could not verify server signature for ' 'SCRAM authentciation: scram-sha-256', ) self.scram = None elif status in (AUTH_REQUIRED_GSS, AUTH_REQUIRED_SSPI): # AUTH_REQUIRED_SSPI is the same as AUTH_REQUIRED_GSS, except that # it uses protocol negotiation with SSPI clients. Both methods use # AUTH_REQUIRED_GSS_CONTINUE for subsequent authentication steps. if self.gss_ctx is not None: self.result_type = RESULT_FAILED self.result = apg_exc.InterfaceError( 'duplicate GSSAPI/SSPI authentication request') else: if self.con_params.gsslib == 'gssapi': self._auth_gss_init_gssapi() else: self._auth_gss_init_sspi(status == AUTH_REQUIRED_SSPI) self.auth_msg = self._auth_gss_step(None) elif status == AUTH_REQUIRED_GSS_CONTINUE: server_response = self.buffer.consume_message() self.auth_msg = self._auth_gss_step(server_response) else: self.result_type = RESULT_FAILED self.result = apg_exc.InterfaceError( 'unsupported authentication method requested by the ' 'server: {!r}'.format(AUTH_METHOD_NAME.get(status, status))) if status not in (AUTH_SASL_CONTINUE, AUTH_SASL_FINAL, AUTH_REQUIRED_GSS_CONTINUE): self.buffer.discard_message() cdef _auth_password_message_cleartext(self): cdef: WriteBuffer msg msg = WriteBuffer.new_message(b'p') msg.write_bytestring(self.password.encode(self.encoding)) msg.end_message() return msg cdef _auth_password_message_md5(self, bytes salt): cdef: WriteBuffer msg msg = WriteBuffer.new_message(b'p') # 'md5' + md5(md5(password + username) + salt)) userpass = (self.password or '') + (self.user or '') md5_1 = hashlib.md5(userpass.encode(self.encoding)).hexdigest() md5_2 = hashlib.md5(md5_1.encode('ascii') + salt).hexdigest() msg.write_bytestring(b'md5' + md5_2.encode('ascii')) msg.end_message() return msg cdef _auth_password_message_sasl_initial(self, list sasl_auth_methods): cdef: WriteBuffer msg # use the first supported advertized mechanism self.scram = SCRAMAuthentication(sasl_auth_methods[0]) # this involves a call and response with the server msg = WriteBuffer.new_message(b'p') msg.write_bytes(self.scram.create_client_first_message(self.user or '')) msg.end_message() return msg cdef _auth_password_message_sasl_continue(self, bytes server_response): cdef: WriteBuffer msg # determine if there is a valid server response self.scram.parse_server_first_message(server_response) # this involves a call and response with the server msg = WriteBuffer.new_message(b'p') client_final_message = self.scram.create_client_final_message( self.password or '') msg.write_bytes(client_final_message) msg.end_message() return msg cdef _auth_gss_init_gssapi(self): try: import gssapi except ModuleNotFoundError: raise apg_exc.InterfaceError( 'gssapi module not found; please install asyncpg[gssauth] to ' 'use asyncpg with Kerberos/GSSAPI/SSPI authentication' ) from None service_name, host = self._auth_gss_get_service() self.gss_ctx = gssapi.SecurityContext( name=gssapi.Name( f'{service_name}@{host}', gssapi.NameType.hostbased_service), usage='initiate') cdef _auth_gss_init_sspi(self, bint negotiate): try: import sspilib except ModuleNotFoundError: raise apg_exc.InterfaceError( 'sspilib module not found; please install asyncpg[gssauth] to ' 'use asyncpg with Kerberos/GSSAPI/SSPI authentication' ) from None service_name, host = self._auth_gss_get_service() self.gss_ctx = sspilib.ClientSecurityContext( target_name=f'{service_name}/{host}', credential=sspilib.UserCredential( protocol='Negotiate' if negotiate else 'Kerberos')) cdef _auth_gss_get_service(self): service_name = self.con_params.krbsrvname or 'postgres' if isinstance(self.address, str): raise apg_exc.InternalClientError( 'GSSAPI/SSPI authentication is only supported for TCP/IP ' 'connections') return service_name, self.address[0] cdef _auth_gss_step(self, bytes server_response): cdef: WriteBuffer msg token = self.gss_ctx.step(server_response) if not token: self.gss_ctx = None return None msg = WriteBuffer.new_message(b'p') msg.write_bytes(token) msg.end_message() return msg cdef _parse_msg_ready_for_query(self): cdef char status = self.buffer.read_byte() if status == b'I': self.xact_status = PQTRANS_IDLE elif status == b'T': self.xact_status = PQTRANS_INTRANS elif status == b'E': self.xact_status = PQTRANS_INERROR else: self.xact_status = PQTRANS_UNKNOWN cdef _parse_msg_error_response(self, is_error): cdef: char code bytes message dict parsed = {} while True: code = self.buffer.read_byte() if code == 0: break message = self.buffer.read_null_str() parsed[chr(code)] = message.decode() if is_error: self.result_type = RESULT_FAILED self.result = parsed else: return parsed cdef _push_result(self): try: self._on_result() finally: self._set_state(PROTOCOL_IDLE) self._reset_result() cdef _reset_result(self): self.result_type = RESULT_OK self.result = None self.result_param_desc = None self.result_row_desc = None self.result_status_msg = None self.result_execute_completed = False self._discard_data = False # executemany support data self._execute_iter = None self._execute_portal_name = None self._execute_stmt_name = None cdef _set_state(self, ProtocolState new_state): if new_state == PROTOCOL_IDLE: if self.state == PROTOCOL_FAILED: raise apg_exc.InternalClientError( 'cannot switch to "idle" state; ' 'protocol is in the "failed" state') elif self.state == PROTOCOL_IDLE: pass else: self.state = new_state elif new_state == PROTOCOL_FAILED: self.state = PROTOCOL_FAILED elif new_state == PROTOCOL_CANCELLED: self.state = PROTOCOL_CANCELLED elif new_state == PROTOCOL_TERMINATING: self.state = PROTOCOL_TERMINATING else: if self.state == PROTOCOL_IDLE: self.state = new_state elif (self.state == PROTOCOL_COPY_OUT and new_state == PROTOCOL_COPY_OUT_DATA): self.state = new_state elif (self.state == PROTOCOL_COPY_OUT_DATA and new_state == PROTOCOL_COPY_OUT_DONE): self.state = new_state elif (self.state == PROTOCOL_COPY_IN and new_state == PROTOCOL_COPY_IN_DATA): self.state = new_state elif self.state == PROTOCOL_FAILED: raise apg_exc.InternalClientError( 'cannot switch to state {}; ' 'protocol is in the "failed" state'.format(new_state)) else: raise apg_exc.InternalClientError( 'cannot switch to state {}; ' 'another operation ({}) is in progress'.format( new_state, self.state)) cdef _ensure_connected(self): if self.con_status != CONNECTION_OK: raise apg_exc.InternalClientError('not connected') cdef WriteBuffer _build_parse_message(self, str stmt_name, str query): cdef WriteBuffer buf buf = WriteBuffer.new_message(b'P') buf.write_str(stmt_name, self.encoding) buf.write_str(query, self.encoding) buf.write_int16(0) buf.end_message() return buf cdef WriteBuffer _build_bind_message(self, str portal_name, str stmt_name, WriteBuffer bind_data): cdef WriteBuffer buf buf = WriteBuffer.new_message(b'B') buf.write_str(portal_name, self.encoding) buf.write_str(stmt_name, self.encoding) # Arguments buf.write_buffer(bind_data) buf.end_message() return buf cdef WriteBuffer _build_empty_bind_data(self): cdef WriteBuffer buf buf = WriteBuffer.new() buf.write_int16(0) # The number of parameter format codes buf.write_int16(0) # The number of parameter values buf.write_int16(0) # The number of result-column format codes return buf cdef WriteBuffer _build_execute_message(self, str portal_name, int32_t limit): cdef WriteBuffer buf buf = WriteBuffer.new_message(b'E') buf.write_str(portal_name, self.encoding) # name of the portal buf.write_int32(limit) # number of rows to return; 0 - all buf.end_message() return buf # API for subclasses cdef _connect(self): cdef: WriteBuffer buf WriteBuffer outbuf if self.con_status != CONNECTION_BAD: raise apg_exc.InternalClientError('already connected') self._set_state(PROTOCOL_AUTH) self.con_status = CONNECTION_STARTED # Assemble a startup message buf = WriteBuffer() # protocol version buf.write_int16(3) buf.write_int16(0) buf.write_bytestring(b'client_encoding') buf.write_bytestring("'{}'".format(self.encoding).encode('ascii')) buf.write_str('user', self.encoding) buf.write_str(self.con_params.user, self.encoding) buf.write_str('database', self.encoding) buf.write_str(self.con_params.database, self.encoding) if self.con_params.server_settings is not None: for k, v in self.con_params.server_settings.items(): buf.write_str(k, self.encoding) buf.write_str(v, self.encoding) buf.write_bytestring(b'') # Send the buffer outbuf = WriteBuffer() outbuf.write_int32(buf.len() + 4) outbuf.write_buffer(buf) self._write(outbuf) cdef _send_parse_message(self, str stmt_name, str query): cdef: WriteBuffer msg self._ensure_connected() msg = self._build_parse_message(stmt_name, query) self._write(msg) cdef _prepare_and_describe(self, str stmt_name, str query): cdef: WriteBuffer packet WriteBuffer buf self._ensure_connected() self._set_state(PROTOCOL_PREPARE) packet = self._build_parse_message(stmt_name, query) buf = WriteBuffer.new_message(b'D') buf.write_byte(b'S') buf.write_str(stmt_name, self.encoding) buf.end_message() packet.write_buffer(buf) packet.write_bytes(FLUSH_MESSAGE) self._write(packet) cdef _send_bind_message(self, str portal_name, str stmt_name, WriteBuffer bind_data, int32_t limit): cdef: WriteBuffer packet WriteBuffer buf buf = self._build_bind_message(portal_name, stmt_name, bind_data) packet = buf buf = self._build_execute_message(portal_name, limit) packet.write_buffer(buf) packet.write_bytes(SYNC_MESSAGE) self._write(packet) cdef _bind_execute(self, str portal_name, str stmt_name, WriteBuffer bind_data, int32_t limit): cdef WriteBuffer buf self._ensure_connected() self._set_state(PROTOCOL_BIND_EXECUTE) self.result = [] self._send_bind_message(portal_name, stmt_name, bind_data, limit) cdef bint _bind_execute_many(self, str portal_name, str stmt_name, object bind_data, bint return_rows): self._ensure_connected() self._set_state(PROTOCOL_BIND_EXECUTE_MANY) self.result = [] if return_rows else None self._discard_data = not return_rows self._execute_iter = bind_data self._execute_portal_name = portal_name self._execute_stmt_name = stmt_name return self._bind_execute_many_more(True) cdef bint _bind_execute_many_more(self, bint first=False): cdef: WriteBuffer packet WriteBuffer buf list buffers = [] # as we keep sending, the server may return an error early if self.result_type == RESULT_FAILED: self._write(SYNC_MESSAGE) return False # collect up to four 32KB buffers to send # https://github.com/MagicStack/asyncpg/pull/289#issuecomment-391215051 while len(buffers) < _EXECUTE_MANY_BUF_NUM: packet = WriteBuffer.new() # fill one 32KB buffer while packet.len() < _EXECUTE_MANY_BUF_SIZE: try: # grab one item from the input buf = next(self._execute_iter) # reached the end of the input except StopIteration: if first: # if we never send anything, simply set the result self._push_result() else: # otherwise, append SYNC and send the buffers packet.write_bytes(SYNC_MESSAGE) buffers.append(memoryview(packet)) self._writelines(buffers) return False # error in input, give up the buffers and cleanup except Exception as ex: self._bind_execute_many_fail(ex, first) return False # all good, write to the buffer first = False packet.write_buffer( self._build_bind_message( self._execute_portal_name, self._execute_stmt_name, buf, ) ) packet.write_buffer( self._build_execute_message(self._execute_portal_name, 0, ) ) # collected one buffer buffers.append(memoryview(packet)) # write to the wire, and signal the caller for more to send self._writelines(buffers) return True cdef _bind_execute_many_fail(self, object error, bint first=False): cdef WriteBuffer buf self.result_type = RESULT_FAILED self.result = error if first: self._push_result() elif self.is_in_transaction(): # we're in an explicit transaction, just SYNC self._write(SYNC_MESSAGE) else: # In an implicit transaction, if `ignore_till_sync` is set, # `ROLLBACK` will be ignored and `Sync` will restore the state; # or the transaction will be rolled back with a warning saying # that there was no transaction, but rollback is done anyway, # so we could safely ignore this warning. # GOTCHA: cannot use simple query message here, because it is # ignored if `ignore_till_sync` is set. buf = self._build_parse_message('', 'ROLLBACK') buf.write_buffer(self._build_bind_message( '', '', self._build_empty_bind_data())) buf.write_buffer(self._build_execute_message('', 0)) buf.write_bytes(SYNC_MESSAGE) self._write(buf) cdef _execute(self, str portal_name, int32_t limit): cdef WriteBuffer buf self._ensure_connected() self._set_state(PROTOCOL_EXECUTE) self.result = [] buf = self._build_execute_message(portal_name, limit) buf.write_bytes(SYNC_MESSAGE) self._write(buf) cdef _bind(self, str portal_name, str stmt_name, WriteBuffer bind_data): cdef WriteBuffer buf self._ensure_connected() self._set_state(PROTOCOL_BIND) buf = self._build_bind_message(portal_name, stmt_name, bind_data) buf.write_bytes(SYNC_MESSAGE) self._write(buf) cdef _close(self, str name, bint is_portal): cdef WriteBuffer buf self._ensure_connected() self._set_state(PROTOCOL_CLOSE_STMT_PORTAL) buf = WriteBuffer.new_message(b'C') if is_portal: buf.write_byte(b'P') else: buf.write_byte(b'S') buf.write_str(name, self.encoding) buf.end_message() buf.write_bytes(SYNC_MESSAGE) self._write(buf) cdef _simple_query(self, str query): cdef WriteBuffer buf self._ensure_connected() self._set_state(PROTOCOL_SIMPLE_QUERY) buf = WriteBuffer.new_message(b'Q') buf.write_str(query, self.encoding) buf.end_message() self._write(buf) cdef _copy_out(self, str copy_stmt): cdef WriteBuffer buf self._ensure_connected() self._set_state(PROTOCOL_COPY_OUT) # Send the COPY .. TO STDOUT using the SimpleQuery protocol. buf = WriteBuffer.new_message(b'Q') buf.write_str(copy_stmt, self.encoding) buf.end_message() self._write(buf) cdef _copy_in(self, str copy_stmt): cdef WriteBuffer buf self._ensure_connected() self._set_state(PROTOCOL_COPY_IN) buf = WriteBuffer.new_message(b'Q') buf.write_str(copy_stmt, self.encoding) buf.end_message() self._write(buf) cdef _terminate(self): cdef WriteBuffer buf self._ensure_connected() self._set_state(PROTOCOL_TERMINATING) buf = WriteBuffer.new_message(b'X') buf.end_message() self._write(buf) cdef _write(self, buf): raise NotImplementedError cdef _writelines(self, list buffers): raise NotImplementedError cdef _decode_row(self, const char* buf, ssize_t buf_len): pass cdef _set_server_parameter(self, name, val): pass cdef _on_result(self): pass cdef _on_notice(self, parsed): pass cdef _on_notification(self, pid, channel, payload): pass cdef _on_connection_lost(self, exc): pass cdef bytes SYNC_MESSAGE = bytes(WriteBuffer.new_message(b'S').end_message()) cdef bytes FLUSH_MESSAGE = bytes(WriteBuffer.new_message(b'H').end_message()) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/cpythonx.pxd0000644000175100001770000000114514705014413020541 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef extern from "Python.h": int PyByteArray_Check(object) int PyMemoryView_Check(object) Py_buffer *PyMemoryView_GET_BUFFER(object) object PyMemoryView_GetContiguous(object, int buffertype, char order) Py_UCS4* PyUnicode_AsUCS4Copy(object) except NULL object PyUnicode_FromKindAndData( int kind, const void *buffer, Py_ssize_t size) int PyUnicode_4BYTE_KIND ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/encodings.pyx0000644000175100001770000000315414705014413020665 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 '''Map PostgreSQL encoding names to Python encoding names https://www.postgresql.org/docs/current/static/multibyte.html#CHARSET-TABLE ''' cdef dict ENCODINGS_MAP = { 'abc': 'cp1258', 'alt': 'cp866', 'euc_cn': 'euccn', 'euc_jp': 'eucjp', 'euc_kr': 'euckr', 'koi8r': 'koi8_r', 'koi8u': 'koi8_u', 'shift_jis_2004': 'euc_jis_2004', 'sjis': 'shift_jis', 'sql_ascii': 'ascii', 'vscii': 'cp1258', 'tcvn': 'cp1258', 'tcvn5712': 'cp1258', 'unicode': 'utf_8', 'win': 'cp1521', 'win1250': 'cp1250', 'win1251': 'cp1251', 'win1252': 'cp1252', 'win1253': 'cp1253', 'win1254': 'cp1254', 'win1255': 'cp1255', 'win1256': 'cp1256', 'win1257': 'cp1257', 'win1258': 'cp1258', 'win866': 'cp866', 'win874': 'cp874', 'win932': 'cp932', 'win936': 'cp936', 'win949': 'cp949', 'win950': 'cp950', 'windows1250': 'cp1250', 'windows1251': 'cp1251', 'windows1252': 'cp1252', 'windows1253': 'cp1253', 'windows1254': 'cp1254', 'windows1255': 'cp1255', 'windows1256': 'cp1256', 'windows1257': 'cp1257', 'windows1258': 'cp1258', 'windows866': 'cp866', 'windows874': 'cp874', 'windows932': 'cp932', 'windows936': 'cp936', 'windows949': 'cp949', 'windows950': 'cp950', } cdef get_python_encoding(pg_encoding): return ENCODINGS_MAP.get(pg_encoding.lower(), pg_encoding.lower()) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/pgtypes.pxi0000644000175100001770000001541414705014413020371 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 # GENERATED FROM pg_catalog.pg_type # DO NOT MODIFY, use tools/generate_type_map.py to update DEF INVALIDOID = 0 DEF MAXBUILTINOID = 9999 DEF MAXSUPPORTEDOID = 5080 DEF BOOLOID = 16 DEF BYTEAOID = 17 DEF CHAROID = 18 DEF NAMEOID = 19 DEF INT8OID = 20 DEF INT2OID = 21 DEF INT4OID = 23 DEF REGPROCOID = 24 DEF TEXTOID = 25 DEF OIDOID = 26 DEF TIDOID = 27 DEF XIDOID = 28 DEF CIDOID = 29 DEF PG_DDL_COMMANDOID = 32 DEF JSONOID = 114 DEF XMLOID = 142 DEF PG_NODE_TREEOID = 194 DEF SMGROID = 210 DEF TABLE_AM_HANDLEROID = 269 DEF INDEX_AM_HANDLEROID = 325 DEF POINTOID = 600 DEF LSEGOID = 601 DEF PATHOID = 602 DEF BOXOID = 603 DEF POLYGONOID = 604 DEF LINEOID = 628 DEF CIDROID = 650 DEF FLOAT4OID = 700 DEF FLOAT8OID = 701 DEF ABSTIMEOID = 702 DEF RELTIMEOID = 703 DEF TINTERVALOID = 704 DEF UNKNOWNOID = 705 DEF CIRCLEOID = 718 DEF MACADDR8OID = 774 DEF MONEYOID = 790 DEF MACADDROID = 829 DEF INETOID = 869 DEF _TEXTOID = 1009 DEF _OIDOID = 1028 DEF ACLITEMOID = 1033 DEF BPCHAROID = 1042 DEF VARCHAROID = 1043 DEF DATEOID = 1082 DEF TIMEOID = 1083 DEF TIMESTAMPOID = 1114 DEF TIMESTAMPTZOID = 1184 DEF INTERVALOID = 1186 DEF TIMETZOID = 1266 DEF BITOID = 1560 DEF VARBITOID = 1562 DEF NUMERICOID = 1700 DEF REFCURSOROID = 1790 DEF REGPROCEDUREOID = 2202 DEF REGOPEROID = 2203 DEF REGOPERATOROID = 2204 DEF REGCLASSOID = 2205 DEF REGTYPEOID = 2206 DEF RECORDOID = 2249 DEF CSTRINGOID = 2275 DEF ANYOID = 2276 DEF ANYARRAYOID = 2277 DEF VOIDOID = 2278 DEF TRIGGEROID = 2279 DEF LANGUAGE_HANDLEROID = 2280 DEF INTERNALOID = 2281 DEF OPAQUEOID = 2282 DEF ANYELEMENTOID = 2283 DEF ANYNONARRAYOID = 2776 DEF UUIDOID = 2950 DEF TXID_SNAPSHOTOID = 2970 DEF FDW_HANDLEROID = 3115 DEF PG_LSNOID = 3220 DEF TSM_HANDLEROID = 3310 DEF PG_NDISTINCTOID = 3361 DEF PG_DEPENDENCIESOID = 3402 DEF ANYENUMOID = 3500 DEF TSVECTOROID = 3614 DEF TSQUERYOID = 3615 DEF GTSVECTOROID = 3642 DEF REGCONFIGOID = 3734 DEF REGDICTIONARYOID = 3769 DEF JSONBOID = 3802 DEF ANYRANGEOID = 3831 DEF EVENT_TRIGGEROID = 3838 DEF JSONPATHOID = 4072 DEF REGNAMESPACEOID = 4089 DEF REGROLEOID = 4096 DEF REGCOLLATIONOID = 4191 DEF ANYMULTIRANGEOID = 4537 DEF ANYCOMPATIBLEMULTIRANGEOID = 4538 DEF PG_BRIN_BLOOM_SUMMARYOID = 4600 DEF PG_BRIN_MINMAX_MULTI_SUMMARYOID = 4601 DEF PG_MCV_LISTOID = 5017 DEF PG_SNAPSHOTOID = 5038 DEF XID8OID = 5069 DEF ANYCOMPATIBLEOID = 5077 DEF ANYCOMPATIBLEARRAYOID = 5078 DEF ANYCOMPATIBLENONARRAYOID = 5079 DEF ANYCOMPATIBLERANGEOID = 5080 cdef ARRAY_TYPES = (_TEXTOID, _OIDOID,) BUILTIN_TYPE_OID_MAP = { ABSTIMEOID: 'abstime', ACLITEMOID: 'aclitem', ANYARRAYOID: 'anyarray', ANYCOMPATIBLEARRAYOID: 'anycompatiblearray', ANYCOMPATIBLEMULTIRANGEOID: 'anycompatiblemultirange', ANYCOMPATIBLENONARRAYOID: 'anycompatiblenonarray', ANYCOMPATIBLEOID: 'anycompatible', ANYCOMPATIBLERANGEOID: 'anycompatiblerange', ANYELEMENTOID: 'anyelement', ANYENUMOID: 'anyenum', ANYMULTIRANGEOID: 'anymultirange', ANYNONARRAYOID: 'anynonarray', ANYOID: 'any', ANYRANGEOID: 'anyrange', BITOID: 'bit', BOOLOID: 'bool', BOXOID: 'box', BPCHAROID: 'bpchar', BYTEAOID: 'bytea', CHAROID: 'char', CIDOID: 'cid', CIDROID: 'cidr', CIRCLEOID: 'circle', CSTRINGOID: 'cstring', DATEOID: 'date', EVENT_TRIGGEROID: 'event_trigger', FDW_HANDLEROID: 'fdw_handler', FLOAT4OID: 'float4', FLOAT8OID: 'float8', GTSVECTOROID: 'gtsvector', INDEX_AM_HANDLEROID: 'index_am_handler', INETOID: 'inet', INT2OID: 'int2', INT4OID: 'int4', INT8OID: 'int8', INTERNALOID: 'internal', INTERVALOID: 'interval', JSONBOID: 'jsonb', JSONOID: 'json', JSONPATHOID: 'jsonpath', LANGUAGE_HANDLEROID: 'language_handler', LINEOID: 'line', LSEGOID: 'lseg', MACADDR8OID: 'macaddr8', MACADDROID: 'macaddr', MONEYOID: 'money', NAMEOID: 'name', NUMERICOID: 'numeric', OIDOID: 'oid', OPAQUEOID: 'opaque', PATHOID: 'path', PG_BRIN_BLOOM_SUMMARYOID: 'pg_brin_bloom_summary', PG_BRIN_MINMAX_MULTI_SUMMARYOID: 'pg_brin_minmax_multi_summary', PG_DDL_COMMANDOID: 'pg_ddl_command', PG_DEPENDENCIESOID: 'pg_dependencies', PG_LSNOID: 'pg_lsn', PG_MCV_LISTOID: 'pg_mcv_list', PG_NDISTINCTOID: 'pg_ndistinct', PG_NODE_TREEOID: 'pg_node_tree', PG_SNAPSHOTOID: 'pg_snapshot', POINTOID: 'point', POLYGONOID: 'polygon', RECORDOID: 'record', REFCURSOROID: 'refcursor', REGCLASSOID: 'regclass', REGCOLLATIONOID: 'regcollation', REGCONFIGOID: 'regconfig', REGDICTIONARYOID: 'regdictionary', REGNAMESPACEOID: 'regnamespace', REGOPERATOROID: 'regoperator', REGOPEROID: 'regoper', REGPROCEDUREOID: 'regprocedure', REGPROCOID: 'regproc', REGROLEOID: 'regrole', REGTYPEOID: 'regtype', RELTIMEOID: 'reltime', SMGROID: 'smgr', TABLE_AM_HANDLEROID: 'table_am_handler', TEXTOID: 'text', TIDOID: 'tid', TIMEOID: 'time', TIMESTAMPOID: 'timestamp', TIMESTAMPTZOID: 'timestamptz', TIMETZOID: 'timetz', TINTERVALOID: 'tinterval', TRIGGEROID: 'trigger', TSM_HANDLEROID: 'tsm_handler', TSQUERYOID: 'tsquery', TSVECTOROID: 'tsvector', TXID_SNAPSHOTOID: 'txid_snapshot', UNKNOWNOID: 'unknown', UUIDOID: 'uuid', VARBITOID: 'varbit', VARCHAROID: 'varchar', VOIDOID: 'void', XID8OID: 'xid8', XIDOID: 'xid', XMLOID: 'xml', _OIDOID: 'oid[]', _TEXTOID: 'text[]' } BUILTIN_TYPE_NAME_MAP = {v: k for k, v in BUILTIN_TYPE_OID_MAP.items()} BUILTIN_TYPE_NAME_MAP['smallint'] = \ BUILTIN_TYPE_NAME_MAP['int2'] BUILTIN_TYPE_NAME_MAP['int'] = \ BUILTIN_TYPE_NAME_MAP['int4'] BUILTIN_TYPE_NAME_MAP['integer'] = \ BUILTIN_TYPE_NAME_MAP['int4'] BUILTIN_TYPE_NAME_MAP['bigint'] = \ BUILTIN_TYPE_NAME_MAP['int8'] BUILTIN_TYPE_NAME_MAP['decimal'] = \ BUILTIN_TYPE_NAME_MAP['numeric'] BUILTIN_TYPE_NAME_MAP['real'] = \ BUILTIN_TYPE_NAME_MAP['float4'] BUILTIN_TYPE_NAME_MAP['double precision'] = \ BUILTIN_TYPE_NAME_MAP['float8'] BUILTIN_TYPE_NAME_MAP['timestamp with timezone'] = \ BUILTIN_TYPE_NAME_MAP['timestamptz'] BUILTIN_TYPE_NAME_MAP['timestamp without timezone'] = \ BUILTIN_TYPE_NAME_MAP['timestamp'] BUILTIN_TYPE_NAME_MAP['time with timezone'] = \ BUILTIN_TYPE_NAME_MAP['timetz'] BUILTIN_TYPE_NAME_MAP['time without timezone'] = \ BUILTIN_TYPE_NAME_MAP['time'] BUILTIN_TYPE_NAME_MAP['char'] = \ BUILTIN_TYPE_NAME_MAP['bpchar'] BUILTIN_TYPE_NAME_MAP['character'] = \ BUILTIN_TYPE_NAME_MAP['bpchar'] BUILTIN_TYPE_NAME_MAP['character varying'] = \ BUILTIN_TYPE_NAME_MAP['varchar'] BUILTIN_TYPE_NAME_MAP['bit varying'] = \ BUILTIN_TYPE_NAME_MAP['varbit'] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/prepared_stmt.pxd0000644000175100001770000000213314705014413021534 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef class PreparedStatementState: cdef: readonly str name readonly str query readonly bint closed readonly bint prepared readonly int refs readonly type record_class readonly bint ignore_custom_codec list row_desc list parameters_desc ConnectionSettings settings int16_t args_num bint have_text_args tuple args_codecs int16_t cols_num object cols_desc bint have_text_cols tuple rows_codecs cdef _encode_bind_msg(self, args, int seqno = ?) cpdef _init_codecs(self) cdef _ensure_rows_decoder(self) cdef _ensure_args_encoder(self) cdef _set_row_desc(self, object desc) cdef _set_args_desc(self, object desc) cdef _decode_row(self, const char* cbuf, ssize_t buf_len) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/prepared_stmt.pyx0000644000175100001770000003140214705014413021562 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 from asyncpg import exceptions @cython.final cdef class PreparedStatementState: def __cinit__( self, str name, str query, BaseProtocol protocol, type record_class, bint ignore_custom_codec ): self.name = name self.query = query self.settings = protocol.settings self.row_desc = self.parameters_desc = None self.args_codecs = self.rows_codecs = None self.args_num = self.cols_num = 0 self.cols_desc = None self.closed = False self.prepared = True self.refs = 0 self.record_class = record_class self.ignore_custom_codec = ignore_custom_codec def _get_parameters(self): cdef Codec codec result = [] for oid in self.parameters_desc: codec = self.settings.get_data_codec(oid) if codec is None: raise exceptions.InternalClientError( 'missing codec information for OID {}'.format(oid)) result.append(apg_types.Type( oid, codec.name, codec.kind, codec.schema)) return tuple(result) def _get_attributes(self): cdef Codec codec if not self.row_desc: return () result = [] for d in self.row_desc: name = d[0] oid = d[3] codec = self.settings.get_data_codec(oid) if codec is None: raise exceptions.InternalClientError( 'missing codec information for OID {}'.format(oid)) name = name.decode(self.settings._encoding) result.append( apg_types.Attribute(name, apg_types.Type(oid, codec.name, codec.kind, codec.schema))) return tuple(result) def _init_types(self): cdef: Codec codec set missing = set() if self.parameters_desc: for p_oid in self.parameters_desc: codec = self.settings.get_data_codec(p_oid) if codec is None or not codec.has_encoder(): missing.add(p_oid) if self.row_desc: for rdesc in self.row_desc: codec = self.settings.get_data_codec((rdesc[3])) if codec is None or not codec.has_decoder(): missing.add(rdesc[3]) return missing cpdef _init_codecs(self): self._ensure_args_encoder() self._ensure_rows_decoder() def attach(self): self.refs += 1 def detach(self): self.refs -= 1 def mark_closed(self): self.closed = True def mark_unprepared(self): if self.name: raise exceptions.InternalClientError( "named prepared statements cannot be marked unprepared") self.prepared = False cdef _encode_bind_msg(self, args, int seqno = -1): cdef: int idx WriteBuffer writer Codec codec if not cpython.PySequence_Check(args): if seqno >= 0: raise exceptions.DataError( f'invalid input in executemany() argument sequence ' f'element #{seqno}: expected a sequence, got ' f'{type(args).__name__}' ) else: # Non executemany() callers do not pass user input directly, # so bad input is a bug. raise exceptions.InternalClientError( f'Bind: expected a sequence, got {type(args).__name__}') if len(args) > 32767: raise exceptions.InterfaceError( 'the number of query arguments cannot exceed 32767') writer = WriteBuffer.new() num_args_passed = len(args) if self.args_num != num_args_passed: hint = 'Check the query against the passed list of arguments.' if self.args_num == 0: # If the server was expecting zero arguments, it is likely # that the user tried to parametrize a statement that does # not support parameters. hint += (r' Note that parameters are supported only in' r' SELECT, INSERT, UPDATE, DELETE, MERGE and VALUES' r' statements, and will *not* work in statements ' r' like CREATE VIEW or DECLARE CURSOR.') raise exceptions.InterfaceError( 'the server expects {x} argument{s} for this query, ' '{y} {w} passed'.format( x=self.args_num, s='s' if self.args_num != 1 else '', y=num_args_passed, w='was' if num_args_passed == 1 else 'were'), hint=hint) if self.have_text_args: writer.write_int16(self.args_num) for idx in range(self.args_num): codec = (self.args_codecs[idx]) writer.write_int16(codec.format) else: # All arguments are in binary format writer.write_int32(0x00010001) writer.write_int16(self.args_num) for idx in range(self.args_num): arg = args[idx] if arg is None: writer.write_int32(-1) else: codec = (self.args_codecs[idx]) try: codec.encode(self.settings, writer, arg) except (AssertionError, exceptions.InternalClientError): # These are internal errors and should raise as-is. raise except exceptions.InterfaceError as e: # This is already a descriptive error, but annotate # with argument name for clarity. pos = f'${idx + 1}' if seqno >= 0: pos = ( f'{pos} in element #{seqno} of' f' executemany() sequence' ) raise e.with_msg( f'query argument {pos}: {e.args[0]}' ) from None except Exception as e: # Everything else is assumed to be an encoding error # due to invalid input. pos = f'${idx + 1}' if seqno >= 0: pos = ( f'{pos} in element #{seqno} of' f' executemany() sequence' ) value_repr = repr(arg) if len(value_repr) > 40: value_repr = value_repr[:40] + '...' raise exceptions.DataError( f'invalid input for query argument' f' {pos}: {value_repr} ({e})' ) from e if self.have_text_cols: writer.write_int16(self.cols_num) for idx in range(self.cols_num): codec = (self.rows_codecs[idx]) writer.write_int16(codec.format) else: # All columns are in binary format writer.write_int32(0x00010001) return writer cdef _ensure_rows_decoder(self): cdef: list cols_names object cols_mapping tuple row uint32_t oid Codec codec list codecs if self.cols_desc is not None: return if self.cols_num == 0: self.cols_desc = record.ApgRecordDesc_New({}, ()) return cols_mapping = collections.OrderedDict() cols_names = [] codecs = [] for i from 0 <= i < self.cols_num: row = self.row_desc[i] col_name = row[0].decode(self.settings._encoding) cols_mapping[col_name] = i cols_names.append(col_name) oid = row[3] codec = self.settings.get_data_codec( oid, ignore_custom_codec=self.ignore_custom_codec) if codec is None or not codec.has_decoder(): raise exceptions.InternalClientError( 'no decoder for OID {}'.format(oid)) if not codec.is_binary(): self.have_text_cols = True codecs.append(codec) self.cols_desc = record.ApgRecordDesc_New( cols_mapping, tuple(cols_names)) self.rows_codecs = tuple(codecs) cdef _ensure_args_encoder(self): cdef: uint32_t p_oid Codec codec list codecs = [] if self.args_num == 0 or self.args_codecs is not None: return for i from 0 <= i < self.args_num: p_oid = self.parameters_desc[i] codec = self.settings.get_data_codec( p_oid, ignore_custom_codec=self.ignore_custom_codec) if codec is None or not codec.has_encoder(): raise exceptions.InternalClientError( 'no encoder for OID {}'.format(p_oid)) if codec.type not in {}: self.have_text_args = True codecs.append(codec) self.args_codecs = tuple(codecs) cdef _set_row_desc(self, object desc): self.row_desc = _decode_row_desc(desc) self.cols_num = (len(self.row_desc)) cdef _set_args_desc(self, object desc): self.parameters_desc = _decode_parameters_desc(desc) self.args_num = (len(self.parameters_desc)) cdef _decode_row(self, const char* cbuf, ssize_t buf_len): cdef: Codec codec int16_t fnum int32_t flen object dec_row tuple rows_codecs = self.rows_codecs ConnectionSettings settings = self.settings int32_t i FRBuffer rbuf ssize_t bl frb_init(&rbuf, cbuf, buf_len) fnum = hton.unpack_int16(frb_read(&rbuf, 2)) if fnum != self.cols_num: raise exceptions.ProtocolError( 'the number of columns in the result row ({}) is ' 'different from what was described ({})'.format( fnum, self.cols_num)) dec_row = record.ApgRecord_New(self.record_class, self.cols_desc, fnum) for i in range(fnum): flen = hton.unpack_int32(frb_read(&rbuf, 4)) if flen == -1: val = None else: # Clamp buffer size to that of the reported field length # to make sure that codecs can rely on read_all() working # properly. bl = frb_get_len(&rbuf) if flen > bl: frb_check(&rbuf, flen) frb_set_len(&rbuf, flen) codec = cpython.PyTuple_GET_ITEM(rows_codecs, i) val = codec.decode(settings, &rbuf) if frb_get_len(&rbuf) != 0: raise BufferError( 'unexpected trailing {} bytes in buffer'.format( frb_get_len(&rbuf))) frb_set_len(&rbuf, bl - flen) cpython.Py_INCREF(val) record.ApgRecord_SET_ITEM(dec_row, i, val) if frb_get_len(&rbuf) != 0: raise BufferError('unexpected trailing {} bytes in buffer'.format( frb_get_len(&rbuf))) return dec_row cdef _decode_parameters_desc(object desc): cdef: ReadBuffer reader int16_t nparams uint32_t p_oid list result = [] reader = ReadBuffer.new_message_parser(desc) nparams = reader.read_int16() for i from 0 <= i < nparams: p_oid = reader.read_int32() result.append(p_oid) return result cdef _decode_row_desc(object desc): cdef: ReadBuffer reader int16_t nfields bytes f_name uint32_t f_table_oid int16_t f_column_num uint32_t f_dt_oid int16_t f_dt_size int32_t f_dt_mod int16_t f_format list result reader = ReadBuffer.new_message_parser(desc) nfields = reader.read_int16() result = [] for i from 0 <= i < nfields: f_name = reader.read_null_str() f_table_oid = reader.read_int32() f_column_num = reader.read_int16() f_dt_oid = reader.read_int32() f_dt_size = reader.read_int16() f_dt_mod = reader.read_int32() f_format = reader.read_int16() result.append( (f_name, f_table_oid, f_column_num, f_dt_oid, f_dt_size, f_dt_mod, f_format)) return result ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370387.0 asyncpg-0.30.0/asyncpg/protocol/protocol.c0000644000175100001770002375765414705014423020212 0ustar00runnerdocker/* Generated by Cython 3.0.11 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ "asyncpg/pgproto/debug.h" ], "extra_compile_args": [ "-O2", "-fsigned-char", "-Wall", "-Wsign-compare", "-Wconversion" ], "include_dirs": [ "asyncpg/pgproto", "asyncpg/pgproto/" ], "name": "asyncpg.protocol.protocol", "sources": [ "asyncpg/protocol/protocol.pyx", "asyncpg/protocol/record/recordobj.c" ] }, "module_name": "asyncpg.protocol.protocol" } END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj) #else #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj, NULL) #endif #if PY_MAJOR_VERSION <= 2 #define PyDict_GetItemWithError _PyDict_GetItemWithError #endif #if (PY_VERSION_HEX < 0x030700b1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600)) && !defined(PyContextVar_Get) #define PyContextVar_Get(var, d, v) ((d) ? ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) : ((v)[0] = NULL, 0) ) #endif #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000BF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__asyncpg__protocol__protocol #define __PYX_HAVE_API__asyncpg__protocol__protocol /* Early includes */ #include #include "debug.h" #include #include #include #include "pythread.h" #include "record/recordobj.h" #include "./hton.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "asyncpg/protocol/protocol.pyx", "asyncpg/protocol/settings.pyx", "", "asyncpg/protocol/codecs/base.pyx", "asyncpg/protocol/codecs/array.pyx", "asyncpg/protocol/scram.pyx", "asyncpg/protocol/coreproto.pyx", "asyncpg/protocol/prepared_stmt.pyx", ".eggs/Cython-3.0.11-py3.12-linux-x86_64.egg/Cython/Includes/cpython/contextvars.pxd", "asyncpg/pgproto/./frb.pxd", "asyncpg/pgproto/./buffer.pxd", "asyncpg/protocol/encodings.pyx", "asyncpg/protocol/codecs/textutils.pyx", "asyncpg/protocol/codecs/pgproto.pyx", "asyncpg/protocol/codecs/range.pyx", "asyncpg/protocol/codecs/record.pyx", "asyncpg/protocol/scram.pxd", "asyncpg/protocol/coreproto.pxd", "asyncpg/protocol/prepared_stmt.pxd", "asyncpg/protocol/protocol.pxd", ".eggs/Cython-3.0.11-py3.12-linux-x86_64.egg/Cython/Includes/cpython/type.pxd", ".eggs/Cython-3.0.11-py3.12-linux-x86_64.egg/Cython/Includes/cpython/bool.pxd", ".eggs/Cython-3.0.11-py3.12-linux-x86_64.egg/Cython/Includes/cpython/complex.pxd", "asyncpg/protocol/pgtypes.pxi", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec; struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig; struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings; struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication; struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol; struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState; struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation; struct __pyx_opt_args_7cpython_11contextvars_get_value; struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default; /* "cpython/contextvars.pxd":112 * * * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the default value of the context variable, */ struct __pyx_opt_args_7cpython_11contextvars_get_value { int __pyx_n; PyObject *default_value; }; /* "cpython/contextvars.pxd":129 * * * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the provided default value if no such value was found. */ struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default { int __pyx_n; PyObject *default_value; }; struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer; struct __pyx_opt_args_7asyncpg_7pgproto_7pgproto_10ReadBuffer_redirect_messages; /* "asyncpg/pgproto/frb.pxd":10 * cdef: * * struct FRBuffer: # <<<<<<<<<<<<<< * const char* buf * ssize_t len */ struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer { char const *buf; Py_ssize_t len; }; /* "asyncpg/pgproto/buffer.pxd":62 * * * ctypedef const char * (*try_consume_message_method)(object, ssize_t*) # <<<<<<<<<<<<<< * ctypedef int32_t (*take_message_type_method)(object, char) except -1 * ctypedef int32_t (*take_message_method)(object) except -1 */ typedef char const *(*__pyx_t_7asyncpg_7pgproto_7pgproto_try_consume_message_method)(PyObject *, Py_ssize_t *); /* "asyncpg/pgproto/buffer.pxd":63 * * ctypedef const char * (*try_consume_message_method)(object, ssize_t*) * ctypedef int32_t (*take_message_type_method)(object, char) except -1 # <<<<<<<<<<<<<< * ctypedef int32_t (*take_message_method)(object) except -1 * ctypedef char (*get_message_type_method)(object) */ typedef int32_t (*__pyx_t_7asyncpg_7pgproto_7pgproto_take_message_type_method)(PyObject *, char); /* "asyncpg/pgproto/buffer.pxd":64 * ctypedef const char * (*try_consume_message_method)(object, ssize_t*) * ctypedef int32_t (*take_message_type_method)(object, char) except -1 * ctypedef int32_t (*take_message_method)(object) except -1 # <<<<<<<<<<<<<< * ctypedef char (*get_message_type_method)(object) * */ typedef int32_t (*__pyx_t_7asyncpg_7pgproto_7pgproto_take_message_method)(PyObject *); /* "asyncpg/pgproto/buffer.pxd":65 * ctypedef int32_t (*take_message_type_method)(object, char) except -1 * ctypedef int32_t (*take_message_method)(object) except -1 * ctypedef char (*get_message_type_method)(object) # <<<<<<<<<<<<<< * * */ typedef char (*__pyx_t_7asyncpg_7pgproto_7pgproto_get_message_type_method)(PyObject *); /* "asyncpg/pgproto/buffer.pxd":130 * cdef bytes consume_message(self) * cdef discard_message(self) * cdef redirect_messages(self, WriteBuffer buf, char mtype, int stop_at=?) # <<<<<<<<<<<<<< * cdef bytearray consume_messages(self, char mtype) * cdef finish_message(self) */ struct __pyx_opt_args_7asyncpg_7pgproto_7pgproto_10ReadBuffer_redirect_messages { int __pyx_n; int stop_at; }; /* "asyncpg/pgproto/codecs/__init__.pxd":18 * * * ctypedef object (*encode_func)(CodecContext settings, # <<<<<<<<<<<<<< * WriteBuffer buf, * object obj) */ typedef PyObject *(*__pyx_t_7asyncpg_7pgproto_7pgproto_encode_func)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /* "asyncpg/pgproto/codecs/__init__.pxd":22 * object obj) * * ctypedef object (*decode_func)(CodecContext settings, # <<<<<<<<<<<<<< * FRBuffer *buf) * */ typedef PyObject *(*__pyx_t_7asyncpg_7pgproto_7pgproto_decode_func)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); struct __pyx_opt_args_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec; struct __pyx_opt_args_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec; struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_more; struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_fail; struct __pyx_opt_args_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg; struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_core_codec; struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_any_core_codec; struct __pyx_opt_args_7asyncpg_8protocol_8protocol_register_core_codec; /* "asyncpg/protocol/codecs/base.pxd":25 * * * cdef enum CodecType: # <<<<<<<<<<<<<< * CODEC_UNDEFINED = 0 * CODEC_C = 1 */ enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType { __pyx_e_7asyncpg_8protocol_8protocol_CODEC_UNDEFINED = 0, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_C = 1, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_PY = 2, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_ARRAY = 3, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_COMPOSITE = 4, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_RANGE = 5, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_MULTIRANGE = 6 }; /* "asyncpg/protocol/codecs/base.pxd":35 * * * cdef enum ServerDataFormat: # <<<<<<<<<<<<<< * PG_FORMAT_ANY = -1 * PG_FORMAT_TEXT = 0 */ enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat { __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY = -1L, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT = 0, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY = 1 }; /* "asyncpg/protocol/codecs/base.pxd":41 * * * cdef enum ClientExchangeFormat: # <<<<<<<<<<<<<< * PG_XFORMAT_OBJECT = 1 * PG_XFORMAT_TUPLE = 2 */ enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat { __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT = 1, __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE = 2 }; /* "asyncpg/protocol/coreproto.pxd":11 * * * cdef enum ConnectionStatus: # <<<<<<<<<<<<<< * CONNECTION_OK = 1 * CONNECTION_BAD = 2 */ enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus { __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_OK = 1, __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_BAD = 2, __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_STARTED = 3 }; /* "asyncpg/protocol/coreproto.pxd":17 * * * cdef enum ProtocolState: # <<<<<<<<<<<<<< * PROTOCOL_IDLE = 0 * */ enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState { __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_IDLE = 0, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_FAILED = 1, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_ERROR_CONSUME = 2, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CANCELLED = 3, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_TERMINATING = 4, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_AUTH = 10, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_PREPARE = 11, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND_EXECUTE = 12, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND_EXECUTE_MANY = 13, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CLOSE_STMT_PORTAL = 14, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_SIMPLE_QUERY = 15, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_EXECUTE = 16, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND = 17, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT = 18, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DATA = 19, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DONE = 20, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN = 21, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN_DATA = 22 }; /* "asyncpg/protocol/coreproto.pxd":40 * * * cdef enum AuthenticationMessage: # <<<<<<<<<<<<<< * AUTH_SUCCESSFUL = 0 * AUTH_REQUIRED_KERBEROS = 2 */ enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage { __pyx_e_7asyncpg_8protocol_8protocol_AUTH_SUCCESSFUL = 0, __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_KERBEROS = 2, __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_PASSWORD = 3, __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_PASSWORDMD5 = 5, __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_SCMCRED = 6, __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_GSS = 7, __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_GSS_CONTINUE = 8, __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_SSPI = 9, __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_SASL = 10, __pyx_e_7asyncpg_8protocol_8protocol_AUTH_SASL_CONTINUE = 11, __pyx_e_7asyncpg_8protocol_8protocol_AUTH_SASL_FINAL = 12 }; /* "asyncpg/protocol/coreproto.pxd":54 * * * cdef enum ResultType: # <<<<<<<<<<<<<< * RESULT_OK = 1 * RESULT_FAILED = 2 */ enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType { __pyx_e_7asyncpg_8protocol_8protocol_RESULT_OK = 1, __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED = 2 }; /* "asyncpg/protocol/coreproto.pxd":59 * * * cdef enum TransactionStatus: # <<<<<<<<<<<<<< * PQTRANS_IDLE = 0 # connection idle * PQTRANS_ACTIVE = 1 # command in progress */ enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus { __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_IDLE = 0, __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_ACTIVE = 1, __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_INTRANS = 2, __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_INERROR = 3, __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_UNKNOWN = 4 }; /* "asyncpg/protocol/codecs/base.pxd":8 * * * ctypedef object (*encode_func)(ConnectionSettings settings, # <<<<<<<<<<<<<< * WriteBuffer buf, * object obj) */ typedef PyObject *(*__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /* "asyncpg/protocol/codecs/base.pxd":12 * object obj) * * ctypedef object (*decode_func)(ConnectionSettings settings, # <<<<<<<<<<<<<< * FRBuffer *buf) * */ typedef PyObject *(*__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /* "asyncpg/protocol/codecs/base.pxd":15 * FRBuffer *buf) * * ctypedef object (*codec_encode_func)(Codec codec, # <<<<<<<<<<<<<< * ConnectionSettings settings, * WriteBuffer buf, */ typedef PyObject *(*__pyx_t_7asyncpg_8protocol_8protocol_codec_encode_func)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /* "asyncpg/protocol/codecs/base.pxd":20 * object obj) * * ctypedef object (*codec_decode_func)(Codec codec, # <<<<<<<<<<<<<< * ConnectionSettings settings, * FRBuffer *buf) */ typedef PyObject *(*__pyx_t_7asyncpg_8protocol_8protocol_codec_decode_func)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /* "asyncpg/protocol/codecs/base.pxd":184 * dict _custom_type_codecs * * cdef inline Codec get_codec(self, uint32_t oid, ServerDataFormat format, # <<<<<<<<<<<<<< * bint ignore_custom_codec=*) * cdef inline Codec get_custom_codec(self, uint32_t oid, */ struct __pyx_opt_args_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec { int __pyx_n; int ignore_custom_codec; }; /* "asyncpg/protocol/settings.pxd":28 * cpdef inline set_builtin_type_codec( * self, typeoid, typename, typeschema, typekind, alias_to, format) * cpdef inline Codec get_data_codec( # <<<<<<<<<<<<<< * self, uint32_t oid, ServerDataFormat format=*, * bint ignore_custom_codec=*) */ struct __pyx_opt_args_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec { int __pyx_n; enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat format; int ignore_custom_codec; }; /* "asyncpg/protocol/coreproto.pxd":67 * * * ctypedef object (*decode_row_method)(object, const char*, ssize_t) # <<<<<<<<<<<<<< * * */ typedef PyObject *(*__pyx_t_7asyncpg_8protocol_8protocol_decode_row_method)(PyObject *, char const *, Py_ssize_t); /* "asyncpg/protocol/coreproto.pxd":175 * cdef bint _bind_execute_many(self, str portal_name, str stmt_name, * object bind_data, bint return_rows) * cdef bint _bind_execute_many_more(self, bint first=*) # <<<<<<<<<<<<<< * cdef _bind_execute_many_fail(self, object error, bint first=*) * cdef _bind(self, str portal_name, str stmt_name, */ struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_more { int __pyx_n; int first; }; /* "asyncpg/protocol/coreproto.pxd":176 * object bind_data, bint return_rows) * cdef bint _bind_execute_many_more(self, bint first=*) * cdef _bind_execute_many_fail(self, object error, bint first=*) # <<<<<<<<<<<<<< * cdef _bind(self, str portal_name, str stmt_name, * WriteBuffer bind_data) */ struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_fail { int __pyx_n; int first; }; /* "asyncpg/protocol/prepared_stmt.pxd":33 * tuple rows_codecs * * cdef _encode_bind_msg(self, args, int seqno = ?) # <<<<<<<<<<<<<< * cpdef _init_codecs(self) * cdef _ensure_rows_decoder(self) */ struct __pyx_opt_args_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg { int __pyx_n; int seqno; }; /* "asyncpg/protocol/codecs/array.pyx":669 * * * cdef enum _ArrayParseState: # <<<<<<<<<<<<<< * APS_START = 1 * APS_STRIDE_STARTED = 2 */ enum __pyx_t_7asyncpg_8protocol_8protocol__ArrayParseState { __pyx_e_7asyncpg_8protocol_8protocol_APS_START = 1, __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_STARTED = 2, __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_DONE = 3, __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_DELIMITED = 4, __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_STARTED = 5, __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_DELIMITED = 6 }; /* "asyncpg/protocol/codecs/range.pyx":20 * * * cdef enum _RangeArgumentType: # <<<<<<<<<<<<<< * _RANGE_ARGUMENT_INVALID = 0 * _RANGE_ARGUMENT_TUPLE = 1 */ enum __pyx_t_7asyncpg_8protocol_8protocol__RangeArgumentType { __pyx_e_7asyncpg_8protocol_8protocol__RANGE_ARGUMENT_INVALID = 0, __pyx_e_7asyncpg_8protocol_8protocol__RANGE_ARGUMENT_TUPLE = 1, __pyx_e_7asyncpg_8protocol_8protocol__RANGE_ARGUMENT_RANGE = 2 }; /* "asyncpg/protocol/codecs/base.pyx":805 * * * cdef inline Codec get_core_codec( # <<<<<<<<<<<<<< * uint32_t oid, ServerDataFormat format, * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): */ struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_core_codec { int __pyx_n; enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat xformat; }; /* "asyncpg/protocol/codecs/base.pyx":824 * * * cdef inline Codec get_any_core_codec( # <<<<<<<<<<<<<< * uint32_t oid, ServerDataFormat format, * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): */ struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_any_core_codec { int __pyx_n; enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat xformat; }; /* "asyncpg/protocol/codecs/base.pyx":845 * * * cdef register_core_codec(uint32_t oid, # <<<<<<<<<<<<<< * encode_func encode, * decode_func decode, */ struct __pyx_opt_args_7asyncpg_8protocol_8protocol_register_core_codec { int __pyx_n; enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat xformat; }; /* "asyncpg/protocol/codecs/array.pyx":21 * * * ctypedef object (*encode_func_ex)(ConnectionSettings settings, # <<<<<<<<<<<<<< * WriteBuffer buf, * object obj, */ typedef PyObject *(*__pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *, void const *); /* "asyncpg/protocol/codecs/array.pyx":27 * * * ctypedef object (*decode_func_ex)(ConnectionSettings settings, # <<<<<<<<<<<<<< * FRBuffer *buf, * const void *arg) */ typedef PyObject *(*__pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, void const *); /* "asyncpg/pgproto/buffer.pxd":8 * * * cdef class WriteBuffer: # <<<<<<<<<<<<<< * cdef: * # Preallocated small buffer */ struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer { PyObject_HEAD struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_vtab; int _smallbuf_inuse; char _smallbuf[0x400]; char *_buf; Py_ssize_t _size; Py_ssize_t _length; int _view_count; int _message_mode; }; /* "asyncpg/pgproto/buffer.pxd":68 * * * cdef class ReadBuffer: # <<<<<<<<<<<<<< * cdef: * # A deque of buffers (bytes objects) */ struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer { PyObject_HEAD struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_vtab; PyObject *_bufs; PyObject *_bufs_append; PyObject *_bufs_popleft; PyObject *_buf0; PyObject *_buf0_prev; int32_t _bufs_len; Py_ssize_t _pos0; Py_ssize_t _len0; Py_ssize_t _length; char _current_message_type; int32_t _current_message_len; Py_ssize_t _current_message_len_unread; int _current_message_ready; }; /* "asyncpg/pgproto/codecs/__init__.pxd":8 * * * cdef class CodecContext: # <<<<<<<<<<<<<< * * cpdef get_text_codec(self) */ struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext { PyObject_HEAD struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_vtab; }; /* "asyncpg/protocol/codecs/base.pxd":46 * * * cdef class Codec: # <<<<<<<<<<<<<< * cdef: * uint32_t oid */ struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec { PyObject_HEAD struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_Codec *__pyx_vtab; uint32_t oid; PyObject *name; PyObject *schema; PyObject *kind; enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType type; enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat format; enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat xformat; __pyx_t_7asyncpg_8protocol_8protocol_encode_func c_encoder; __pyx_t_7asyncpg_8protocol_8protocol_decode_func c_decoder; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *base_codec; PyObject *py_encoder; PyObject *py_decoder; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *element_codec; Py_UCS4 element_delimiter; PyObject *element_type_oids; PyObject *element_names; PyObject *record_desc; PyObject *element_codecs; __pyx_t_7asyncpg_8protocol_8protocol_codec_encode_func encoder; __pyx_t_7asyncpg_8protocol_8protocol_codec_decode_func decoder; }; /* "asyncpg/protocol/codecs/base.pxd":179 * * * cdef class DataCodecConfig: # <<<<<<<<<<<<<< * cdef: * dict _derived_type_codecs */ struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig { PyObject_HEAD struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_vtab; PyObject *_derived_type_codecs; PyObject *_custom_type_codecs; }; /* "asyncpg/protocol/settings.pxd":8 * * * cdef class ConnectionSettings(pgproto.CodecContext): # <<<<<<<<<<<<<< * cdef: * str _encoding */ struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext __pyx_base; PyObject *_encoding; PyObject *_codec; PyObject *_settings; int _is_utf8; struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *_data_codecs; }; /* "asyncpg/protocol/scram.pxd":8 * * * cdef class SCRAMAuthentication: # <<<<<<<<<<<<<< * cdef: * readonly bytes authentication_method */ struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication { PyObject_HEAD struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_vtab; PyObject *authentication_method; PyObject *authorization_message; PyObject *client_channel_binding; PyObject *client_first_message_bare; PyObject *client_nonce; PyObject *client_proof; PyObject *password_salt; int password_iterations; PyObject *server_first_message; PyObject *server_key; PyObject *server_nonce; }; /* "asyncpg/protocol/coreproto.pxd":70 * * * cdef class CoreProtocol: # <<<<<<<<<<<<<< * cdef: * ReadBuffer buffer */ struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol { PyObject_HEAD struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_vtab; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *buffer; int _skip_discard; int _discard_data; PyObject *_execute_iter; PyObject *_execute_portal_name; PyObject *_execute_stmt_name; enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus con_status; enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState state; enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus xact_status; PyObject *encoding; PyObject *transport; PyObject *address; PyObject *con_params; struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *scram; PyObject *gss_ctx; int32_t backend_pid; int32_t backend_secret; enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType result_type; PyObject *result; PyObject *result_param_desc; PyObject *result_row_desc; PyObject *result_status_msg; int result_execute_completed; }; /* "asyncpg/protocol/prepared_stmt.pxd":8 * * * cdef class PreparedStatementState: # <<<<<<<<<<<<<< * cdef: * readonly str name */ struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState { PyObject_HEAD struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_vtab; PyObject *name; PyObject *query; int closed; int prepared; int refs; PyTypeObject *record_class; int ignore_custom_codec; PyObject *row_desc; PyObject *parameters_desc; struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *settings; int16_t args_num; int have_text_args; PyObject *args_codecs; int16_t cols_num; PyObject *cols_desc; int have_text_cols; PyObject *rows_codecs; }; /* "asyncpg/protocol/protocol.pxd":30 * * * cdef class BaseProtocol(CoreProtocol): # <<<<<<<<<<<<<< * * cdef: */ struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol { struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol __pyx_base; PyObject *loop; struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *settings; PyObject *cancel_sent_waiter; PyObject *cancel_waiter; PyObject *waiter; int return_extra; PyObject *create_future; PyObject *timeout_handle; PyObject *conref; PyTypeObject *record_class; int is_reading; PyObject *last_query; int writing_paused; int closing; uint64_t queries_count; int _is_ssl; struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *statement; }; /* "asyncpg/protocol/scram.pyx":188 * cdef _bytes_xor(self, bytes a, bytes b): * """XOR two bytestrings together""" * return bytes(a_i ^ b_i for a_i, b_i in zip(a, b)) # <<<<<<<<<<<<<< * * cdef _generate_client_nonce(self, int num_bytes): */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_a_i; PyObject *__pyx_v_b_i; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; PyObject *(*__pyx_t_2)(PyObject *); }; /* "asyncpg/protocol/scram.pyx":256 * return u * * cdef _normalize_password(self, str original_password): # <<<<<<<<<<<<<< * """Normalize the password using the SASLprep from RFC4013""" * cdef: */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password { PyObject_HEAD PyObject *__pyx_v_c; }; /* "asyncpg/protocol/scram.pyx":287 * # Table B.1 -- "Commonly mapped to nothing" * normalized_password = u"".join( * ' ' if stringprep.in_table_c12(c) else c # <<<<<<<<<<<<<< * for c in tuple(normalized_password) if not stringprep.in_table_b1(c) * ) */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_c; }; /* "asyncpg/protocol/scram.pyx":313 * for c in normalized_password_tuple: * if any( * in_prohibited_table(c) # <<<<<<<<<<<<<< * for in_prohibited_table in self.SASLPREP_PROHIBITED * ): */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr { PyObject_HEAD struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_in_prohibited_table; }; /* "asyncpg/protocol/scram.pyx":327 * # character must be the first and last character of the string * # RandALCat characters are found in table D.1, whereas LCat are in D.2 * if any(stringprep.in_table_d1(c) for c in normalized_password_tuple): # <<<<<<<<<<<<<< * # if the first character or the last character are not in D.1, * # return the original password */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_c; }; /* "asyncpg/protocol/scram.pyx":336 * # if any characters are in D.2, use the original password * if any( * stringprep.in_table_d2(c) for c in normalized_password_tuple # <<<<<<<<<<<<<< * ): * return original_password */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_c; }; /* "asyncpg/protocol/protocol.pyx":138 * self.transport.pause_reading() * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def prepare(self, stmt_name, query, timeout, * *, */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare { PyObject_HEAD PyObject *__pyx_v_ex; PyObject *__pyx_v_ignore_custom_codec; PyObject *__pyx_v_query; PyObject *__pyx_v_record_class; struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self; struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state; PyObject *__pyx_v_stmt_name; PyObject *__pyx_v_timeout; PyObject *__pyx_v_waiter; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; PyObject *__pyx_t_3; PyObject *__pyx_t_4; PyObject *__pyx_t_5; }; /* "asyncpg/protocol/protocol.pyx":167 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def bind_execute( * self, */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute { PyObject_HEAD PyObject *__pyx_v_args; PyObject *__pyx_v_args_buf; PyObject *__pyx_v_ex; PyObject *__pyx_v_limit; PyObject *__pyx_v_portal_name; PyObject *__pyx_v_return_extra; struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self; struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state; PyObject *__pyx_v_timeout; PyObject *__pyx_v_waiter; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; PyObject *__pyx_t_3; PyObject *__pyx_t_4; PyObject *__pyx_t_5; }; /* "asyncpg/protocol/protocol.pyx":208 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def bind_execute_many( * self, */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many { PyObject_HEAD PyObject *__pyx_v_arg_bufs; PyObject *__pyx_v_args; PyObject *__pyx_v_data_gen; PyObject *__pyx_v_e; PyObject *__pyx_v_ex; PyObject *__pyx_v_genexpr; int __pyx_v_more; PyObject *__pyx_v_portal_name; PyObject *__pyx_v_return_rows; struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self; struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state; PyObject *__pyx_v_timeout; PyObject *__pyx_v_timer; PyObject *__pyx_v_waiter; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; PyObject *__pyx_t_3; PyObject *__pyx_t_4; PyObject *__pyx_t_5; PyObject *__pyx_t_6; }; /* "asyncpg/protocol/protocol.pyx":230 * # this generator expression to keep the memory pressure under * # control. * data_gen = (state._encode_bind_msg(b, i) for i, b in enumerate(args)) # <<<<<<<<<<<<<< * arg_bufs = iter(data_gen) * */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr { PyObject_HEAD struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_b; PyObject *__pyx_v_i; PyObject *__pyx_t_0; PyObject *__pyx_t_1; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); }; /* "asyncpg/protocol/protocol.pyx":270 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def bind(self, PreparedStatementState state, args, * str portal_name, timeout): */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind { PyObject_HEAD PyObject *__pyx_v_args; PyObject *__pyx_v_args_buf; PyObject *__pyx_v_ex; PyObject *__pyx_v_portal_name; struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self; struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state; PyObject *__pyx_v_timeout; PyObject *__pyx_v_waiter; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; PyObject *__pyx_t_3; PyObject *__pyx_t_4; PyObject *__pyx_t_5; }; /* "asyncpg/protocol/protocol.pyx":299 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def execute(self, PreparedStatementState state, * str portal_name, int limit, return_extra, */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute { PyObject_HEAD PyObject *__pyx_v_ex; int __pyx_v_limit; PyObject *__pyx_v_portal_name; PyObject *__pyx_v_return_extra; struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self; struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state; PyObject *__pyx_v_timeout; PyObject *__pyx_v_waiter; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; PyObject *__pyx_t_3; PyObject *__pyx_t_4; PyObject *__pyx_t_5; }; /* "asyncpg/protocol/protocol.pyx":329 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def close_portal(self, str portal_name, timeout): * */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal { PyObject_HEAD PyObject *__pyx_v_ex; PyObject *__pyx_v_portal_name; struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self; PyObject *__pyx_v_timeout; PyObject *__pyx_v_waiter; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; PyObject *__pyx_t_3; PyObject *__pyx_t_4; PyObject *__pyx_t_5; }; /* "asyncpg/protocol/protocol.pyx":352 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def query(self, query, timeout): * if self.cancel_waiter is not None: */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query { PyObject_HEAD PyObject *__pyx_v_ex; PyObject *__pyx_v_query; struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self; PyObject *__pyx_v_timeout; PyObject *__pyx_v_waiter; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; PyObject *__pyx_t_3; PyObject *__pyx_t_4; PyObject *__pyx_t_5; }; /* "asyncpg/protocol/protocol.pyx":377 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def copy_out(self, copy_stmt, sink, timeout): * if self.cancel_waiter is not None: */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out { PyObject_HEAD PyObject *__pyx_v_buffer; PyObject *__pyx_v_copy_stmt; PyObject *__pyx_v_done; PyObject *__pyx_v_ex; struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self; PyObject *__pyx_v_sink; PyObject *__pyx_v_status_msg; PyObject *__pyx_v_timeout; PyObject *__pyx_v_timer; PyObject *__pyx_v_waiter; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; PyObject *__pyx_t_3; PyObject *__pyx_t_4; PyObject *__pyx_t_5; PyObject *__pyx_t_6; }; /* "asyncpg/protocol/protocol.pyx":431 * return status_msg * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def copy_in(self, copy_stmt, reader, data, * records, PreparedStatementState record_stmt, timeout): */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in { PyObject_HEAD PyObject *__pyx_v_aiter; PyObject *__pyx_v_chunk; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec; PyObject *__pyx_v_codecs; PyObject *__pyx_v_copy_stmt; PyObject *__pyx_v_data; PyObject *__pyx_v_e; Py_ssize_t __pyx_v_i; PyObject *__pyx_v_item; PyObject *__pyx_v_iterator; Py_ssize_t __pyx_v_num_cols; PyObject *__pyx_v_reader; struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_record_stmt; PyObject *__pyx_v_records; PyObject *__pyx_v_row; struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self; struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings; PyObject *__pyx_v_status_msg; PyObject *__pyx_v_timeout; PyObject *__pyx_v_timer; PyObject *__pyx_v_waiter; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_wbuf; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; PyObject *__pyx_t_3; PyObject *__pyx_t_4; PyObject *__pyx_t_5; PyObject *__pyx_t_6; PyObject *__pyx_t_7; Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); PyObject *__pyx_t_10; PyObject *__pyx_t_11; }; /* "asyncpg/protocol/protocol.pyx":570 * return status_msg * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def close_statement(self, PreparedStatementState state, timeout): * if self.cancel_waiter is not None: */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement { PyObject_HEAD PyObject *__pyx_v_ex; struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self; struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state; PyObject *__pyx_v_timeout; PyObject *__pyx_v_waiter; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; PyObject *__pyx_t_3; PyObject *__pyx_t_4; PyObject *__pyx_t_5; }; /* "asyncpg/protocol/protocol.pyx":611 * self.transport = None * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def close(self, timeout): * if self.closing: */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close { PyObject_HEAD struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self; PyObject *__pyx_v_timeout; PyObject *__pyx_t_0; PyObject *__pyx_t_1; PyObject *__pyx_t_2; }; /* "asyncpg/protocol/protocol.pyx":754 * ) * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def _wait_for_cancellation(self): * if self.cancel_sent_waiter is not None: */ struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation { PyObject_HEAD struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self; }; /* "asyncpg/pgproto/buffer.pxd":8 * * * cdef class WriteBuffer: # <<<<<<<<<<<<<< * cdef: * # Preallocated small buffer */ struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer { PyObject *(*len)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *); PyObject *(*write_len_prefixed_utf8)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); PyObject *(*_check_readonly)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *); PyObject *(*_ensure_alloced)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, Py_ssize_t); PyObject *(*_reallocate)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, Py_ssize_t); PyObject *(*reset)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *); PyObject *(*start_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, char); PyObject *(*end_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *); PyObject *(*write_buffer)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *); PyObject *(*write_byte)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, char); PyObject *(*write_bytes)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); PyObject *(*write_len_prefixed_buffer)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *); PyObject *(*write_len_prefixed_bytes)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); PyObject *(*write_bytestring)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); PyObject *(*write_str)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *, PyObject *); PyObject *(*write_frbuf)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); PyObject *(*write_cstr)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, char const *, Py_ssize_t); PyObject *(*write_int16)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int16_t); PyObject *(*write_int32)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int32_t); PyObject *(*write_int64)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int64_t); PyObject *(*write_float)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, float); PyObject *(*write_double)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, double); struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*new_message)(char); struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*new)(void); }; static struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer; static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /* "asyncpg/pgproto/buffer.pxd":68 * * * cdef class ReadBuffer: # <<<<<<<<<<<<<< * cdef: * # A deque of buffers (bytes objects) */ struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer { PyObject *(*len)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); char (*get_message_type)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); int32_t (*get_message_length)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); PyObject *(*feed_data)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, PyObject *); PyObject *(*_ensure_first_buf)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); PyObject *(*_switch_to_next_buf)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); char (*read_byte)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); char const *(*_try_read_bytes)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t); PyObject *(*_read_into)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, char *, Py_ssize_t); PyObject *(*_read_and_discard)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t); PyObject *(*read_bytes)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t); PyObject *(*read_len_prefixed_bytes)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); PyObject *(*read_len_prefixed_utf8)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); PyObject *(*read_uuid)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); int64_t (*read_int64)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); int32_t (*read_int32)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); int16_t (*read_int16)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); PyObject *(*read_null_str)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); int32_t (*take_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); int32_t (*take_message_type)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, char); int32_t (*put_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); char const *(*try_consume_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t *); PyObject *(*consume_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); PyObject *(*discard_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); PyObject *(*redirect_messages)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, char, struct __pyx_opt_args_7asyncpg_7pgproto_7pgproto_10ReadBuffer_redirect_messages *__pyx_optional_args); PyObject *(*consume_messages)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, char); PyObject *(*finish_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); PyObject *(*_finish_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *(*new_message_parser)(PyObject *); }; static struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_ReadBuffer; static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_len(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); static CYTHON_INLINE char __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_type(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); static CYTHON_INLINE int32_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_length(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *); /* "asyncpg/pgproto/codecs/__init__.pxd":8 * * * cdef class CodecContext: # <<<<<<<<<<<<<< * * cpdef get_text_codec(self) */ struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext { PyObject *(*get_text_codec)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, int __pyx_skip_dispatch); PyObject *(*is_encoding_utf8)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *); PyObject *(*get_json_decoder)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, int __pyx_skip_dispatch); PyObject *(*is_decoding_json)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *); PyObject *(*get_json_encoder)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, int __pyx_skip_dispatch); PyObject *(*is_encoding_json)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *); }; static struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_CodecContext; /* "asyncpg/protocol/codecs/base.pyx":20 * * @cython.final * cdef class Codec: # <<<<<<<<<<<<<< * * def __cinit__(self, uint32_t oid): */ struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_Codec { PyObject *(*init)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, PyObject *, PyObject *, PyObject *, enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, __pyx_t_7asyncpg_8protocol_8protocol_encode_func, __pyx_t_7asyncpg_8protocol_8protocol_decode_func, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, PyObject *, PyObject *, PyObject *, Py_UCS4); PyObject *(*encode_scalar)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); PyObject *(*encode_array)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); PyObject *(*encode_array_text)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); PyObject *(*encode_range)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); PyObject *(*encode_multirange)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); PyObject *(*encode_composite)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); PyObject *(*encode_in_python)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); PyObject *(*decode_scalar)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); PyObject *(*decode_array)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); PyObject *(*decode_array_text)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); PyObject *(*decode_range)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); PyObject *(*decode_multirange)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); PyObject *(*decode_composite)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); PyObject *(*decode_in_python)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); PyObject *(*encode)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); PyObject *(*decode)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); PyObject *(*has_encoder)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *); PyObject *(*has_decoder)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *); PyObject *(*is_binary)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *); struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*copy)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *); struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*new_array_codec)(uint32_t, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, Py_UCS4); struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*new_range_codec)(uint32_t, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *); struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*new_multirange_codec)(uint32_t, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *); struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*new_composite_codec)(uint32_t, PyObject *, PyObject *, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, PyObject *, PyObject *, PyObject *); struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*new_python_codec)(uint32_t, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, __pyx_t_7asyncpg_8protocol_8protocol_encode_func, __pyx_t_7asyncpg_8protocol_8protocol_decode_func, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat); }; static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_Codec *__pyx_vtabptr_7asyncpg_8protocol_8protocol_Codec; static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, PyObject *, PyObject *, PyObject *, enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, __pyx_t_7asyncpg_8protocol_8protocol_encode_func, __pyx_t_7asyncpg_8protocol_8protocol_decode_func, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, PyObject *, PyObject *, PyObject *, Py_UCS4); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_scalar(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_array(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_array_text(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_range(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_multirange(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_composite(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_in_python(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_scalar(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_array(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_array_text(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_range(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_multirange(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_composite(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_in_python(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_encoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_is_binary(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *); static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_copy(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *); static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_array_codec(uint32_t, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, Py_UCS4); static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_range_codec(uint32_t, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *); static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_multirange_codec(uint32_t, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *); static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_composite_codec(uint32_t, PyObject *, PyObject *, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, PyObject *, PyObject *, PyObject *); static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_python_codec(uint32_t, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, __pyx_t_7asyncpg_8protocol_8protocol_encode_func, __pyx_t_7asyncpg_8protocol_8protocol_decode_func, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat); /* "asyncpg/protocol/codecs/base.pyx":485 * * * cdef class DataCodecConfig: # <<<<<<<<<<<<<< * def __init__(self): * # Codec instance cache for derived types: */ struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_DataCodecConfig { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*get_codec)(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *, uint32_t, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec *__pyx_optional_args); struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*get_custom_codec)(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *, uint32_t, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat); }; static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_vtabptr_7asyncpg_8protocol_8protocol_DataCodecConfig; static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *, uint32_t, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec *__pyx_optional_args); static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_custom_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *, uint32_t, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat); /* "asyncpg/protocol/settings.pyx":12 * * @cython.final * cdef class ConnectionSettings(pgproto.CodecContext): # <<<<<<<<<<<<<< * * def __cinit__(self): */ struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_ConnectionSettings { struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext __pyx_base; PyObject *(*add_setting)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *); PyObject *(*register_data_types)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, int __pyx_skip_dispatch); PyObject *(*add_python_codec)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); PyObject *(*remove_python_codec)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); PyObject *(*clear_type_cache)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, int __pyx_skip_dispatch); PyObject *(*set_builtin_type_codec)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*get_data_codec)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, uint32_t, int __pyx_skip_dispatch, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec *__pyx_optional_args); }; static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_vtabptr_7asyncpg_8protocol_8protocol_ConnectionSettings; static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_add_setting(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_register_data_types(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, int __pyx_skip_dispatch); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_add_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_remove_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_clear_type_cache(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, int __pyx_skip_dispatch); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_set_builtin_type_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, uint32_t, int __pyx_skip_dispatch, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec *__pyx_optional_args); /* "asyncpg/protocol/scram.pyx":18 * * @cython.final * cdef class SCRAMAuthentication: # <<<<<<<<<<<<<< * """Contains the protocol for generating and a SCRAM hashed password. * */ struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_SCRAMAuthentication { PyObject *(*create_client_first_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *); PyObject *(*create_client_final_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *); PyObject *(*parse_server_first_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *); PyObject *(*verify_server_final_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *); PyObject *(*_bytes_xor)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *, PyObject *); PyObject *(*_generate_client_nonce)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, int); PyObject *(*_generate_client_proof)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *); PyObject *(*_generate_salted_password)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *, PyObject *, int); PyObject *(*_normalize_password)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *); }; static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_vtabptr_7asyncpg_8protocol_8protocol_SCRAMAuthentication; static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_create_client_first_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_create_client_final_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_parse_server_first_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_verify_server_final_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__bytes_xor(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *, PyObject *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_client_nonce(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, int); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_client_proof(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_salted_password(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *, PyObject *, int); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__normalize_password(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *); /* "asyncpg/protocol/coreproto.pyx":24 * * * cdef class CoreProtocol: # <<<<<<<<<<<<<< * * def __init__(self, addr, con_params): */ struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol { PyObject *(*is_in_transaction)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, int __pyx_skip_dispatch); PyObject *(*_process__auth)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char); PyObject *(*_process__prepare)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char); PyObject *(*_process__bind_execute)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char); PyObject *(*_process__bind_execute_many)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char); PyObject *(*_process__close_stmt_portal)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char); PyObject *(*_process__simple_query)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char); PyObject *(*_process__bind)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char); PyObject *(*_process__copy_out)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char); PyObject *(*_process__copy_out_data)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char); PyObject *(*_process__copy_in)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char); PyObject *(*_process__copy_in_data)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char); PyObject *(*_parse_msg_authentication)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); PyObject *(*_parse_msg_parameter_status)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); PyObject *(*_parse_msg_notification)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); PyObject *(*_parse_msg_backend_key_data)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); PyObject *(*_parse_msg_ready_for_query)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); PyObject *(*_parse_data_msgs)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); PyObject *(*_parse_copy_data_msgs)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); PyObject *(*_parse_msg_error_response)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *); PyObject *(*_parse_msg_command_complete)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); PyObject *(*_write_copy_data_msg)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *); PyObject *(*_write_copy_done_msg)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); PyObject *(*_write_copy_fail_msg)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *); PyObject *(*_auth_password_message_cleartext)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); PyObject *(*_auth_password_message_md5)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *); PyObject *(*_auth_password_message_sasl_initial)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *); PyObject *(*_auth_password_message_sasl_continue)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *); PyObject *(*_auth_gss_init_gssapi)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); PyObject *(*_auth_gss_init_sspi)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, int); PyObject *(*_auth_gss_get_service)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); PyObject *(*_auth_gss_step)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *); PyObject *(*_write)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *); PyObject *(*_writelines)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *); PyObject *(*_read_server_messages)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); PyObject *(*_push_result)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); PyObject *(*_reset_result)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); PyObject *(*_set_state)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState); PyObject *(*_ensure_connected)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*_build_parse_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *); struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*_build_bind_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *); struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*_build_empty_bind_data)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*_build_execute_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, int32_t); PyObject *(*_connect)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); PyObject *(*_prepare_and_describe)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *); PyObject *(*_send_parse_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *); PyObject *(*_send_bind_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int32_t); PyObject *(*_bind_execute)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int32_t); int (*_bind_execute_many)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, PyObject *, int); int (*_bind_execute_many_more)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_more *__pyx_optional_args); PyObject *(*_bind_execute_many_fail)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_fail *__pyx_optional_args); PyObject *(*_bind)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *); PyObject *(*_execute)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, int32_t); PyObject *(*_close)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, int); PyObject *(*_simple_query)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *); PyObject *(*_copy_out)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *); PyObject *(*_copy_in)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *); PyObject *(*_terminate)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); PyObject *(*_decode_row)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char const *, Py_ssize_t); PyObject *(*_on_result)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *); PyObject *(*_on_notification)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, PyObject *); PyObject *(*_on_notice)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *); PyObject *(*_set_server_parameter)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *); PyObject *(*_on_connection_lost)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *); }; static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_vtabptr_7asyncpg_8protocol_8protocol_CoreProtocol; /* "asyncpg/protocol/prepared_stmt.pyx":12 * * @cython.final * cdef class PreparedStatementState: # <<<<<<<<<<<<<< * * def __cinit__( */ struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_PreparedStatementState { PyObject *(*_encode_bind_msg)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, PyObject *, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg *__pyx_optional_args); PyObject *(*_init_codecs)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, int __pyx_skip_dispatch); PyObject *(*_ensure_rows_decoder)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *); PyObject *(*_ensure_args_encoder)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *); PyObject *(*_set_row_desc)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, PyObject *); PyObject *(*_set_args_desc)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, PyObject *); PyObject *(*_decode_row)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, char const *, Py_ssize_t); }; static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_vtabptr_7asyncpg_8protocol_8protocol_PreparedStatementState; static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, PyObject *, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg *__pyx_optional_args); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__init_codecs(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, int __pyx_skip_dispatch); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_rows_decoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_args_encoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_row_desc(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, PyObject *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_args_desc(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, PyObject *); static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__decode_row(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, char const *, Py_ssize_t); /* "asyncpg/protocol/protocol.pyx":75 * * * cdef class BaseProtocol(CoreProtocol): # <<<<<<<<<<<<<< * def __init__(self, addr, connected_fut, con_params, record_class: type, loop): * # type of `con_params` is `_ConnectionParameters` */ struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol { struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol __pyx_base; PyObject *(*get_connection)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *); PyObject *(*_get_timeout_impl)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *); PyObject *(*_check_state)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *); PyObject *(*_new_waiter)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *); PyObject *(*_coreproto_error)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *); PyObject *(*_on_result__connect)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *); PyObject *(*_on_result__prepare)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *); PyObject *(*_on_result__bind_and_exec)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *); PyObject *(*_on_result__close_stmt_or_portal)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *); PyObject *(*_on_result__simple_query)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *); PyObject *(*_on_result__bind)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *); PyObject *(*_on_result__copy_out)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *); PyObject *(*_on_result__copy_in)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *); PyObject *(*_handle_waiter_on_connection_lost)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *); PyObject *(*_dispatch_result)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *); PyObject *(*resume_reading)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *); PyObject *(*pause_reading)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *); }; static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_vtabptr_7asyncpg_8protocol_8protocol_BaseProtocol; static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_resume_reading(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *); static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_pause_reading(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *); /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* dict_getitem_default.proto */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* UnpackUnboundCMethod.proto */ typedef struct { PyObject *type; PyObject **method_name; PyCFunction func; PyObject *method; int flag; } __Pyx_CachedCFunction; /* CallUnboundCMethod1.proto */ static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #else #define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) #endif /* CallUnboundCMethod2.proto */ static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); #else #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* RaiseUnexpectedTypeError.proto */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); #define __Pyx_PyObject_Dict_GetItem(obj, name)\ (likely(PyDict_CheckExact(obj)) ?\ __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) #else #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) #endif /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* PyObjectFormatSimple.proto */ #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ PyObject_Format(s, f)) #elif PY_MAJOR_VERSION < 3 #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\ PyObject_Format(s, f)) #elif CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\ likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\ PyObject_Format(s, f)) #else #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ PyObject_Format(s, f)) #endif /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif /* py_dict_pop.proto */ static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value); /* JoinPyUnicode.proto */ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char); /* py_dict_clear.proto */ #define __Pyx_PyDict_Clear(d) (PyDict_Clear(d), 0) /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* PyObjectFormatAndDecref.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f); static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f); /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) #endif /* RaiseUnboundLocalError.proto */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_AddCObj(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* BuildPyUnicode.proto */ static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, int prepend_sign, char padding_char); /* CIntToPyUnicode.proto */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char); /* ListCompAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len)) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* bytes_tailmatch.proto */ static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg, Py_ssize_t start, Py_ssize_t end, int direction); static int __Pyx_PyBytes_Tailmatch(PyObject* self, PyObject* substr, Py_ssize_t start, Py_ssize_t end, int direction); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* pep479.proto */ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); /* RaiseClosureNameError.proto */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* CIntToPyUnicode.proto */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState value, Py_ssize_t width, char padding_char, char format_char); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); #endif /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* decode_c_string_utf16.proto */ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 0; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = -1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } /* decode_c_bytes.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* decode_bytes.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_bytes( PyObject* string, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { char* as_c_string; Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS as_c_string = PyBytes_AS_STRING(string); size = PyBytes_GET_SIZE(string); #else if (PyBytes_AsStringAndSize(string, &as_c_string, &size) < 0) { return NULL; } #endif return __Pyx_decode_c_bytes( as_c_string, size, start, stop, encoding, errors, decode_func); } /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); /* UnpackTupleError.proto */ static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /* UnpackTuple2.proto */ #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ (likely(is_tuple || PyTuple_Check(tuple)) ?\ (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); static int __Pyx_unpack_tuple2_generic( PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); /* dict_iter.proto */ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_is_dict); static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); /* IterNext.proto */ #define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL) static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *); /* CIntToPyUnicode.proto */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char); /* UnicodeConcatInPlace.proto */ # if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #if CYTHON_REFNANNY #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, __pyx_refnanny) #else #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right) #endif static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right #if CYTHON_REFNANNY , void* __pyx_refnanny #endif ); #else #define __Pyx_PyUnicode_ConcatInPlace __Pyx_PyUnicode_Concat #endif #define __Pyx_PyUnicode_ConcatInPlaceSafe(left, right) ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_ConcatInPlace(left, right)) /* PyDictContains.proto */ static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { int result = PyDict_Contains(dict, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* RaiseKeywordRequired.proto */ static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* CoroutineBase.proto */ struct __pyx_CoroutineObject; typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); #if CYTHON_USE_EXC_INFO_STACK #define __Pyx_ExcInfoStruct _PyErr_StackItem #else typedef struct { PyObject *exc_type; PyObject *exc_value; PyObject *exc_traceback; } __Pyx_ExcInfoStruct; #endif typedef struct __pyx_CoroutineObject { PyObject_HEAD __pyx_coroutine_body_t body; PyObject *closure; __Pyx_ExcInfoStruct gi_exc_state; PyObject *gi_weakreflist; PyObject *classobj; PyObject *yieldfrom; PyObject *gi_name; PyObject *gi_qualname; PyObject *gi_modulename; PyObject *gi_code; PyObject *gi_frame; int resume_label; char is_running; } __pyx_CoroutineObject; static __pyx_CoroutineObject *__Pyx__Coroutine_New( PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name); static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name); static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); static int __Pyx_Coroutine_clear(PyObject *self); static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); static PyObject *__Pyx_Coroutine_Close(PyObject *self); static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); #if CYTHON_USE_EXC_INFO_STACK #define __Pyx_Coroutine_SwapException(self) #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state) #else #define __Pyx_Coroutine_SwapException(self) {\ __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\ __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\ } #define __Pyx_Coroutine_ResetAndClearException(self) {\ __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\ (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\ } #endif #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) #else #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) #endif static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PatchModuleWithCoroutine.proto */ static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); /* PatchGeneratorABC.proto */ static int __Pyx_patch_abc(void); /* Coroutine.proto */ #define __Pyx_Coroutine_USED #define __Pyx_Coroutine_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CoroutineType) #define __Pyx_Coroutine_Check(obj) __Pyx_Coroutine_CheckExact(obj) #define __Pyx_CoroutineAwait_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CoroutineAwaitType) #define __Pyx_Coroutine_New(body, code, closure, name, qualname, module_name)\ __Pyx__Coroutine_New(__pyx_CoroutineType, body, code, closure, name, qualname, module_name) static int __pyx_Coroutine_init(PyObject *module); static PyObject *__Pyx__Coroutine_await(PyObject *coroutine); typedef struct { PyObject_HEAD PyObject *coroutine; } __pyx_CoroutineAwaitObject; static PyObject *__Pyx_CoroutineAwait_Close(__pyx_CoroutineAwaitObject *self, PyObject *arg); static PyObject *__Pyx_CoroutineAwait_Throw(__pyx_CoroutineAwaitObject *self, PyObject *args); /* GetAwaitIter.proto */ static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAwaitableIter(PyObject *o); static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *o); /* CoroutineYieldFrom.proto */ static CYTHON_INLINE PyObject* __Pyx_Coroutine_Yield_From(__pyx_CoroutineObject *gen, PyObject *source); /* ReturnWithStopIteration.proto */ #define __Pyx_ReturnWithStopIteration(value)\ if (value == Py_None) PyErr_SetNone(PyExc_StopIteration); else __Pyx__ReturnWithStopIteration(value) static void __Pyx__ReturnWithStopIteration(PyObject* value); /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* AsyncIter.proto */ static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAsyncIter(PyObject *o); static CYTHON_INLINE PyObject *__Pyx_Coroutine_AsyncIterNext(PyObject *o); /* StopAsyncIteration.proto */ #define __Pyx_StopAsyncIteration_USED static PyObject *__Pyx_PyExc_StopAsyncIteration; static int __pyx_StopAsyncIteration_init(PyObject *module); /* PyObject_Unicode.proto */ #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyObject_Unicode(obj)\ (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj)) #else #define __Pyx_PyObject_Unicode(obj)\ (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj)) #endif /* AssertionsEnabled.proto */ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define __Pyx_init_assertions_enabled() (0) #define __pyx_assertions_enabled() (1) #elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) static int __pyx_assertions_enabled_flag; #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) static int __Pyx_init_assertions_enabled(void) { PyObject *builtins, *debug, *debug_str; int flag; builtins = PyEval_GetBuiltins(); if (!builtins) goto bad; debug_str = PyUnicode_FromStringAndSize("__debug__", 9); if (!debug_str) goto bad; debug = PyObject_GetItem(builtins, debug_str); Py_DECREF(debug_str); if (!debug) goto bad; flag = PyObject_IsTrue(debug); Py_DECREF(debug); if (flag == -1) goto bad; __pyx_assertions_enabled_flag = flag; return 0; bad: __pyx_assertions_enabled_flag = 1; return -1; } #else #define __Pyx_init_assertions_enabled() (0) #define __pyx_assertions_enabled() (!Py_OptimizeFlag) #endif /* pybytes_as_double.proto */ static double __Pyx_SlowPyString_AsDouble(PyObject *obj); static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length); static CYTHON_INLINE double __Pyx_PyBytes_AsDouble(PyObject *obj) { char* as_c_string; Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS as_c_string = PyBytes_AS_STRING(obj); size = PyBytes_GET_SIZE(obj); #else if (PyBytes_AsStringAndSize(obj, &as_c_string, &size) < 0) { return (double)-1; } #endif return __Pyx__PyBytes_AsDouble(obj, as_c_string, size); } static CYTHON_INLINE double __Pyx_PyByteArray_AsDouble(PyObject *obj) { char* as_c_string; Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS as_c_string = PyByteArray_AS_STRING(obj); size = PyByteArray_GET_SIZE(obj); #else as_c_string = PyByteArray_AsString(obj); if (as_c_string == NULL) { return (double)-1; } size = PyByteArray_Size(obj); #endif return __Pyx__PyBytes_AsDouble(obj, as_c_string, size); } /* pyunicode_as_double.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS static const char* __Pyx__PyUnicode_AsDouble_Copy(const void* data, const int kind, char* buffer, Py_ssize_t start, Py_ssize_t end) { int last_was_punctuation; Py_ssize_t i; last_was_punctuation = 1; for (i=start; i <= end; i++) { Py_UCS4 chr = PyUnicode_READ(kind, data, i); int is_punctuation = (chr == '_') | (chr == '.'); *buffer = (char)chr; buffer += (chr != '_'); if (unlikely(chr > 127)) goto parse_failure; if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure; last_was_punctuation = is_punctuation; } if (unlikely(last_was_punctuation)) goto parse_failure; *buffer = '\0'; return buffer; parse_failure: return NULL; } static double __Pyx__PyUnicode_AsDouble_inf_nan(const void* data, int kind, Py_ssize_t start, Py_ssize_t length) { int matches = 1; Py_UCS4 chr; Py_UCS4 sign = PyUnicode_READ(kind, data, start); int is_signed = (sign == '-') | (sign == '+'); start += is_signed; length -= is_signed; switch (PyUnicode_READ(kind, data, start)) { #ifdef Py_NAN case 'n': case 'N': if (unlikely(length != 3)) goto parse_failure; chr = PyUnicode_READ(kind, data, start+1); matches &= (chr == 'a') | (chr == 'A'); chr = PyUnicode_READ(kind, data, start+2); matches &= (chr == 'n') | (chr == 'N'); if (unlikely(!matches)) goto parse_failure; return (sign == '-') ? -Py_NAN : Py_NAN; #endif case 'i': case 'I': if (unlikely(length < 3)) goto parse_failure; chr = PyUnicode_READ(kind, data, start+1); matches &= (chr == 'n') | (chr == 'N'); chr = PyUnicode_READ(kind, data, start+2); matches &= (chr == 'f') | (chr == 'F'); if (likely(length == 3 && matches)) return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; if (unlikely(length != 8)) goto parse_failure; chr = PyUnicode_READ(kind, data, start+3); matches &= (chr == 'i') | (chr == 'I'); chr = PyUnicode_READ(kind, data, start+4); matches &= (chr == 'n') | (chr == 'N'); chr = PyUnicode_READ(kind, data, start+5); matches &= (chr == 'i') | (chr == 'I'); chr = PyUnicode_READ(kind, data, start+6); matches &= (chr == 't') | (chr == 'T'); chr = PyUnicode_READ(kind, data, start+7); matches &= (chr == 'y') | (chr == 'Y'); if (unlikely(!matches)) goto parse_failure; return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; default: goto parse_failure; } return 0.0; parse_failure: return -1.0; } static double __Pyx_PyUnicode_AsDouble_WithSpaces(PyObject *obj) { double value; const char *last; char *end; Py_ssize_t start, length = PyUnicode_GET_LENGTH(obj); const int kind = PyUnicode_KIND(obj); const void* data = PyUnicode_DATA(obj); start = 0; while (Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, start))) start++; while (start < length - 1 && Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, length - 1))) length--; length -= start; if (unlikely(length <= 0)) goto fallback; value = __Pyx__PyUnicode_AsDouble_inf_nan(data, kind, start, length); if (unlikely(value == -1.0)) goto fallback; if (value != 0.0) return value; if (length < 40) { char number[40]; last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length); if (unlikely(!last)) goto fallback; value = PyOS_string_to_double(number, &end, NULL); } else { char *number = (char*) PyMem_Malloc((length + 1) * sizeof(char)); if (unlikely(!number)) goto fallback; last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length); if (unlikely(!last)) { PyMem_Free(number); goto fallback; } value = PyOS_string_to_double(number, &end, NULL); PyMem_Free(number); } if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) { return value; } fallback: return __Pyx_SlowPyString_AsDouble(obj); } #endif static CYTHON_INLINE double __Pyx_PyUnicode_AsDouble(PyObject *obj) { #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS if (unlikely(__Pyx_PyUnicode_READY(obj) == -1)) return (double)-1; if (likely(PyUnicode_IS_ASCII(obj))) { const char *s; Py_ssize_t length; s = PyUnicode_AsUTF8AndSize(obj, &length); return __Pyx__PyBytes_AsDouble(obj, s, length); } return __Pyx_PyUnicode_AsDouble_WithSpaces(obj); #else return __Pyx_SlowPyString_AsDouble(obj); #endif } /* pynumber_float.proto */ static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj); #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : __Pyx__PyNumber_Float(x)) /* HasAttr.proto */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* CallNextTpDealloc.proto */ static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); /* CallNextTpTraverse.proto */ static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); /* CallNextTpClear.proto */ static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* SetVTable.proto */ static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable); /* GetVTable.proto */ static void* __Pyx_GetVtable(PyTypeObject *type); /* MergeVTables.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type); #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_11 #define __PYX_HAVE_RT_ImportType_proto_3_0_11 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_11 { __Pyx_ImportType_CheckSize_Error_3_0_11 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_11 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_11 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size); #endif /* PatchInspect.proto */ static PyObject* __Pyx_patch_inspect(PyObject* module); /* PatchAsyncIO.proto */ static PyObject* __Pyx_patch_asyncio(PyObject* module); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* Py3UpdateBases.proto */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* UnicodeAsUCS4.proto */ static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value); /* CIntFromPy.proto */ static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus value); /* CIntFromPy.proto */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType value); /* CIntFromPy.proto */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState value); /* CIntFromPy.proto */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus value); /* CIntFromPy.proto */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value); /* CIntFromPy.proto */ static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_CodecType(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value); /* ObjectAsUCS4.proto */ #define __Pyx_PyObject_AsPy_UCS4(x)\ (likely(PyUnicode_Check(x)) ? __Pyx_PyUnicode_AsPy_UCS4(x) : __Pyx__PyObject_AsPy_UCS4(x)) static Py_UCS4 __Pyx__PyObject_AsPy_UCS4(PyObject*); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* Generator.proto */ #define __Pyx_Generator_USED #define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_GeneratorType) #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(PyObject *module); /* IterableCoroutine.proto */ #define __Pyx_IterableCoroutine_USED #undef __Pyx_Coroutine_Check #define __Pyx_Coroutine_Check(obj) (__Pyx_Coroutine_CheckExact(obj) || __Pyx_IS_TYPE(obj, __pyx_IterableCoroutineType)) #define __Pyx_IterableCoroutine_New(body, code, closure, name, qualname, module_name)\ __Pyx__Coroutine_New(__pyx_IterableCoroutineType, body, code, closure, name, qualname, module_name) static int __pyx_IterableCoroutine_init(PyObject *module); /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* VoidPtrExport.proto */ static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); /* FunctionImport.proto */ static int __Pyx_ImportFunction_3_0_11(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/ static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_s); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_len(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE char __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_type(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/ static CYTHON_INLINE int32_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_length(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_add_setting(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_val); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_is_encoding_utf8(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_text_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_register_data_types(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_types, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_add_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typeinfos, PyObject *__pyx_v_typekind, PyObject *__pyx_v_encoder, PyObject *__pyx_v_decoder, PyObject *__pyx_v_format, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_remove_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_clear_type_cache(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_set_builtin_type_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typekind, PyObject *__pyx_v_alias_to, PyObject *__pyx_v_format, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, uint32_t __pyx_v_oid, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec *__pyx_optional_args); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, PyObject *__pyx_v_kind, enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType __pyx_v_type, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_v_xformat, __pyx_t_7asyncpg_8protocol_8protocol_encode_func __pyx_v_c_encoder, __pyx_t_7asyncpg_8protocol_8protocol_decode_func __pyx_v_c_decoder, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_base_codec, PyObject *__pyx_v_py_encoder, PyObject *__pyx_v_py_decoder, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_element_codec, PyObject *__pyx_v_element_type_oids, PyObject *__pyx_v_element_names, PyObject *__pyx_v_element_codecs, Py_UCS4 __pyx_v_element_delimiter); /* proto*/ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_copy(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_scalar(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_array(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_array_text(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_range(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_multirange(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_composite(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_in_python(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_scalar(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_array(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_array_text(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_range(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_multirange(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_composite(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_in_python(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_encoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_is_binary(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self); /* proto*/ static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_array_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_element_codec, Py_UCS4 __pyx_v_element_delimiter); /* proto*/ static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_range_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_element_codec); /* proto*/ static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_multirange_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_element_codec); /* proto*/ static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_composite_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, PyObject *__pyx_v_element_codecs, PyObject *__pyx_v_element_type_oids, PyObject *__pyx_v_element_names); /* proto*/ static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_python_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, PyObject *__pyx_v_kind, PyObject *__pyx_v_encoder, PyObject *__pyx_v_decoder, __pyx_t_7asyncpg_8protocol_8protocol_encode_func __pyx_v_c_encoder, __pyx_t_7asyncpg_8protocol_8protocol_decode_func __pyx_v_c_decoder, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_base_codec, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_v_xformat); /* proto*/ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, uint32_t __pyx_v_oid, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec *__pyx_optional_args); /* proto*/ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_custom_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, uint32_t __pyx_v_oid, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_create_client_first_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_username); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_create_client_final_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_password); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_parse_server_first_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_server_response); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_verify_server_final_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_server_final_message); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__bytes_xor(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_client_nonce(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, int __pyx_v_num_bytes); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_client_proof(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_password); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_salted_password(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_password, PyObject *__pyx_v_salt, int __pyx_v_iterations); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__normalize_password(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_original_password); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol_is_in_transaction(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__read_server_messages(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__auth(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__prepare(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__bind_execute(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__bind_execute_many(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__bind(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__close_stmt_portal(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__simple_query(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_out(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_out_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_in(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_in_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_command_complete(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_copy_data_msgs(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_copy_data_msg(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_data); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_copy_done_msg(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_copy_fail_msg(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_cause); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_data_msgs(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_backend_key_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_parameter_status(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_notification(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_authentication(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_cleartext(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_md5(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_salt); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_sasl_initial(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_sasl_auth_methods); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_sasl_continue(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_server_response); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_init_gssapi(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_init_sspi(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, int __pyx_v_negotiate); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_get_service(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_step(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_server_response); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_ready_for_query(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_error_response(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_is_error); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__push_result(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__reset_result(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState __pyx_v_new_state); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__ensure_connected(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/ static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_parse_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_stmt_name, PyObject *__pyx_v_query); /* proto*/ static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_bind_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_stmt_name, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_bind_data); /* proto*/ static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_empty_bind_data(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/ static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_execute_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, int32_t __pyx_v_limit); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__connect(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__send_parse_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_stmt_name, PyObject *__pyx_v_query); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__prepare_and_describe(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_stmt_name, PyObject *__pyx_v_query); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__send_bind_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_stmt_name, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_bind_data, int32_t __pyx_v_limit); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_stmt_name, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_bind_data, int32_t __pyx_v_limit); /* proto*/ static int __pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_stmt_name, PyObject *__pyx_v_bind_data, int __pyx_v_return_rows); /* proto*/ static int __pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_more(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_more *__pyx_optional_args); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_fail(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_error, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_fail *__pyx_optional_args); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__execute(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, int32_t __pyx_v_limit); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_stmt_name, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_bind_data); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__close(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_name, int __pyx_v_is_portal); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__simple_query(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_query); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__copy_out(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_copy_stmt); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__copy_in(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_copy_stmt); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__terminate(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_buf); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__writelines(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_buffers); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__decode_row(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED char const *__pyx_v_buf, CYTHON_UNUSED Py_ssize_t __pyx_v_buf_len); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__set_server_parameter(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_val); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_result(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_notice(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_parsed); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_notification(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_pid, CYTHON_UNUSED PyObject *__pyx_v_channel, CYTHON_UNUSED PyObject *__pyx_v_payload); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_connection_lost(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__init_codecs(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, PyObject *__pyx_v_args, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg *__pyx_optional_args); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_rows_decoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_args_encoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_row_desc(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, PyObject *__pyx_v_desc); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_args_desc(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, PyObject *__pyx_v_desc); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__decode_row(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, char const *__pyx_v_cbuf, Py_ssize_t __pyx_v_buf_len); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_get_connection(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_resume_reading(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_pause_reading(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__handle_waiter_on_connection_lost(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_cause); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__set_server_parameter(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_val); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__check_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__coreproto_error(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__new_waiter(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__connect(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__prepare(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__bind_and_exec(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__bind(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__close_stmt_or_portal(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__simple_query(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__copy_out(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__copy_in(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__decode_row(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, char const *__pyx_v_buf, Py_ssize_t __pyx_v_buf_len); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__dispatch_result(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_notice(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_parsed); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_notification(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_pid, PyObject *__pyx_v_channel, PyObject *__pyx_v_payload); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_connection_lost(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_exc); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__write(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_buf); /* proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__writelines(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_buffers); /* proto*/ /* Module declarations from "libc.stdint" */ /* Module declarations from "asyncpg.pgproto.debug" */ /* Module declarations from "cython" */ /* Module declarations from "cpython.version" */ /* Module declarations from "__builtin__" */ /* Module declarations from "cpython.type" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "cpython.object" */ /* Module declarations from "cpython.ref" */ /* Module declarations from "cpython.exc" */ /* Module declarations from "cpython.module" */ /* Module declarations from "cpython.mem" */ /* Module declarations from "cpython.tuple" */ /* Module declarations from "cpython.list" */ /* Module declarations from "cpython.sequence" */ /* Module declarations from "cpython.mapping" */ /* Module declarations from "cpython.iterator" */ /* Module declarations from "cpython.number" */ /* Module declarations from "cpython.int" */ /* Module declarations from "__builtin__" */ /* Module declarations from "cpython.bool" */ /* Module declarations from "cpython.long" */ /* Module declarations from "cpython.float" */ /* Module declarations from "__builtin__" */ /* Module declarations from "cpython.complex" */ /* Module declarations from "cpython.string" */ /* Module declarations from "libc.stddef" */ /* Module declarations from "cpython.unicode" */ /* Module declarations from "cpython.pyport" */ /* Module declarations from "cpython.dict" */ /* Module declarations from "cpython.instance" */ /* Module declarations from "cpython.function" */ /* Module declarations from "cpython.method" */ /* Module declarations from "cpython.weakref" */ /* Module declarations from "cpython.getargs" */ /* Module declarations from "cpython.pythread" */ /* Module declarations from "cpython.pystate" */ /* Module declarations from "cpython.cobject" */ /* Module declarations from "cpython.oldbuffer" */ /* Module declarations from "cpython.set" */ /* Module declarations from "cpython.buffer" */ /* Module declarations from "cpython.bytes" */ /* Module declarations from "cpython.pycapsule" */ /* Module declarations from "cpython.contextvars" */ /* Module declarations from "cpython" */ /* Module declarations from "asyncpg.pgproto.pgproto" */ static CYTHON_INLINE Py_ssize_t __pyx_f_7asyncpg_7pgproto_7pgproto_frb_get_len(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static CYTHON_INLINE void __pyx_f_7asyncpg_7pgproto_7pgproto_frb_set_len(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, Py_ssize_t); /*proto*/ static CYTHON_INLINE void __pyx_f_7asyncpg_7pgproto_7pgproto_frb_init(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, char const *, Py_ssize_t); /*proto*/ static CYTHON_INLINE char const *__pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, Py_ssize_t); /*proto*/ static CYTHON_INLINE char const *__pyx_f_7asyncpg_7pgproto_7pgproto_frb_read_all(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static CYTHON_INLINE struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_f_7asyncpg_7pgproto_7pgproto_frb_slice_from(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, Py_ssize_t); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_frb_check)(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, Py_ssize_t); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_date_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_date_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_date_encode_tuple)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_date_decode_tuple)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_encode_tuple)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_decode_tuple)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_timestamptz_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_timestamptz_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_time_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_time_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_time_encode_tuple)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_time_decode_tuple)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_encode_tuple)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_decode_tuple)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_interval_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_interval_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_interval_encode_tuple)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_interval_decode_tuple)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_bits_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_bits_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_bool_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_bool_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_box_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_box_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_line_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_line_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_lseg_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_lseg_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_point_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_point_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_path_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_path_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_poly_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_poly_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_circle_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_circle_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_hstore_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_hstore_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_int2_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_int2_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_int4_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_int4_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_uint4_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_uint4_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_int8_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_int8_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_uint8_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_uint8_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_float4_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_float4_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_float8_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_float8_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_jsonb_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_jsonb_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_jsonpath_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_jsonpath_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_as_pg_string_and_size)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, PyObject *, char **, Py_ssize_t *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_uuid_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_uuid_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_encode_text)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_text)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_encode_binary)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_binary)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_void_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_void_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_tid_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_tid_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_cidr_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_cidr_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_inet_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_inet_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ /* Module declarations from "asyncpg.pgproto" */ /* Module declarations from "asyncpg.protocol" */ /* Module declarations from "asyncpg.protocol.cpythonx" */ /* Module declarations from "asyncpg.protocol.record" */ /* Module declarations from "asyncpg.pgproto.hton" */ /* Module declarations from "asyncpg.protocol.protocol" */ static PyObject *__pyx_v_7asyncpg_8protocol_8protocol_ARRAY_TYPES = 0; static PyObject *__pyx_7genexpr__pyx_v_7asyncpg_8protocol_8protocol_k; static PyObject *__pyx_7genexpr__pyx_v_7asyncpg_8protocol_8protocol_v; static PyObject *__pyx_v_7asyncpg_8protocol_8protocol_ENCODINGS_MAP = 0; static void *__pyx_v_7asyncpg_8protocol_8protocol_binary_codec_map[((0x13D8 + 1) * 2)]; static void *__pyx_v_7asyncpg_8protocol_8protocol_text_codec_map[((0x13D8 + 1) * 2)]; static PyObject *__pyx_v_7asyncpg_8protocol_8protocol_EXTRA_CODECS = 0; static Py_UCS4 *__pyx_v_7asyncpg_8protocol_8protocol_APG_NULL; static PyObject *__pyx_v_7asyncpg_8protocol_8protocol_AUTH_METHOD_NAME = 0; static PyObject *__pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE = 0; static PyObject *__pyx_v_7asyncpg_8protocol_8protocol_FLUSH_MESSAGE = 0; static PyObject *__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_k; static PyObject *__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_v; static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_get_python_encoding(PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_codec_encode_func_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *, void const *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_codec_decode_func_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, void const *); /*proto*/ static uint32_t __pyx_f_7asyncpg_8protocol_8protocol_pylong_as_oid(PyObject *); /*proto*/ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_get_core_codec(uint32_t, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_core_codec *__pyx_optional_args); /*proto*/ static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol_has_core_codec(uint32_t); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(uint32_t, __pyx_t_7asyncpg_8protocol_8protocol_encode_func, __pyx_t_7asyncpg_8protocol_8protocol_decode_func, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_register_core_codec *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_register_extra_codec(PyObject *, __pyx_t_7asyncpg_8protocol_8protocol_encode_func, __pyx_t_7asyncpg_8protocol_8protocol_decode_func, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat); /*proto*/ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_get_extra_codec(PyObject *, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat); /*proto*/ static CYTHON_INLINE uint32_t __pyx_f_7asyncpg_8protocol_8protocol__apg_tolower(uint32_t); /*proto*/ static int __pyx_f_7asyncpg_8protocol_8protocol_apg_strcasecmp(Py_UCS4 const *, Py_UCS4 const *); /*proto*/ static int __pyx_f_7asyncpg_8protocol_8protocol_apg_strcasecmp_char(char const *, char const *); /*proto*/ static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace(Py_UCS4); /*proto*/ static Py_UCS4 *__pyx_f_7asyncpg_8protocol_8protocol_apg_parse_int32(Py_UCS4 *, int32_t *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_bits_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_bytea_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_datetime_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_float_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_geometry_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_hstore_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_json_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_int_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_pseudo_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_text_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_tid_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_txid_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_tsearch_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_uuid_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_numeric_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_network_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_monetary_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_all_pgproto_codecs(void); /*proto*/ static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol__is_trivial_container(PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol__is_array_iterable(PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol__is_sub_array_iterable(PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__get_array_shape(PyObject *, int32_t *, int32_t *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__write_array_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, int32_t, int32_t, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex, void const *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_array_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *, uint32_t, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex, void const *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__write_textarray_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, int32_t, int32_t, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex, void const *, Py_UCS4); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_textarray_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex, void const *, Py_UCS4); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_array_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex, void const *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__nested_array_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex, void const *, int32_t, int32_t *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_textarray_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex, void const *, Py_UCS4); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__textarray_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, Py_UCS4 *, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex, void const *, Py_UCS4); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__UnexpectedCharacter(Py_UCS4 const *, Py_UCS4 const *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__infer_array_dims(Py_UCS4 const *, Py_UCS4, int32_t *, int32_t *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_uint4_encode_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *, void const *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_uint4_decode_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, void const *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_arrayoid_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_arrayoid_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_text_encode_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *, void const *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_text_decode_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, void const *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_arraytext_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_arraytext_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_array_codecs(void); /*proto*/ static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol__range_has_lbound(uint8_t); /*proto*/ static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol__range_has_ubound(uint8_t); /*proto*/ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol__RangeArgumentType __pyx_f_7asyncpg_8protocol_8protocol__range_type(PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_range_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *, uint32_t, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex, void const *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_range_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex, void const *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_multirange_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *, uint32_t, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex, void const *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_multirange_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex, void const *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_record_encode_frame(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int32_t); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_anonymous_record_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_anonymous_record_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_record_codecs(void); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__decode_parameters_desc(PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__decode_row_desc(PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_DataCodecConfig__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_CoreProtocol__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_BaseProtocol__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "asyncpg.protocol.protocol" extern int __pyx_module_is_main_asyncpg__protocol__protocol; int __pyx_module_is_main_asyncpg__protocol__protocol = 0; /* Implementation of "asyncpg.protocol.protocol" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_object; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_AttributeError; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_OverflowError; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_reversed; static PyObject *__pyx_builtin_any; static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_zip; static PyObject *__pyx_builtin_UnicodeEncodeError; static PyObject *__pyx_builtin_chr; static PyObject *__pyx_builtin_StopIteration; static PyObject *__pyx_builtin_NotImplementedError; static PyObject *__pyx_builtin_AssertionError; static PyObject *__pyx_builtin_BufferError; /* #### Code section: string_decls ### */ static const char __pyx_k_c[] = "c"; static const char __pyx_k_d[] = "d"; static const char __pyx_k_e[] = "e"; static const char __pyx_k_f[] = "f"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_m[] = "m"; static const char __pyx_k_n[] = "n,,"; static const char __pyx_k_p[] = ",p="; static const char __pyx_k_r[] = "r"; static const char __pyx_k_s[] = ",s=([^,]+),"; static const char __pyx_k_v[] = "v=([^,]+)"; static const char __pyx_k_w[] = "w"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k_NA[] = "NA"; static const char __pyx_k__2[] = "_"; static const char __pyx_k__5[] = "{}[]"; static const char __pyx_k__8[] = ")"; static const char __pyx_k_et[] = "et"; static const char __pyx_k_ex[] = "ex"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_ns[] = "ns"; static const char __pyx_k_re[] = "re"; static const char __pyx_k_tb[] = "tb"; static const char __pyx_k_ti[] = "ti"; static const char __pyx_k_to[] = " to "; static const char __pyx_k_OID[] = " (OID "; static const char __pyx_k__15[] = "\"\""; static const char __pyx_k__23[] = "\000"; static const char __pyx_k__31[] = ","; static const char __pyx_k__32[] = "\000\000\000\001"; static const char __pyx_k__33[] = " "; static const char __pyx_k__34[] = ""; static const char __pyx_k__35[] = "."; static const char __pyx_k__36[] = ", "; static const char __pyx_k__37[] = "*"; static const char __pyx_k__38[] = "@"; static const char __pyx_k__39[] = "/"; static const char __pyx_k__40[] = "'{}'"; static const char __pyx_k__41[] = "$"; static const char __pyx_k__42[] = ": "; static const char __pyx_k__44[] = "..."; static const char __pyx_k__45[] = " ("; static const char __pyx_k_abc[] = "abc"; static const char __pyx_k_alt[] = "alt"; static const char __pyx_k_any[] = "any"; static const char __pyx_k_big[] = "big"; static const char __pyx_k_bit[] = "bit"; static const char __pyx_k_box[] = "box"; static const char __pyx_k_c_2[] = "c="; static const char __pyx_k_c_3[] = ",c="; static const char __pyx_k_chr[] = "chr"; static const char __pyx_k_cid[] = "cid"; static const char __pyx_k_con[] = "con"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_exc[] = "exc"; static const char __pyx_k_fmt[] = "fmt"; static const char __pyx_k_fut[] = "fut"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_gss[] = "gss"; static const char __pyx_k_i_d[] = ",i=(\\d+),?"; static const char __pyx_k_int[] = "int"; static const char __pyx_k_md5[] = "md5"; static const char __pyx_k_n_2[] = "n="; static const char __pyx_k_new[] = "new"; static const char __pyx_k_oid[] = "oid"; static const char __pyx_k_pop[] = "pop"; static const char __pyx_k_r_2[] = ",r="; static const char __pyx_k_r_3[] = "r=([^,]+),"; static const char __pyx_k_rec[] = "rec"; static const char __pyx_k_ref[] = "ref"; static const char __pyx_k_row[] = "row"; static const char __pyx_k_s_2[] = "s"; static const char __pyx_k_set[] = "set"; static const char __pyx_k_str[] = "str"; static const char __pyx_k_tid[] = "tid"; static const char __pyx_k_was[] = "was"; static const char __pyx_k_win[] = "win"; static const char __pyx_k_xid[] = "xid"; static const char __pyx_k_xml[] = "xml"; static const char __pyx_k_zip[] = "zip"; static const char __pyx_k_NFKC[] = "NFKC"; static const char __pyx_k_NULL[] = "NULL"; static const char __pyx_k_Name[] = "Name"; static const char __pyx_k_Type[] = "Type"; static const char __pyx_k__167[] = "?"; static const char __pyx_k_addr[] = "addr"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_base[] = "_base"; static const char __pyx_k_bind[] = "bind"; static const char __pyx_k_bool[] = "bool"; static const char __pyx_k_char[] = "char"; static const char __pyx_k_cidr[] = "cidr"; static const char __pyx_k_data[] = "data"; static const char __pyx_k_date[] = "date"; static const char __pyx_k_desc[] = "desc"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_done[] = "done"; static const char __pyx_k_elem[] = "elem"; static const char __pyx_k_exit[] = "__exit__"; static const char __pyx_k_hint[] = "hint"; static const char __pyx_k_hmac[] = "hmac"; static const char __pyx_k_inet[] = "inet"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_int2[] = "int2"; static const char __pyx_k_int4[] = "int4"; static const char __pyx_k_int8[] = "int8"; static const char __pyx_k_item[] = "item"; static const char __pyx_k_json[] = "json"; static const char __pyx_k_kind[] = "kind"; static const char __pyx_k_line[] = "line"; static const char __pyx_k_loop[] = "loop"; static const char __pyx_k_lseg[] = "lseg"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_more[] = "more"; static const char __pyx_k_name[] = "name"; static const char __pyx_k_path[] = "path"; static const char __pyx_k_real[] = "real"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_send[] = "send"; static const char __pyx_k_sink[] = "sink"; static const char __pyx_k_sjis[] = "sjis"; static const char __pyx_k_smgr[] = "smgr"; static const char __pyx_k_sock[] = "sock"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_sspi[] = "sspi"; static const char __pyx_k_step[] = "step"; static const char __pyx_k_tcvn[] = "tcvn"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_text[] = "text"; static const char __pyx_k_time[] = "time"; static const char __pyx_k_user[] = "user"; static const char __pyx_k_uuid[] = "uuid"; static const char __pyx_k_void[] = "void"; static const char __pyx_k_wait[] = "wait"; static const char __pyx_k_wbuf[] = "wbuf"; static const char __pyx_k_were[] = "were"; static const char __pyx_k_xid8[] = "xid8"; static const char __pyx_k_Codec[] = "Codec"; static const char __pyx_k_Event[] = "Event"; static const char __pyx_k_Range[] = "Range"; static const char __pyx_k_Sized[] = "Sized"; static const char __pyx_k_Timer[] = "Timer"; static const char __pyx_k_abort[] = "abort"; static const char __pyx_k_aiter[] = "__aiter__"; static const char __pyx_k_anext[] = "__anext__"; static const char __pyx_k_array[] = "array"; static const char __pyx_k_ascii[] = "ascii"; static const char __pyx_k_await[] = "__await__"; static const char __pyx_k_bytea[] = "bytea"; static const char __pyx_k_bytes[] = " bytes"; static const char __pyx_k_cause[] = "__cause__"; static const char __pyx_k_chunk[] = "chunk"; static const char __pyx_k_clear[] = "clear"; static const char __pyx_k_close[] = "close"; static const char __pyx_k_codec[] = "codec"; static const char __pyx_k_cp866[] = "cp866"; static const char __pyx_k_cp874[] = "cp874"; static const char __pyx_k_cp932[] = "cp932"; static const char __pyx_k_cp936[] = "cp936"; static const char __pyx_k_cp949[] = "cp949"; static const char __pyx_k_cp950[] = "cp950"; static const char __pyx_k_elems[] = "elems"; static const char __pyx_k_empty[] = "empty"; static const char __pyx_k_enter[] = "__enter__"; static const char __pyx_k_euccn[] = "euccn"; static const char __pyx_k_eucjp[] = "eucjp"; static const char __pyx_k_euckr[] = "euckr"; static const char __pyx_k_group[] = "group"; static const char __pyx_k_items[] = "items"; static const char __pyx_k_jsonb[] = "jsonb"; static const char __pyx_k_koi8r[] = "koi8r"; static const char __pyx_k_koi8u[] = "koi8u"; static const char __pyx_k_limit[] = "limit"; static const char __pyx_k_lower[] = "lower"; static const char __pyx_k_money[] = "money"; static const char __pyx_k_new_2[] = "__new__"; static const char __pyx_k_oid_2[] = "oid[]"; static const char __pyx_k_p_oid[] = "p_oid"; static const char __pyx_k_point[] = "point"; static const char __pyx_k_query[] = "query"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_rdesc[] = "rdesc"; static const char __pyx_k_sleep[] = "sleep"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_throw[] = "throw"; static const char __pyx_k_timer[] = "timer"; static const char __pyx_k_tuple[] = "tuple"; static const char __pyx_k_types[] = "types"; static const char __pyx_k_upper[] = "upper"; static const char __pyx_k_usage[] = "usage"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_vscii[] = "vscii"; static const char __pyx_k_write[] = "write"; static const char __pyx_k_DIGEST[] = "DIGEST"; static const char __pyx_k_Future[] = "Future"; static const char __pyx_k_PGCOPY[] = "PGCOPY\n\377\r\n\000"; static const char __pyx_k_Record[] = "Record"; static const char __pyx_k_amount[] = "amount"; static const char __pyx_k_attach[] = "attach"; static const char __pyx_k_base64[] = "base64"; static const char __pyx_k_bigint[] = "bigint"; static const char __pyx_k_binary[] = "binary"; static const char __pyx_k_bpchar[] = "bpchar"; static const char __pyx_k_budget[] = "budget"; static const char __pyx_k_buffer[] = "buffer"; static const char __pyx_k_cancel[] = "cancel"; static const char __pyx_k_circle[] = "circle"; static const char __pyx_k_codecs[] = "codecs"; static const char __pyx_k_compat[] = "compat"; static const char __pyx_k_config[] = "_config"; static const char __pyx_k_cp1250[] = "cp1250"; static const char __pyx_k_cp1251[] = "cp1251"; static const char __pyx_k_cp1252[] = "cp1252"; static const char __pyx_k_cp1253[] = "cp1253"; static const char __pyx_k_cp1254[] = "cp1254"; static const char __pyx_k_cp1255[] = "cp1255"; static const char __pyx_k_cp1256[] = "cp1256"; static const char __pyx_k_cp1257[] = "cp1257"; static const char __pyx_k_cp1258[] = "cp1258"; static const char __pyx_k_cp1521[] = "cp1521"; static const char __pyx_k_decode[] = "decode"; static const char __pyx_k_detach[] = "detach"; static const char __pyx_k_detail[] = "detail"; static const char __pyx_k_dict_2[] = "_dict"; static const char __pyx_k_digest[] = "digest"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_euc_cn[] = "euc_cn"; static const char __pyx_k_euc_jp[] = "euc_jp"; static const char __pyx_k_euc_kr[] = "euc_kr"; static const char __pyx_k_family[] = "family"; static const char __pyx_k_float4[] = "float4"; static const char __pyx_k_float8[] = "float8"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_gssapi[] = "gssapi"; static const char __pyx_k_gsslib[] = "gsslib"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_koi8_r[] = "koi8_r"; static const char __pyx_k_koi8_u[] = "koi8_u"; static const char __pyx_k_lookup[] = "lookup"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_object[] = "object"; static const char __pyx_k_opaque[] = "opaque"; static const char __pyx_k_pg_lsn[] = "pg_lsn"; static const char __pyx_k_pickle[] = "pickle"; static const char __pyx_k_reader[] = "reader"; static const char __pyx_k_record[] = "record"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_result[] = "result"; static const char __pyx_k_scalar[] = "scalar"; static const char __pyx_k_schema[] = "schema"; static const char __pyx_k_search[] = "search"; static const char __pyx_k_sha256[] = "sha256"; static const char __pyx_k_socket[] = "socket"; static const char __pyx_k_text_2[] = "text[]"; static const char __pyx_k_timetz[] = "timetz"; static const char __pyx_k_typoid[] = "typoid"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_varbit[] = "varbit"; static const char __pyx_k_waiter[] = "waiter"; static const char __pyx_k_win866[] = "win866"; static const char __pyx_k_win874[] = "win874"; static const char __pyx_k_win932[] = "win932"; static const char __pyx_k_win936[] = "win936"; static const char __pyx_k_win949[] = "win949"; static const char __pyx_k_win950[] = "win950"; static const char __pyx_k_AF_UNIX[] = "AF_UNIX"; static const char __pyx_k_Mapping[] = "Mapping"; static const char __pyx_k_abstime[] = "abstime"; static const char __pyx_k_aclitem[] = "aclitem"; static const char __pyx_k_aiter_2[] = "aiter"; static const char __pyx_k_anyenum[] = "anyenum"; static const char __pyx_k_apg_exc[] = "apg_exc"; static const char __pyx_k_asyncio[] = "asyncio"; static const char __pyx_k_asyncpg[] = "asyncpg"; static const char __pyx_k_cleanup[] = "_cleanup"; static const char __pyx_k_copy_in[] = "copy_in"; static const char __pyx_k_cstring[] = "cstring"; static const char __pyx_k_decimal[] = "decimal"; static const char __pyx_k_decoder[] = "decoder"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_encoder[] = "encoder"; static const char __pyx_k_execute[] = "execute"; static const char __pyx_k_formats[] = "formats"; static const char __pyx_k_genexpr[] = "genexpr"; static const char __pyx_k_hashlib[] = "hashlib"; static const char __pyx_k_inspect[] = "inspect"; static const char __pyx_k_integer[] = "integer"; static const char __pyx_k_isempty[] = "isempty"; static const char __pyx_k_macaddr[] = "macaddr"; static const char __pyx_k_mapping[] = "mapping"; static const char __pyx_k_message[] = "message"; static const char __pyx_k_missing[] = "missing"; static const char __pyx_k_numeric[] = "numeric"; static const char __pyx_k_polygon[] = "polygon"; static const char __pyx_k_prepare[] = "prepare"; static const char __pyx_k_records[] = "records"; static const char __pyx_k_regoper[] = "regoper"; static const char __pyx_k_regproc[] = "regproc"; static const char __pyx_k_regrole[] = "regrole"; static const char __pyx_k_regtype[] = "regtype"; static const char __pyx_k_release[] = "release"; static const char __pyx_k_reltime[] = "reltime"; static const char __pyx_k_secrets[] = "secrets"; static const char __pyx_k_sspilib[] = "sspilib"; static const char __pyx_k_started[] = "_started"; static const char __pyx_k_timeout[] = "timeout"; static const char __pyx_k_trigger[] = "trigger"; static const char __pyx_k_tsquery[] = "tsquery"; static const char __pyx_k_typeoid[] = "typeoid"; static const char __pyx_k_unicode[] = "unicode"; static const char __pyx_k_unknown[] = "unknown"; static const char __pyx_k_utf_8_2[] = "utf_8"; static const char __pyx_k_varchar[] = "varchar"; static const char __pyx_k_weakref[] = "weakref"; static const char __pyx_k_win1250[] = "win1250"; static const char __pyx_k_win1251[] = "win1251"; static const char __pyx_k_win1252[] = "win1252"; static const char __pyx_k_win1253[] = "win1253"; static const char __pyx_k_win1254[] = "win1254"; static const char __pyx_k_win1255[] = "win1255"; static const char __pyx_k_win1256[] = "win1256"; static const char __pyx_k_win1257[] = "win1257"; static const char __pyx_k_win1258[] = "win1258"; static const char __pyx_k_xformat[] = "xformat"; static const char __pyx_k_Iterable[] = "Iterable"; static const char __pyx_k_Kerberos[] = "Kerberos"; static const char __pyx_k_KeyError[] = "KeyError"; static const char __pyx_k_NameType[] = "NameType"; static const char __pyx_k_Protocol[] = "Protocol"; static const char __pyx_k_ROLLBACK[] = "ROLLBACK"; static const char __pyx_k_Sequence[] = "Sequence"; static const char __pyx_k_SizedABC[] = "SizedABC"; static const char __pyx_k_alias_to[] = "alias_to"; static const char __pyx_k_anyarray[] = "anyarray"; static const char __pyx_k_anyrange[] = "anyrange"; static const char __pyx_k_arg_bufs[] = "arg_bufs"; static const char __pyx_k_args_buf[] = "args_buf"; static const char __pyx_k_attrname[] = "attrname"; static const char __pyx_k_auth_msg[] = "auth_msg"; static const char __pyx_k_basetype[] = "basetype"; static const char __pyx_k_budget_2[] = "_budget"; static const char __pyx_k_builtins[] = "builtins"; static const char __pyx_k_copy_out[] = "copy_out"; static const char __pyx_k_data_gen[] = "data_gen"; static const char __pyx_k_database[] = "database"; static const char __pyx_k_elemtype[] = "elemtype"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_initiate[] = "initiate"; static const char __pyx_k_internal[] = "internal"; static const char __pyx_k_interval[] = "interval"; static const char __pyx_k_iterator[] = "iterator"; static const char __pyx_k_jsonpath[] = "jsonpath"; static const char __pyx_k_macaddr8[] = "macaddr8"; static const char __pyx_k_num_cols[] = "num_cols"; static const char __pyx_k_on_error[] = "_on_error"; static const char __pyx_k_password[] = "password"; static const char __pyx_k_position[] = "position"; static const char __pyx_k_postgres[] = "postgres"; static const char __pyx_k_protocol[] = "protocol"; static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_regclass[] = "regclass"; static const char __pyx_k_reversed[] = "reversed"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_settings[] = "settings"; static const char __pyx_k_smallint[] = "smallint"; static const char __pyx_k_tcvn5712[] = "tcvn5712"; static const char __pyx_k_to_bytes[] = "to_bytes"; static const char __pyx_k_tsvector[] = "tsvector"; static const char __pyx_k_typekind[] = "typekind"; static const char __pyx_k_typename[] = "typename"; static const char __pyx_k_wait_for[] = "wait_for"; static const char __pyx_k_with_msg[] = "with_msg"; static const char __pyx_k_Attribute[] = "Attribute"; static const char __pyx_k_DataError[] = "DataError"; static const char __pyx_k_Negotiate[] = "Negotiate"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_add_types[] = "add_types"; static const char __pyx_k_alias_oid[] = "alias_oid"; static const char __pyx_k_apg_types[] = "apg_types"; static const char __pyx_k_attrnames[] = "attrnames"; static const char __pyx_k_b64decode[] = "b64decode"; static const char __pyx_k_b64encode[] = "b64encode"; static const char __pyx_k_base_type[] = "base_type"; static const char __pyx_k_byteorder[] = "byteorder"; static const char __pyx_k_c_decoder[] = "c_decoder"; static const char __pyx_k_c_encoder[] = "c_encoder"; static const char __pyx_k_cancelled[] = "cancelled"; static const char __pyx_k_character[] = "character"; static const char __pyx_k_codec_for[] = " codec for "; static const char __pyx_k_codec_set[] = "codec_set"; static const char __pyx_k_codec_str[] = "codec_str"; static const char __pyx_k_composite[] = "composite"; static const char __pyx_k_copy_stmt[] = "copy_stmt"; static const char __pyx_k_data_type[] = "data_type"; static const char __pyx_k_elemdelim[] = "elemdelim"; static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_exception[] = "exception"; static const char __pyx_k_gtsvector[] = "gtsvector"; static const char __pyx_k_hexdigest[] = "hexdigest"; static const char __pyx_k_is_closed[] = "is_closed"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_lower_inc[] = "lower_inc"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_monotonic[] = "monotonic"; static const char __pyx_k_normalize[] = "normalize"; static const char __pyx_k_prepare_2[] = "__prepare__"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_refcursor[] = "refcursor"; static const char __pyx_k_regconfig[] = "regconfig"; static const char __pyx_k_shift_jis[] = "shift_jis"; static const char __pyx_k_sql_ascii[] = "sql_ascii"; static const char __pyx_k_stmt_name[] = "stmt_name"; static const char __pyx_k_timestamp[] = "timestamp"; static const char __pyx_k_tinterval[] = "tinterval"; static const char __pyx_k_transport[] = "transport"; static const char __pyx_k_typeinfos[] = "typeinfos"; static const char __pyx_k_upper_inc[] = "upper_inc"; static const char __pyx_k_Client_Key[] = "Client Key"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_MappingABC[] = "MappingABC"; static const char __pyx_k_NO_TIMEOUT[] = "NO_TIMEOUT"; static const char __pyx_k_Server_Key[] = "Server Key"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_anyelement[] = "anyelement"; static const char __pyx_k_base_codec[] = "base_codec"; static const char __pyx_k_call_later[] = "call_later"; static const char __pyx_k_con_params[] = "con_params"; static const char __pyx_k_connection[] = "connection"; static const char __pyx_k_core_codec[] = "core_codec"; static const char __pyx_k_credential[] = "credential"; static const char __pyx_k_elem_codec[] = "elem_codec"; static const char __pyx_k_elem_delim[] = "elem_delim"; static const char __pyx_k_exceptions[] = "exceptions"; static const char __pyx_k_in_element[] = " in element #"; static const char __pyx_k_init_types[] = "_init_types"; static const char __pyx_k_kerberosv5[] = "kerberosv5"; static const char __pyx_k_krbsrvname[] = "krbsrvname"; static const char __pyx_k_multirange[] = "multirange"; static const char __pyx_k_on_timeout[] = "_on_timeout"; static const char __pyx_k_pg_catalog[] = "pg_catalog"; static const char __pyx_k_pyx_result[] = "__pyx_result"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_set_result[] = "set_result"; static const char __pyx_k_setsockopt[] = "setsockopt"; static const char __pyx_k_startswith[] = "startswith"; static const char __pyx_k_status_msg[] = "status_msg"; static const char __pyx_k_stringprep[] = "stringprep"; static const char __pyx_k_typeschema[] = "typeschema"; static const char __pyx_k_windows866[] = "windows866"; static const char __pyx_k_windows874[] = "windows874"; static const char __pyx_k_windows932[] = "windows932"; static const char __pyx_k_windows936[] = "windows936"; static const char __pyx_k_windows949[] = "windows949"; static const char __pyx_k_windows950[] = "windows950"; static const char __pyx_k_writelines[] = "writelines"; static const char __pyx_k_ARRAY_TYPES[] = "ARRAY_TYPES"; static const char __pyx_k_BufferError[] = "BufferError"; static const char __pyx_k_IPPROTO_TCP[] = "IPPROTO_TCP"; static const char __pyx_k_IterableABC[] = "IterableABC"; static const char __pyx_k_OrderedDict[] = "OrderedDict"; static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_SequenceABC[] = "SequenceABC"; static const char __pyx_k_TCP_NODELAY[] = "TCP_NODELAY"; static const char __pyx_k_anynonarray[] = "anynonarray"; static const char __pyx_k_attrtypoids[] = "attrtypoids"; static const char __pyx_k_bit_varying[] = "bit varying"; static const char __pyx_k_collections[] = "collections"; static const char __pyx_k_elem_format[] = "elem_format"; static const char __pyx_k_fdw_handler[] = "fdw_handler"; static const char __pyx_k_get_timeout[] = "_get_timeout"; static const char __pyx_k_in_table_a1[] = "in_table_a1"; static const char __pyx_k_in_table_b1[] = "in_table_b1"; static const char __pyx_k_in_table_c3[] = "in_table_c3"; static const char __pyx_k_in_table_c4[] = "in_table_c4"; static const char __pyx_k_in_table_c5[] = "in_table_c5"; static const char __pyx_k_in_table_c6[] = "in_table_c6"; static const char __pyx_k_in_table_c7[] = "in_table_c7"; static const char __pyx_k_in_table_c8[] = "in_table_c8"; static const char __pyx_k_in_table_c9[] = "in_table_c9"; static const char __pyx_k_in_table_d1[] = "in_table_d1"; static const char __pyx_k_in_table_d2[] = "in_table_d2"; static const char __pyx_k_init_codecs[] = "_init_codecs"; static const char __pyx_k_mark_closed[] = "mark_closed"; static const char __pyx_k_mro_entries[] = "__mro_entries__"; static const char __pyx_k_pg_mcv_list[] = "pg_mcv_list"; static const char __pyx_k_pg_snapshot[] = "pg_snapshot"; static const char __pyx_k_portal_name[] = "portal_name"; static const char __pyx_k_record_stmt[] = "record_stmt"; static const char __pyx_k_regoperator[] = "regoperator"; static const char __pyx_k_return_rows[] = "return_rows"; static const char __pyx_k_target_name[] = "target_name"; static const char __pyx_k_there_is_no[] = ": there is no "; static const char __pyx_k_timestamptz[] = "timestamptz"; static const char __pyx_k_token_bytes[] = "token_bytes"; static const char __pyx_k_tsm_handler[] = "tsm_handler"; static const char __pyx_k_unicodedata[] = "unicodedata"; static const char __pyx_k_windows1250[] = "windows1250"; static const char __pyx_k_windows1251[] = "windows1251"; static const char __pyx_k_windows1252[] = "windows1252"; static const char __pyx_k_windows1253[] = "windows1253"; static const char __pyx_k_windows1254[] = "windows1254"; static const char __pyx_k_windows1255[] = "windows1255"; static const char __pyx_k_windows1256[] = "windows1256"; static const char __pyx_k_windows1257[] = "windows1257"; static const char __pyx_k_windows1258[] = "windows1258"; static const char __pyx_k_BaseProtocol[] = "BaseProtocol"; static const char __pyx_k_CoreProtocol[] = "CoreProtocol"; static const char __pyx_k_TimeoutError[] = "TimeoutError"; static const char __pyx_k_Timer___exit[] = "Timer.__exit__"; static const char __pyx_k_Timer___init[] = "Timer.__init__"; static const char __pyx_k_apg_exc_base[] = "apg_exc_base"; static const char __pyx_k_bind_execute[] = "bind_execute"; static const char __pyx_k_cannot_alias[] = "cannot alias "; static const char __pyx_k_close_portal[] = "close_portal"; static const char __pyx_k_euc_jis_2004[] = "euc_jis_2004"; static const char __pyx_k_get_settings[] = "get_settings"; static const char __pyx_k_getattribute[] = "__getattribute__"; static const char __pyx_k_in_table_c12[] = "in_table_c12"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_connected[] = "is_connected"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_pg_ndistinct[] = "pg_ndistinct"; static const char __pyx_k_pg_node_tree[] = "pg_node_tree"; static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; static const char __pyx_k_record_class[] = "record_class"; static const char __pyx_k_regcollation[] = "regcollation"; static const char __pyx_k_regnamespace[] = "regnamespace"; static const char __pyx_k_regprocedure[] = "regprocedure"; static const char __pyx_k_return_extra[] = "return_extra"; static const char __pyx_k_server_nonce[] = "server_nonce"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_target_codec[] = "target_codec"; static const char __pyx_k_use_setstate[] = "use_setstate"; static const char __pyx_k_AsyncIterable[] = "AsyncIterable"; static const char __pyx_k_OverflowError[] = "OverflowError"; static const char __pyx_k_PostgresError[] = "PostgresError"; static const char __pyx_k_ProtocolError[] = "ProtocolError"; static const char __pyx_k_SCRAM_SHA_256[] = "SCRAM-SHA-256"; static const char __pyx_k_StopIteration[] = "StopIteration"; static const char __pyx_k_Timer___enter[] = "Timer.__enter__"; static const char __pyx_k_anycompatible[] = "anycompatible"; static const char __pyx_k_anymultirange[] = "anymultirange"; static const char __pyx_k_asyncio_tasks[] = "asyncio.tasks"; static const char __pyx_k_basetype_name[] = "basetype_name"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_connected_fut[] = "connected_fut"; static const char __pyx_k_create_future[] = "create_future"; static const char __pyx_k_create_record[] = "_create_record"; static const char __pyx_k_data_received[] = "data_received"; static const char __pyx_k_element_names[] = "element_names"; static const char __pyx_k_elemtype_name[] = "elemtype_name"; static const char __pyx_k_event_trigger[] = "event_trigger"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_invalid_nonce[] = "invalid nonce"; static const char __pyx_k_is_cancelling[] = "_is_cancelling"; static const char __pyx_k_not_connected[] = "not connected"; static const char __pyx_k_password_salt[] = "password_salt"; static const char __pyx_k_pause_reading[] = "pause_reading"; static const char __pyx_k_pause_writing[] = "pause_writing"; static const char __pyx_k_range_subtype[] = "range_subtype"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_regdictionary[] = "regdictionary"; static const char __pyx_k_scram_sha_256[] = "scram-sha-256"; static const char __pyx_k_set_exception[] = "set_exception"; static const char __pyx_k_txid_snapshot[] = "txid_snapshot"; static const char __pyx_k_AssertionError[] = "AssertionError"; static const char __pyx_k_AttributeError[] = "AttributeError"; static const char __pyx_k_CancelledError[] = "CancelledError"; static const char __pyx_k_InterfaceError[] = "InterfaceError"; static const char __pyx_k_UserCredential[] = "UserCredential"; static const char __pyx_k_get_attributes[] = "_get_attributes"; static const char __pyx_k_get_data_codec[] = "get_data_codec"; static const char __pyx_k_get_extra_info[] = "get_extra_info"; static const char __pyx_k_get_parameters[] = "_get_parameters"; static const char __pyx_k_get_server_pid[] = "get_server_pid"; static const char __pyx_k_get_text_codec[] = "get_text_codec"; static const char __pyx_k_pg_ddl_command[] = "pg_ddl_command"; static const char __pyx_k_query_argument[] = "query argument "; static const char __pyx_k_request_cancel[] = "_request_cancel"; static const char __pyx_k_resume_reading[] = "resume_reading"; static const char __pyx_k_resume_writing[] = "resume_writing"; static const char __pyx_k_set_connection[] = "set_connection"; static const char __pyx_k_shift_jis_2004[] = "shift_jis_2004"; static const char __pyx_k_text_or_binary[] = "'text' or 'binary'"; static const char __pyx_k_DataCodecConfig[] = "DataCodecConfig"; static const char __pyx_k_SecurityContext[] = "SecurityContext"; static const char __pyx_k_client_encoding[] = "client_encoding"; static const char __pyx_k_close_statement[] = "close_statement"; static const char __pyx_k_collections_abc[] = "collections.abc"; static const char __pyx_k_command_timeout[] = "command_timeout"; static const char __pyx_k_comp_type_attrs[] = "comp_type_attrs"; static const char __pyx_k_connection_lost[] = "connection_lost"; static const char __pyx_k_connection_made[] = "connection_made"; static const char __pyx_k_mark_unprepared[] = "mark_unprepared"; static const char __pyx_k_pg_dependencies[] = "pg_dependencies"; static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; static const char __pyx_k_server_settings[] = "server_settings"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_writing_allowed[] = "writing_allowed"; static const char __pyx_k_add_python_codec[] = "add_python_codec"; static const char __pyx_k_clear_type_cache[] = "clear_type_cache"; static const char __pyx_k_comp_elem_codecs[] = "comp_elem_codecs"; static const char __pyx_k_double_precision[] = "double precision"; static const char __pyx_k_get_record_class[] = "get_record_class"; static const char __pyx_k_in_table_c21_c22[] = "in_table_c21_c22"; static const char __pyx_k_index_am_handler[] = "index_am_handler"; static const char __pyx_k_language_handler[] = "language_handler"; static const char __pyx_k_table_am_handler[] = "table_am_handler"; static const char __pyx_k_text_or_binary_2[] = "text or binary"; static const char __pyx_k_BaseProtocol_bind[] = "BaseProtocol.bind"; static const char __pyx_k_add_done_callback[] = "add_done_callback"; static const char __pyx_k_already_connected[] = "already connected"; static const char __pyx_k_array_element_oid[] = "array_element_oid"; static const char __pyx_k_bind_execute_many[] = "bind_execute_many"; static const char __pyx_k_character_varying[] = "character varying"; static const char __pyx_k_has_text_elements[] = "has_text_elements"; static const char __pyx_k_hostbased_service[] = "hostbased_service"; static const char __pyx_k_is_in_transaction[] = "is_in_transaction"; static const char __pyx_k_pg_contrib_hstore[] = "pg_contrib.hstore"; static const char __pyx_k_range_subtype_oid[] = "range_subtype_oid"; static const char __pyx_k_BaseProtocol_abort[] = "BaseProtocol.abort"; static const char __pyx_k_BaseProtocol_close[] = "BaseProtocol.close"; static const char __pyx_k_BaseProtocol_query[] = "BaseProtocol.query"; static const char __pyx_k_ConnectionSettings[] = "ConnectionSettings"; static const char __pyx_k_StopAsyncIteration[] = "StopAsyncIteration"; static const char __pyx_k_UnicodeEncodeError[] = "UnicodeEncodeError"; static const char __pyx_k_anycompatiblearray[] = "anycompatiblearray"; static const char __pyx_k_anycompatiblerange[] = "anycompatiblerange"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_asyncpg_exceptions[] = "asyncpg.exceptions"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_could_not_get_salt[] = "could not get salt"; static const char __pyx_k_no_decoder_for_OID[] = "no decoder for OID {}"; static const char __pyx_k_no_encoder_for_OID[] = "no encoder for OID {}"; static const char __pyx_k_range_subtype_name[] = "range_subtype_name"; static const char __pyx_k_time_with_timezone[] = "time with timezone"; static const char __pyx_k_InternalClientError[] = "InternalClientError"; static const char __pyx_k_ModuleNotFoundError[] = "ModuleNotFoundError"; static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; static const char __pyx_k_SASLPREP_PROHIBITED[] = "SASLPREP_PROHIBITED"; static const char __pyx_k_SCRAMAuthentication[] = "SCRAMAuthentication"; static const char __pyx_k_could_not_get_nonce[] = "could not get nonce"; static const char __pyx_k_ignore_custom_codec[] = "ignore_custom_codec"; static const char __pyx_k_invalid_data_format[] = "invalid data format: {}"; static const char __pyx_k_on_waiter_completed[] = "_on_waiter_completed"; static const char __pyx_k_password_iterations[] = "password_iterations"; static const char __pyx_k_process_log_message[] = "_process_log_message"; static const char __pyx_k_register_data_types[] = "register_data_types"; static const char __pyx_k_remove_python_codec[] = "remove_python_codec"; static const char __pyx_k_BUILTIN_TYPE_OID_MAP[] = "BUILTIN_TYPE_OID_MAP"; static const char __pyx_k_BaseProtocol_copy_in[] = "BaseProtocol.copy_in"; static const char __pyx_k_BaseProtocol_execute[] = "BaseProtocol.execute"; static const char __pyx_k_BaseProtocol_prepare[] = "BaseProtocol.prepare"; static const char __pyx_k_ConnectionResetError[] = "ConnectionResetError"; static const char __pyx_k_ConnectionSettings_r[] = ""; static const char __pyx_k_get_remaining_budget[] = "get_remaining_budget"; static const char __pyx_k_process_notification[] = "_process_notification"; static const char __pyx_k_server_first_message[] = "server_first_message"; static const char __pyx_k_text_binary_or_tuple[] = "'text', 'binary' or 'tuple'"; static const char __pyx_k_BUILTIN_TYPE_NAME_MAP[] = "BUILTIN_TYPE_NAME_MAP"; static const char __pyx_k_BaseProtocol_copy_out[] = "BaseProtocol.copy_out"; static const char __pyx_k_ClientSecurityContext[] = "ClientSecurityContext"; static const char __pyx_k_Codec___reduce_cython[] = "Codec.__reduce_cython__"; static const char __pyx_k_OID_value_too_large_r[] = "OID value too large: {!r}"; static const char __pyx_k_anycompatiblenonarray[] = "anycompatiblenonarray"; static const char __pyx_k_array_length_overflow[] = "array length overflow"; static const char __pyx_k_authentication_method[] = "authentication_method"; static const char __pyx_k_copy_in_locals_lambda[] = "copy_in.."; static const char __pyx_k_invalid_array_element[] = "invalid array element: {}"; static const char __pyx_k_non_homogeneous_array[] = "non-homogeneous array"; static const char __pyx_k_pg_brin_bloom_summary[] = "pg_brin_bloom_summary"; static const char __pyx_k_time_without_timezone[] = "time without timezone"; static const char __pyx_k_unexpected_codec_type[] = "unexpected codec type: {}"; static const char __pyx_k_wait_for_cancellation[] = "_wait_for_cancellation"; static const char __pyx_k_AUTHENTICATION_METHODS[] = "AUTHENTICATION_METHODS"; static const char __pyx_k_BaseProtocol_is_closed[] = "BaseProtocol.is_closed"; static const char __pyx_k_PreparedStatementState[] = "PreparedStatementState"; static const char __pyx_k_call_exception_handler[] = "call_exception_handler"; static const char __pyx_k_cancel_current_command[] = "_cancel_current_command"; static const char __pyx_k_cannot_process_message[] = "cannot process message "; static const char __pyx_k_client_channel_binding[] = "client_channel_binding"; static const char __pyx_k_copy_out_locals_lambda[] = "copy_out.."; static const char __pyx_k_create_future_fallback[] = "_create_future_fallback"; static const char __pyx_k_declare_fallback_codec[] = "declare_fallback_codec"; static const char __pyx_k_set_builtin_type_codec[] = "set_builtin_type_codec"; static const char __pyx_k_unexpected_data_format[] = "unexpected data format: {}"; static const char __pyx_k_Codec___setstate_cython[] = "Codec.__setstate_cython__"; static const char __pyx_k_Codec_oid_elem_oid_core[] = ""; static const char __pyx_k_anycompatiblemultirange[] = "anycompatiblemultirange"; static const char __pyx_k_expected_a_sequence_got[] = ": expected a sequence, got "; static const char __pyx_k_has_budget_greater_than[] = "has_budget_greater_than"; static const char __pyx_k_of_executemany_sequence[] = " of executemany() sequence"; static const char __pyx_k_timestamp_with_timezone[] = "timestamp with timezone"; static const char __pyx_k_BaseProtocol__on_timeout[] = "BaseProtocol._on_timeout"; static const char __pyx_k_OutdatedSchemaCacheError[] = "OutdatedSchemaCacheError"; static const char __pyx_k_could_not_get_iterations[] = "could not get iterations"; static const char __pyx_k_on_result_waiter_is_None[] = "_on_result: waiter is None"; static const char __pyx_k_on_result_waiter_is_done[] = "_on_result: waiter is done"; static const char __pyx_k_set_builtin_type_codec_2[] = "_set_builtin_type_codec"; static const char __pyx_k_unexpected_end_of_string[] = "unexpected end of string"; static const char __pyx_k_BaseProtocol__get_timeout[] = "BaseProtocol._get_timeout"; static const char __pyx_k_BaseProtocol_bind_execute[] = "BaseProtocol.bind_execute"; static const char __pyx_k_BaseProtocol_close_portal[] = "BaseProtocol.close_portal"; static const char __pyx_k_BaseProtocol_get_settings[] = "BaseProtocol.get_settings"; static const char __pyx_k_BaseProtocol_is_connected[] = "BaseProtocol.is_connected"; static const char __pyx_k_DataCodecConfig_add_types[] = "DataCodecConfig.add_types"; static const char __pyx_k_REQUIREMENTS_CLIENT_PROOF[] = "REQUIREMENTS_CLIENT_PROOF"; static const char __pyx_k_asyncpg_protocol_protocol[] = "asyncpg.protocol.protocol"; static const char __pyx_k_malformed_array_literal_r[] = "malformed array literal {!r}: {}"; static const char __pyx_k_pyx_unpickle_BaseProtocol[] = "__pyx_unpickle_BaseProtocol"; static const char __pyx_k_pyx_unpickle_CoreProtocol[] = "__pyx_unpickle_CoreProtocol"; static const char __pyx_k_BaseProtocol_data_received[] = "BaseProtocol.data_received"; static const char __pyx_k_BaseProtocol_pause_writing[] = "BaseProtocol.pause_writing"; static const char __pyx_k_DEFAULT_CLIENT_NONCE_BYTES[] = "DEFAULT_CLIENT_NONCE_BYTES"; static const char __pyx_k_Timer_get_remaining_budget[] = "Timer.get_remaining_budget"; static const char __pyx_k_TimoutError_was_not_raised[] = "TimoutError was not raised"; static const char __pyx_k_timestamp_without_timezone[] = "timestamp without timezone"; static const char __pyx_k_unexpected_exchange_format[] = "unexpected exchange format: {}"; static const char __pyx_k_BaseProtocol__is_cancelling[] = "BaseProtocol._is_cancelling"; static const char __pyx_k_BaseProtocol_get_server_pid[] = "BaseProtocol.get_server_pid"; static const char __pyx_k_BaseProtocol_resume_writing[] = "BaseProtocol.resume_writing"; static const char __pyx_k_BaseProtocol_set_connection[] = "BaseProtocol.set_connection"; static const char __pyx_k_ConnectionDoesNotExistError[] = "ConnectionDoesNotExistError"; static const char __pyx_k_BaseProtocol___reduce_cython[] = "BaseProtocol.__reduce_cython__"; static const char __pyx_k_BaseProtocol__request_cancel[] = "BaseProtocol._request_cancel"; static const char __pyx_k_BaseProtocol_close_statement[] = "BaseProtocol.close_statement"; static const char __pyx_k_BaseProtocol_connection_lost[] = "BaseProtocol.connection_lost"; static const char __pyx_k_BaseProtocol_connection_made[] = "BaseProtocol.connection_made"; static const char __pyx_k_Bind_expected_a_sequence_got[] = "Bind: expected a sequence, got "; static const char __pyx_k_CoreProtocol___reduce_cython[] = "CoreProtocol.__reduce_cython__"; static const char __pyx_k_decode_row_statement_is_None[] = "_decode_row: statement is None"; static const char __pyx_k_pg_brin_minmax_multi_summary[] = "pg_brin_minmax_multi_summary"; static const char __pyx_k_pyx_unpickle_DataCodecConfig[] = "__pyx_unpickle_DataCodecConfig"; static const char __pyx_k_unhandled_standard_data_type[] = "unhandled standard data type "; static const char __pyx_k_BaseProtocol_get_record_class[] = "BaseProtocol.get_record_class"; static const char __pyx_k_PreparedStatementState_attach[] = "PreparedStatementState.attach"; static const char __pyx_k_PreparedStatementState_detach[] = "PreparedStatementState.detach"; static const char __pyx_k_Timer_has_budget_greater_than[] = "Timer.has_budget_greater_than"; static const char __pyx_k_UnsupportedClientFeatureError[] = "UnsupportedClientFeatureError"; static const char __pyx_k_asyncpg_protocol_protocol_pyx[] = "asyncpg/protocol/protocol.pyx"; static const char __pyx_k_asyncpg_protocol_settings_pyx[] = "asyncpg/protocol/settings.pyx"; static const char __pyx_k_missing_array_dimension_value[] = "missing array dimension value"; static const char __pyx_k_BaseProtocol___setstate_cython[] = "BaseProtocol.__setstate_cython__"; static const char __pyx_k_BaseProtocol_bind_execute_many[] = "BaseProtocol.bind_execute_many"; static const char __pyx_k_CoreProtocol___setstate_cython[] = "CoreProtocol.__setstate_cython__"; static const char __pyx_k_CoreProtocol_is_in_transaction[] = "CoreProtocol.is_in_transaction"; static const char __pyx_k_asyncpg_protocol_coreproto_pyx[] = "asyncpg/protocol/coreproto.pyx"; static const char __pyx_k_could_not_get_server_signature[] = "could not get server signature"; static const char __pyx_k_expected_a_sequence_got_type_r[] = "expected a sequence (got type {!r})"; static const char __pyx_k_invalid_array_element_at_index[] = "invalid array element at index {}: {}"; static const char __pyx_k_missing_after_array_dimensions[] = "missing ']' after array dimensions"; static const char __pyx_k_DataCodecConfig___reduce_cython[] = "DataCodecConfig.__reduce_cython__"; static const char __pyx_k_Note_that_parameters_are_suppor[] = " Note that parameters are supported only in SELECT, INSERT, UPDATE, DELETE, MERGE and VALUES statements, and will *not* work in statements like CREATE VIEW or DECLARE CURSOR."; static const char __pyx_k_PreparedStatementState___reduce[] = "PreparedStatementState.__reduce_cython__"; static const char __pyx_k_cannot_close_prepared_statement[] = "cannot close prepared statement; refs == {} != 0"; static const char __pyx_k_cannot_switch_to_state_protocol[] = "cannot switch to state {}; protocol is in the \"failed\" state"; static const char __pyx_k_got_result_for_unknown_protocol[] = "got result for unknown protocol state {}"; static const char __pyx_k_on_result__prepare_statement_is[] = "_on_result__prepare: statement is None"; static const char __pyx_k_parse_data_msgs_first_message_i[] = "_parse_data_msgs: first message is not \"D\""; static const char __pyx_k_parse_data_msgs_result_is_not_a[] = "_parse_data_msgs: result is not a list, but {!r}"; static const char __pyx_k_protocol_is_in_an_unexpected_st[] = ": protocol is in an unexpected state "; static const char __pyx_k_r_is_not_a_valid_element_of_com[] = "{!r} is not a valid element of composite type {}"; static const char __pyx_k_sspilib_module_not_found_please[] = "sspilib module not found; please install asyncpg[gssauth] to use asyncpg with Kerberos/GSSAPI/SSPI authentication"; static const char __pyx_k_the_server_expects_x_argument_s[] = "the server expects {x} argument{s} for this query, {y} {w} passed"; static const char __pyx_k_too_many_elements_in_multirange[] = "too many elements in multirange value"; static const char __pyx_k_type_does_not_support_the_tuple[] = "{} type does not support the 'tuple' exchange format"; static const char __pyx_k_type_record_missing_field_types[] = "type record missing field types for composite "; static const char __pyx_k_unexpected_array_dimension_size[] = "unexpected array dimension size: {}"; static const char __pyx_k_unexpected_number_of_attributes[] = "unexpected number of attributes of composite type: {}, expected {}"; static const char __pyx_k_unsupported_SASL_Authentication[] = "unsupported SASL Authentication methods requested by the server: {!r}"; static const char __pyx_k_BaseProtocol__create_future_fall[] = "BaseProtocol._create_future_fallback"; static const char __pyx_k_BaseProtocol__on_waiter_complete[] = "BaseProtocol._on_waiter_completed"; static const char __pyx_k_BaseProtocol__wait_for_cancellat[] = "BaseProtocol._wait_for_cancellation"; static const char __pyx_k_Check_the_query_against_the_pass[] = "Check the query against the passed list of arguments."; static const char __pyx_k_ConnectionSettings___reduce_cyth[] = "ConnectionSettings.__reduce_cython__"; static const char __pyx_k_ConnectionSettings___setstate_cy[] = "ConnectionSettings.__setstate_cython__"; static const char __pyx_k_ConnectionSettings_add_python_co[] = "ConnectionSettings.add_python_codec"; static const char __pyx_k_ConnectionSettings_clear_type_ca[] = "ConnectionSettings.clear_type_cache"; static const char __pyx_k_ConnectionSettings_get_data_code[] = "ConnectionSettings.get_data_codec"; static const char __pyx_k_ConnectionSettings_get_text_code[] = "ConnectionSettings.get_text_codec"; static const char __pyx_k_ConnectionSettings_register_data[] = "ConnectionSettings.register_data_types"; static const char __pyx_k_ConnectionSettings_remove_python[] = "ConnectionSettings.remove_python_codec"; static const char __pyx_k_ConnectionSettings_set_builtin_t[] = "ConnectionSettings.set_builtin_type_codec"; static const char __pyx_k_Consider_declaring_an_explicit_c[] = "Consider declaring an explicit composite type and using it to cast the argument."; static const char __pyx_k_DataCodecConfig___setstate_cytho[] = "DataCodecConfig.__setstate_cython__"; static const char __pyx_k_DataCodecConfig__set_builtin_typ[] = "DataCodecConfig._set_builtin_type_codec"; static const char __pyx_k_DataCodecConfig_add_python_codec[] = "DataCodecConfig.add_python_codec"; static const char __pyx_k_DataCodecConfig_clear_type_cache[] = "DataCodecConfig.clear_type_cache"; static const char __pyx_k_DataCodecConfig_declare_fallback[] = "DataCodecConfig.declare_fallback_codec"; static const char __pyx_k_DataCodecConfig_remove_python_co[] = "DataCodecConfig.remove_python_codec"; static const char __pyx_k_DataCodecConfig_set_builtin_type[] = "DataCodecConfig.set_builtin_type_codec"; static const char __pyx_k_GSSAPI_SSPI_authentication_is_on[] = "GSSAPI/SSPI authentication is only supported for TCP/IP connections"; static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xd9a8555, 0xea6089f, 0x7336a95) = (_custom_type_codecs, _derived_type_codecs))"; static const char __pyx_k_PostgreSQL_does_not_implement_an[] = "PostgreSQL does not implement anonymous composite type input."; static const char __pyx_k_PreparedStatementState___setstat[] = "PreparedStatementState.__setstate_cython__"; static const char __pyx_k_PreparedStatementState__get_attr[] = "PreparedStatementState._get_attributes"; static const char __pyx_k_PreparedStatementState__get_para[] = "PreparedStatementState._get_parameters"; static const char __pyx_k_PreparedStatementState__init_cod[] = "PreparedStatementState._init_codecs"; static const char __pyx_k_PreparedStatementState__init_typ[] = "PreparedStatementState._init_types"; static const char __pyx_k_PreparedStatementState_mark_clos[] = "PreparedStatementState.mark_closed"; static const char __pyx_k_PreparedStatementState_mark_unpr[] = "PreparedStatementState.mark_unprepared"; static const char __pyx_k_REQUIREMENTS_CLIENT_FINAL_MESSAG[] = "REQUIREMENTS_CLIENT_FINAL_MESSAGE"; static const char __pyx_k_SCRAMAuthentication___reduce_cyt[] = "SCRAMAuthentication.__reduce_cython__"; static const char __pyx_k_SCRAMAuthentication___setstate_c[] = "SCRAMAuthentication.__setstate_cython__"; static const char __pyx_k_SCRAMAuthentication__bytes_xor_l[] = "SCRAMAuthentication._bytes_xor..genexpr"; static const char __pyx_k_SCRAMAuthentication__normalize_p[] = "SCRAMAuthentication._normalize_password..genexpr"; static const char __pyx_k_a_sized_iterable_container_expec[] = "a sized iterable container expected (got type {!r})"; static const char __pyx_k_asyncpg_Protocol_has_no_referenc[] = "asyncpg.Protocol has no reference to its Connection object and yet a cancellation was requested. Please report this at github.com/magicstack/asyncpg."; static const char __pyx_k_asyncpg_protocol_codecs_base_pyx[] = "asyncpg/protocol/codecs/base.pyx"; static const char __pyx_k_asyncpg_protocol_prepared_stmt_p[] = "asyncpg/protocol/prepared_stmt.pyx"; static const char __pyx_k_base_codec_is_mutually_exclusive[] = "base_codec is mutually exclusive with c_encoder/c_decoder"; static const char __pyx_k_bind_execute_many_locals_genexpr[] = "bind_execute_many..genexpr"; static const char __pyx_k_cannot_decode_type_text_encoding[] = "cannot decode type \"{}\".\"{}\": text encoding of range types is not supported"; static const char __pyx_k_cannot_perform_operation_another[] = "cannot perform operation: another operation is cancelling"; static const char __pyx_k_cannot_perform_operation_connect[] = "cannot perform operation: connection is closed"; static const char __pyx_k_cannot_register_core_codec_for_O[] = "cannot register core codec for OID {}: it is greater than MAXSUPPORTEDOID ({})"; static const char __pyx_k_cannot_switch_to_idle_state_prot[] = "cannot switch to \"idle\" state; protocol is in the \"failed\" state"; static const char __pyx_k_cannot_switch_to_state_another_o[] = "cannot switch to state {}; another operation ({}) is in progress"; static const char __pyx_k_connection_was_closed_in_the_mid[] = "connection was closed in the middle of operation"; static const char __pyx_k_could_not_verify_server_signatur[] = "could not verify server signature for SCRAM authentciation: scram-sha-256"; static const char __pyx_k_duplicate_GSSAPI_SSPI_authentica[] = "duplicate GSSAPI/SSPI authentication request"; static const char __pyx_k_expected_0_1_or_2_elements_in_ra[] = "expected 0, 1 or 2 elements in range (got {})"; static const char __pyx_k_gssapi_module_not_found_please_i[] = "gssapi module not found; please install asyncpg[gssauth] to use asyncpg with Kerberos/GSSAPI/SSPI authentication"; static const char __pyx_k_inconsistent_sub_array_dimension[] = "inconsistent sub-array dimensions at position {}"; static const char __pyx_k_input_of_anonymous_composite_typ[] = "input of anonymous composite types is not supported"; static const char __pyx_k_invalid_format_argument_expected[] = "invalid `format` argument, expected {}, got {!r}"; static const char __pyx_k_invalid_input_for_query_argument[] = "invalid input for query argument "; static const char __pyx_k_invalid_input_in_executemany_arg[] = "invalid input in executemany() argument sequence element #"; static const char __pyx_k_invalid_timeout_value_expected_n[] = "invalid timeout value: expected non-negative float (got {!r})"; static const char __pyx_k_list_tuple_or_Range_object_expec[] = "list, tuple or Range object expected (got type {})"; static const char __pyx_k_missing_after_array_dimensions_2[] = "missing '=' after array dimensions"; static const char __pyx_k_missing_codec_information_for_OI[] = "missing codec information for OID {}"; static const char __pyx_k_named_prepared_statements_cannot[] = "named prepared statements cannot be marked unprepared"; static const char __pyx_k_no_binary_format_encoder_for_typ[] = "no binary format encoder for type {} (OID {})"; static const char __pyx_k_no_codec_for_composite_attribute[] = "no codec for composite attribute type "; static const char __pyx_k_no_decoder_for_composite_type_el[] = "no decoder for composite type element in position {} of type OID {}"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; static const char __pyx_k_number_of_array_dimensions_excee[] = "number of array dimensions ({}) exceed the maximum expected ({})"; static const char __pyx_k_reader_is_not_an_asynchronous_it[] = "reader is not an asynchronous iterable"; static const char __pyx_k_size_of_encoded_multirange_datum[] = "size of encoded multirange datum exceeds the maximum allowed "; static const char __pyx_k_specified_array_dimensions_do_no[] = "specified array dimensions do not match array content"; static const char __pyx_k_the_number_of_columns_in_the_res[] = "the number of columns in the result row ({}) is different from what was described ({})"; static const char __pyx_k_the_number_of_query_arguments_ca[] = "the number of query arguments cannot exceed 32767"; static const char __pyx_k_too_many_elements_in_array_value[] = "too many elements in array value"; static const char __pyx_k_too_many_elements_in_composite_t[] = "too many elements in composite type record"; static const char __pyx_k_type_record_missing_base_type_fo[] = "type record missing base type for domain "; static const char __pyx_k_unexpected_NULL_element_in_multi[] = "unexpected NULL element in multirange value"; static const char __pyx_k_unexpected_array_dimensions_valu[] = "unexpected array dimensions value: {}"; static const char __pyx_k_unexpected_character_r_at_positi[] = "unexpected character {!r} at position {}"; static const char __pyx_k_unexpected_data_type_of_composit[] = "unexpected data type of composite type attribute {}: {!r}, expected {!r}"; static const char __pyx_k_unexpected_error_while_performin[] = "unexpected error while performing authentication: "; static const char __pyx_k_unexpected_multirange_size_value[] = "unexpected multirange size value: {}"; static const char __pyx_k_unexpected_trailing_bytes_in_buf[] = "unexpected trailing {} bytes in buffer"; static const char __pyx_k_unknown_error_in_protocol_implem[] = "unknown error in protocol implementation"; static const char __pyx_k_unsupported_authentication_metho[] = "unsupported authentication method requested by the server: {!r}"; static const char __pyx_k_waiter_is_not_done_while_handlin[] = "waiter is not done while handling critical protocol error"; static const char __pyx_k_you_need_values_from_server_to_g[] = "you need values from server to generate a client proof"; static const char __pyx_k_Incompatible_checksums_0x_x_vs_0_2[] = "Incompatible checksums (0x%x vs (0xa7a9ac8, 0xf0eeb4b, 0x55a24b7) = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, con_params, con_status, encoding, gss_ctx, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, scram, state, transport, xact_status))"; static const char __pyx_k_Incompatible_checksums_0x_x_vs_0_3[] = "Incompatible checksums (0x%x vs (0x804a80d, 0x270b831, 0xdd78461) = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _is_ssl, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, con_params, con_status, conref, create_future, encoding, gss_ctx, is_reading, last_query, loop, queries_count, record_class, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, scram, settings, state, statement, timeout_handle, transport, waiter, writing_paused, xact_status))"; static const char __pyx_k_cannot_decode_type_text_encoding_2[] = "cannot decode type \"{}\".\"{}\": text encoding of composite types is not supported"; static const char __pyx_k_cannot_perform_operation_another_2[] = "cannot perform operation: another operation is in progress"; static const char __pyx_k_type_record_missing_base_type_fo_2[] = "type record missing base type for range "; static const char __pyx_k_type_record_missing_base_type_fo_3[] = "type record missing base type for multirange "; /* #### Code section: decls ### */ static int __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_2get_text_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_4register_data_types(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_types); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_6add_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typeinfos, PyObject *__pyx_v_typekind, PyObject *__pyx_v_encoder, PyObject *__pyx_v_decoder, PyObject *__pyx_v_format); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_8remove_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_10clear_type_cache(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_12set_builtin_type_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typekind, PyObject *__pyx_v_alias_to, PyObject *__pyx_v_format); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_14get_data_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, uint32_t __pyx_v_oid, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, int __pyx_v_ignore_custom_codec); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_16__getattr__(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_18__repr__(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7asyncpg_8protocol_8protocol_5Codec___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, uint32_t __pyx_v_oid); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Codec_2__repr__(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Codec_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Codec_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig___init__(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_2add_types(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v_types); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_4add_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typekind, PyObject *__pyx_v_typeinfos, PyObject *__pyx_v_encoder, PyObject *__pyx_v_decoder, PyObject *__pyx_v_format, PyObject *__pyx_v_xformat); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_6remove_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v_typeoid, CYTHON_UNUSED PyObject *__pyx_v_typename, CYTHON_UNUSED PyObject *__pyx_v_typeschema); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_8_set_builtin_type_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typekind, PyObject *__pyx_v_alias_to, PyObject *__pyx_v_format); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_10set_builtin_type_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typekind, PyObject *__pyx_v_alias_to, PyObject *__pyx_v_format); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_12clear_type_cache(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_14declare_fallback_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_16__reduce_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_18__setstate_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_authentication_method); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10_bytes_xor_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_3genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_6genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_9genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authentication_method___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authorization_message___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_22client_channel_binding___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_25client_first_message_bare___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_nonce___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_proof___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_13password_salt___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19password_iterations___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_20server_first_message___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10server_key___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12server_nonce___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol___init__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_addr, PyObject *__pyx_v_con_params); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_2is_in_transaction(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_11backend_pid___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_14backend_secret___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_4__reduce_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_6__setstate_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_query, struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_protocol, PyTypeObject *__pyx_v_record_class, int __pyx_v_ignore_custom_codec); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_2_get_parameters(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_4_get_attributes(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_6_init_types(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_8_init_codecs(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_10attach(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_12detach(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_14mark_closed(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_16mark_unprepared(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_4name___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_5query___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_6closed___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_8prepared___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_4refs___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_12record_class___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_19ignore_custom_codec___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol___init__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_addr, PyObject *__pyx_v_connected_fut, PyObject *__pyx_v_con_params, PyTypeObject *__pyx_v_record_class, PyObject *__pyx_v_loop); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_2set_connection(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_connection); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_4get_server_pid(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_6get_settings(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_8get_record_class(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_10prepare(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_stmt_name, PyObject *__pyx_v_query, PyObject *__pyx_v_timeout, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_ignore_custom_codec, PyObject *__pyx_v_record_class); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_13bind_execute(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_args, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_limit, PyObject *__pyx_v_return_extra, PyObject *__pyx_v_timeout); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_16bind_execute_many(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_args, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_timeout, PyObject *__pyx_v_return_rows); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_19bind(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_args, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_timeout); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_22execute(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_portal_name, int __pyx_v_limit, PyObject *__pyx_v_return_extra, PyObject *__pyx_v_timeout); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_25close_portal(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_timeout); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_28query(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_timeout); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_f); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_31copy_out(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_copy_stmt, PyObject *__pyx_v_sink, PyObject *__pyx_v_timeout); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_f); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_34copy_in(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_copy_stmt, PyObject *__pyx_v_reader, PyObject *__pyx_v_data, PyObject *__pyx_v_records, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_record_stmt, PyObject *__pyx_v_timeout); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_37close_statement(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_timeout); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_40is_closed(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_42is_connected(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_44abort(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_46close(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_49_request_cancel(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_51_on_timeout(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_fut); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_53_on_waiter_completed(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_fut); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_55_create_future_fallback(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_57_get_timeout(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_59_is_cancelling(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_61_wait_for_cancellation(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_64data_received(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_66connection_made(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_transport); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_68connection_lost(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_exc); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_70pause_writing(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_72resume_writing(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static int __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl_2__set__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_13queries_count___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_74__reduce_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_76__setstate_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Timer___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_budget); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Timer_2__enter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Timer_4__exit__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_et, CYTHON_UNUSED PyObject *__pyx_v_e, CYTHON_UNUSED PyObject *__pyx_v_tb); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Timer_6get_remaining_budget(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Timer_8has_budget_greater_than(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_amount); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol__create_record(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping, PyObject *__pyx_v_elems); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_2__pyx_unpickle_DataCodecConfig(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_4__pyx_unpickle_CoreProtocol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_6__pyx_unpickle_BaseProtocol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_Codec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_DataCodecConfig(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_ConnectionSettings(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_SCRAMAuthentication(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_CoreProtocol(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_PreparedStatementState(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_BaseProtocol(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, 0, 0, 0, 0}; static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop = {0, 0, 0, 0, 0}; /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_7cpython_4type_type; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_7cpython_4bool_bool; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_7cpython_7complex_complex; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer; PyTypeObject *__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer; PyTypeObject *__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_7asyncpg_8protocol_8protocol_Codec; PyObject *__pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig; PyObject *__pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings; PyObject *__pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication; PyObject *__pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol; PyObject *__pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState; PyObject *__pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol; PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr; PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password; PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr; PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr; PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr; PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr; PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare; PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute; PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many; PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr; PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind; PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute; PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal; PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query; PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out; PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in; PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement; PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close; PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation; #endif PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_Codec; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close; PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation; PyObject *__pyx_n_s_AF_UNIX; PyObject *__pyx_n_u_AF_UNIX; PyObject *__pyx_n_s_ARRAY_TYPES; PyObject *__pyx_n_s_AUTHENTICATION_METHODS; PyObject *__pyx_n_s_AssertionError; PyObject *__pyx_n_s_AsyncIterable; PyObject *__pyx_n_s_Attribute; PyObject *__pyx_n_s_AttributeError; PyObject *__pyx_n_s_BUILTIN_TYPE_NAME_MAP; PyObject *__pyx_n_s_BUILTIN_TYPE_OID_MAP; PyObject *__pyx_n_s_BaseProtocol; PyObject *__pyx_n_s_BaseProtocol___reduce_cython; PyObject *__pyx_n_s_BaseProtocol___setstate_cython; PyObject *__pyx_n_s_BaseProtocol__create_future_fall; PyObject *__pyx_n_s_BaseProtocol__get_timeout; PyObject *__pyx_n_s_BaseProtocol__is_cancelling; PyObject *__pyx_n_s_BaseProtocol__on_timeout; PyObject *__pyx_n_s_BaseProtocol__on_waiter_complete; PyObject *__pyx_n_s_BaseProtocol__request_cancel; PyObject *__pyx_n_s_BaseProtocol__wait_for_cancellat; PyObject *__pyx_n_s_BaseProtocol_abort; PyObject *__pyx_n_s_BaseProtocol_bind; PyObject *__pyx_n_s_BaseProtocol_bind_execute; PyObject *__pyx_n_s_BaseProtocol_bind_execute_many; PyObject *__pyx_n_s_BaseProtocol_close; PyObject *__pyx_n_s_BaseProtocol_close_portal; PyObject *__pyx_n_s_BaseProtocol_close_statement; PyObject *__pyx_n_s_BaseProtocol_connection_lost; PyObject *__pyx_n_s_BaseProtocol_connection_made; PyObject *__pyx_n_s_BaseProtocol_copy_in; PyObject *__pyx_n_s_BaseProtocol_copy_out; PyObject *__pyx_n_s_BaseProtocol_data_received; PyObject *__pyx_n_s_BaseProtocol_execute; PyObject *__pyx_n_s_BaseProtocol_get_record_class; PyObject *__pyx_n_s_BaseProtocol_get_server_pid; PyObject *__pyx_n_s_BaseProtocol_get_settings; PyObject *__pyx_n_s_BaseProtocol_is_closed; PyObject *__pyx_n_s_BaseProtocol_is_connected; PyObject *__pyx_n_s_BaseProtocol_pause_writing; PyObject *__pyx_n_s_BaseProtocol_prepare; PyObject *__pyx_n_s_BaseProtocol_query; PyObject *__pyx_n_s_BaseProtocol_resume_writing; PyObject *__pyx_n_s_BaseProtocol_set_connection; PyObject *__pyx_kp_u_Bind_expected_a_sequence_got; PyObject *__pyx_n_s_BufferError; PyObject *__pyx_n_s_CancelledError; PyObject *__pyx_kp_u_Check_the_query_against_the_pass; PyObject *__pyx_n_s_ClientSecurityContext; PyObject *__pyx_kp_b_Client_Key; PyObject *__pyx_n_s_Codec; PyObject *__pyx_n_s_Codec___reduce_cython; PyObject *__pyx_n_s_Codec___setstate_cython; PyObject *__pyx_kp_u_Codec_oid_elem_oid_core; PyObject *__pyx_n_s_ConnectionDoesNotExistError; PyObject *__pyx_n_s_ConnectionResetError; PyObject *__pyx_n_s_ConnectionSettings; PyObject *__pyx_n_s_ConnectionSettings___reduce_cyth; PyObject *__pyx_n_s_ConnectionSettings___setstate_cy; PyObject *__pyx_n_s_ConnectionSettings_add_python_co; PyObject *__pyx_n_s_ConnectionSettings_clear_type_ca; PyObject *__pyx_n_s_ConnectionSettings_get_data_code; PyObject *__pyx_n_s_ConnectionSettings_get_text_code; PyObject *__pyx_kp_u_ConnectionSettings_r; PyObject *__pyx_n_s_ConnectionSettings_register_data; PyObject *__pyx_n_s_ConnectionSettings_remove_python; PyObject *__pyx_n_s_ConnectionSettings_set_builtin_t; PyObject *__pyx_kp_u_Consider_declaring_an_explicit_c; PyObject *__pyx_n_s_CoreProtocol; PyObject *__pyx_n_s_CoreProtocol___reduce_cython; PyObject *__pyx_n_s_CoreProtocol___setstate_cython; PyObject *__pyx_n_s_CoreProtocol_is_in_transaction; PyObject *__pyx_n_s_DEFAULT_CLIENT_NONCE_BYTES; PyObject *__pyx_n_s_DIGEST; PyObject *__pyx_n_s_DataCodecConfig; PyObject *__pyx_n_s_DataCodecConfig___reduce_cython; PyObject *__pyx_n_s_DataCodecConfig___setstate_cytho; PyObject *__pyx_n_s_DataCodecConfig__set_builtin_typ; PyObject *__pyx_n_s_DataCodecConfig_add_python_codec; PyObject *__pyx_n_s_DataCodecConfig_add_types; PyObject *__pyx_n_s_DataCodecConfig_clear_type_cache; PyObject *__pyx_n_s_DataCodecConfig_declare_fallback; PyObject *__pyx_n_s_DataCodecConfig_remove_python_co; PyObject *__pyx_n_s_DataCodecConfig_set_builtin_type; PyObject *__pyx_n_s_DataError; PyObject *__pyx_n_s_Event; PyObject *__pyx_n_s_Future; PyObject *__pyx_kp_u_GSSAPI_SSPI_authentication_is_on; PyObject *__pyx_n_s_IPPROTO_TCP; PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0; PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2; PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_3; PyObject *__pyx_n_s_IndexError; PyObject *__pyx_n_s_InterfaceError; PyObject *__pyx_n_s_InternalClientError; PyObject *__pyx_n_s_Iterable; PyObject *__pyx_n_s_IterableABC; PyObject *__pyx_n_u_Kerberos; PyObject *__pyx_n_s_KeyError; PyObject *__pyx_n_s_Mapping; PyObject *__pyx_n_s_MappingABC; PyObject *__pyx_n_s_ModuleNotFoundError; PyObject *__pyx_n_u_NA; PyObject *__pyx_n_u_NFKC; PyObject *__pyx_n_s_NO_TIMEOUT; PyObject *__pyx_n_b_NULL; PyObject *__pyx_n_s_Name; PyObject *__pyx_n_s_NameType; PyObject *__pyx_n_u_Negotiate; PyObject *__pyx_n_s_NotImplementedError; PyObject *__pyx_kp_u_Note_that_parameters_are_suppor; PyObject *__pyx_kp_u_OID; PyObject *__pyx_kp_u_OID_value_too_large_r; PyObject *__pyx_n_s_OrderedDict; PyObject *__pyx_n_s_OutdatedSchemaCacheError; PyObject *__pyx_n_s_OverflowError; PyObject *__pyx_kp_b_PGCOPY; PyObject *__pyx_n_s_PickleError; PyObject *__pyx_kp_u_PostgreSQL_does_not_implement_an; PyObject *__pyx_n_s_PostgresError; PyObject *__pyx_n_s_PreparedStatementState; PyObject *__pyx_n_s_PreparedStatementState___reduce; PyObject *__pyx_n_s_PreparedStatementState___setstat; PyObject *__pyx_n_s_PreparedStatementState__get_attr; PyObject *__pyx_n_s_PreparedStatementState__get_para; PyObject *__pyx_n_s_PreparedStatementState__init_cod; PyObject *__pyx_n_s_PreparedStatementState__init_typ; PyObject *__pyx_n_s_PreparedStatementState_attach; PyObject *__pyx_n_s_PreparedStatementState_detach; PyObject *__pyx_n_s_PreparedStatementState_mark_clos; PyObject *__pyx_n_s_PreparedStatementState_mark_unpr; PyObject *__pyx_n_s_Protocol; PyObject *__pyx_n_s_ProtocolError; PyObject *__pyx_n_s_REQUIREMENTS_CLIENT_FINAL_MESSAG; PyObject *__pyx_n_s_REQUIREMENTS_CLIENT_PROOF; PyObject *__pyx_n_u_ROLLBACK; PyObject *__pyx_n_s_Range; PyObject *__pyx_n_s_Record; PyObject *__pyx_n_s_SASLPREP_PROHIBITED; PyObject *__pyx_n_s_SCRAMAuthentication; PyObject *__pyx_n_s_SCRAMAuthentication___reduce_cyt; PyObject *__pyx_n_s_SCRAMAuthentication___setstate_c; PyObject *__pyx_n_s_SCRAMAuthentication__bytes_xor_l; PyObject *__pyx_n_s_SCRAMAuthentication__normalize_p; PyObject *__pyx_kp_b_SCRAM_SHA_256; PyObject *__pyx_n_s_SecurityContext; PyObject *__pyx_n_s_Sequence; PyObject *__pyx_n_s_SequenceABC; PyObject *__pyx_kp_b_Server_Key; PyObject *__pyx_n_s_Sized; PyObject *__pyx_n_s_SizedABC; PyObject *__pyx_n_s_StopAsyncIteration; PyObject *__pyx_n_s_StopIteration; PyObject *__pyx_n_s_TCP_NODELAY; PyObject *__pyx_n_s_TimeoutError; PyObject *__pyx_n_u_TimeoutError; PyObject *__pyx_n_s_Timer; PyObject *__pyx_n_s_Timer___enter; PyObject *__pyx_n_s_Timer___exit; PyObject *__pyx_n_s_Timer___init; PyObject *__pyx_n_s_Timer_get_remaining_budget; PyObject *__pyx_n_s_Timer_has_budget_greater_than; PyObject *__pyx_kp_u_TimoutError_was_not_raised; PyObject *__pyx_n_s_Type; PyObject *__pyx_n_s_TypeError; PyObject *__pyx_n_s_UnicodeEncodeError; PyObject *__pyx_n_s_UnsupportedClientFeatureError; PyObject *__pyx_n_s_UserCredential; PyObject *__pyx_n_s_ValueError; PyObject *__pyx_kp_b__15; PyObject *__pyx_n_s__167; PyObject *__pyx_n_u__2; PyObject *__pyx_kp_b__23; PyObject *__pyx_kp_b__31; PyObject *__pyx_kp_b__32; PyObject *__pyx_kp_u__33; PyObject *__pyx_kp_b__34; PyObject *__pyx_kp_u__34; PyObject *__pyx_kp_u__35; PyObject *__pyx_kp_u__36; PyObject *__pyx_n_s__37; PyObject *__pyx_kp_u__38; PyObject *__pyx_kp_u__39; PyObject *__pyx_kp_u__40; PyObject *__pyx_kp_u__41; PyObject *__pyx_kp_u__42; PyObject *__pyx_kp_u__44; PyObject *__pyx_kp_u__45; PyObject *__pyx_kp_u__5; PyObject *__pyx_kp_u__8; PyObject *__pyx_kp_u_a_sized_iterable_container_expec; PyObject *__pyx_n_s_abc; PyObject *__pyx_n_u_abc; PyObject *__pyx_n_s_abort; PyObject *__pyx_n_u_abstime; PyObject *__pyx_n_u_aclitem; PyObject *__pyx_n_s_add_done_callback; PyObject *__pyx_n_s_add_python_codec; PyObject *__pyx_n_s_add_types; PyObject *__pyx_n_s_addr; PyObject *__pyx_n_s_aiter; PyObject *__pyx_n_s_aiter_2; PyObject *__pyx_n_s_alias_oid; PyObject *__pyx_n_s_alias_to; PyObject *__pyx_kp_u_already_connected; PyObject *__pyx_n_u_alt; PyObject *__pyx_n_s_amount; PyObject *__pyx_n_s_anext; PyObject *__pyx_n_s_any; PyObject *__pyx_n_u_any; PyObject *__pyx_n_u_anyarray; PyObject *__pyx_n_u_anycompatible; PyObject *__pyx_n_u_anycompatiblearray; PyObject *__pyx_n_u_anycompatiblemultirange; PyObject *__pyx_n_u_anycompatiblenonarray; PyObject *__pyx_n_u_anycompatiblerange; PyObject *__pyx_n_u_anyelement; PyObject *__pyx_n_u_anyenum; PyObject *__pyx_n_u_anymultirange; PyObject *__pyx_n_u_anynonarray; PyObject *__pyx_n_u_anyrange; PyObject *__pyx_n_s_apg_exc; PyObject *__pyx_n_s_apg_exc_base; PyObject *__pyx_n_s_apg_types; PyObject *__pyx_n_s_arg_bufs; PyObject *__pyx_n_s_args; PyObject *__pyx_n_s_args_buf; PyObject *__pyx_n_u_array; PyObject *__pyx_n_s_array_element_oid; PyObject *__pyx_kp_u_array_length_overflow; PyObject *__pyx_n_u_ascii; PyObject *__pyx_n_s_asyncio; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_asyncio_tasks; PyObject *__pyx_n_s_asyncpg; PyObject *__pyx_kp_u_asyncpg_Protocol_has_no_referenc; PyObject *__pyx_n_s_asyncpg_exceptions; PyObject *__pyx_kp_s_asyncpg_protocol_codecs_base_pyx; PyObject *__pyx_kp_s_asyncpg_protocol_coreproto_pyx; PyObject *__pyx_kp_s_asyncpg_protocol_prepared_stmt_p; PyObject *__pyx_n_s_asyncpg_protocol_protocol; PyObject *__pyx_kp_s_asyncpg_protocol_protocol_pyx; PyObject *__pyx_kp_s_asyncpg_protocol_settings_pyx; PyObject *__pyx_n_s_attach; PyObject *__pyx_n_s_attrname; PyObject *__pyx_n_u_attrnames; PyObject *__pyx_n_u_attrtypoids; PyObject *__pyx_n_s_auth_msg; PyObject *__pyx_n_s_authentication_method; PyObject *__pyx_n_s_await; PyObject *__pyx_n_s_b64decode; PyObject *__pyx_n_s_b64encode; PyObject *__pyx_n_s_base; PyObject *__pyx_n_s_base64; PyObject *__pyx_n_s_base_codec; PyObject *__pyx_kp_u_base_codec_is_mutually_exclusive; PyObject *__pyx_n_s_base_type; PyObject *__pyx_n_u_basetype; PyObject *__pyx_n_u_basetype_name; PyObject *__pyx_n_u_big; PyObject *__pyx_n_u_bigint; PyObject *__pyx_n_u_binary; PyObject *__pyx_n_s_bind; PyObject *__pyx_n_s_bind_execute; PyObject *__pyx_n_s_bind_execute_many; PyObject *__pyx_n_s_bind_execute_many_locals_genexpr; PyObject *__pyx_n_u_bit; PyObject *__pyx_kp_u_bit_varying; PyObject *__pyx_n_s_bool; PyObject *__pyx_n_u_bool; PyObject *__pyx_n_u_box; PyObject *__pyx_n_u_bpchar; PyObject *__pyx_n_s_budget; PyObject *__pyx_n_s_budget_2; PyObject *__pyx_n_s_buffer; PyObject *__pyx_n_s_builtins; PyObject *__pyx_n_u_bytea; PyObject *__pyx_n_s_byteorder; PyObject *__pyx_kp_u_bytes; PyObject *__pyx_n_b_c; PyObject *__pyx_kp_b_c_2; PyObject *__pyx_kp_b_c_3; PyObject *__pyx_n_s_c_decoder; PyObject *__pyx_n_s_c_encoder; PyObject *__pyx_n_s_call_exception_handler; PyObject *__pyx_n_s_call_later; PyObject *__pyx_n_s_cancel; PyObject *__pyx_n_s_cancel_current_command; PyObject *__pyx_n_s_cancelled; PyObject *__pyx_kp_u_cannot_alias; PyObject *__pyx_kp_u_cannot_close_prepared_statement; PyObject *__pyx_kp_u_cannot_decode_type_text_encoding; PyObject *__pyx_kp_u_cannot_decode_type_text_encoding_2; PyObject *__pyx_kp_u_cannot_perform_operation_another; PyObject *__pyx_kp_u_cannot_perform_operation_another_2; PyObject *__pyx_kp_u_cannot_perform_operation_connect; PyObject *__pyx_kp_u_cannot_process_message; PyObject *__pyx_kp_u_cannot_register_core_codec_for_O; PyObject *__pyx_kp_u_cannot_switch_to_idle_state_prot; PyObject *__pyx_kp_u_cannot_switch_to_state_another_o; PyObject *__pyx_kp_u_cannot_switch_to_state_protocol; PyObject *__pyx_n_s_cause; PyObject *__pyx_n_u_char; PyObject *__pyx_n_u_character; PyObject *__pyx_kp_u_character_varying; PyObject *__pyx_n_s_chr; PyObject *__pyx_n_s_chunk; PyObject *__pyx_n_u_cid; PyObject *__pyx_n_u_cidr; PyObject *__pyx_n_u_circle; PyObject *__pyx_n_s_class_getitem; PyObject *__pyx_n_s_cleanup; PyObject *__pyx_n_s_clear; PyObject *__pyx_n_s_clear_type_cache; PyObject *__pyx_n_u_client_channel_binding; PyObject *__pyx_n_b_client_encoding; PyObject *__pyx_n_u_client_encoding; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_close; PyObject *__pyx_n_s_close_portal; PyObject *__pyx_n_s_close_statement; PyObject *__pyx_n_s_codec; PyObject *__pyx_kp_u_codec_for; PyObject *__pyx_n_s_codec_set; PyObject *__pyx_n_s_codec_str; PyObject *__pyx_n_s_codecs; PyObject *__pyx_n_s_collections; PyObject *__pyx_n_s_collections_abc; PyObject *__pyx_n_s_command_timeout; PyObject *__pyx_n_s_comp_elem_codecs; PyObject *__pyx_n_s_comp_type_attrs; PyObject *__pyx_n_s_compat; PyObject *__pyx_n_u_composite; PyObject *__pyx_n_s_con; PyObject *__pyx_n_s_con_params; PyObject *__pyx_n_s_config; PyObject *__pyx_n_s_connected_fut; PyObject *__pyx_n_s_connection; PyObject *__pyx_n_s_connection_lost; PyObject *__pyx_n_s_connection_made; PyObject *__pyx_kp_u_connection_was_closed_in_the_mid; PyObject *__pyx_n_s_copy_in; PyObject *__pyx_n_s_copy_in_locals_lambda; PyObject *__pyx_n_s_copy_out; PyObject *__pyx_n_s_copy_out_locals_lambda; PyObject *__pyx_n_s_copy_stmt; PyObject *__pyx_n_s_core_codec; PyObject *__pyx_kp_u_could_not_get_iterations; PyObject *__pyx_kp_u_could_not_get_nonce; PyObject *__pyx_kp_u_could_not_get_salt; PyObject *__pyx_kp_u_could_not_get_server_signature; PyObject *__pyx_kp_u_could_not_verify_server_signatur; PyObject *__pyx_n_u_cp1250; PyObject *__pyx_n_u_cp1251; PyObject *__pyx_n_u_cp1252; PyObject *__pyx_n_u_cp1253; PyObject *__pyx_n_u_cp1254; PyObject *__pyx_n_u_cp1255; PyObject *__pyx_n_u_cp1256; PyObject *__pyx_n_u_cp1257; PyObject *__pyx_n_u_cp1258; PyObject *__pyx_n_u_cp1521; PyObject *__pyx_n_u_cp866; PyObject *__pyx_n_u_cp874; PyObject *__pyx_n_u_cp932; PyObject *__pyx_n_u_cp936; PyObject *__pyx_n_u_cp949; PyObject *__pyx_n_u_cp950; PyObject *__pyx_n_s_create_future; PyObject *__pyx_n_s_create_future_fallback; PyObject *__pyx_n_s_create_record; PyObject *__pyx_n_s_credential; PyObject *__pyx_n_u_cstring; PyObject *__pyx_n_b_d; PyObject *__pyx_n_s_d; PyObject *__pyx_n_s_data; PyObject *__pyx_n_s_data_gen; PyObject *__pyx_n_s_data_received; PyObject *__pyx_n_s_data_type; PyObject *__pyx_n_s_database; PyObject *__pyx_n_u_database; PyObject *__pyx_n_u_date; PyObject *__pyx_n_u_decimal; PyObject *__pyx_n_s_declare_fallback_codec; PyObject *__pyx_n_s_decode; PyObject *__pyx_kp_u_decode_row_statement_is_None; PyObject *__pyx_n_s_decoder; PyObject *__pyx_n_s_desc; PyObject *__pyx_n_s_detach; PyObject *__pyx_n_s_detail; PyObject *__pyx_n_s_dict; PyObject *__pyx_n_s_dict_2; PyObject *__pyx_n_s_digest; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_doc; PyObject *__pyx_n_s_done; PyObject *__pyx_kp_u_double_precision; PyObject *__pyx_kp_u_duplicate_GSSAPI_SSPI_authentica; PyObject *__pyx_n_b_e; PyObject *__pyx_n_s_e; PyObject *__pyx_n_s_elem; PyObject *__pyx_n_s_elem_codec; PyObject *__pyx_n_s_elem_delim; PyObject *__pyx_n_s_elem_format; PyObject *__pyx_n_u_elemdelim; PyObject *__pyx_n_s_element_names; PyObject *__pyx_n_s_elems; PyObject *__pyx_n_u_elemtype; PyObject *__pyx_n_u_elemtype_name; PyObject *__pyx_n_s_empty; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_encode; PyObject *__pyx_n_s_encoder; PyObject *__pyx_n_s_enter; PyObject *__pyx_n_s_enumerate; PyObject *__pyx_n_s_et; PyObject *__pyx_n_u_euc_cn; PyObject *__pyx_n_u_euc_jis_2004; PyObject *__pyx_n_u_euc_jp; PyObject *__pyx_n_u_euc_kr; PyObject *__pyx_n_u_euccn; PyObject *__pyx_n_u_eucjp; PyObject *__pyx_n_u_euckr; PyObject *__pyx_n_u_event_trigger; PyObject *__pyx_n_s_ex; PyObject *__pyx_n_s_exc; PyObject *__pyx_n_s_exception; PyObject *__pyx_n_s_exceptions; PyObject *__pyx_n_s_execute; PyObject *__pyx_n_s_exit; PyObject *__pyx_kp_u_expected_0_1_or_2_elements_in_ra; PyObject *__pyx_kp_u_expected_a_sequence_got; PyObject *__pyx_kp_u_expected_a_sequence_got_type_r; PyObject *__pyx_n_s_f; PyObject *__pyx_n_s_family; PyObject *__pyx_n_u_fdw_handler; PyObject *__pyx_n_u_float4; PyObject *__pyx_n_u_float8; PyObject *__pyx_n_s_fmt; PyObject *__pyx_n_s_format; PyObject *__pyx_n_s_formats; PyObject *__pyx_n_s_fut; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_genexpr; PyObject *__pyx_n_s_get; PyObject *__pyx_n_s_get_attributes; PyObject *__pyx_n_s_get_data_codec; PyObject *__pyx_n_s_get_extra_info; PyObject *__pyx_n_s_get_parameters; PyObject *__pyx_n_s_get_record_class; PyObject *__pyx_n_s_get_remaining_budget; PyObject *__pyx_n_s_get_server_pid; PyObject *__pyx_n_s_get_settings; PyObject *__pyx_n_s_get_text_codec; PyObject *__pyx_n_s_get_timeout; PyObject *__pyx_n_s_getattribute; PyObject *__pyx_n_s_getstate; PyObject *__pyx_kp_u_got_result_for_unknown_protocol; PyObject *__pyx_n_s_group; PyObject *__pyx_n_u_gss; PyObject *__pyx_n_s_gssapi; PyObject *__pyx_n_u_gssapi; PyObject *__pyx_kp_u_gssapi_module_not_found_please_i; PyObject *__pyx_n_s_gsslib; PyObject *__pyx_n_u_gtsvector; PyObject *__pyx_n_s_has_budget_greater_than; PyObject *__pyx_n_s_has_text_elements; PyObject *__pyx_n_s_hashlib; PyObject *__pyx_n_s_hexdigest; PyObject *__pyx_n_s_hint; PyObject *__pyx_n_s_hmac; PyObject *__pyx_n_s_hostbased_service; PyObject *__pyx_n_s_i; PyObject *__pyx_kp_b_i_d; PyObject *__pyx_n_s_ignore_custom_codec; PyObject *__pyx_n_s_import; PyObject *__pyx_kp_u_in_element; PyObject *__pyx_n_s_in_table_a1; PyObject *__pyx_n_s_in_table_b1; PyObject *__pyx_n_s_in_table_c12; PyObject *__pyx_n_s_in_table_c21_c22; PyObject *__pyx_n_s_in_table_c3; PyObject *__pyx_n_s_in_table_c4; PyObject *__pyx_n_s_in_table_c5; PyObject *__pyx_n_s_in_table_c6; PyObject *__pyx_n_s_in_table_c7; PyObject *__pyx_n_s_in_table_c8; PyObject *__pyx_n_s_in_table_c9; PyObject *__pyx_n_s_in_table_d1; PyObject *__pyx_n_s_in_table_d2; PyObject *__pyx_kp_u_inconsistent_sub_array_dimension; PyObject *__pyx_n_u_index_am_handler; PyObject *__pyx_n_u_inet; PyObject *__pyx_n_s_init; PyObject *__pyx_n_s_init_codecs; PyObject *__pyx_n_s_init_subclass; PyObject *__pyx_n_s_init_types; PyObject *__pyx_n_s_initializing; PyObject *__pyx_n_u_initiate; PyObject *__pyx_kp_u_input_of_anonymous_composite_typ; PyObject *__pyx_n_s_inspect; PyObject *__pyx_n_s_int; PyObject *__pyx_n_u_int; PyObject *__pyx_n_u_int2; PyObject *__pyx_n_u_int4; PyObject *__pyx_n_u_int8; PyObject *__pyx_n_u_integer; PyObject *__pyx_n_u_internal; PyObject *__pyx_n_u_interval; PyObject *__pyx_kp_u_invalid_array_element; PyObject *__pyx_kp_u_invalid_array_element_at_index; PyObject *__pyx_kp_u_invalid_data_format; PyObject *__pyx_kp_u_invalid_format_argument_expected; PyObject *__pyx_kp_u_invalid_input_for_query_argument; PyObject *__pyx_kp_u_invalid_input_in_executemany_arg; PyObject *__pyx_kp_u_invalid_nonce; PyObject *__pyx_kp_u_invalid_timeout_value_expected_n; PyObject *__pyx_n_s_is_cancelling; PyObject *__pyx_n_s_is_closed; PyObject *__pyx_n_s_is_connected; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_n_s_is_in_transaction; PyObject *__pyx_n_s_isempty; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_item; PyObject *__pyx_n_s_items; PyObject *__pyx_n_s_iterator; PyObject *__pyx_n_u_json; PyObject *__pyx_n_u_jsonb; PyObject *__pyx_n_u_jsonpath; PyObject *__pyx_n_u_kerberosv5; PyObject *__pyx_n_u_kind; PyObject *__pyx_n_u_koi8_r; PyObject *__pyx_n_u_koi8_u; PyObject *__pyx_n_u_koi8r; PyObject *__pyx_n_u_koi8u; PyObject *__pyx_n_s_krbsrvname; PyObject *__pyx_n_u_language_handler; PyObject *__pyx_n_s_limit; PyObject *__pyx_n_u_line; PyObject *__pyx_kp_u_list_tuple_or_Range_object_expec; PyObject *__pyx_n_s_lookup; PyObject *__pyx_n_s_loop; PyObject *__pyx_n_s_lower; PyObject *__pyx_n_s_lower_inc; PyObject *__pyx_n_u_lseg; PyObject *__pyx_n_b_m; PyObject *__pyx_n_u_macaddr; PyObject *__pyx_n_u_macaddr8; PyObject *__pyx_n_s_main; PyObject *__pyx_kp_u_malformed_array_literal_r; PyObject *__pyx_n_s_mapping; PyObject *__pyx_n_s_mark_closed; PyObject *__pyx_n_s_mark_unprepared; PyObject *__pyx_n_b_md5; PyObject *__pyx_n_s_md5; PyObject *__pyx_n_u_md5; PyObject *__pyx_n_u_message; PyObject *__pyx_n_s_metaclass; PyObject *__pyx_n_s_missing; PyObject *__pyx_kp_u_missing_after_array_dimensions; PyObject *__pyx_kp_u_missing_after_array_dimensions_2; PyObject *__pyx_kp_u_missing_array_dimension_value; PyObject *__pyx_kp_u_missing_codec_information_for_OI; PyObject *__pyx_n_s_module; PyObject *__pyx_n_u_money; PyObject *__pyx_n_s_monotonic; PyObject *__pyx_n_s_more; PyObject *__pyx_n_s_mro_entries; PyObject *__pyx_n_u_multirange; PyObject *__pyx_kp_b_n; PyObject *__pyx_kp_b_n_2; PyObject *__pyx_n_s_name; PyObject *__pyx_n_u_name; PyObject *__pyx_n_s_name_2; PyObject *__pyx_kp_u_named_prepared_statements_cannot; PyObject *__pyx_n_s_new; PyObject *__pyx_n_s_new_2; PyObject *__pyx_kp_u_no_binary_format_encoder_for_typ; PyObject *__pyx_kp_u_no_codec_for_composite_attribute; PyObject *__pyx_kp_u_no_decoder_for_OID; PyObject *__pyx_kp_u_no_decoder_for_composite_type_el; PyObject *__pyx_kp_s_no_default___reduce___due_to_non; PyObject *__pyx_kp_u_no_encoder_for_OID; PyObject *__pyx_kp_u_non_homogeneous_array; PyObject *__pyx_n_s_normalize; PyObject *__pyx_kp_u_not_connected; PyObject *__pyx_n_u_ns; PyObject *__pyx_n_s_num_cols; PyObject *__pyx_kp_u_number_of_array_dimensions_excee; PyObject *__pyx_n_u_numeric; PyObject *__pyx_n_s_object; PyObject *__pyx_kp_u_of_executemany_sequence; PyObject *__pyx_n_s_oid; PyObject *__pyx_n_u_oid; PyObject *__pyx_kp_u_oid_2; PyObject *__pyx_n_s_on_error; PyObject *__pyx_kp_u_on_result__prepare_statement_is; PyObject *__pyx_kp_u_on_result_waiter_is_None; PyObject *__pyx_kp_u_on_result_waiter_is_done; PyObject *__pyx_n_s_on_timeout; PyObject *__pyx_n_s_on_waiter_completed; PyObject *__pyx_n_u_opaque; PyObject *__pyx_kp_b_p; PyObject *__pyx_n_s_p_oid; PyObject *__pyx_kp_u_parse_data_msgs_first_message_i; PyObject *__pyx_kp_u_parse_data_msgs_result_is_not_a; PyObject *__pyx_n_s_password; PyObject *__pyx_n_u_password; PyObject *__pyx_n_u_password_iterations; PyObject *__pyx_n_u_password_salt; PyObject *__pyx_n_u_path; PyObject *__pyx_n_s_pause_reading; PyObject *__pyx_n_s_pause_writing; PyObject *__pyx_n_u_pg_brin_bloom_summary; PyObject *__pyx_n_u_pg_brin_minmax_multi_summary; PyObject *__pyx_n_u_pg_catalog; PyObject *__pyx_kp_u_pg_contrib_hstore; PyObject *__pyx_n_u_pg_ddl_command; PyObject *__pyx_n_u_pg_dependencies; PyObject *__pyx_n_u_pg_lsn; PyObject *__pyx_n_u_pg_mcv_list; PyObject *__pyx_n_u_pg_ndistinct; PyObject *__pyx_n_u_pg_node_tree; PyObject *__pyx_n_u_pg_snapshot; PyObject *__pyx_n_s_pickle; PyObject *__pyx_n_u_point; PyObject *__pyx_n_u_polygon; PyObject *__pyx_n_s_pop; PyObject *__pyx_n_s_portal_name; PyObject *__pyx_n_s_position; PyObject *__pyx_n_u_postgres; PyObject *__pyx_n_s_prepare; PyObject *__pyx_n_s_prepare_2; PyObject *__pyx_n_s_process_log_message; PyObject *__pyx_n_s_process_notification; PyObject *__pyx_n_s_protocol; PyObject *__pyx_kp_u_protocol_is_in_an_unexpected_st; PyObject *__pyx_n_s_pyx_PickleError; PyObject *__pyx_n_s_pyx_capi; PyObject *__pyx_n_s_pyx_checksum; PyObject *__pyx_n_s_pyx_result; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_pyx_type; PyObject *__pyx_n_s_pyx_unpickle_BaseProtocol; PyObject *__pyx_n_s_pyx_unpickle_CoreProtocol; PyObject *__pyx_n_s_pyx_unpickle_DataCodecConfig; PyObject *__pyx_n_s_pyx_vtable; PyObject *__pyx_n_s_qualname; PyObject *__pyx_n_s_query; PyObject *__pyx_kp_u_query_argument; PyObject *__pyx_n_b_r; PyObject *__pyx_kp_b_r_2; PyObject *__pyx_kp_b_r_3; PyObject *__pyx_kp_u_r_is_not_a_valid_element_of_com; PyObject *__pyx_n_s_range; PyObject *__pyx_n_u_range; PyObject *__pyx_n_u_range_subtype; PyObject *__pyx_n_u_range_subtype_name; PyObject *__pyx_n_s_range_subtype_oid; PyObject *__pyx_n_s_rdesc; PyObject *__pyx_n_s_re; PyObject *__pyx_n_s_reader; PyObject *__pyx_kp_u_reader_is_not_an_asynchronous_it; PyObject *__pyx_n_u_real; PyObject *__pyx_n_s_rec; PyObject *__pyx_n_u_record; PyObject *__pyx_n_s_record_class; PyObject *__pyx_n_s_record_stmt; PyObject *__pyx_n_s_records; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_ref; PyObject *__pyx_n_u_refcursor; PyObject *__pyx_n_u_regclass; PyObject *__pyx_n_u_regcollation; PyObject *__pyx_n_u_regconfig; PyObject *__pyx_n_u_regdictionary; PyObject *__pyx_n_s_register_data_types; PyObject *__pyx_n_u_regnamespace; PyObject *__pyx_n_u_regoper; PyObject *__pyx_n_u_regoperator; PyObject *__pyx_n_u_regproc; PyObject *__pyx_n_u_regprocedure; PyObject *__pyx_n_u_regrole; PyObject *__pyx_n_u_regtype; PyObject *__pyx_n_s_release; PyObject *__pyx_n_u_reltime; PyObject *__pyx_n_s_remove_python_codec; PyObject *__pyx_n_s_request_cancel; PyObject *__pyx_n_s_result; PyObject *__pyx_n_s_resume_reading; PyObject *__pyx_n_s_resume_writing; PyObject *__pyx_n_s_return_extra; PyObject *__pyx_n_s_return_rows; PyObject *__pyx_n_s_reversed; PyObject *__pyx_n_s_row; PyObject *__pyx_kp_b_s; PyObject *__pyx_n_s_s_2; PyObject *__pyx_n_u_s_2; PyObject *__pyx_n_u_scalar; PyObject *__pyx_n_s_schema; PyObject *__pyx_kp_u_scram_sha_256; PyObject *__pyx_n_s_search; PyObject *__pyx_n_s_secrets; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_send; PyObject *__pyx_n_u_server_first_message; PyObject *__pyx_n_u_server_nonce; PyObject *__pyx_n_s_server_settings; PyObject *__pyx_n_s_set; PyObject *__pyx_n_s_set_builtin_type_codec; PyObject *__pyx_n_s_set_builtin_type_codec_2; PyObject *__pyx_n_s_set_connection; PyObject *__pyx_n_s_set_exception; PyObject *__pyx_n_s_set_name; PyObject *__pyx_n_s_set_result; PyObject *__pyx_n_s_setsockopt; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_settings; PyObject *__pyx_n_s_sha256; PyObject *__pyx_n_u_shift_jis; PyObject *__pyx_n_u_shift_jis_2004; PyObject *__pyx_n_s_sink; PyObject *__pyx_kp_u_size_of_encoded_multirange_datum; PyObject *__pyx_n_u_sjis; PyObject *__pyx_n_s_sleep; PyObject *__pyx_n_u_smallint; PyObject *__pyx_n_u_smgr; PyObject *__pyx_n_s_sock; PyObject *__pyx_n_s_socket; PyObject *__pyx_n_u_socket; PyObject *__pyx_n_s_spec; PyObject *__pyx_kp_u_specified_array_dimensions_do_no; PyObject *__pyx_n_u_sql_ascii; PyObject *__pyx_n_u_sspi; PyObject *__pyx_n_s_sspilib; PyObject *__pyx_kp_u_sspilib_module_not_found_please; PyObject *__pyx_n_s_started; PyObject *__pyx_n_s_startswith; PyObject *__pyx_n_s_state; PyObject *__pyx_n_s_status_msg; PyObject *__pyx_n_s_step; PyObject *__pyx_n_s_stmt_name; PyObject *__pyx_n_s_str; PyObject *__pyx_n_s_stringprep; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_super; PyObject *__pyx_n_u_table_am_handler; PyObject *__pyx_n_s_target_codec; PyObject *__pyx_n_s_target_name; PyObject *__pyx_n_s_tb; PyObject *__pyx_n_u_tcvn; PyObject *__pyx_n_u_tcvn5712; PyObject *__pyx_n_s_test; PyObject *__pyx_n_u_text; PyObject *__pyx_kp_u_text_2; PyObject *__pyx_kp_u_text_binary_or_tuple; PyObject *__pyx_kp_u_text_or_binary; PyObject *__pyx_kp_u_text_or_binary_2; PyObject *__pyx_kp_u_the_number_of_columns_in_the_res; PyObject *__pyx_kp_u_the_number_of_query_arguments_ca; PyObject *__pyx_kp_u_the_server_expects_x_argument_s; PyObject *__pyx_kp_u_there_is_no; PyObject *__pyx_n_s_throw; PyObject *__pyx_n_s_ti; PyObject *__pyx_n_u_tid; PyObject *__pyx_n_s_time; PyObject *__pyx_n_u_time; PyObject *__pyx_kp_u_time_with_timezone; PyObject *__pyx_kp_u_time_without_timezone; PyObject *__pyx_n_s_timeout; PyObject *__pyx_n_s_timer; PyObject *__pyx_n_u_timestamp; PyObject *__pyx_kp_u_timestamp_with_timezone; PyObject *__pyx_kp_u_timestamp_without_timezone; PyObject *__pyx_n_u_timestamptz; PyObject *__pyx_n_u_timetz; PyObject *__pyx_n_u_tinterval; PyObject *__pyx_kp_u_to; PyObject *__pyx_n_s_to_bytes; PyObject *__pyx_n_s_token_bytes; PyObject *__pyx_kp_u_too_many_elements_in_array_value; PyObject *__pyx_kp_u_too_many_elements_in_composite_t; PyObject *__pyx_kp_u_too_many_elements_in_multirange; PyObject *__pyx_n_s_transport; PyObject *__pyx_n_u_trigger; PyObject *__pyx_n_u_tsm_handler; PyObject *__pyx_n_u_tsquery; PyObject *__pyx_n_u_tsvector; PyObject *__pyx_n_u_tuple; PyObject *__pyx_n_u_txid_snapshot; PyObject *__pyx_kp_u_type_does_not_support_the_tuple; PyObject *__pyx_kp_u_type_record_missing_base_type_fo; PyObject *__pyx_kp_u_type_record_missing_base_type_fo_2; PyObject *__pyx_kp_u_type_record_missing_base_type_fo_3; PyObject *__pyx_kp_u_type_record_missing_field_types; PyObject *__pyx_n_s_typeinfos; PyObject *__pyx_n_s_typekind; PyObject *__pyx_n_s_typename; PyObject *__pyx_n_s_typeoid; PyObject *__pyx_n_s_types; PyObject *__pyx_n_s_typeschema; PyObject *__pyx_n_s_typoid; PyObject *__pyx_kp_u_unexpected_NULL_element_in_multi; PyObject *__pyx_kp_u_unexpected_array_dimension_size; PyObject *__pyx_kp_u_unexpected_array_dimensions_valu; PyObject *__pyx_kp_u_unexpected_character_r_at_positi; PyObject *__pyx_kp_u_unexpected_codec_type; PyObject *__pyx_kp_u_unexpected_data_format; PyObject *__pyx_kp_u_unexpected_data_type_of_composit; PyObject *__pyx_kp_u_unexpected_end_of_string; PyObject *__pyx_kp_u_unexpected_error_while_performin; PyObject *__pyx_kp_u_unexpected_exchange_format; PyObject *__pyx_kp_u_unexpected_multirange_size_value; PyObject *__pyx_kp_u_unexpected_number_of_attributes; PyObject *__pyx_kp_u_unexpected_trailing_bytes_in_buf; PyObject *__pyx_kp_u_unhandled_standard_data_type; PyObject *__pyx_n_u_unicode; PyObject *__pyx_n_s_unicodedata; PyObject *__pyx_n_u_unknown; PyObject *__pyx_kp_u_unknown_error_in_protocol_implem; PyObject *__pyx_kp_u_unsupported_SASL_Authentication; PyObject *__pyx_kp_u_unsupported_authentication_metho; PyObject *__pyx_n_s_update; PyObject *__pyx_n_s_upper; PyObject *__pyx_n_s_upper_inc; PyObject *__pyx_n_s_usage; PyObject *__pyx_n_s_use_setstate; PyObject *__pyx_n_s_user; PyObject *__pyx_n_u_user; PyObject *__pyx_kp_u_utf_8; PyObject *__pyx_n_u_utf_8_2; PyObject *__pyx_n_u_uuid; PyObject *__pyx_kp_b_v; PyObject *__pyx_n_u_varbit; PyObject *__pyx_n_u_varchar; PyObject *__pyx_n_u_void; PyObject *__pyx_n_u_vscii; PyObject *__pyx_n_s_w; PyObject *__pyx_n_s_wait; PyObject *__pyx_n_s_wait_for; PyObject *__pyx_n_s_wait_for_cancellation; PyObject *__pyx_n_s_waiter; PyObject *__pyx_kp_u_waiter_is_not_done_while_handlin; PyObject *__pyx_n_u_was; PyObject *__pyx_n_s_wbuf; PyObject *__pyx_n_s_weakref; PyObject *__pyx_n_u_were; PyObject *__pyx_n_u_win; PyObject *__pyx_n_u_win1250; PyObject *__pyx_n_u_win1251; PyObject *__pyx_n_u_win1252; PyObject *__pyx_n_u_win1253; PyObject *__pyx_n_u_win1254; PyObject *__pyx_n_u_win1255; PyObject *__pyx_n_u_win1256; PyObject *__pyx_n_u_win1257; PyObject *__pyx_n_u_win1258; PyObject *__pyx_n_u_win866; PyObject *__pyx_n_u_win874; PyObject *__pyx_n_u_win932; PyObject *__pyx_n_u_win936; PyObject *__pyx_n_u_win949; PyObject *__pyx_n_u_win950; PyObject *__pyx_n_u_windows1250; PyObject *__pyx_n_u_windows1251; PyObject *__pyx_n_u_windows1252; PyObject *__pyx_n_u_windows1253; PyObject *__pyx_n_u_windows1254; PyObject *__pyx_n_u_windows1255; PyObject *__pyx_n_u_windows1256; PyObject *__pyx_n_u_windows1257; PyObject *__pyx_n_u_windows1258; PyObject *__pyx_n_u_windows866; PyObject *__pyx_n_u_windows874; PyObject *__pyx_n_u_windows932; PyObject *__pyx_n_u_windows936; PyObject *__pyx_n_u_windows949; PyObject *__pyx_n_u_windows950; PyObject *__pyx_n_s_with_msg; PyObject *__pyx_n_s_write; PyObject *__pyx_n_s_writelines; PyObject *__pyx_n_s_writing_allowed; PyObject *__pyx_n_s_x; PyObject *__pyx_n_s_xformat; PyObject *__pyx_n_u_xid; PyObject *__pyx_n_u_xid8; PyObject *__pyx_n_u_xml; PyObject *__pyx_n_s_y; PyObject *__pyx_kp_u_you_need_values_from_server_to_g; PyObject *__pyx_n_s_zip; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_4; PyObject *__pyx_int_6; PyObject *__pyx_int_16; PyObject *__pyx_int_17; PyObject *__pyx_int_18; PyObject *__pyx_int_19; PyObject *__pyx_int_20; PyObject *__pyx_int_21; PyObject *__pyx_int_23; PyObject *__pyx_int_24; PyObject *__pyx_int_25; PyObject *__pyx_int_26; PyObject *__pyx_int_27; PyObject *__pyx_int_28; PyObject *__pyx_int_29; PyObject *__pyx_int_32; PyObject *__pyx_int_40; PyObject *__pyx_int_114; PyObject *__pyx_int_142; PyObject *__pyx_int_194; PyObject *__pyx_int_210; PyObject *__pyx_int_269; PyObject *__pyx_int_325; PyObject *__pyx_int_600; PyObject *__pyx_int_601; PyObject *__pyx_int_602; PyObject *__pyx_int_603; PyObject *__pyx_int_604; PyObject *__pyx_int_628; PyObject *__pyx_int_650; PyObject *__pyx_int_700; PyObject *__pyx_int_701; PyObject *__pyx_int_702; PyObject *__pyx_int_703; PyObject *__pyx_int_704; PyObject *__pyx_int_705; PyObject *__pyx_int_718; PyObject *__pyx_int_774; PyObject *__pyx_int_790; PyObject *__pyx_int_829; PyObject *__pyx_int_869; PyObject *__pyx_int_1009; PyObject *__pyx_int_1028; PyObject *__pyx_int_1033; PyObject *__pyx_int_1042; PyObject *__pyx_int_1043; PyObject *__pyx_int_1082; PyObject *__pyx_int_1083; PyObject *__pyx_int_1114; PyObject *__pyx_int_1184; PyObject *__pyx_int_1186; PyObject *__pyx_int_1266; PyObject *__pyx_int_1560; PyObject *__pyx_int_1562; PyObject *__pyx_int_1700; PyObject *__pyx_int_1790; PyObject *__pyx_int_2202; PyObject *__pyx_int_2203; PyObject *__pyx_int_2204; PyObject *__pyx_int_2205; PyObject *__pyx_int_2206; PyObject *__pyx_int_2249; PyObject *__pyx_int_2275; PyObject *__pyx_int_2276; PyObject *__pyx_int_2277; PyObject *__pyx_int_2278; PyObject *__pyx_int_2279; PyObject *__pyx_int_2280; PyObject *__pyx_int_2281; PyObject *__pyx_int_2282; PyObject *__pyx_int_2283; PyObject *__pyx_int_2776; PyObject *__pyx_int_2950; PyObject *__pyx_int_2970; PyObject *__pyx_int_3115; PyObject *__pyx_int_3220; PyObject *__pyx_int_3310; PyObject *__pyx_int_3361; PyObject *__pyx_int_3402; PyObject *__pyx_int_3500; PyObject *__pyx_int_3614; PyObject *__pyx_int_3615; PyObject *__pyx_int_3642; PyObject *__pyx_int_3734; PyObject *__pyx_int_3769; PyObject *__pyx_int_3802; PyObject *__pyx_int_3831; PyObject *__pyx_int_3838; PyObject *__pyx_int_4072; PyObject *__pyx_int_4089; PyObject *__pyx_int_4096; PyObject *__pyx_int_4191; PyObject *__pyx_int_4537; PyObject *__pyx_int_4538; PyObject *__pyx_int_4600; PyObject *__pyx_int_4601; PyObject *__pyx_int_5017; PyObject *__pyx_int_5038; PyObject *__pyx_int_5069; PyObject *__pyx_int_5077; PyObject *__pyx_int_5078; PyObject *__pyx_int_5079; PyObject *__pyx_int_5080; PyObject *__pyx_int_32768; PyObject *__pyx_int_524288; PyObject *__pyx_int_40941617; PyObject *__pyx_int_89793719; PyObject *__pyx_int_120810133; PyObject *__pyx_int_134522893; PyObject *__pyx_int_175807176; PyObject *__pyx_int_228230485; PyObject *__pyx_int_232227937; PyObject *__pyx_int_245762207; PyObject *__pyx_int_252635979; enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_k_; PyObject *__pyx_k__6; PyObject *__pyx_k__7; enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_k__9; enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_k__10; enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_k__11; PyObject *__pyx_slice__4; PyObject *__pyx_tuple__3; PyObject *__pyx_slice__43; PyObject *__pyx_tuple__12; PyObject *__pyx_tuple__13; PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__16; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__18; PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__20; PyObject *__pyx_tuple__21; PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__25; PyObject *__pyx_tuple__26; PyObject *__pyx_tuple__27; PyObject *__pyx_tuple__28; PyObject *__pyx_tuple__29; PyObject *__pyx_tuple__30; PyObject *__pyx_tuple__49; PyObject *__pyx_tuple__56; PyObject *__pyx_tuple__60; PyObject *__pyx_tuple__61; PyObject *__pyx_tuple__62; PyObject *__pyx_tuple__63; PyObject *__pyx_tuple__64; PyObject *__pyx_tuple__65; PyObject *__pyx_tuple__67; PyObject *__pyx_tuple__69; PyObject *__pyx_tuple__71; PyObject *__pyx_tuple__74; PyObject *__pyx_tuple__76; PyObject *__pyx_tuple__79; PyObject *__pyx_tuple__83; PyObject *__pyx_tuple__85; PyObject *__pyx_tuple__87; PyObject *__pyx_tuple__89; PyObject *__pyx_tuple__93; PyObject *__pyx_tuple__95; PyObject *__pyx_tuple__103; PyObject *__pyx_tuple__105; PyObject *__pyx_tuple__107; PyObject *__pyx_tuple__116; PyObject *__pyx_tuple__121; PyObject *__pyx_tuple__122; PyObject *__pyx_tuple__123; PyObject *__pyx_tuple__124; PyObject *__pyx_tuple__125; PyObject *__pyx_tuple__126; PyObject *__pyx_tuple__127; PyObject *__pyx_tuple__128; PyObject *__pyx_tuple__129; PyObject *__pyx_tuple__130; PyObject *__pyx_tuple__134; PyObject *__pyx_tuple__135; PyObject *__pyx_tuple__137; PyObject *__pyx_tuple__143; PyObject *__pyx_tuple__145; PyObject *__pyx_tuple__147; PyObject *__pyx_tuple__153; PyObject *__pyx_tuple__156; PyObject *__pyx_tuple__159; PyObject *__pyx_tuple__161; PyObject *__pyx_tuple__163; PyObject *__pyx_codeobj__46; PyObject *__pyx_codeobj__47; PyObject *__pyx_codeobj__48; PyObject *__pyx_codeobj__50; PyObject *__pyx_codeobj__51; PyObject *__pyx_codeobj__52; PyObject *__pyx_codeobj__53; PyObject *__pyx_codeobj__54; PyObject *__pyx_codeobj__55; PyObject *__pyx_codeobj__57; PyObject *__pyx_codeobj__58; PyObject *__pyx_codeobj__59; PyObject *__pyx_codeobj__66; PyObject *__pyx_codeobj__68; PyObject *__pyx_codeobj__70; PyObject *__pyx_codeobj__72; PyObject *__pyx_codeobj__73; PyObject *__pyx_codeobj__75; PyObject *__pyx_codeobj__77; PyObject *__pyx_codeobj__78; PyObject *__pyx_codeobj__80; PyObject *__pyx_codeobj__81; PyObject *__pyx_codeobj__82; PyObject *__pyx_codeobj__84; PyObject *__pyx_codeobj__86; PyObject *__pyx_codeobj__88; PyObject *__pyx_codeobj__90; PyObject *__pyx_codeobj__91; PyObject *__pyx_codeobj__92; PyObject *__pyx_codeobj__94; PyObject *__pyx_codeobj__96; PyObject *__pyx_codeobj__97; PyObject *__pyx_codeobj__98; PyObject *__pyx_codeobj__99; PyObject *__pyx_codeobj__100; PyObject *__pyx_codeobj__101; PyObject *__pyx_codeobj__102; PyObject *__pyx_codeobj__104; PyObject *__pyx_codeobj__106; PyObject *__pyx_codeobj__108; PyObject *__pyx_codeobj__109; PyObject *__pyx_codeobj__110; PyObject *__pyx_codeobj__111; PyObject *__pyx_codeobj__112; PyObject *__pyx_codeobj__113; PyObject *__pyx_codeobj__114; PyObject *__pyx_codeobj__115; PyObject *__pyx_codeobj__117; PyObject *__pyx_codeobj__118; PyObject *__pyx_codeobj__119; PyObject *__pyx_codeobj__120; PyObject *__pyx_codeobj__131; PyObject *__pyx_codeobj__132; PyObject *__pyx_codeobj__133; PyObject *__pyx_codeobj__136; PyObject *__pyx_codeobj__138; PyObject *__pyx_codeobj__139; PyObject *__pyx_codeobj__140; PyObject *__pyx_codeobj__141; PyObject *__pyx_codeobj__142; PyObject *__pyx_codeobj__144; PyObject *__pyx_codeobj__146; PyObject *__pyx_codeobj__148; PyObject *__pyx_codeobj__149; PyObject *__pyx_codeobj__150; PyObject *__pyx_codeobj__151; PyObject *__pyx_codeobj__152; PyObject *__pyx_codeobj__154; PyObject *__pyx_codeobj__155; PyObject *__pyx_codeobj__157; PyObject *__pyx_codeobj__158; PyObject *__pyx_codeobj__160; PyObject *__pyx_codeobj__162; PyObject *__pyx_codeobj__164; PyObject *__pyx_codeobj__165; PyObject *__pyx_codeobj__166; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool); Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol_Codec); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close); Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation); Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation); Py_CLEAR(clear_module_state->__pyx_n_s_AF_UNIX); Py_CLEAR(clear_module_state->__pyx_n_u_AF_UNIX); Py_CLEAR(clear_module_state->__pyx_n_s_ARRAY_TYPES); Py_CLEAR(clear_module_state->__pyx_n_s_AUTHENTICATION_METHODS); Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError); Py_CLEAR(clear_module_state->__pyx_n_s_AsyncIterable); Py_CLEAR(clear_module_state->__pyx_n_s_Attribute); Py_CLEAR(clear_module_state->__pyx_n_s_AttributeError); Py_CLEAR(clear_module_state->__pyx_n_s_BUILTIN_TYPE_NAME_MAP); Py_CLEAR(clear_module_state->__pyx_n_s_BUILTIN_TYPE_OID_MAP); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol__create_future_fall); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol__get_timeout); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol__is_cancelling); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol__on_timeout); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol__on_waiter_complete); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol__request_cancel); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol__wait_for_cancellat); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_abort); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_bind); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_bind_execute); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_bind_execute_many); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_close); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_close_portal); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_close_statement); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_connection_lost); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_connection_made); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_copy_in); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_copy_out); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_data_received); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_execute); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_get_record_class); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_get_server_pid); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_get_settings); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_is_closed); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_is_connected); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_pause_writing); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_query); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_resume_writing); Py_CLEAR(clear_module_state->__pyx_n_s_BaseProtocol_set_connection); Py_CLEAR(clear_module_state->__pyx_kp_u_Bind_expected_a_sequence_got); Py_CLEAR(clear_module_state->__pyx_n_s_BufferError); Py_CLEAR(clear_module_state->__pyx_n_s_CancelledError); Py_CLEAR(clear_module_state->__pyx_kp_u_Check_the_query_against_the_pass); Py_CLEAR(clear_module_state->__pyx_n_s_ClientSecurityContext); Py_CLEAR(clear_module_state->__pyx_kp_b_Client_Key); Py_CLEAR(clear_module_state->__pyx_n_s_Codec); Py_CLEAR(clear_module_state->__pyx_n_s_Codec___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Codec___setstate_cython); Py_CLEAR(clear_module_state->__pyx_kp_u_Codec_oid_elem_oid_core); Py_CLEAR(clear_module_state->__pyx_n_s_ConnectionDoesNotExistError); Py_CLEAR(clear_module_state->__pyx_n_s_ConnectionResetError); Py_CLEAR(clear_module_state->__pyx_n_s_ConnectionSettings); Py_CLEAR(clear_module_state->__pyx_n_s_ConnectionSettings___reduce_cyth); Py_CLEAR(clear_module_state->__pyx_n_s_ConnectionSettings___setstate_cy); Py_CLEAR(clear_module_state->__pyx_n_s_ConnectionSettings_add_python_co); Py_CLEAR(clear_module_state->__pyx_n_s_ConnectionSettings_clear_type_ca); Py_CLEAR(clear_module_state->__pyx_n_s_ConnectionSettings_get_data_code); Py_CLEAR(clear_module_state->__pyx_n_s_ConnectionSettings_get_text_code); Py_CLEAR(clear_module_state->__pyx_kp_u_ConnectionSettings_r); Py_CLEAR(clear_module_state->__pyx_n_s_ConnectionSettings_register_data); Py_CLEAR(clear_module_state->__pyx_n_s_ConnectionSettings_remove_python); Py_CLEAR(clear_module_state->__pyx_n_s_ConnectionSettings_set_builtin_t); Py_CLEAR(clear_module_state->__pyx_kp_u_Consider_declaring_an_explicit_c); Py_CLEAR(clear_module_state->__pyx_n_s_CoreProtocol); Py_CLEAR(clear_module_state->__pyx_n_s_CoreProtocol___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_CoreProtocol___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_CoreProtocol_is_in_transaction); Py_CLEAR(clear_module_state->__pyx_n_s_DEFAULT_CLIENT_NONCE_BYTES); Py_CLEAR(clear_module_state->__pyx_n_s_DIGEST); Py_CLEAR(clear_module_state->__pyx_n_s_DataCodecConfig); Py_CLEAR(clear_module_state->__pyx_n_s_DataCodecConfig___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_DataCodecConfig___setstate_cytho); Py_CLEAR(clear_module_state->__pyx_n_s_DataCodecConfig__set_builtin_typ); Py_CLEAR(clear_module_state->__pyx_n_s_DataCodecConfig_add_python_codec); Py_CLEAR(clear_module_state->__pyx_n_s_DataCodecConfig_add_types); Py_CLEAR(clear_module_state->__pyx_n_s_DataCodecConfig_clear_type_cache); Py_CLEAR(clear_module_state->__pyx_n_s_DataCodecConfig_declare_fallback); Py_CLEAR(clear_module_state->__pyx_n_s_DataCodecConfig_remove_python_co); Py_CLEAR(clear_module_state->__pyx_n_s_DataCodecConfig_set_builtin_type); Py_CLEAR(clear_module_state->__pyx_n_s_DataError); Py_CLEAR(clear_module_state->__pyx_n_s_Event); Py_CLEAR(clear_module_state->__pyx_n_s_Future); Py_CLEAR(clear_module_state->__pyx_kp_u_GSSAPI_SSPI_authentication_is_on); Py_CLEAR(clear_module_state->__pyx_n_s_IPPROTO_TCP); Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2); Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_3); Py_CLEAR(clear_module_state->__pyx_n_s_IndexError); Py_CLEAR(clear_module_state->__pyx_n_s_InterfaceError); Py_CLEAR(clear_module_state->__pyx_n_s_InternalClientError); Py_CLEAR(clear_module_state->__pyx_n_s_Iterable); Py_CLEAR(clear_module_state->__pyx_n_s_IterableABC); Py_CLEAR(clear_module_state->__pyx_n_u_Kerberos); Py_CLEAR(clear_module_state->__pyx_n_s_KeyError); Py_CLEAR(clear_module_state->__pyx_n_s_Mapping); Py_CLEAR(clear_module_state->__pyx_n_s_MappingABC); Py_CLEAR(clear_module_state->__pyx_n_s_ModuleNotFoundError); Py_CLEAR(clear_module_state->__pyx_n_u_NA); Py_CLEAR(clear_module_state->__pyx_n_u_NFKC); Py_CLEAR(clear_module_state->__pyx_n_s_NO_TIMEOUT); Py_CLEAR(clear_module_state->__pyx_n_b_NULL); Py_CLEAR(clear_module_state->__pyx_n_s_Name); Py_CLEAR(clear_module_state->__pyx_n_s_NameType); Py_CLEAR(clear_module_state->__pyx_n_u_Negotiate); Py_CLEAR(clear_module_state->__pyx_n_s_NotImplementedError); Py_CLEAR(clear_module_state->__pyx_kp_u_Note_that_parameters_are_suppor); Py_CLEAR(clear_module_state->__pyx_kp_u_OID); Py_CLEAR(clear_module_state->__pyx_kp_u_OID_value_too_large_r); Py_CLEAR(clear_module_state->__pyx_n_s_OrderedDict); Py_CLEAR(clear_module_state->__pyx_n_s_OutdatedSchemaCacheError); Py_CLEAR(clear_module_state->__pyx_n_s_OverflowError); Py_CLEAR(clear_module_state->__pyx_kp_b_PGCOPY); Py_CLEAR(clear_module_state->__pyx_n_s_PickleError); Py_CLEAR(clear_module_state->__pyx_kp_u_PostgreSQL_does_not_implement_an); Py_CLEAR(clear_module_state->__pyx_n_s_PostgresError); Py_CLEAR(clear_module_state->__pyx_n_s_PreparedStatementState); Py_CLEAR(clear_module_state->__pyx_n_s_PreparedStatementState___reduce); Py_CLEAR(clear_module_state->__pyx_n_s_PreparedStatementState___setstat); Py_CLEAR(clear_module_state->__pyx_n_s_PreparedStatementState__get_attr); Py_CLEAR(clear_module_state->__pyx_n_s_PreparedStatementState__get_para); Py_CLEAR(clear_module_state->__pyx_n_s_PreparedStatementState__init_cod); Py_CLEAR(clear_module_state->__pyx_n_s_PreparedStatementState__init_typ); Py_CLEAR(clear_module_state->__pyx_n_s_PreparedStatementState_attach); Py_CLEAR(clear_module_state->__pyx_n_s_PreparedStatementState_detach); Py_CLEAR(clear_module_state->__pyx_n_s_PreparedStatementState_mark_clos); Py_CLEAR(clear_module_state->__pyx_n_s_PreparedStatementState_mark_unpr); Py_CLEAR(clear_module_state->__pyx_n_s_Protocol); Py_CLEAR(clear_module_state->__pyx_n_s_ProtocolError); Py_CLEAR(clear_module_state->__pyx_n_s_REQUIREMENTS_CLIENT_FINAL_MESSAG); Py_CLEAR(clear_module_state->__pyx_n_s_REQUIREMENTS_CLIENT_PROOF); Py_CLEAR(clear_module_state->__pyx_n_u_ROLLBACK); Py_CLEAR(clear_module_state->__pyx_n_s_Range); Py_CLEAR(clear_module_state->__pyx_n_s_Record); Py_CLEAR(clear_module_state->__pyx_n_s_SASLPREP_PROHIBITED); Py_CLEAR(clear_module_state->__pyx_n_s_SCRAMAuthentication); Py_CLEAR(clear_module_state->__pyx_n_s_SCRAMAuthentication___reduce_cyt); Py_CLEAR(clear_module_state->__pyx_n_s_SCRAMAuthentication___setstate_c); Py_CLEAR(clear_module_state->__pyx_n_s_SCRAMAuthentication__bytes_xor_l); Py_CLEAR(clear_module_state->__pyx_n_s_SCRAMAuthentication__normalize_p); Py_CLEAR(clear_module_state->__pyx_kp_b_SCRAM_SHA_256); Py_CLEAR(clear_module_state->__pyx_n_s_SecurityContext); Py_CLEAR(clear_module_state->__pyx_n_s_Sequence); Py_CLEAR(clear_module_state->__pyx_n_s_SequenceABC); Py_CLEAR(clear_module_state->__pyx_kp_b_Server_Key); Py_CLEAR(clear_module_state->__pyx_n_s_Sized); Py_CLEAR(clear_module_state->__pyx_n_s_SizedABC); Py_CLEAR(clear_module_state->__pyx_n_s_StopAsyncIteration); Py_CLEAR(clear_module_state->__pyx_n_s_StopIteration); Py_CLEAR(clear_module_state->__pyx_n_s_TCP_NODELAY); Py_CLEAR(clear_module_state->__pyx_n_s_TimeoutError); Py_CLEAR(clear_module_state->__pyx_n_u_TimeoutError); Py_CLEAR(clear_module_state->__pyx_n_s_Timer); Py_CLEAR(clear_module_state->__pyx_n_s_Timer___enter); Py_CLEAR(clear_module_state->__pyx_n_s_Timer___exit); Py_CLEAR(clear_module_state->__pyx_n_s_Timer___init); Py_CLEAR(clear_module_state->__pyx_n_s_Timer_get_remaining_budget); Py_CLEAR(clear_module_state->__pyx_n_s_Timer_has_budget_greater_than); Py_CLEAR(clear_module_state->__pyx_kp_u_TimoutError_was_not_raised); Py_CLEAR(clear_module_state->__pyx_n_s_Type); Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); Py_CLEAR(clear_module_state->__pyx_n_s_UnicodeEncodeError); Py_CLEAR(clear_module_state->__pyx_n_s_UnsupportedClientFeatureError); Py_CLEAR(clear_module_state->__pyx_n_s_UserCredential); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); Py_CLEAR(clear_module_state->__pyx_kp_b__15); Py_CLEAR(clear_module_state->__pyx_n_s__167); Py_CLEAR(clear_module_state->__pyx_n_u__2); Py_CLEAR(clear_module_state->__pyx_kp_b__23); Py_CLEAR(clear_module_state->__pyx_kp_b__31); Py_CLEAR(clear_module_state->__pyx_kp_b__32); Py_CLEAR(clear_module_state->__pyx_kp_u__33); Py_CLEAR(clear_module_state->__pyx_kp_b__34); Py_CLEAR(clear_module_state->__pyx_kp_u__34); Py_CLEAR(clear_module_state->__pyx_kp_u__35); Py_CLEAR(clear_module_state->__pyx_kp_u__36); Py_CLEAR(clear_module_state->__pyx_n_s__37); Py_CLEAR(clear_module_state->__pyx_kp_u__38); Py_CLEAR(clear_module_state->__pyx_kp_u__39); Py_CLEAR(clear_module_state->__pyx_kp_u__40); Py_CLEAR(clear_module_state->__pyx_kp_u__41); Py_CLEAR(clear_module_state->__pyx_kp_u__42); Py_CLEAR(clear_module_state->__pyx_kp_u__44); Py_CLEAR(clear_module_state->__pyx_kp_u__45); Py_CLEAR(clear_module_state->__pyx_kp_u__5); Py_CLEAR(clear_module_state->__pyx_kp_u__8); Py_CLEAR(clear_module_state->__pyx_kp_u_a_sized_iterable_container_expec); Py_CLEAR(clear_module_state->__pyx_n_s_abc); Py_CLEAR(clear_module_state->__pyx_n_u_abc); Py_CLEAR(clear_module_state->__pyx_n_s_abort); Py_CLEAR(clear_module_state->__pyx_n_u_abstime); Py_CLEAR(clear_module_state->__pyx_n_u_aclitem); Py_CLEAR(clear_module_state->__pyx_n_s_add_done_callback); Py_CLEAR(clear_module_state->__pyx_n_s_add_python_codec); Py_CLEAR(clear_module_state->__pyx_n_s_add_types); Py_CLEAR(clear_module_state->__pyx_n_s_addr); Py_CLEAR(clear_module_state->__pyx_n_s_aiter); Py_CLEAR(clear_module_state->__pyx_n_s_aiter_2); Py_CLEAR(clear_module_state->__pyx_n_s_alias_oid); Py_CLEAR(clear_module_state->__pyx_n_s_alias_to); Py_CLEAR(clear_module_state->__pyx_kp_u_already_connected); Py_CLEAR(clear_module_state->__pyx_n_u_alt); Py_CLEAR(clear_module_state->__pyx_n_s_amount); Py_CLEAR(clear_module_state->__pyx_n_s_anext); Py_CLEAR(clear_module_state->__pyx_n_s_any); Py_CLEAR(clear_module_state->__pyx_n_u_any); Py_CLEAR(clear_module_state->__pyx_n_u_anyarray); Py_CLEAR(clear_module_state->__pyx_n_u_anycompatible); Py_CLEAR(clear_module_state->__pyx_n_u_anycompatiblearray); Py_CLEAR(clear_module_state->__pyx_n_u_anycompatiblemultirange); Py_CLEAR(clear_module_state->__pyx_n_u_anycompatiblenonarray); Py_CLEAR(clear_module_state->__pyx_n_u_anycompatiblerange); Py_CLEAR(clear_module_state->__pyx_n_u_anyelement); Py_CLEAR(clear_module_state->__pyx_n_u_anyenum); Py_CLEAR(clear_module_state->__pyx_n_u_anymultirange); Py_CLEAR(clear_module_state->__pyx_n_u_anynonarray); Py_CLEAR(clear_module_state->__pyx_n_u_anyrange); Py_CLEAR(clear_module_state->__pyx_n_s_apg_exc); Py_CLEAR(clear_module_state->__pyx_n_s_apg_exc_base); Py_CLEAR(clear_module_state->__pyx_n_s_apg_types); Py_CLEAR(clear_module_state->__pyx_n_s_arg_bufs); Py_CLEAR(clear_module_state->__pyx_n_s_args); Py_CLEAR(clear_module_state->__pyx_n_s_args_buf); Py_CLEAR(clear_module_state->__pyx_n_u_array); Py_CLEAR(clear_module_state->__pyx_n_s_array_element_oid); Py_CLEAR(clear_module_state->__pyx_kp_u_array_length_overflow); Py_CLEAR(clear_module_state->__pyx_n_u_ascii); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_tasks); Py_CLEAR(clear_module_state->__pyx_n_s_asyncpg); Py_CLEAR(clear_module_state->__pyx_kp_u_asyncpg_Protocol_has_no_referenc); Py_CLEAR(clear_module_state->__pyx_n_s_asyncpg_exceptions); Py_CLEAR(clear_module_state->__pyx_kp_s_asyncpg_protocol_codecs_base_pyx); Py_CLEAR(clear_module_state->__pyx_kp_s_asyncpg_protocol_coreproto_pyx); Py_CLEAR(clear_module_state->__pyx_kp_s_asyncpg_protocol_prepared_stmt_p); Py_CLEAR(clear_module_state->__pyx_n_s_asyncpg_protocol_protocol); Py_CLEAR(clear_module_state->__pyx_kp_s_asyncpg_protocol_protocol_pyx); Py_CLEAR(clear_module_state->__pyx_kp_s_asyncpg_protocol_settings_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_attach); Py_CLEAR(clear_module_state->__pyx_n_s_attrname); Py_CLEAR(clear_module_state->__pyx_n_u_attrnames); Py_CLEAR(clear_module_state->__pyx_n_u_attrtypoids); Py_CLEAR(clear_module_state->__pyx_n_s_auth_msg); Py_CLEAR(clear_module_state->__pyx_n_s_authentication_method); Py_CLEAR(clear_module_state->__pyx_n_s_await); Py_CLEAR(clear_module_state->__pyx_n_s_b64decode); Py_CLEAR(clear_module_state->__pyx_n_s_b64encode); Py_CLEAR(clear_module_state->__pyx_n_s_base); Py_CLEAR(clear_module_state->__pyx_n_s_base64); Py_CLEAR(clear_module_state->__pyx_n_s_base_codec); Py_CLEAR(clear_module_state->__pyx_kp_u_base_codec_is_mutually_exclusive); Py_CLEAR(clear_module_state->__pyx_n_s_base_type); Py_CLEAR(clear_module_state->__pyx_n_u_basetype); Py_CLEAR(clear_module_state->__pyx_n_u_basetype_name); Py_CLEAR(clear_module_state->__pyx_n_u_big); Py_CLEAR(clear_module_state->__pyx_n_u_bigint); Py_CLEAR(clear_module_state->__pyx_n_u_binary); Py_CLEAR(clear_module_state->__pyx_n_s_bind); Py_CLEAR(clear_module_state->__pyx_n_s_bind_execute); Py_CLEAR(clear_module_state->__pyx_n_s_bind_execute_many); Py_CLEAR(clear_module_state->__pyx_n_s_bind_execute_many_locals_genexpr); Py_CLEAR(clear_module_state->__pyx_n_u_bit); Py_CLEAR(clear_module_state->__pyx_kp_u_bit_varying); Py_CLEAR(clear_module_state->__pyx_n_s_bool); Py_CLEAR(clear_module_state->__pyx_n_u_bool); Py_CLEAR(clear_module_state->__pyx_n_u_box); Py_CLEAR(clear_module_state->__pyx_n_u_bpchar); Py_CLEAR(clear_module_state->__pyx_n_s_budget); Py_CLEAR(clear_module_state->__pyx_n_s_budget_2); Py_CLEAR(clear_module_state->__pyx_n_s_buffer); Py_CLEAR(clear_module_state->__pyx_n_s_builtins); Py_CLEAR(clear_module_state->__pyx_n_u_bytea); Py_CLEAR(clear_module_state->__pyx_n_s_byteorder); Py_CLEAR(clear_module_state->__pyx_kp_u_bytes); Py_CLEAR(clear_module_state->__pyx_n_b_c); Py_CLEAR(clear_module_state->__pyx_kp_b_c_2); Py_CLEAR(clear_module_state->__pyx_kp_b_c_3); Py_CLEAR(clear_module_state->__pyx_n_s_c_decoder); Py_CLEAR(clear_module_state->__pyx_n_s_c_encoder); Py_CLEAR(clear_module_state->__pyx_n_s_call_exception_handler); Py_CLEAR(clear_module_state->__pyx_n_s_call_later); Py_CLEAR(clear_module_state->__pyx_n_s_cancel); Py_CLEAR(clear_module_state->__pyx_n_s_cancel_current_command); Py_CLEAR(clear_module_state->__pyx_n_s_cancelled); Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_alias); Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_close_prepared_statement); Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_decode_type_text_encoding); Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_decode_type_text_encoding_2); Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_perform_operation_another); Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_perform_operation_another_2); Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_perform_operation_connect); Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_process_message); Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_register_core_codec_for_O); Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_switch_to_idle_state_prot); Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_switch_to_state_another_o); Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_switch_to_state_protocol); Py_CLEAR(clear_module_state->__pyx_n_s_cause); Py_CLEAR(clear_module_state->__pyx_n_u_char); Py_CLEAR(clear_module_state->__pyx_n_u_character); Py_CLEAR(clear_module_state->__pyx_kp_u_character_varying); Py_CLEAR(clear_module_state->__pyx_n_s_chr); Py_CLEAR(clear_module_state->__pyx_n_s_chunk); Py_CLEAR(clear_module_state->__pyx_n_u_cid); Py_CLEAR(clear_module_state->__pyx_n_u_cidr); Py_CLEAR(clear_module_state->__pyx_n_u_circle); Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); Py_CLEAR(clear_module_state->__pyx_n_s_cleanup); Py_CLEAR(clear_module_state->__pyx_n_s_clear); Py_CLEAR(clear_module_state->__pyx_n_s_clear_type_cache); Py_CLEAR(clear_module_state->__pyx_n_u_client_channel_binding); Py_CLEAR(clear_module_state->__pyx_n_b_client_encoding); Py_CLEAR(clear_module_state->__pyx_n_u_client_encoding); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_close); Py_CLEAR(clear_module_state->__pyx_n_s_close_portal); Py_CLEAR(clear_module_state->__pyx_n_s_close_statement); Py_CLEAR(clear_module_state->__pyx_n_s_codec); Py_CLEAR(clear_module_state->__pyx_kp_u_codec_for); Py_CLEAR(clear_module_state->__pyx_n_s_codec_set); Py_CLEAR(clear_module_state->__pyx_n_s_codec_str); Py_CLEAR(clear_module_state->__pyx_n_s_codecs); Py_CLEAR(clear_module_state->__pyx_n_s_collections); Py_CLEAR(clear_module_state->__pyx_n_s_collections_abc); Py_CLEAR(clear_module_state->__pyx_n_s_command_timeout); Py_CLEAR(clear_module_state->__pyx_n_s_comp_elem_codecs); Py_CLEAR(clear_module_state->__pyx_n_s_comp_type_attrs); Py_CLEAR(clear_module_state->__pyx_n_s_compat); Py_CLEAR(clear_module_state->__pyx_n_u_composite); Py_CLEAR(clear_module_state->__pyx_n_s_con); Py_CLEAR(clear_module_state->__pyx_n_s_con_params); Py_CLEAR(clear_module_state->__pyx_n_s_config); Py_CLEAR(clear_module_state->__pyx_n_s_connected_fut); Py_CLEAR(clear_module_state->__pyx_n_s_connection); Py_CLEAR(clear_module_state->__pyx_n_s_connection_lost); Py_CLEAR(clear_module_state->__pyx_n_s_connection_made); Py_CLEAR(clear_module_state->__pyx_kp_u_connection_was_closed_in_the_mid); Py_CLEAR(clear_module_state->__pyx_n_s_copy_in); Py_CLEAR(clear_module_state->__pyx_n_s_copy_in_locals_lambda); Py_CLEAR(clear_module_state->__pyx_n_s_copy_out); Py_CLEAR(clear_module_state->__pyx_n_s_copy_out_locals_lambda); Py_CLEAR(clear_module_state->__pyx_n_s_copy_stmt); Py_CLEAR(clear_module_state->__pyx_n_s_core_codec); Py_CLEAR(clear_module_state->__pyx_kp_u_could_not_get_iterations); Py_CLEAR(clear_module_state->__pyx_kp_u_could_not_get_nonce); Py_CLEAR(clear_module_state->__pyx_kp_u_could_not_get_salt); Py_CLEAR(clear_module_state->__pyx_kp_u_could_not_get_server_signature); Py_CLEAR(clear_module_state->__pyx_kp_u_could_not_verify_server_signatur); Py_CLEAR(clear_module_state->__pyx_n_u_cp1250); Py_CLEAR(clear_module_state->__pyx_n_u_cp1251); Py_CLEAR(clear_module_state->__pyx_n_u_cp1252); Py_CLEAR(clear_module_state->__pyx_n_u_cp1253); Py_CLEAR(clear_module_state->__pyx_n_u_cp1254); Py_CLEAR(clear_module_state->__pyx_n_u_cp1255); Py_CLEAR(clear_module_state->__pyx_n_u_cp1256); Py_CLEAR(clear_module_state->__pyx_n_u_cp1257); Py_CLEAR(clear_module_state->__pyx_n_u_cp1258); Py_CLEAR(clear_module_state->__pyx_n_u_cp1521); Py_CLEAR(clear_module_state->__pyx_n_u_cp866); Py_CLEAR(clear_module_state->__pyx_n_u_cp874); Py_CLEAR(clear_module_state->__pyx_n_u_cp932); Py_CLEAR(clear_module_state->__pyx_n_u_cp936); Py_CLEAR(clear_module_state->__pyx_n_u_cp949); Py_CLEAR(clear_module_state->__pyx_n_u_cp950); Py_CLEAR(clear_module_state->__pyx_n_s_create_future); Py_CLEAR(clear_module_state->__pyx_n_s_create_future_fallback); Py_CLEAR(clear_module_state->__pyx_n_s_create_record); Py_CLEAR(clear_module_state->__pyx_n_s_credential); Py_CLEAR(clear_module_state->__pyx_n_u_cstring); Py_CLEAR(clear_module_state->__pyx_n_b_d); Py_CLEAR(clear_module_state->__pyx_n_s_d); Py_CLEAR(clear_module_state->__pyx_n_s_data); Py_CLEAR(clear_module_state->__pyx_n_s_data_gen); Py_CLEAR(clear_module_state->__pyx_n_s_data_received); Py_CLEAR(clear_module_state->__pyx_n_s_data_type); Py_CLEAR(clear_module_state->__pyx_n_s_database); Py_CLEAR(clear_module_state->__pyx_n_u_database); Py_CLEAR(clear_module_state->__pyx_n_u_date); Py_CLEAR(clear_module_state->__pyx_n_u_decimal); Py_CLEAR(clear_module_state->__pyx_n_s_declare_fallback_codec); Py_CLEAR(clear_module_state->__pyx_n_s_decode); Py_CLEAR(clear_module_state->__pyx_kp_u_decode_row_statement_is_None); Py_CLEAR(clear_module_state->__pyx_n_s_decoder); Py_CLEAR(clear_module_state->__pyx_n_s_desc); Py_CLEAR(clear_module_state->__pyx_n_s_detach); Py_CLEAR(clear_module_state->__pyx_n_s_detail); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_n_s_dict_2); Py_CLEAR(clear_module_state->__pyx_n_s_digest); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_doc); Py_CLEAR(clear_module_state->__pyx_n_s_done); Py_CLEAR(clear_module_state->__pyx_kp_u_double_precision); Py_CLEAR(clear_module_state->__pyx_kp_u_duplicate_GSSAPI_SSPI_authentica); Py_CLEAR(clear_module_state->__pyx_n_b_e); Py_CLEAR(clear_module_state->__pyx_n_s_e); Py_CLEAR(clear_module_state->__pyx_n_s_elem); Py_CLEAR(clear_module_state->__pyx_n_s_elem_codec); Py_CLEAR(clear_module_state->__pyx_n_s_elem_delim); Py_CLEAR(clear_module_state->__pyx_n_s_elem_format); Py_CLEAR(clear_module_state->__pyx_n_u_elemdelim); Py_CLEAR(clear_module_state->__pyx_n_s_element_names); Py_CLEAR(clear_module_state->__pyx_n_s_elems); Py_CLEAR(clear_module_state->__pyx_n_u_elemtype); Py_CLEAR(clear_module_state->__pyx_n_u_elemtype_name); Py_CLEAR(clear_module_state->__pyx_n_s_empty); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_encode); Py_CLEAR(clear_module_state->__pyx_n_s_encoder); Py_CLEAR(clear_module_state->__pyx_n_s_enter); Py_CLEAR(clear_module_state->__pyx_n_s_enumerate); Py_CLEAR(clear_module_state->__pyx_n_s_et); Py_CLEAR(clear_module_state->__pyx_n_u_euc_cn); Py_CLEAR(clear_module_state->__pyx_n_u_euc_jis_2004); Py_CLEAR(clear_module_state->__pyx_n_u_euc_jp); Py_CLEAR(clear_module_state->__pyx_n_u_euc_kr); Py_CLEAR(clear_module_state->__pyx_n_u_euccn); Py_CLEAR(clear_module_state->__pyx_n_u_eucjp); Py_CLEAR(clear_module_state->__pyx_n_u_euckr); Py_CLEAR(clear_module_state->__pyx_n_u_event_trigger); Py_CLEAR(clear_module_state->__pyx_n_s_ex); Py_CLEAR(clear_module_state->__pyx_n_s_exc); Py_CLEAR(clear_module_state->__pyx_n_s_exception); Py_CLEAR(clear_module_state->__pyx_n_s_exceptions); Py_CLEAR(clear_module_state->__pyx_n_s_execute); Py_CLEAR(clear_module_state->__pyx_n_s_exit); Py_CLEAR(clear_module_state->__pyx_kp_u_expected_0_1_or_2_elements_in_ra); Py_CLEAR(clear_module_state->__pyx_kp_u_expected_a_sequence_got); Py_CLEAR(clear_module_state->__pyx_kp_u_expected_a_sequence_got_type_r); Py_CLEAR(clear_module_state->__pyx_n_s_f); Py_CLEAR(clear_module_state->__pyx_n_s_family); Py_CLEAR(clear_module_state->__pyx_n_u_fdw_handler); Py_CLEAR(clear_module_state->__pyx_n_u_float4); Py_CLEAR(clear_module_state->__pyx_n_u_float8); Py_CLEAR(clear_module_state->__pyx_n_s_fmt); Py_CLEAR(clear_module_state->__pyx_n_s_format); Py_CLEAR(clear_module_state->__pyx_n_s_formats); Py_CLEAR(clear_module_state->__pyx_n_s_fut); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_genexpr); Py_CLEAR(clear_module_state->__pyx_n_s_get); Py_CLEAR(clear_module_state->__pyx_n_s_get_attributes); Py_CLEAR(clear_module_state->__pyx_n_s_get_data_codec); Py_CLEAR(clear_module_state->__pyx_n_s_get_extra_info); Py_CLEAR(clear_module_state->__pyx_n_s_get_parameters); Py_CLEAR(clear_module_state->__pyx_n_s_get_record_class); Py_CLEAR(clear_module_state->__pyx_n_s_get_remaining_budget); Py_CLEAR(clear_module_state->__pyx_n_s_get_server_pid); Py_CLEAR(clear_module_state->__pyx_n_s_get_settings); Py_CLEAR(clear_module_state->__pyx_n_s_get_text_codec); Py_CLEAR(clear_module_state->__pyx_n_s_get_timeout); Py_CLEAR(clear_module_state->__pyx_n_s_getattribute); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_kp_u_got_result_for_unknown_protocol); Py_CLEAR(clear_module_state->__pyx_n_s_group); Py_CLEAR(clear_module_state->__pyx_n_u_gss); Py_CLEAR(clear_module_state->__pyx_n_s_gssapi); Py_CLEAR(clear_module_state->__pyx_n_u_gssapi); Py_CLEAR(clear_module_state->__pyx_kp_u_gssapi_module_not_found_please_i); Py_CLEAR(clear_module_state->__pyx_n_s_gsslib); Py_CLEAR(clear_module_state->__pyx_n_u_gtsvector); Py_CLEAR(clear_module_state->__pyx_n_s_has_budget_greater_than); Py_CLEAR(clear_module_state->__pyx_n_s_has_text_elements); Py_CLEAR(clear_module_state->__pyx_n_s_hashlib); Py_CLEAR(clear_module_state->__pyx_n_s_hexdigest); Py_CLEAR(clear_module_state->__pyx_n_s_hint); Py_CLEAR(clear_module_state->__pyx_n_s_hmac); Py_CLEAR(clear_module_state->__pyx_n_s_hostbased_service); Py_CLEAR(clear_module_state->__pyx_n_s_i); Py_CLEAR(clear_module_state->__pyx_kp_b_i_d); Py_CLEAR(clear_module_state->__pyx_n_s_ignore_custom_codec); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_kp_u_in_element); Py_CLEAR(clear_module_state->__pyx_n_s_in_table_a1); Py_CLEAR(clear_module_state->__pyx_n_s_in_table_b1); Py_CLEAR(clear_module_state->__pyx_n_s_in_table_c12); Py_CLEAR(clear_module_state->__pyx_n_s_in_table_c21_c22); Py_CLEAR(clear_module_state->__pyx_n_s_in_table_c3); Py_CLEAR(clear_module_state->__pyx_n_s_in_table_c4); Py_CLEAR(clear_module_state->__pyx_n_s_in_table_c5); Py_CLEAR(clear_module_state->__pyx_n_s_in_table_c6); Py_CLEAR(clear_module_state->__pyx_n_s_in_table_c7); Py_CLEAR(clear_module_state->__pyx_n_s_in_table_c8); Py_CLEAR(clear_module_state->__pyx_n_s_in_table_c9); Py_CLEAR(clear_module_state->__pyx_n_s_in_table_d1); Py_CLEAR(clear_module_state->__pyx_n_s_in_table_d2); Py_CLEAR(clear_module_state->__pyx_kp_u_inconsistent_sub_array_dimension); Py_CLEAR(clear_module_state->__pyx_n_u_index_am_handler); Py_CLEAR(clear_module_state->__pyx_n_u_inet); Py_CLEAR(clear_module_state->__pyx_n_s_init); Py_CLEAR(clear_module_state->__pyx_n_s_init_codecs); Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); Py_CLEAR(clear_module_state->__pyx_n_s_init_types); Py_CLEAR(clear_module_state->__pyx_n_s_initializing); Py_CLEAR(clear_module_state->__pyx_n_u_initiate); Py_CLEAR(clear_module_state->__pyx_kp_u_input_of_anonymous_composite_typ); Py_CLEAR(clear_module_state->__pyx_n_s_inspect); Py_CLEAR(clear_module_state->__pyx_n_s_int); Py_CLEAR(clear_module_state->__pyx_n_u_int); Py_CLEAR(clear_module_state->__pyx_n_u_int2); Py_CLEAR(clear_module_state->__pyx_n_u_int4); Py_CLEAR(clear_module_state->__pyx_n_u_int8); Py_CLEAR(clear_module_state->__pyx_n_u_integer); Py_CLEAR(clear_module_state->__pyx_n_u_internal); Py_CLEAR(clear_module_state->__pyx_n_u_interval); Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_array_element); Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_array_element_at_index); Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_data_format); Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_format_argument_expected); Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_input_for_query_argument); Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_input_in_executemany_arg); Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_nonce); Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_timeout_value_expected_n); Py_CLEAR(clear_module_state->__pyx_n_s_is_cancelling); Py_CLEAR(clear_module_state->__pyx_n_s_is_closed); Py_CLEAR(clear_module_state->__pyx_n_s_is_connected); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_n_s_is_in_transaction); Py_CLEAR(clear_module_state->__pyx_n_s_isempty); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_item); Py_CLEAR(clear_module_state->__pyx_n_s_items); Py_CLEAR(clear_module_state->__pyx_n_s_iterator); Py_CLEAR(clear_module_state->__pyx_n_u_json); Py_CLEAR(clear_module_state->__pyx_n_u_jsonb); Py_CLEAR(clear_module_state->__pyx_n_u_jsonpath); Py_CLEAR(clear_module_state->__pyx_n_u_kerberosv5); Py_CLEAR(clear_module_state->__pyx_n_u_kind); Py_CLEAR(clear_module_state->__pyx_n_u_koi8_r); Py_CLEAR(clear_module_state->__pyx_n_u_koi8_u); Py_CLEAR(clear_module_state->__pyx_n_u_koi8r); Py_CLEAR(clear_module_state->__pyx_n_u_koi8u); Py_CLEAR(clear_module_state->__pyx_n_s_krbsrvname); Py_CLEAR(clear_module_state->__pyx_n_u_language_handler); Py_CLEAR(clear_module_state->__pyx_n_s_limit); Py_CLEAR(clear_module_state->__pyx_n_u_line); Py_CLEAR(clear_module_state->__pyx_kp_u_list_tuple_or_Range_object_expec); Py_CLEAR(clear_module_state->__pyx_n_s_lookup); Py_CLEAR(clear_module_state->__pyx_n_s_loop); Py_CLEAR(clear_module_state->__pyx_n_s_lower); Py_CLEAR(clear_module_state->__pyx_n_s_lower_inc); Py_CLEAR(clear_module_state->__pyx_n_u_lseg); Py_CLEAR(clear_module_state->__pyx_n_b_m); Py_CLEAR(clear_module_state->__pyx_n_u_macaddr); Py_CLEAR(clear_module_state->__pyx_n_u_macaddr8); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_kp_u_malformed_array_literal_r); Py_CLEAR(clear_module_state->__pyx_n_s_mapping); Py_CLEAR(clear_module_state->__pyx_n_s_mark_closed); Py_CLEAR(clear_module_state->__pyx_n_s_mark_unprepared); Py_CLEAR(clear_module_state->__pyx_n_b_md5); Py_CLEAR(clear_module_state->__pyx_n_s_md5); Py_CLEAR(clear_module_state->__pyx_n_u_md5); Py_CLEAR(clear_module_state->__pyx_n_u_message); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); Py_CLEAR(clear_module_state->__pyx_n_s_missing); Py_CLEAR(clear_module_state->__pyx_kp_u_missing_after_array_dimensions); Py_CLEAR(clear_module_state->__pyx_kp_u_missing_after_array_dimensions_2); Py_CLEAR(clear_module_state->__pyx_kp_u_missing_array_dimension_value); Py_CLEAR(clear_module_state->__pyx_kp_u_missing_codec_information_for_OI); Py_CLEAR(clear_module_state->__pyx_n_s_module); Py_CLEAR(clear_module_state->__pyx_n_u_money); Py_CLEAR(clear_module_state->__pyx_n_s_monotonic); Py_CLEAR(clear_module_state->__pyx_n_s_more); Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); Py_CLEAR(clear_module_state->__pyx_n_u_multirange); Py_CLEAR(clear_module_state->__pyx_kp_b_n); Py_CLEAR(clear_module_state->__pyx_kp_b_n_2); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_u_name); Py_CLEAR(clear_module_state->__pyx_n_s_name_2); Py_CLEAR(clear_module_state->__pyx_kp_u_named_prepared_statements_cannot); Py_CLEAR(clear_module_state->__pyx_n_s_new); Py_CLEAR(clear_module_state->__pyx_n_s_new_2); Py_CLEAR(clear_module_state->__pyx_kp_u_no_binary_format_encoder_for_typ); Py_CLEAR(clear_module_state->__pyx_kp_u_no_codec_for_composite_attribute); Py_CLEAR(clear_module_state->__pyx_kp_u_no_decoder_for_OID); Py_CLEAR(clear_module_state->__pyx_kp_u_no_decoder_for_composite_type_el); Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_CLEAR(clear_module_state->__pyx_kp_u_no_encoder_for_OID); Py_CLEAR(clear_module_state->__pyx_kp_u_non_homogeneous_array); Py_CLEAR(clear_module_state->__pyx_n_s_normalize); Py_CLEAR(clear_module_state->__pyx_kp_u_not_connected); Py_CLEAR(clear_module_state->__pyx_n_u_ns); Py_CLEAR(clear_module_state->__pyx_n_s_num_cols); Py_CLEAR(clear_module_state->__pyx_kp_u_number_of_array_dimensions_excee); Py_CLEAR(clear_module_state->__pyx_n_u_numeric); Py_CLEAR(clear_module_state->__pyx_n_s_object); Py_CLEAR(clear_module_state->__pyx_kp_u_of_executemany_sequence); Py_CLEAR(clear_module_state->__pyx_n_s_oid); Py_CLEAR(clear_module_state->__pyx_n_u_oid); Py_CLEAR(clear_module_state->__pyx_kp_u_oid_2); Py_CLEAR(clear_module_state->__pyx_n_s_on_error); Py_CLEAR(clear_module_state->__pyx_kp_u_on_result__prepare_statement_is); Py_CLEAR(clear_module_state->__pyx_kp_u_on_result_waiter_is_None); Py_CLEAR(clear_module_state->__pyx_kp_u_on_result_waiter_is_done); Py_CLEAR(clear_module_state->__pyx_n_s_on_timeout); Py_CLEAR(clear_module_state->__pyx_n_s_on_waiter_completed); Py_CLEAR(clear_module_state->__pyx_n_u_opaque); Py_CLEAR(clear_module_state->__pyx_kp_b_p); Py_CLEAR(clear_module_state->__pyx_n_s_p_oid); Py_CLEAR(clear_module_state->__pyx_kp_u_parse_data_msgs_first_message_i); Py_CLEAR(clear_module_state->__pyx_kp_u_parse_data_msgs_result_is_not_a); Py_CLEAR(clear_module_state->__pyx_n_s_password); Py_CLEAR(clear_module_state->__pyx_n_u_password); Py_CLEAR(clear_module_state->__pyx_n_u_password_iterations); Py_CLEAR(clear_module_state->__pyx_n_u_password_salt); Py_CLEAR(clear_module_state->__pyx_n_u_path); Py_CLEAR(clear_module_state->__pyx_n_s_pause_reading); Py_CLEAR(clear_module_state->__pyx_n_s_pause_writing); Py_CLEAR(clear_module_state->__pyx_n_u_pg_brin_bloom_summary); Py_CLEAR(clear_module_state->__pyx_n_u_pg_brin_minmax_multi_summary); Py_CLEAR(clear_module_state->__pyx_n_u_pg_catalog); Py_CLEAR(clear_module_state->__pyx_kp_u_pg_contrib_hstore); Py_CLEAR(clear_module_state->__pyx_n_u_pg_ddl_command); Py_CLEAR(clear_module_state->__pyx_n_u_pg_dependencies); Py_CLEAR(clear_module_state->__pyx_n_u_pg_lsn); Py_CLEAR(clear_module_state->__pyx_n_u_pg_mcv_list); Py_CLEAR(clear_module_state->__pyx_n_u_pg_ndistinct); Py_CLEAR(clear_module_state->__pyx_n_u_pg_node_tree); Py_CLEAR(clear_module_state->__pyx_n_u_pg_snapshot); Py_CLEAR(clear_module_state->__pyx_n_s_pickle); Py_CLEAR(clear_module_state->__pyx_n_u_point); Py_CLEAR(clear_module_state->__pyx_n_u_polygon); Py_CLEAR(clear_module_state->__pyx_n_s_pop); Py_CLEAR(clear_module_state->__pyx_n_s_portal_name); Py_CLEAR(clear_module_state->__pyx_n_s_position); Py_CLEAR(clear_module_state->__pyx_n_u_postgres); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_prepare_2); Py_CLEAR(clear_module_state->__pyx_n_s_process_log_message); Py_CLEAR(clear_module_state->__pyx_n_s_process_notification); Py_CLEAR(clear_module_state->__pyx_n_s_protocol); Py_CLEAR(clear_module_state->__pyx_kp_u_protocol_is_in_an_unexpected_st); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_capi); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_BaseProtocol); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_CoreProtocol); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_DataCodecConfig); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_n_s_query); Py_CLEAR(clear_module_state->__pyx_kp_u_query_argument); Py_CLEAR(clear_module_state->__pyx_n_b_r); Py_CLEAR(clear_module_state->__pyx_kp_b_r_2); Py_CLEAR(clear_module_state->__pyx_kp_b_r_3); Py_CLEAR(clear_module_state->__pyx_kp_u_r_is_not_a_valid_element_of_com); Py_CLEAR(clear_module_state->__pyx_n_s_range); Py_CLEAR(clear_module_state->__pyx_n_u_range); Py_CLEAR(clear_module_state->__pyx_n_u_range_subtype); Py_CLEAR(clear_module_state->__pyx_n_u_range_subtype_name); Py_CLEAR(clear_module_state->__pyx_n_s_range_subtype_oid); Py_CLEAR(clear_module_state->__pyx_n_s_rdesc); Py_CLEAR(clear_module_state->__pyx_n_s_re); Py_CLEAR(clear_module_state->__pyx_n_s_reader); Py_CLEAR(clear_module_state->__pyx_kp_u_reader_is_not_an_asynchronous_it); Py_CLEAR(clear_module_state->__pyx_n_u_real); Py_CLEAR(clear_module_state->__pyx_n_s_rec); Py_CLEAR(clear_module_state->__pyx_n_u_record); Py_CLEAR(clear_module_state->__pyx_n_s_record_class); Py_CLEAR(clear_module_state->__pyx_n_s_record_stmt); Py_CLEAR(clear_module_state->__pyx_n_s_records); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_ref); Py_CLEAR(clear_module_state->__pyx_n_u_refcursor); Py_CLEAR(clear_module_state->__pyx_n_u_regclass); Py_CLEAR(clear_module_state->__pyx_n_u_regcollation); Py_CLEAR(clear_module_state->__pyx_n_u_regconfig); Py_CLEAR(clear_module_state->__pyx_n_u_regdictionary); Py_CLEAR(clear_module_state->__pyx_n_s_register_data_types); Py_CLEAR(clear_module_state->__pyx_n_u_regnamespace); Py_CLEAR(clear_module_state->__pyx_n_u_regoper); Py_CLEAR(clear_module_state->__pyx_n_u_regoperator); Py_CLEAR(clear_module_state->__pyx_n_u_regproc); Py_CLEAR(clear_module_state->__pyx_n_u_regprocedure); Py_CLEAR(clear_module_state->__pyx_n_u_regrole); Py_CLEAR(clear_module_state->__pyx_n_u_regtype); Py_CLEAR(clear_module_state->__pyx_n_s_release); Py_CLEAR(clear_module_state->__pyx_n_u_reltime); Py_CLEAR(clear_module_state->__pyx_n_s_remove_python_codec); Py_CLEAR(clear_module_state->__pyx_n_s_request_cancel); Py_CLEAR(clear_module_state->__pyx_n_s_result); Py_CLEAR(clear_module_state->__pyx_n_s_resume_reading); Py_CLEAR(clear_module_state->__pyx_n_s_resume_writing); Py_CLEAR(clear_module_state->__pyx_n_s_return_extra); Py_CLEAR(clear_module_state->__pyx_n_s_return_rows); Py_CLEAR(clear_module_state->__pyx_n_s_reversed); Py_CLEAR(clear_module_state->__pyx_n_s_row); Py_CLEAR(clear_module_state->__pyx_kp_b_s); Py_CLEAR(clear_module_state->__pyx_n_s_s_2); Py_CLEAR(clear_module_state->__pyx_n_u_s_2); Py_CLEAR(clear_module_state->__pyx_n_u_scalar); Py_CLEAR(clear_module_state->__pyx_n_s_schema); Py_CLEAR(clear_module_state->__pyx_kp_u_scram_sha_256); Py_CLEAR(clear_module_state->__pyx_n_s_search); Py_CLEAR(clear_module_state->__pyx_n_s_secrets); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_send); Py_CLEAR(clear_module_state->__pyx_n_u_server_first_message); Py_CLEAR(clear_module_state->__pyx_n_u_server_nonce); Py_CLEAR(clear_module_state->__pyx_n_s_server_settings); Py_CLEAR(clear_module_state->__pyx_n_s_set); Py_CLEAR(clear_module_state->__pyx_n_s_set_builtin_type_codec); Py_CLEAR(clear_module_state->__pyx_n_s_set_builtin_type_codec_2); Py_CLEAR(clear_module_state->__pyx_n_s_set_connection); Py_CLEAR(clear_module_state->__pyx_n_s_set_exception); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); Py_CLEAR(clear_module_state->__pyx_n_s_set_result); Py_CLEAR(clear_module_state->__pyx_n_s_setsockopt); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_settings); Py_CLEAR(clear_module_state->__pyx_n_s_sha256); Py_CLEAR(clear_module_state->__pyx_n_u_shift_jis); Py_CLEAR(clear_module_state->__pyx_n_u_shift_jis_2004); Py_CLEAR(clear_module_state->__pyx_n_s_sink); Py_CLEAR(clear_module_state->__pyx_kp_u_size_of_encoded_multirange_datum); Py_CLEAR(clear_module_state->__pyx_n_u_sjis); Py_CLEAR(clear_module_state->__pyx_n_s_sleep); Py_CLEAR(clear_module_state->__pyx_n_u_smallint); Py_CLEAR(clear_module_state->__pyx_n_u_smgr); Py_CLEAR(clear_module_state->__pyx_n_s_sock); Py_CLEAR(clear_module_state->__pyx_n_s_socket); Py_CLEAR(clear_module_state->__pyx_n_u_socket); Py_CLEAR(clear_module_state->__pyx_n_s_spec); Py_CLEAR(clear_module_state->__pyx_kp_u_specified_array_dimensions_do_no); Py_CLEAR(clear_module_state->__pyx_n_u_sql_ascii); Py_CLEAR(clear_module_state->__pyx_n_u_sspi); Py_CLEAR(clear_module_state->__pyx_n_s_sspilib); Py_CLEAR(clear_module_state->__pyx_kp_u_sspilib_module_not_found_please); Py_CLEAR(clear_module_state->__pyx_n_s_started); Py_CLEAR(clear_module_state->__pyx_n_s_startswith); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_n_s_status_msg); Py_CLEAR(clear_module_state->__pyx_n_s_step); Py_CLEAR(clear_module_state->__pyx_n_s_stmt_name); Py_CLEAR(clear_module_state->__pyx_n_s_str); Py_CLEAR(clear_module_state->__pyx_n_s_stringprep); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_n_u_table_am_handler); Py_CLEAR(clear_module_state->__pyx_n_s_target_codec); Py_CLEAR(clear_module_state->__pyx_n_s_target_name); Py_CLEAR(clear_module_state->__pyx_n_s_tb); Py_CLEAR(clear_module_state->__pyx_n_u_tcvn); Py_CLEAR(clear_module_state->__pyx_n_u_tcvn5712); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_u_text); Py_CLEAR(clear_module_state->__pyx_kp_u_text_2); Py_CLEAR(clear_module_state->__pyx_kp_u_text_binary_or_tuple); Py_CLEAR(clear_module_state->__pyx_kp_u_text_or_binary); Py_CLEAR(clear_module_state->__pyx_kp_u_text_or_binary_2); Py_CLEAR(clear_module_state->__pyx_kp_u_the_number_of_columns_in_the_res); Py_CLEAR(clear_module_state->__pyx_kp_u_the_number_of_query_arguments_ca); Py_CLEAR(clear_module_state->__pyx_kp_u_the_server_expects_x_argument_s); Py_CLEAR(clear_module_state->__pyx_kp_u_there_is_no); Py_CLEAR(clear_module_state->__pyx_n_s_throw); Py_CLEAR(clear_module_state->__pyx_n_s_ti); Py_CLEAR(clear_module_state->__pyx_n_u_tid); Py_CLEAR(clear_module_state->__pyx_n_s_time); Py_CLEAR(clear_module_state->__pyx_n_u_time); Py_CLEAR(clear_module_state->__pyx_kp_u_time_with_timezone); Py_CLEAR(clear_module_state->__pyx_kp_u_time_without_timezone); Py_CLEAR(clear_module_state->__pyx_n_s_timeout); Py_CLEAR(clear_module_state->__pyx_n_s_timer); Py_CLEAR(clear_module_state->__pyx_n_u_timestamp); Py_CLEAR(clear_module_state->__pyx_kp_u_timestamp_with_timezone); Py_CLEAR(clear_module_state->__pyx_kp_u_timestamp_without_timezone); Py_CLEAR(clear_module_state->__pyx_n_u_timestamptz); Py_CLEAR(clear_module_state->__pyx_n_u_timetz); Py_CLEAR(clear_module_state->__pyx_n_u_tinterval); Py_CLEAR(clear_module_state->__pyx_kp_u_to); Py_CLEAR(clear_module_state->__pyx_n_s_to_bytes); Py_CLEAR(clear_module_state->__pyx_n_s_token_bytes); Py_CLEAR(clear_module_state->__pyx_kp_u_too_many_elements_in_array_value); Py_CLEAR(clear_module_state->__pyx_kp_u_too_many_elements_in_composite_t); Py_CLEAR(clear_module_state->__pyx_kp_u_too_many_elements_in_multirange); Py_CLEAR(clear_module_state->__pyx_n_s_transport); Py_CLEAR(clear_module_state->__pyx_n_u_trigger); Py_CLEAR(clear_module_state->__pyx_n_u_tsm_handler); Py_CLEAR(clear_module_state->__pyx_n_u_tsquery); Py_CLEAR(clear_module_state->__pyx_n_u_tsvector); Py_CLEAR(clear_module_state->__pyx_n_u_tuple); Py_CLEAR(clear_module_state->__pyx_n_u_txid_snapshot); Py_CLEAR(clear_module_state->__pyx_kp_u_type_does_not_support_the_tuple); Py_CLEAR(clear_module_state->__pyx_kp_u_type_record_missing_base_type_fo); Py_CLEAR(clear_module_state->__pyx_kp_u_type_record_missing_base_type_fo_2); Py_CLEAR(clear_module_state->__pyx_kp_u_type_record_missing_base_type_fo_3); Py_CLEAR(clear_module_state->__pyx_kp_u_type_record_missing_field_types); Py_CLEAR(clear_module_state->__pyx_n_s_typeinfos); Py_CLEAR(clear_module_state->__pyx_n_s_typekind); Py_CLEAR(clear_module_state->__pyx_n_s_typename); Py_CLEAR(clear_module_state->__pyx_n_s_typeoid); Py_CLEAR(clear_module_state->__pyx_n_s_types); Py_CLEAR(clear_module_state->__pyx_n_s_typeschema); Py_CLEAR(clear_module_state->__pyx_n_s_typoid); Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_NULL_element_in_multi); Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_array_dimension_size); Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_array_dimensions_valu); Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_character_r_at_positi); Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_codec_type); Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_data_format); Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_data_type_of_composit); Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_end_of_string); Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_error_while_performin); Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_exchange_format); Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_multirange_size_value); Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_number_of_attributes); Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_trailing_bytes_in_buf); Py_CLEAR(clear_module_state->__pyx_kp_u_unhandled_standard_data_type); Py_CLEAR(clear_module_state->__pyx_n_u_unicode); Py_CLEAR(clear_module_state->__pyx_n_s_unicodedata); Py_CLEAR(clear_module_state->__pyx_n_u_unknown); Py_CLEAR(clear_module_state->__pyx_kp_u_unknown_error_in_protocol_implem); Py_CLEAR(clear_module_state->__pyx_kp_u_unsupported_SASL_Authentication); Py_CLEAR(clear_module_state->__pyx_kp_u_unsupported_authentication_metho); Py_CLEAR(clear_module_state->__pyx_n_s_update); Py_CLEAR(clear_module_state->__pyx_n_s_upper); Py_CLEAR(clear_module_state->__pyx_n_s_upper_inc); Py_CLEAR(clear_module_state->__pyx_n_s_usage); Py_CLEAR(clear_module_state->__pyx_n_s_use_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_user); Py_CLEAR(clear_module_state->__pyx_n_u_user); Py_CLEAR(clear_module_state->__pyx_kp_u_utf_8); Py_CLEAR(clear_module_state->__pyx_n_u_utf_8_2); Py_CLEAR(clear_module_state->__pyx_n_u_uuid); Py_CLEAR(clear_module_state->__pyx_kp_b_v); Py_CLEAR(clear_module_state->__pyx_n_u_varbit); Py_CLEAR(clear_module_state->__pyx_n_u_varchar); Py_CLEAR(clear_module_state->__pyx_n_u_void); Py_CLEAR(clear_module_state->__pyx_n_u_vscii); Py_CLEAR(clear_module_state->__pyx_n_s_w); Py_CLEAR(clear_module_state->__pyx_n_s_wait); Py_CLEAR(clear_module_state->__pyx_n_s_wait_for); Py_CLEAR(clear_module_state->__pyx_n_s_wait_for_cancellation); Py_CLEAR(clear_module_state->__pyx_n_s_waiter); Py_CLEAR(clear_module_state->__pyx_kp_u_waiter_is_not_done_while_handlin); Py_CLEAR(clear_module_state->__pyx_n_u_was); Py_CLEAR(clear_module_state->__pyx_n_s_wbuf); Py_CLEAR(clear_module_state->__pyx_n_s_weakref); Py_CLEAR(clear_module_state->__pyx_n_u_were); Py_CLEAR(clear_module_state->__pyx_n_u_win); Py_CLEAR(clear_module_state->__pyx_n_u_win1250); Py_CLEAR(clear_module_state->__pyx_n_u_win1251); Py_CLEAR(clear_module_state->__pyx_n_u_win1252); Py_CLEAR(clear_module_state->__pyx_n_u_win1253); Py_CLEAR(clear_module_state->__pyx_n_u_win1254); Py_CLEAR(clear_module_state->__pyx_n_u_win1255); Py_CLEAR(clear_module_state->__pyx_n_u_win1256); Py_CLEAR(clear_module_state->__pyx_n_u_win1257); Py_CLEAR(clear_module_state->__pyx_n_u_win1258); Py_CLEAR(clear_module_state->__pyx_n_u_win866); Py_CLEAR(clear_module_state->__pyx_n_u_win874); Py_CLEAR(clear_module_state->__pyx_n_u_win932); Py_CLEAR(clear_module_state->__pyx_n_u_win936); Py_CLEAR(clear_module_state->__pyx_n_u_win949); Py_CLEAR(clear_module_state->__pyx_n_u_win950); Py_CLEAR(clear_module_state->__pyx_n_u_windows1250); Py_CLEAR(clear_module_state->__pyx_n_u_windows1251); Py_CLEAR(clear_module_state->__pyx_n_u_windows1252); Py_CLEAR(clear_module_state->__pyx_n_u_windows1253); Py_CLEAR(clear_module_state->__pyx_n_u_windows1254); Py_CLEAR(clear_module_state->__pyx_n_u_windows1255); Py_CLEAR(clear_module_state->__pyx_n_u_windows1256); Py_CLEAR(clear_module_state->__pyx_n_u_windows1257); Py_CLEAR(clear_module_state->__pyx_n_u_windows1258); Py_CLEAR(clear_module_state->__pyx_n_u_windows866); Py_CLEAR(clear_module_state->__pyx_n_u_windows874); Py_CLEAR(clear_module_state->__pyx_n_u_windows932); Py_CLEAR(clear_module_state->__pyx_n_u_windows936); Py_CLEAR(clear_module_state->__pyx_n_u_windows949); Py_CLEAR(clear_module_state->__pyx_n_u_windows950); Py_CLEAR(clear_module_state->__pyx_n_s_with_msg); Py_CLEAR(clear_module_state->__pyx_n_s_write); Py_CLEAR(clear_module_state->__pyx_n_s_writelines); Py_CLEAR(clear_module_state->__pyx_n_s_writing_allowed); Py_CLEAR(clear_module_state->__pyx_n_s_x); Py_CLEAR(clear_module_state->__pyx_n_s_xformat); Py_CLEAR(clear_module_state->__pyx_n_u_xid); Py_CLEAR(clear_module_state->__pyx_n_u_xid8); Py_CLEAR(clear_module_state->__pyx_n_u_xml); Py_CLEAR(clear_module_state->__pyx_n_s_y); Py_CLEAR(clear_module_state->__pyx_kp_u_you_need_values_from_server_to_g); Py_CLEAR(clear_module_state->__pyx_n_s_zip); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_4); Py_CLEAR(clear_module_state->__pyx_int_6); Py_CLEAR(clear_module_state->__pyx_int_16); Py_CLEAR(clear_module_state->__pyx_int_17); Py_CLEAR(clear_module_state->__pyx_int_18); Py_CLEAR(clear_module_state->__pyx_int_19); Py_CLEAR(clear_module_state->__pyx_int_20); Py_CLEAR(clear_module_state->__pyx_int_21); Py_CLEAR(clear_module_state->__pyx_int_23); Py_CLEAR(clear_module_state->__pyx_int_24); Py_CLEAR(clear_module_state->__pyx_int_25); Py_CLEAR(clear_module_state->__pyx_int_26); Py_CLEAR(clear_module_state->__pyx_int_27); Py_CLEAR(clear_module_state->__pyx_int_28); Py_CLEAR(clear_module_state->__pyx_int_29); Py_CLEAR(clear_module_state->__pyx_int_32); Py_CLEAR(clear_module_state->__pyx_int_40); Py_CLEAR(clear_module_state->__pyx_int_114); Py_CLEAR(clear_module_state->__pyx_int_142); Py_CLEAR(clear_module_state->__pyx_int_194); Py_CLEAR(clear_module_state->__pyx_int_210); Py_CLEAR(clear_module_state->__pyx_int_269); Py_CLEAR(clear_module_state->__pyx_int_325); Py_CLEAR(clear_module_state->__pyx_int_600); Py_CLEAR(clear_module_state->__pyx_int_601); Py_CLEAR(clear_module_state->__pyx_int_602); Py_CLEAR(clear_module_state->__pyx_int_603); Py_CLEAR(clear_module_state->__pyx_int_604); Py_CLEAR(clear_module_state->__pyx_int_628); Py_CLEAR(clear_module_state->__pyx_int_650); Py_CLEAR(clear_module_state->__pyx_int_700); Py_CLEAR(clear_module_state->__pyx_int_701); Py_CLEAR(clear_module_state->__pyx_int_702); Py_CLEAR(clear_module_state->__pyx_int_703); Py_CLEAR(clear_module_state->__pyx_int_704); Py_CLEAR(clear_module_state->__pyx_int_705); Py_CLEAR(clear_module_state->__pyx_int_718); Py_CLEAR(clear_module_state->__pyx_int_774); Py_CLEAR(clear_module_state->__pyx_int_790); Py_CLEAR(clear_module_state->__pyx_int_829); Py_CLEAR(clear_module_state->__pyx_int_869); Py_CLEAR(clear_module_state->__pyx_int_1009); Py_CLEAR(clear_module_state->__pyx_int_1028); Py_CLEAR(clear_module_state->__pyx_int_1033); Py_CLEAR(clear_module_state->__pyx_int_1042); Py_CLEAR(clear_module_state->__pyx_int_1043); Py_CLEAR(clear_module_state->__pyx_int_1082); Py_CLEAR(clear_module_state->__pyx_int_1083); Py_CLEAR(clear_module_state->__pyx_int_1114); Py_CLEAR(clear_module_state->__pyx_int_1184); Py_CLEAR(clear_module_state->__pyx_int_1186); Py_CLEAR(clear_module_state->__pyx_int_1266); Py_CLEAR(clear_module_state->__pyx_int_1560); Py_CLEAR(clear_module_state->__pyx_int_1562); Py_CLEAR(clear_module_state->__pyx_int_1700); Py_CLEAR(clear_module_state->__pyx_int_1790); Py_CLEAR(clear_module_state->__pyx_int_2202); Py_CLEAR(clear_module_state->__pyx_int_2203); Py_CLEAR(clear_module_state->__pyx_int_2204); Py_CLEAR(clear_module_state->__pyx_int_2205); Py_CLEAR(clear_module_state->__pyx_int_2206); Py_CLEAR(clear_module_state->__pyx_int_2249); Py_CLEAR(clear_module_state->__pyx_int_2275); Py_CLEAR(clear_module_state->__pyx_int_2276); Py_CLEAR(clear_module_state->__pyx_int_2277); Py_CLEAR(clear_module_state->__pyx_int_2278); Py_CLEAR(clear_module_state->__pyx_int_2279); Py_CLEAR(clear_module_state->__pyx_int_2280); Py_CLEAR(clear_module_state->__pyx_int_2281); Py_CLEAR(clear_module_state->__pyx_int_2282); Py_CLEAR(clear_module_state->__pyx_int_2283); Py_CLEAR(clear_module_state->__pyx_int_2776); Py_CLEAR(clear_module_state->__pyx_int_2950); Py_CLEAR(clear_module_state->__pyx_int_2970); Py_CLEAR(clear_module_state->__pyx_int_3115); Py_CLEAR(clear_module_state->__pyx_int_3220); Py_CLEAR(clear_module_state->__pyx_int_3310); Py_CLEAR(clear_module_state->__pyx_int_3361); Py_CLEAR(clear_module_state->__pyx_int_3402); Py_CLEAR(clear_module_state->__pyx_int_3500); Py_CLEAR(clear_module_state->__pyx_int_3614); Py_CLEAR(clear_module_state->__pyx_int_3615); Py_CLEAR(clear_module_state->__pyx_int_3642); Py_CLEAR(clear_module_state->__pyx_int_3734); Py_CLEAR(clear_module_state->__pyx_int_3769); Py_CLEAR(clear_module_state->__pyx_int_3802); Py_CLEAR(clear_module_state->__pyx_int_3831); Py_CLEAR(clear_module_state->__pyx_int_3838); Py_CLEAR(clear_module_state->__pyx_int_4072); Py_CLEAR(clear_module_state->__pyx_int_4089); Py_CLEAR(clear_module_state->__pyx_int_4096); Py_CLEAR(clear_module_state->__pyx_int_4191); Py_CLEAR(clear_module_state->__pyx_int_4537); Py_CLEAR(clear_module_state->__pyx_int_4538); Py_CLEAR(clear_module_state->__pyx_int_4600); Py_CLEAR(clear_module_state->__pyx_int_4601); Py_CLEAR(clear_module_state->__pyx_int_5017); Py_CLEAR(clear_module_state->__pyx_int_5038); Py_CLEAR(clear_module_state->__pyx_int_5069); Py_CLEAR(clear_module_state->__pyx_int_5077); Py_CLEAR(clear_module_state->__pyx_int_5078); Py_CLEAR(clear_module_state->__pyx_int_5079); Py_CLEAR(clear_module_state->__pyx_int_5080); Py_CLEAR(clear_module_state->__pyx_int_32768); Py_CLEAR(clear_module_state->__pyx_int_524288); Py_CLEAR(clear_module_state->__pyx_int_40941617); Py_CLEAR(clear_module_state->__pyx_int_89793719); Py_CLEAR(clear_module_state->__pyx_int_120810133); Py_CLEAR(clear_module_state->__pyx_int_134522893); Py_CLEAR(clear_module_state->__pyx_int_175807176); Py_CLEAR(clear_module_state->__pyx_int_228230485); Py_CLEAR(clear_module_state->__pyx_int_232227937); Py_CLEAR(clear_module_state->__pyx_int_245762207); Py_CLEAR(clear_module_state->__pyx_int_252635979); Py_CLEAR(clear_module_state->__pyx_k__6); Py_CLEAR(clear_module_state->__pyx_k__7); Py_CLEAR(clear_module_state->__pyx_slice__4); Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_slice__43); Py_CLEAR(clear_module_state->__pyx_tuple__12); Py_CLEAR(clear_module_state->__pyx_tuple__13); Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__16); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__18); Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__20); Py_CLEAR(clear_module_state->__pyx_tuple__21); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__25); Py_CLEAR(clear_module_state->__pyx_tuple__26); Py_CLEAR(clear_module_state->__pyx_tuple__27); Py_CLEAR(clear_module_state->__pyx_tuple__28); Py_CLEAR(clear_module_state->__pyx_tuple__29); Py_CLEAR(clear_module_state->__pyx_tuple__30); Py_CLEAR(clear_module_state->__pyx_tuple__49); Py_CLEAR(clear_module_state->__pyx_tuple__56); Py_CLEAR(clear_module_state->__pyx_tuple__60); Py_CLEAR(clear_module_state->__pyx_tuple__61); Py_CLEAR(clear_module_state->__pyx_tuple__62); Py_CLEAR(clear_module_state->__pyx_tuple__63); Py_CLEAR(clear_module_state->__pyx_tuple__64); Py_CLEAR(clear_module_state->__pyx_tuple__65); Py_CLEAR(clear_module_state->__pyx_tuple__67); Py_CLEAR(clear_module_state->__pyx_tuple__69); Py_CLEAR(clear_module_state->__pyx_tuple__71); Py_CLEAR(clear_module_state->__pyx_tuple__74); Py_CLEAR(clear_module_state->__pyx_tuple__76); Py_CLEAR(clear_module_state->__pyx_tuple__79); Py_CLEAR(clear_module_state->__pyx_tuple__83); Py_CLEAR(clear_module_state->__pyx_tuple__85); Py_CLEAR(clear_module_state->__pyx_tuple__87); Py_CLEAR(clear_module_state->__pyx_tuple__89); Py_CLEAR(clear_module_state->__pyx_tuple__93); Py_CLEAR(clear_module_state->__pyx_tuple__95); Py_CLEAR(clear_module_state->__pyx_tuple__103); Py_CLEAR(clear_module_state->__pyx_tuple__105); Py_CLEAR(clear_module_state->__pyx_tuple__107); Py_CLEAR(clear_module_state->__pyx_tuple__116); Py_CLEAR(clear_module_state->__pyx_tuple__121); Py_CLEAR(clear_module_state->__pyx_tuple__122); Py_CLEAR(clear_module_state->__pyx_tuple__123); Py_CLEAR(clear_module_state->__pyx_tuple__124); Py_CLEAR(clear_module_state->__pyx_tuple__125); Py_CLEAR(clear_module_state->__pyx_tuple__126); Py_CLEAR(clear_module_state->__pyx_tuple__127); Py_CLEAR(clear_module_state->__pyx_tuple__128); Py_CLEAR(clear_module_state->__pyx_tuple__129); Py_CLEAR(clear_module_state->__pyx_tuple__130); Py_CLEAR(clear_module_state->__pyx_tuple__134); Py_CLEAR(clear_module_state->__pyx_tuple__135); Py_CLEAR(clear_module_state->__pyx_tuple__137); Py_CLEAR(clear_module_state->__pyx_tuple__143); Py_CLEAR(clear_module_state->__pyx_tuple__145); Py_CLEAR(clear_module_state->__pyx_tuple__147); Py_CLEAR(clear_module_state->__pyx_tuple__153); Py_CLEAR(clear_module_state->__pyx_tuple__156); Py_CLEAR(clear_module_state->__pyx_tuple__159); Py_CLEAR(clear_module_state->__pyx_tuple__161); Py_CLEAR(clear_module_state->__pyx_tuple__163); Py_CLEAR(clear_module_state->__pyx_codeobj__46); Py_CLEAR(clear_module_state->__pyx_codeobj__47); Py_CLEAR(clear_module_state->__pyx_codeobj__48); Py_CLEAR(clear_module_state->__pyx_codeobj__50); Py_CLEAR(clear_module_state->__pyx_codeobj__51); Py_CLEAR(clear_module_state->__pyx_codeobj__52); Py_CLEAR(clear_module_state->__pyx_codeobj__53); Py_CLEAR(clear_module_state->__pyx_codeobj__54); Py_CLEAR(clear_module_state->__pyx_codeobj__55); Py_CLEAR(clear_module_state->__pyx_codeobj__57); Py_CLEAR(clear_module_state->__pyx_codeobj__58); Py_CLEAR(clear_module_state->__pyx_codeobj__59); Py_CLEAR(clear_module_state->__pyx_codeobj__66); Py_CLEAR(clear_module_state->__pyx_codeobj__68); Py_CLEAR(clear_module_state->__pyx_codeobj__70); Py_CLEAR(clear_module_state->__pyx_codeobj__72); Py_CLEAR(clear_module_state->__pyx_codeobj__73); Py_CLEAR(clear_module_state->__pyx_codeobj__75); Py_CLEAR(clear_module_state->__pyx_codeobj__77); Py_CLEAR(clear_module_state->__pyx_codeobj__78); Py_CLEAR(clear_module_state->__pyx_codeobj__80); Py_CLEAR(clear_module_state->__pyx_codeobj__81); Py_CLEAR(clear_module_state->__pyx_codeobj__82); Py_CLEAR(clear_module_state->__pyx_codeobj__84); Py_CLEAR(clear_module_state->__pyx_codeobj__86); Py_CLEAR(clear_module_state->__pyx_codeobj__88); Py_CLEAR(clear_module_state->__pyx_codeobj__90); Py_CLEAR(clear_module_state->__pyx_codeobj__91); Py_CLEAR(clear_module_state->__pyx_codeobj__92); Py_CLEAR(clear_module_state->__pyx_codeobj__94); Py_CLEAR(clear_module_state->__pyx_codeobj__96); Py_CLEAR(clear_module_state->__pyx_codeobj__97); Py_CLEAR(clear_module_state->__pyx_codeobj__98); Py_CLEAR(clear_module_state->__pyx_codeobj__99); Py_CLEAR(clear_module_state->__pyx_codeobj__100); Py_CLEAR(clear_module_state->__pyx_codeobj__101); Py_CLEAR(clear_module_state->__pyx_codeobj__102); Py_CLEAR(clear_module_state->__pyx_codeobj__104); Py_CLEAR(clear_module_state->__pyx_codeobj__106); Py_CLEAR(clear_module_state->__pyx_codeobj__108); Py_CLEAR(clear_module_state->__pyx_codeobj__109); Py_CLEAR(clear_module_state->__pyx_codeobj__110); Py_CLEAR(clear_module_state->__pyx_codeobj__111); Py_CLEAR(clear_module_state->__pyx_codeobj__112); Py_CLEAR(clear_module_state->__pyx_codeobj__113); Py_CLEAR(clear_module_state->__pyx_codeobj__114); Py_CLEAR(clear_module_state->__pyx_codeobj__115); Py_CLEAR(clear_module_state->__pyx_codeobj__117); Py_CLEAR(clear_module_state->__pyx_codeobj__118); Py_CLEAR(clear_module_state->__pyx_codeobj__119); Py_CLEAR(clear_module_state->__pyx_codeobj__120); Py_CLEAR(clear_module_state->__pyx_codeobj__131); Py_CLEAR(clear_module_state->__pyx_codeobj__132); Py_CLEAR(clear_module_state->__pyx_codeobj__133); Py_CLEAR(clear_module_state->__pyx_codeobj__136); Py_CLEAR(clear_module_state->__pyx_codeobj__138); Py_CLEAR(clear_module_state->__pyx_codeobj__139); Py_CLEAR(clear_module_state->__pyx_codeobj__140); Py_CLEAR(clear_module_state->__pyx_codeobj__141); Py_CLEAR(clear_module_state->__pyx_codeobj__142); Py_CLEAR(clear_module_state->__pyx_codeobj__144); Py_CLEAR(clear_module_state->__pyx_codeobj__146); Py_CLEAR(clear_module_state->__pyx_codeobj__148); Py_CLEAR(clear_module_state->__pyx_codeobj__149); Py_CLEAR(clear_module_state->__pyx_codeobj__150); Py_CLEAR(clear_module_state->__pyx_codeobj__151); Py_CLEAR(clear_module_state->__pyx_codeobj__152); Py_CLEAR(clear_module_state->__pyx_codeobj__154); Py_CLEAR(clear_module_state->__pyx_codeobj__155); Py_CLEAR(clear_module_state->__pyx_codeobj__157); Py_CLEAR(clear_module_state->__pyx_codeobj__158); Py_CLEAR(clear_module_state->__pyx_codeobj__160); Py_CLEAR(clear_module_state->__pyx_codeobj__162); Py_CLEAR(clear_module_state->__pyx_codeobj__164); Py_CLEAR(clear_module_state->__pyx_codeobj__165); Py_CLEAR(clear_module_state->__pyx_codeobj__166); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool); Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol_Codec); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close); Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation); Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation); Py_VISIT(traverse_module_state->__pyx_n_s_AF_UNIX); Py_VISIT(traverse_module_state->__pyx_n_u_AF_UNIX); Py_VISIT(traverse_module_state->__pyx_n_s_ARRAY_TYPES); Py_VISIT(traverse_module_state->__pyx_n_s_AUTHENTICATION_METHODS); Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError); Py_VISIT(traverse_module_state->__pyx_n_s_AsyncIterable); Py_VISIT(traverse_module_state->__pyx_n_s_Attribute); Py_VISIT(traverse_module_state->__pyx_n_s_AttributeError); Py_VISIT(traverse_module_state->__pyx_n_s_BUILTIN_TYPE_NAME_MAP); Py_VISIT(traverse_module_state->__pyx_n_s_BUILTIN_TYPE_OID_MAP); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol__create_future_fall); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol__get_timeout); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol__is_cancelling); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol__on_timeout); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol__on_waiter_complete); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol__request_cancel); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol__wait_for_cancellat); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_abort); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_bind); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_bind_execute); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_bind_execute_many); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_close); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_close_portal); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_close_statement); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_connection_lost); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_connection_made); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_copy_in); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_copy_out); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_data_received); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_execute); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_get_record_class); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_get_server_pid); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_get_settings); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_is_closed); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_is_connected); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_pause_writing); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_query); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_resume_writing); Py_VISIT(traverse_module_state->__pyx_n_s_BaseProtocol_set_connection); Py_VISIT(traverse_module_state->__pyx_kp_u_Bind_expected_a_sequence_got); Py_VISIT(traverse_module_state->__pyx_n_s_BufferError); Py_VISIT(traverse_module_state->__pyx_n_s_CancelledError); Py_VISIT(traverse_module_state->__pyx_kp_u_Check_the_query_against_the_pass); Py_VISIT(traverse_module_state->__pyx_n_s_ClientSecurityContext); Py_VISIT(traverse_module_state->__pyx_kp_b_Client_Key); Py_VISIT(traverse_module_state->__pyx_n_s_Codec); Py_VISIT(traverse_module_state->__pyx_n_s_Codec___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Codec___setstate_cython); Py_VISIT(traverse_module_state->__pyx_kp_u_Codec_oid_elem_oid_core); Py_VISIT(traverse_module_state->__pyx_n_s_ConnectionDoesNotExistError); Py_VISIT(traverse_module_state->__pyx_n_s_ConnectionResetError); Py_VISIT(traverse_module_state->__pyx_n_s_ConnectionSettings); Py_VISIT(traverse_module_state->__pyx_n_s_ConnectionSettings___reduce_cyth); Py_VISIT(traverse_module_state->__pyx_n_s_ConnectionSettings___setstate_cy); Py_VISIT(traverse_module_state->__pyx_n_s_ConnectionSettings_add_python_co); Py_VISIT(traverse_module_state->__pyx_n_s_ConnectionSettings_clear_type_ca); Py_VISIT(traverse_module_state->__pyx_n_s_ConnectionSettings_get_data_code); Py_VISIT(traverse_module_state->__pyx_n_s_ConnectionSettings_get_text_code); Py_VISIT(traverse_module_state->__pyx_kp_u_ConnectionSettings_r); Py_VISIT(traverse_module_state->__pyx_n_s_ConnectionSettings_register_data); Py_VISIT(traverse_module_state->__pyx_n_s_ConnectionSettings_remove_python); Py_VISIT(traverse_module_state->__pyx_n_s_ConnectionSettings_set_builtin_t); Py_VISIT(traverse_module_state->__pyx_kp_u_Consider_declaring_an_explicit_c); Py_VISIT(traverse_module_state->__pyx_n_s_CoreProtocol); Py_VISIT(traverse_module_state->__pyx_n_s_CoreProtocol___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_CoreProtocol___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_CoreProtocol_is_in_transaction); Py_VISIT(traverse_module_state->__pyx_n_s_DEFAULT_CLIENT_NONCE_BYTES); Py_VISIT(traverse_module_state->__pyx_n_s_DIGEST); Py_VISIT(traverse_module_state->__pyx_n_s_DataCodecConfig); Py_VISIT(traverse_module_state->__pyx_n_s_DataCodecConfig___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_DataCodecConfig___setstate_cytho); Py_VISIT(traverse_module_state->__pyx_n_s_DataCodecConfig__set_builtin_typ); Py_VISIT(traverse_module_state->__pyx_n_s_DataCodecConfig_add_python_codec); Py_VISIT(traverse_module_state->__pyx_n_s_DataCodecConfig_add_types); Py_VISIT(traverse_module_state->__pyx_n_s_DataCodecConfig_clear_type_cache); Py_VISIT(traverse_module_state->__pyx_n_s_DataCodecConfig_declare_fallback); Py_VISIT(traverse_module_state->__pyx_n_s_DataCodecConfig_remove_python_co); Py_VISIT(traverse_module_state->__pyx_n_s_DataCodecConfig_set_builtin_type); Py_VISIT(traverse_module_state->__pyx_n_s_DataError); Py_VISIT(traverse_module_state->__pyx_n_s_Event); Py_VISIT(traverse_module_state->__pyx_n_s_Future); Py_VISIT(traverse_module_state->__pyx_kp_u_GSSAPI_SSPI_authentication_is_on); Py_VISIT(traverse_module_state->__pyx_n_s_IPPROTO_TCP); Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2); Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_3); Py_VISIT(traverse_module_state->__pyx_n_s_IndexError); Py_VISIT(traverse_module_state->__pyx_n_s_InterfaceError); Py_VISIT(traverse_module_state->__pyx_n_s_InternalClientError); Py_VISIT(traverse_module_state->__pyx_n_s_Iterable); Py_VISIT(traverse_module_state->__pyx_n_s_IterableABC); Py_VISIT(traverse_module_state->__pyx_n_u_Kerberos); Py_VISIT(traverse_module_state->__pyx_n_s_KeyError); Py_VISIT(traverse_module_state->__pyx_n_s_Mapping); Py_VISIT(traverse_module_state->__pyx_n_s_MappingABC); Py_VISIT(traverse_module_state->__pyx_n_s_ModuleNotFoundError); Py_VISIT(traverse_module_state->__pyx_n_u_NA); Py_VISIT(traverse_module_state->__pyx_n_u_NFKC); Py_VISIT(traverse_module_state->__pyx_n_s_NO_TIMEOUT); Py_VISIT(traverse_module_state->__pyx_n_b_NULL); Py_VISIT(traverse_module_state->__pyx_n_s_Name); Py_VISIT(traverse_module_state->__pyx_n_s_NameType); Py_VISIT(traverse_module_state->__pyx_n_u_Negotiate); Py_VISIT(traverse_module_state->__pyx_n_s_NotImplementedError); Py_VISIT(traverse_module_state->__pyx_kp_u_Note_that_parameters_are_suppor); Py_VISIT(traverse_module_state->__pyx_kp_u_OID); Py_VISIT(traverse_module_state->__pyx_kp_u_OID_value_too_large_r); Py_VISIT(traverse_module_state->__pyx_n_s_OrderedDict); Py_VISIT(traverse_module_state->__pyx_n_s_OutdatedSchemaCacheError); Py_VISIT(traverse_module_state->__pyx_n_s_OverflowError); Py_VISIT(traverse_module_state->__pyx_kp_b_PGCOPY); Py_VISIT(traverse_module_state->__pyx_n_s_PickleError); Py_VISIT(traverse_module_state->__pyx_kp_u_PostgreSQL_does_not_implement_an); Py_VISIT(traverse_module_state->__pyx_n_s_PostgresError); Py_VISIT(traverse_module_state->__pyx_n_s_PreparedStatementState); Py_VISIT(traverse_module_state->__pyx_n_s_PreparedStatementState___reduce); Py_VISIT(traverse_module_state->__pyx_n_s_PreparedStatementState___setstat); Py_VISIT(traverse_module_state->__pyx_n_s_PreparedStatementState__get_attr); Py_VISIT(traverse_module_state->__pyx_n_s_PreparedStatementState__get_para); Py_VISIT(traverse_module_state->__pyx_n_s_PreparedStatementState__init_cod); Py_VISIT(traverse_module_state->__pyx_n_s_PreparedStatementState__init_typ); Py_VISIT(traverse_module_state->__pyx_n_s_PreparedStatementState_attach); Py_VISIT(traverse_module_state->__pyx_n_s_PreparedStatementState_detach); Py_VISIT(traverse_module_state->__pyx_n_s_PreparedStatementState_mark_clos); Py_VISIT(traverse_module_state->__pyx_n_s_PreparedStatementState_mark_unpr); Py_VISIT(traverse_module_state->__pyx_n_s_Protocol); Py_VISIT(traverse_module_state->__pyx_n_s_ProtocolError); Py_VISIT(traverse_module_state->__pyx_n_s_REQUIREMENTS_CLIENT_FINAL_MESSAG); Py_VISIT(traverse_module_state->__pyx_n_s_REQUIREMENTS_CLIENT_PROOF); Py_VISIT(traverse_module_state->__pyx_n_u_ROLLBACK); Py_VISIT(traverse_module_state->__pyx_n_s_Range); Py_VISIT(traverse_module_state->__pyx_n_s_Record); Py_VISIT(traverse_module_state->__pyx_n_s_SASLPREP_PROHIBITED); Py_VISIT(traverse_module_state->__pyx_n_s_SCRAMAuthentication); Py_VISIT(traverse_module_state->__pyx_n_s_SCRAMAuthentication___reduce_cyt); Py_VISIT(traverse_module_state->__pyx_n_s_SCRAMAuthentication___setstate_c); Py_VISIT(traverse_module_state->__pyx_n_s_SCRAMAuthentication__bytes_xor_l); Py_VISIT(traverse_module_state->__pyx_n_s_SCRAMAuthentication__normalize_p); Py_VISIT(traverse_module_state->__pyx_kp_b_SCRAM_SHA_256); Py_VISIT(traverse_module_state->__pyx_n_s_SecurityContext); Py_VISIT(traverse_module_state->__pyx_n_s_Sequence); Py_VISIT(traverse_module_state->__pyx_n_s_SequenceABC); Py_VISIT(traverse_module_state->__pyx_kp_b_Server_Key); Py_VISIT(traverse_module_state->__pyx_n_s_Sized); Py_VISIT(traverse_module_state->__pyx_n_s_SizedABC); Py_VISIT(traverse_module_state->__pyx_n_s_StopAsyncIteration); Py_VISIT(traverse_module_state->__pyx_n_s_StopIteration); Py_VISIT(traverse_module_state->__pyx_n_s_TCP_NODELAY); Py_VISIT(traverse_module_state->__pyx_n_s_TimeoutError); Py_VISIT(traverse_module_state->__pyx_n_u_TimeoutError); Py_VISIT(traverse_module_state->__pyx_n_s_Timer); Py_VISIT(traverse_module_state->__pyx_n_s_Timer___enter); Py_VISIT(traverse_module_state->__pyx_n_s_Timer___exit); Py_VISIT(traverse_module_state->__pyx_n_s_Timer___init); Py_VISIT(traverse_module_state->__pyx_n_s_Timer_get_remaining_budget); Py_VISIT(traverse_module_state->__pyx_n_s_Timer_has_budget_greater_than); Py_VISIT(traverse_module_state->__pyx_kp_u_TimoutError_was_not_raised); Py_VISIT(traverse_module_state->__pyx_n_s_Type); Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); Py_VISIT(traverse_module_state->__pyx_n_s_UnicodeEncodeError); Py_VISIT(traverse_module_state->__pyx_n_s_UnsupportedClientFeatureError); Py_VISIT(traverse_module_state->__pyx_n_s_UserCredential); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); Py_VISIT(traverse_module_state->__pyx_kp_b__15); Py_VISIT(traverse_module_state->__pyx_n_s__167); Py_VISIT(traverse_module_state->__pyx_n_u__2); Py_VISIT(traverse_module_state->__pyx_kp_b__23); Py_VISIT(traverse_module_state->__pyx_kp_b__31); Py_VISIT(traverse_module_state->__pyx_kp_b__32); Py_VISIT(traverse_module_state->__pyx_kp_u__33); Py_VISIT(traverse_module_state->__pyx_kp_b__34); Py_VISIT(traverse_module_state->__pyx_kp_u__34); Py_VISIT(traverse_module_state->__pyx_kp_u__35); Py_VISIT(traverse_module_state->__pyx_kp_u__36); Py_VISIT(traverse_module_state->__pyx_n_s__37); Py_VISIT(traverse_module_state->__pyx_kp_u__38); Py_VISIT(traverse_module_state->__pyx_kp_u__39); Py_VISIT(traverse_module_state->__pyx_kp_u__40); Py_VISIT(traverse_module_state->__pyx_kp_u__41); Py_VISIT(traverse_module_state->__pyx_kp_u__42); Py_VISIT(traverse_module_state->__pyx_kp_u__44); Py_VISIT(traverse_module_state->__pyx_kp_u__45); Py_VISIT(traverse_module_state->__pyx_kp_u__5); Py_VISIT(traverse_module_state->__pyx_kp_u__8); Py_VISIT(traverse_module_state->__pyx_kp_u_a_sized_iterable_container_expec); Py_VISIT(traverse_module_state->__pyx_n_s_abc); Py_VISIT(traverse_module_state->__pyx_n_u_abc); Py_VISIT(traverse_module_state->__pyx_n_s_abort); Py_VISIT(traverse_module_state->__pyx_n_u_abstime); Py_VISIT(traverse_module_state->__pyx_n_u_aclitem); Py_VISIT(traverse_module_state->__pyx_n_s_add_done_callback); Py_VISIT(traverse_module_state->__pyx_n_s_add_python_codec); Py_VISIT(traverse_module_state->__pyx_n_s_add_types); Py_VISIT(traverse_module_state->__pyx_n_s_addr); Py_VISIT(traverse_module_state->__pyx_n_s_aiter); Py_VISIT(traverse_module_state->__pyx_n_s_aiter_2); Py_VISIT(traverse_module_state->__pyx_n_s_alias_oid); Py_VISIT(traverse_module_state->__pyx_n_s_alias_to); Py_VISIT(traverse_module_state->__pyx_kp_u_already_connected); Py_VISIT(traverse_module_state->__pyx_n_u_alt); Py_VISIT(traverse_module_state->__pyx_n_s_amount); Py_VISIT(traverse_module_state->__pyx_n_s_anext); Py_VISIT(traverse_module_state->__pyx_n_s_any); Py_VISIT(traverse_module_state->__pyx_n_u_any); Py_VISIT(traverse_module_state->__pyx_n_u_anyarray); Py_VISIT(traverse_module_state->__pyx_n_u_anycompatible); Py_VISIT(traverse_module_state->__pyx_n_u_anycompatiblearray); Py_VISIT(traverse_module_state->__pyx_n_u_anycompatiblemultirange); Py_VISIT(traverse_module_state->__pyx_n_u_anycompatiblenonarray); Py_VISIT(traverse_module_state->__pyx_n_u_anycompatiblerange); Py_VISIT(traverse_module_state->__pyx_n_u_anyelement); Py_VISIT(traverse_module_state->__pyx_n_u_anyenum); Py_VISIT(traverse_module_state->__pyx_n_u_anymultirange); Py_VISIT(traverse_module_state->__pyx_n_u_anynonarray); Py_VISIT(traverse_module_state->__pyx_n_u_anyrange); Py_VISIT(traverse_module_state->__pyx_n_s_apg_exc); Py_VISIT(traverse_module_state->__pyx_n_s_apg_exc_base); Py_VISIT(traverse_module_state->__pyx_n_s_apg_types); Py_VISIT(traverse_module_state->__pyx_n_s_arg_bufs); Py_VISIT(traverse_module_state->__pyx_n_s_args); Py_VISIT(traverse_module_state->__pyx_n_s_args_buf); Py_VISIT(traverse_module_state->__pyx_n_u_array); Py_VISIT(traverse_module_state->__pyx_n_s_array_element_oid); Py_VISIT(traverse_module_state->__pyx_kp_u_array_length_overflow); Py_VISIT(traverse_module_state->__pyx_n_u_ascii); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_tasks); Py_VISIT(traverse_module_state->__pyx_n_s_asyncpg); Py_VISIT(traverse_module_state->__pyx_kp_u_asyncpg_Protocol_has_no_referenc); Py_VISIT(traverse_module_state->__pyx_n_s_asyncpg_exceptions); Py_VISIT(traverse_module_state->__pyx_kp_s_asyncpg_protocol_codecs_base_pyx); Py_VISIT(traverse_module_state->__pyx_kp_s_asyncpg_protocol_coreproto_pyx); Py_VISIT(traverse_module_state->__pyx_kp_s_asyncpg_protocol_prepared_stmt_p); Py_VISIT(traverse_module_state->__pyx_n_s_asyncpg_protocol_protocol); Py_VISIT(traverse_module_state->__pyx_kp_s_asyncpg_protocol_protocol_pyx); Py_VISIT(traverse_module_state->__pyx_kp_s_asyncpg_protocol_settings_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_attach); Py_VISIT(traverse_module_state->__pyx_n_s_attrname); Py_VISIT(traverse_module_state->__pyx_n_u_attrnames); Py_VISIT(traverse_module_state->__pyx_n_u_attrtypoids); Py_VISIT(traverse_module_state->__pyx_n_s_auth_msg); Py_VISIT(traverse_module_state->__pyx_n_s_authentication_method); Py_VISIT(traverse_module_state->__pyx_n_s_await); Py_VISIT(traverse_module_state->__pyx_n_s_b64decode); Py_VISIT(traverse_module_state->__pyx_n_s_b64encode); Py_VISIT(traverse_module_state->__pyx_n_s_base); Py_VISIT(traverse_module_state->__pyx_n_s_base64); Py_VISIT(traverse_module_state->__pyx_n_s_base_codec); Py_VISIT(traverse_module_state->__pyx_kp_u_base_codec_is_mutually_exclusive); Py_VISIT(traverse_module_state->__pyx_n_s_base_type); Py_VISIT(traverse_module_state->__pyx_n_u_basetype); Py_VISIT(traverse_module_state->__pyx_n_u_basetype_name); Py_VISIT(traverse_module_state->__pyx_n_u_big); Py_VISIT(traverse_module_state->__pyx_n_u_bigint); Py_VISIT(traverse_module_state->__pyx_n_u_binary); Py_VISIT(traverse_module_state->__pyx_n_s_bind); Py_VISIT(traverse_module_state->__pyx_n_s_bind_execute); Py_VISIT(traverse_module_state->__pyx_n_s_bind_execute_many); Py_VISIT(traverse_module_state->__pyx_n_s_bind_execute_many_locals_genexpr); Py_VISIT(traverse_module_state->__pyx_n_u_bit); Py_VISIT(traverse_module_state->__pyx_kp_u_bit_varying); Py_VISIT(traverse_module_state->__pyx_n_s_bool); Py_VISIT(traverse_module_state->__pyx_n_u_bool); Py_VISIT(traverse_module_state->__pyx_n_u_box); Py_VISIT(traverse_module_state->__pyx_n_u_bpchar); Py_VISIT(traverse_module_state->__pyx_n_s_budget); Py_VISIT(traverse_module_state->__pyx_n_s_budget_2); Py_VISIT(traverse_module_state->__pyx_n_s_buffer); Py_VISIT(traverse_module_state->__pyx_n_s_builtins); Py_VISIT(traverse_module_state->__pyx_n_u_bytea); Py_VISIT(traverse_module_state->__pyx_n_s_byteorder); Py_VISIT(traverse_module_state->__pyx_kp_u_bytes); Py_VISIT(traverse_module_state->__pyx_n_b_c); Py_VISIT(traverse_module_state->__pyx_kp_b_c_2); Py_VISIT(traverse_module_state->__pyx_kp_b_c_3); Py_VISIT(traverse_module_state->__pyx_n_s_c_decoder); Py_VISIT(traverse_module_state->__pyx_n_s_c_encoder); Py_VISIT(traverse_module_state->__pyx_n_s_call_exception_handler); Py_VISIT(traverse_module_state->__pyx_n_s_call_later); Py_VISIT(traverse_module_state->__pyx_n_s_cancel); Py_VISIT(traverse_module_state->__pyx_n_s_cancel_current_command); Py_VISIT(traverse_module_state->__pyx_n_s_cancelled); Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_alias); Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_close_prepared_statement); Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_decode_type_text_encoding); Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_decode_type_text_encoding_2); Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_perform_operation_another); Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_perform_operation_another_2); Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_perform_operation_connect); Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_process_message); Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_register_core_codec_for_O); Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_switch_to_idle_state_prot); Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_switch_to_state_another_o); Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_switch_to_state_protocol); Py_VISIT(traverse_module_state->__pyx_n_s_cause); Py_VISIT(traverse_module_state->__pyx_n_u_char); Py_VISIT(traverse_module_state->__pyx_n_u_character); Py_VISIT(traverse_module_state->__pyx_kp_u_character_varying); Py_VISIT(traverse_module_state->__pyx_n_s_chr); Py_VISIT(traverse_module_state->__pyx_n_s_chunk); Py_VISIT(traverse_module_state->__pyx_n_u_cid); Py_VISIT(traverse_module_state->__pyx_n_u_cidr); Py_VISIT(traverse_module_state->__pyx_n_u_circle); Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); Py_VISIT(traverse_module_state->__pyx_n_s_cleanup); Py_VISIT(traverse_module_state->__pyx_n_s_clear); Py_VISIT(traverse_module_state->__pyx_n_s_clear_type_cache); Py_VISIT(traverse_module_state->__pyx_n_u_client_channel_binding); Py_VISIT(traverse_module_state->__pyx_n_b_client_encoding); Py_VISIT(traverse_module_state->__pyx_n_u_client_encoding); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_close); Py_VISIT(traverse_module_state->__pyx_n_s_close_portal); Py_VISIT(traverse_module_state->__pyx_n_s_close_statement); Py_VISIT(traverse_module_state->__pyx_n_s_codec); Py_VISIT(traverse_module_state->__pyx_kp_u_codec_for); Py_VISIT(traverse_module_state->__pyx_n_s_codec_set); Py_VISIT(traverse_module_state->__pyx_n_s_codec_str); Py_VISIT(traverse_module_state->__pyx_n_s_codecs); Py_VISIT(traverse_module_state->__pyx_n_s_collections); Py_VISIT(traverse_module_state->__pyx_n_s_collections_abc); Py_VISIT(traverse_module_state->__pyx_n_s_command_timeout); Py_VISIT(traverse_module_state->__pyx_n_s_comp_elem_codecs); Py_VISIT(traverse_module_state->__pyx_n_s_comp_type_attrs); Py_VISIT(traverse_module_state->__pyx_n_s_compat); Py_VISIT(traverse_module_state->__pyx_n_u_composite); Py_VISIT(traverse_module_state->__pyx_n_s_con); Py_VISIT(traverse_module_state->__pyx_n_s_con_params); Py_VISIT(traverse_module_state->__pyx_n_s_config); Py_VISIT(traverse_module_state->__pyx_n_s_connected_fut); Py_VISIT(traverse_module_state->__pyx_n_s_connection); Py_VISIT(traverse_module_state->__pyx_n_s_connection_lost); Py_VISIT(traverse_module_state->__pyx_n_s_connection_made); Py_VISIT(traverse_module_state->__pyx_kp_u_connection_was_closed_in_the_mid); Py_VISIT(traverse_module_state->__pyx_n_s_copy_in); Py_VISIT(traverse_module_state->__pyx_n_s_copy_in_locals_lambda); Py_VISIT(traverse_module_state->__pyx_n_s_copy_out); Py_VISIT(traverse_module_state->__pyx_n_s_copy_out_locals_lambda); Py_VISIT(traverse_module_state->__pyx_n_s_copy_stmt); Py_VISIT(traverse_module_state->__pyx_n_s_core_codec); Py_VISIT(traverse_module_state->__pyx_kp_u_could_not_get_iterations); Py_VISIT(traverse_module_state->__pyx_kp_u_could_not_get_nonce); Py_VISIT(traverse_module_state->__pyx_kp_u_could_not_get_salt); Py_VISIT(traverse_module_state->__pyx_kp_u_could_not_get_server_signature); Py_VISIT(traverse_module_state->__pyx_kp_u_could_not_verify_server_signatur); Py_VISIT(traverse_module_state->__pyx_n_u_cp1250); Py_VISIT(traverse_module_state->__pyx_n_u_cp1251); Py_VISIT(traverse_module_state->__pyx_n_u_cp1252); Py_VISIT(traverse_module_state->__pyx_n_u_cp1253); Py_VISIT(traverse_module_state->__pyx_n_u_cp1254); Py_VISIT(traverse_module_state->__pyx_n_u_cp1255); Py_VISIT(traverse_module_state->__pyx_n_u_cp1256); Py_VISIT(traverse_module_state->__pyx_n_u_cp1257); Py_VISIT(traverse_module_state->__pyx_n_u_cp1258); Py_VISIT(traverse_module_state->__pyx_n_u_cp1521); Py_VISIT(traverse_module_state->__pyx_n_u_cp866); Py_VISIT(traverse_module_state->__pyx_n_u_cp874); Py_VISIT(traverse_module_state->__pyx_n_u_cp932); Py_VISIT(traverse_module_state->__pyx_n_u_cp936); Py_VISIT(traverse_module_state->__pyx_n_u_cp949); Py_VISIT(traverse_module_state->__pyx_n_u_cp950); Py_VISIT(traverse_module_state->__pyx_n_s_create_future); Py_VISIT(traverse_module_state->__pyx_n_s_create_future_fallback); Py_VISIT(traverse_module_state->__pyx_n_s_create_record); Py_VISIT(traverse_module_state->__pyx_n_s_credential); Py_VISIT(traverse_module_state->__pyx_n_u_cstring); Py_VISIT(traverse_module_state->__pyx_n_b_d); Py_VISIT(traverse_module_state->__pyx_n_s_d); Py_VISIT(traverse_module_state->__pyx_n_s_data); Py_VISIT(traverse_module_state->__pyx_n_s_data_gen); Py_VISIT(traverse_module_state->__pyx_n_s_data_received); Py_VISIT(traverse_module_state->__pyx_n_s_data_type); Py_VISIT(traverse_module_state->__pyx_n_s_database); Py_VISIT(traverse_module_state->__pyx_n_u_database); Py_VISIT(traverse_module_state->__pyx_n_u_date); Py_VISIT(traverse_module_state->__pyx_n_u_decimal); Py_VISIT(traverse_module_state->__pyx_n_s_declare_fallback_codec); Py_VISIT(traverse_module_state->__pyx_n_s_decode); Py_VISIT(traverse_module_state->__pyx_kp_u_decode_row_statement_is_None); Py_VISIT(traverse_module_state->__pyx_n_s_decoder); Py_VISIT(traverse_module_state->__pyx_n_s_desc); Py_VISIT(traverse_module_state->__pyx_n_s_detach); Py_VISIT(traverse_module_state->__pyx_n_s_detail); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_n_s_dict_2); Py_VISIT(traverse_module_state->__pyx_n_s_digest); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_doc); Py_VISIT(traverse_module_state->__pyx_n_s_done); Py_VISIT(traverse_module_state->__pyx_kp_u_double_precision); Py_VISIT(traverse_module_state->__pyx_kp_u_duplicate_GSSAPI_SSPI_authentica); Py_VISIT(traverse_module_state->__pyx_n_b_e); Py_VISIT(traverse_module_state->__pyx_n_s_e); Py_VISIT(traverse_module_state->__pyx_n_s_elem); Py_VISIT(traverse_module_state->__pyx_n_s_elem_codec); Py_VISIT(traverse_module_state->__pyx_n_s_elem_delim); Py_VISIT(traverse_module_state->__pyx_n_s_elem_format); Py_VISIT(traverse_module_state->__pyx_n_u_elemdelim); Py_VISIT(traverse_module_state->__pyx_n_s_element_names); Py_VISIT(traverse_module_state->__pyx_n_s_elems); Py_VISIT(traverse_module_state->__pyx_n_u_elemtype); Py_VISIT(traverse_module_state->__pyx_n_u_elemtype_name); Py_VISIT(traverse_module_state->__pyx_n_s_empty); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_encode); Py_VISIT(traverse_module_state->__pyx_n_s_encoder); Py_VISIT(traverse_module_state->__pyx_n_s_enter); Py_VISIT(traverse_module_state->__pyx_n_s_enumerate); Py_VISIT(traverse_module_state->__pyx_n_s_et); Py_VISIT(traverse_module_state->__pyx_n_u_euc_cn); Py_VISIT(traverse_module_state->__pyx_n_u_euc_jis_2004); Py_VISIT(traverse_module_state->__pyx_n_u_euc_jp); Py_VISIT(traverse_module_state->__pyx_n_u_euc_kr); Py_VISIT(traverse_module_state->__pyx_n_u_euccn); Py_VISIT(traverse_module_state->__pyx_n_u_eucjp); Py_VISIT(traverse_module_state->__pyx_n_u_euckr); Py_VISIT(traverse_module_state->__pyx_n_u_event_trigger); Py_VISIT(traverse_module_state->__pyx_n_s_ex); Py_VISIT(traverse_module_state->__pyx_n_s_exc); Py_VISIT(traverse_module_state->__pyx_n_s_exception); Py_VISIT(traverse_module_state->__pyx_n_s_exceptions); Py_VISIT(traverse_module_state->__pyx_n_s_execute); Py_VISIT(traverse_module_state->__pyx_n_s_exit); Py_VISIT(traverse_module_state->__pyx_kp_u_expected_0_1_or_2_elements_in_ra); Py_VISIT(traverse_module_state->__pyx_kp_u_expected_a_sequence_got); Py_VISIT(traverse_module_state->__pyx_kp_u_expected_a_sequence_got_type_r); Py_VISIT(traverse_module_state->__pyx_n_s_f); Py_VISIT(traverse_module_state->__pyx_n_s_family); Py_VISIT(traverse_module_state->__pyx_n_u_fdw_handler); Py_VISIT(traverse_module_state->__pyx_n_u_float4); Py_VISIT(traverse_module_state->__pyx_n_u_float8); Py_VISIT(traverse_module_state->__pyx_n_s_fmt); Py_VISIT(traverse_module_state->__pyx_n_s_format); Py_VISIT(traverse_module_state->__pyx_n_s_formats); Py_VISIT(traverse_module_state->__pyx_n_s_fut); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_genexpr); Py_VISIT(traverse_module_state->__pyx_n_s_get); Py_VISIT(traverse_module_state->__pyx_n_s_get_attributes); Py_VISIT(traverse_module_state->__pyx_n_s_get_data_codec); Py_VISIT(traverse_module_state->__pyx_n_s_get_extra_info); Py_VISIT(traverse_module_state->__pyx_n_s_get_parameters); Py_VISIT(traverse_module_state->__pyx_n_s_get_record_class); Py_VISIT(traverse_module_state->__pyx_n_s_get_remaining_budget); Py_VISIT(traverse_module_state->__pyx_n_s_get_server_pid); Py_VISIT(traverse_module_state->__pyx_n_s_get_settings); Py_VISIT(traverse_module_state->__pyx_n_s_get_text_codec); Py_VISIT(traverse_module_state->__pyx_n_s_get_timeout); Py_VISIT(traverse_module_state->__pyx_n_s_getattribute); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_kp_u_got_result_for_unknown_protocol); Py_VISIT(traverse_module_state->__pyx_n_s_group); Py_VISIT(traverse_module_state->__pyx_n_u_gss); Py_VISIT(traverse_module_state->__pyx_n_s_gssapi); Py_VISIT(traverse_module_state->__pyx_n_u_gssapi); Py_VISIT(traverse_module_state->__pyx_kp_u_gssapi_module_not_found_please_i); Py_VISIT(traverse_module_state->__pyx_n_s_gsslib); Py_VISIT(traverse_module_state->__pyx_n_u_gtsvector); Py_VISIT(traverse_module_state->__pyx_n_s_has_budget_greater_than); Py_VISIT(traverse_module_state->__pyx_n_s_has_text_elements); Py_VISIT(traverse_module_state->__pyx_n_s_hashlib); Py_VISIT(traverse_module_state->__pyx_n_s_hexdigest); Py_VISIT(traverse_module_state->__pyx_n_s_hint); Py_VISIT(traverse_module_state->__pyx_n_s_hmac); Py_VISIT(traverse_module_state->__pyx_n_s_hostbased_service); Py_VISIT(traverse_module_state->__pyx_n_s_i); Py_VISIT(traverse_module_state->__pyx_kp_b_i_d); Py_VISIT(traverse_module_state->__pyx_n_s_ignore_custom_codec); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_kp_u_in_element); Py_VISIT(traverse_module_state->__pyx_n_s_in_table_a1); Py_VISIT(traverse_module_state->__pyx_n_s_in_table_b1); Py_VISIT(traverse_module_state->__pyx_n_s_in_table_c12); Py_VISIT(traverse_module_state->__pyx_n_s_in_table_c21_c22); Py_VISIT(traverse_module_state->__pyx_n_s_in_table_c3); Py_VISIT(traverse_module_state->__pyx_n_s_in_table_c4); Py_VISIT(traverse_module_state->__pyx_n_s_in_table_c5); Py_VISIT(traverse_module_state->__pyx_n_s_in_table_c6); Py_VISIT(traverse_module_state->__pyx_n_s_in_table_c7); Py_VISIT(traverse_module_state->__pyx_n_s_in_table_c8); Py_VISIT(traverse_module_state->__pyx_n_s_in_table_c9); Py_VISIT(traverse_module_state->__pyx_n_s_in_table_d1); Py_VISIT(traverse_module_state->__pyx_n_s_in_table_d2); Py_VISIT(traverse_module_state->__pyx_kp_u_inconsistent_sub_array_dimension); Py_VISIT(traverse_module_state->__pyx_n_u_index_am_handler); Py_VISIT(traverse_module_state->__pyx_n_u_inet); Py_VISIT(traverse_module_state->__pyx_n_s_init); Py_VISIT(traverse_module_state->__pyx_n_s_init_codecs); Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); Py_VISIT(traverse_module_state->__pyx_n_s_init_types); Py_VISIT(traverse_module_state->__pyx_n_s_initializing); Py_VISIT(traverse_module_state->__pyx_n_u_initiate); Py_VISIT(traverse_module_state->__pyx_kp_u_input_of_anonymous_composite_typ); Py_VISIT(traverse_module_state->__pyx_n_s_inspect); Py_VISIT(traverse_module_state->__pyx_n_s_int); Py_VISIT(traverse_module_state->__pyx_n_u_int); Py_VISIT(traverse_module_state->__pyx_n_u_int2); Py_VISIT(traverse_module_state->__pyx_n_u_int4); Py_VISIT(traverse_module_state->__pyx_n_u_int8); Py_VISIT(traverse_module_state->__pyx_n_u_integer); Py_VISIT(traverse_module_state->__pyx_n_u_internal); Py_VISIT(traverse_module_state->__pyx_n_u_interval); Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_array_element); Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_array_element_at_index); Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_data_format); Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_format_argument_expected); Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_input_for_query_argument); Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_input_in_executemany_arg); Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_nonce); Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_timeout_value_expected_n); Py_VISIT(traverse_module_state->__pyx_n_s_is_cancelling); Py_VISIT(traverse_module_state->__pyx_n_s_is_closed); Py_VISIT(traverse_module_state->__pyx_n_s_is_connected); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_n_s_is_in_transaction); Py_VISIT(traverse_module_state->__pyx_n_s_isempty); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_item); Py_VISIT(traverse_module_state->__pyx_n_s_items); Py_VISIT(traverse_module_state->__pyx_n_s_iterator); Py_VISIT(traverse_module_state->__pyx_n_u_json); Py_VISIT(traverse_module_state->__pyx_n_u_jsonb); Py_VISIT(traverse_module_state->__pyx_n_u_jsonpath); Py_VISIT(traverse_module_state->__pyx_n_u_kerberosv5); Py_VISIT(traverse_module_state->__pyx_n_u_kind); Py_VISIT(traverse_module_state->__pyx_n_u_koi8_r); Py_VISIT(traverse_module_state->__pyx_n_u_koi8_u); Py_VISIT(traverse_module_state->__pyx_n_u_koi8r); Py_VISIT(traverse_module_state->__pyx_n_u_koi8u); Py_VISIT(traverse_module_state->__pyx_n_s_krbsrvname); Py_VISIT(traverse_module_state->__pyx_n_u_language_handler); Py_VISIT(traverse_module_state->__pyx_n_s_limit); Py_VISIT(traverse_module_state->__pyx_n_u_line); Py_VISIT(traverse_module_state->__pyx_kp_u_list_tuple_or_Range_object_expec); Py_VISIT(traverse_module_state->__pyx_n_s_lookup); Py_VISIT(traverse_module_state->__pyx_n_s_loop); Py_VISIT(traverse_module_state->__pyx_n_s_lower); Py_VISIT(traverse_module_state->__pyx_n_s_lower_inc); Py_VISIT(traverse_module_state->__pyx_n_u_lseg); Py_VISIT(traverse_module_state->__pyx_n_b_m); Py_VISIT(traverse_module_state->__pyx_n_u_macaddr); Py_VISIT(traverse_module_state->__pyx_n_u_macaddr8); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_kp_u_malformed_array_literal_r); Py_VISIT(traverse_module_state->__pyx_n_s_mapping); Py_VISIT(traverse_module_state->__pyx_n_s_mark_closed); Py_VISIT(traverse_module_state->__pyx_n_s_mark_unprepared); Py_VISIT(traverse_module_state->__pyx_n_b_md5); Py_VISIT(traverse_module_state->__pyx_n_s_md5); Py_VISIT(traverse_module_state->__pyx_n_u_md5); Py_VISIT(traverse_module_state->__pyx_n_u_message); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); Py_VISIT(traverse_module_state->__pyx_n_s_missing); Py_VISIT(traverse_module_state->__pyx_kp_u_missing_after_array_dimensions); Py_VISIT(traverse_module_state->__pyx_kp_u_missing_after_array_dimensions_2); Py_VISIT(traverse_module_state->__pyx_kp_u_missing_array_dimension_value); Py_VISIT(traverse_module_state->__pyx_kp_u_missing_codec_information_for_OI); Py_VISIT(traverse_module_state->__pyx_n_s_module); Py_VISIT(traverse_module_state->__pyx_n_u_money); Py_VISIT(traverse_module_state->__pyx_n_s_monotonic); Py_VISIT(traverse_module_state->__pyx_n_s_more); Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); Py_VISIT(traverse_module_state->__pyx_n_u_multirange); Py_VISIT(traverse_module_state->__pyx_kp_b_n); Py_VISIT(traverse_module_state->__pyx_kp_b_n_2); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_u_name); Py_VISIT(traverse_module_state->__pyx_n_s_name_2); Py_VISIT(traverse_module_state->__pyx_kp_u_named_prepared_statements_cannot); Py_VISIT(traverse_module_state->__pyx_n_s_new); Py_VISIT(traverse_module_state->__pyx_n_s_new_2); Py_VISIT(traverse_module_state->__pyx_kp_u_no_binary_format_encoder_for_typ); Py_VISIT(traverse_module_state->__pyx_kp_u_no_codec_for_composite_attribute); Py_VISIT(traverse_module_state->__pyx_kp_u_no_decoder_for_OID); Py_VISIT(traverse_module_state->__pyx_kp_u_no_decoder_for_composite_type_el); Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); Py_VISIT(traverse_module_state->__pyx_kp_u_no_encoder_for_OID); Py_VISIT(traverse_module_state->__pyx_kp_u_non_homogeneous_array); Py_VISIT(traverse_module_state->__pyx_n_s_normalize); Py_VISIT(traverse_module_state->__pyx_kp_u_not_connected); Py_VISIT(traverse_module_state->__pyx_n_u_ns); Py_VISIT(traverse_module_state->__pyx_n_s_num_cols); Py_VISIT(traverse_module_state->__pyx_kp_u_number_of_array_dimensions_excee); Py_VISIT(traverse_module_state->__pyx_n_u_numeric); Py_VISIT(traverse_module_state->__pyx_n_s_object); Py_VISIT(traverse_module_state->__pyx_kp_u_of_executemany_sequence); Py_VISIT(traverse_module_state->__pyx_n_s_oid); Py_VISIT(traverse_module_state->__pyx_n_u_oid); Py_VISIT(traverse_module_state->__pyx_kp_u_oid_2); Py_VISIT(traverse_module_state->__pyx_n_s_on_error); Py_VISIT(traverse_module_state->__pyx_kp_u_on_result__prepare_statement_is); Py_VISIT(traverse_module_state->__pyx_kp_u_on_result_waiter_is_None); Py_VISIT(traverse_module_state->__pyx_kp_u_on_result_waiter_is_done); Py_VISIT(traverse_module_state->__pyx_n_s_on_timeout); Py_VISIT(traverse_module_state->__pyx_n_s_on_waiter_completed); Py_VISIT(traverse_module_state->__pyx_n_u_opaque); Py_VISIT(traverse_module_state->__pyx_kp_b_p); Py_VISIT(traverse_module_state->__pyx_n_s_p_oid); Py_VISIT(traverse_module_state->__pyx_kp_u_parse_data_msgs_first_message_i); Py_VISIT(traverse_module_state->__pyx_kp_u_parse_data_msgs_result_is_not_a); Py_VISIT(traverse_module_state->__pyx_n_s_password); Py_VISIT(traverse_module_state->__pyx_n_u_password); Py_VISIT(traverse_module_state->__pyx_n_u_password_iterations); Py_VISIT(traverse_module_state->__pyx_n_u_password_salt); Py_VISIT(traverse_module_state->__pyx_n_u_path); Py_VISIT(traverse_module_state->__pyx_n_s_pause_reading); Py_VISIT(traverse_module_state->__pyx_n_s_pause_writing); Py_VISIT(traverse_module_state->__pyx_n_u_pg_brin_bloom_summary); Py_VISIT(traverse_module_state->__pyx_n_u_pg_brin_minmax_multi_summary); Py_VISIT(traverse_module_state->__pyx_n_u_pg_catalog); Py_VISIT(traverse_module_state->__pyx_kp_u_pg_contrib_hstore); Py_VISIT(traverse_module_state->__pyx_n_u_pg_ddl_command); Py_VISIT(traverse_module_state->__pyx_n_u_pg_dependencies); Py_VISIT(traverse_module_state->__pyx_n_u_pg_lsn); Py_VISIT(traverse_module_state->__pyx_n_u_pg_mcv_list); Py_VISIT(traverse_module_state->__pyx_n_u_pg_ndistinct); Py_VISIT(traverse_module_state->__pyx_n_u_pg_node_tree); Py_VISIT(traverse_module_state->__pyx_n_u_pg_snapshot); Py_VISIT(traverse_module_state->__pyx_n_s_pickle); Py_VISIT(traverse_module_state->__pyx_n_u_point); Py_VISIT(traverse_module_state->__pyx_n_u_polygon); Py_VISIT(traverse_module_state->__pyx_n_s_pop); Py_VISIT(traverse_module_state->__pyx_n_s_portal_name); Py_VISIT(traverse_module_state->__pyx_n_s_position); Py_VISIT(traverse_module_state->__pyx_n_u_postgres); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_prepare_2); Py_VISIT(traverse_module_state->__pyx_n_s_process_log_message); Py_VISIT(traverse_module_state->__pyx_n_s_process_notification); Py_VISIT(traverse_module_state->__pyx_n_s_protocol); Py_VISIT(traverse_module_state->__pyx_kp_u_protocol_is_in_an_unexpected_st); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_capi); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_BaseProtocol); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_CoreProtocol); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_DataCodecConfig); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_n_s_query); Py_VISIT(traverse_module_state->__pyx_kp_u_query_argument); Py_VISIT(traverse_module_state->__pyx_n_b_r); Py_VISIT(traverse_module_state->__pyx_kp_b_r_2); Py_VISIT(traverse_module_state->__pyx_kp_b_r_3); Py_VISIT(traverse_module_state->__pyx_kp_u_r_is_not_a_valid_element_of_com); Py_VISIT(traverse_module_state->__pyx_n_s_range); Py_VISIT(traverse_module_state->__pyx_n_u_range); Py_VISIT(traverse_module_state->__pyx_n_u_range_subtype); Py_VISIT(traverse_module_state->__pyx_n_u_range_subtype_name); Py_VISIT(traverse_module_state->__pyx_n_s_range_subtype_oid); Py_VISIT(traverse_module_state->__pyx_n_s_rdesc); Py_VISIT(traverse_module_state->__pyx_n_s_re); Py_VISIT(traverse_module_state->__pyx_n_s_reader); Py_VISIT(traverse_module_state->__pyx_kp_u_reader_is_not_an_asynchronous_it); Py_VISIT(traverse_module_state->__pyx_n_u_real); Py_VISIT(traverse_module_state->__pyx_n_s_rec); Py_VISIT(traverse_module_state->__pyx_n_u_record); Py_VISIT(traverse_module_state->__pyx_n_s_record_class); Py_VISIT(traverse_module_state->__pyx_n_s_record_stmt); Py_VISIT(traverse_module_state->__pyx_n_s_records); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_ref); Py_VISIT(traverse_module_state->__pyx_n_u_refcursor); Py_VISIT(traverse_module_state->__pyx_n_u_regclass); Py_VISIT(traverse_module_state->__pyx_n_u_regcollation); Py_VISIT(traverse_module_state->__pyx_n_u_regconfig); Py_VISIT(traverse_module_state->__pyx_n_u_regdictionary); Py_VISIT(traverse_module_state->__pyx_n_s_register_data_types); Py_VISIT(traverse_module_state->__pyx_n_u_regnamespace); Py_VISIT(traverse_module_state->__pyx_n_u_regoper); Py_VISIT(traverse_module_state->__pyx_n_u_regoperator); Py_VISIT(traverse_module_state->__pyx_n_u_regproc); Py_VISIT(traverse_module_state->__pyx_n_u_regprocedure); Py_VISIT(traverse_module_state->__pyx_n_u_regrole); Py_VISIT(traverse_module_state->__pyx_n_u_regtype); Py_VISIT(traverse_module_state->__pyx_n_s_release); Py_VISIT(traverse_module_state->__pyx_n_u_reltime); Py_VISIT(traverse_module_state->__pyx_n_s_remove_python_codec); Py_VISIT(traverse_module_state->__pyx_n_s_request_cancel); Py_VISIT(traverse_module_state->__pyx_n_s_result); Py_VISIT(traverse_module_state->__pyx_n_s_resume_reading); Py_VISIT(traverse_module_state->__pyx_n_s_resume_writing); Py_VISIT(traverse_module_state->__pyx_n_s_return_extra); Py_VISIT(traverse_module_state->__pyx_n_s_return_rows); Py_VISIT(traverse_module_state->__pyx_n_s_reversed); Py_VISIT(traverse_module_state->__pyx_n_s_row); Py_VISIT(traverse_module_state->__pyx_kp_b_s); Py_VISIT(traverse_module_state->__pyx_n_s_s_2); Py_VISIT(traverse_module_state->__pyx_n_u_s_2); Py_VISIT(traverse_module_state->__pyx_n_u_scalar); Py_VISIT(traverse_module_state->__pyx_n_s_schema); Py_VISIT(traverse_module_state->__pyx_kp_u_scram_sha_256); Py_VISIT(traverse_module_state->__pyx_n_s_search); Py_VISIT(traverse_module_state->__pyx_n_s_secrets); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_send); Py_VISIT(traverse_module_state->__pyx_n_u_server_first_message); Py_VISIT(traverse_module_state->__pyx_n_u_server_nonce); Py_VISIT(traverse_module_state->__pyx_n_s_server_settings); Py_VISIT(traverse_module_state->__pyx_n_s_set); Py_VISIT(traverse_module_state->__pyx_n_s_set_builtin_type_codec); Py_VISIT(traverse_module_state->__pyx_n_s_set_builtin_type_codec_2); Py_VISIT(traverse_module_state->__pyx_n_s_set_connection); Py_VISIT(traverse_module_state->__pyx_n_s_set_exception); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); Py_VISIT(traverse_module_state->__pyx_n_s_set_result); Py_VISIT(traverse_module_state->__pyx_n_s_setsockopt); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_settings); Py_VISIT(traverse_module_state->__pyx_n_s_sha256); Py_VISIT(traverse_module_state->__pyx_n_u_shift_jis); Py_VISIT(traverse_module_state->__pyx_n_u_shift_jis_2004); Py_VISIT(traverse_module_state->__pyx_n_s_sink); Py_VISIT(traverse_module_state->__pyx_kp_u_size_of_encoded_multirange_datum); Py_VISIT(traverse_module_state->__pyx_n_u_sjis); Py_VISIT(traverse_module_state->__pyx_n_s_sleep); Py_VISIT(traverse_module_state->__pyx_n_u_smallint); Py_VISIT(traverse_module_state->__pyx_n_u_smgr); Py_VISIT(traverse_module_state->__pyx_n_s_sock); Py_VISIT(traverse_module_state->__pyx_n_s_socket); Py_VISIT(traverse_module_state->__pyx_n_u_socket); Py_VISIT(traverse_module_state->__pyx_n_s_spec); Py_VISIT(traverse_module_state->__pyx_kp_u_specified_array_dimensions_do_no); Py_VISIT(traverse_module_state->__pyx_n_u_sql_ascii); Py_VISIT(traverse_module_state->__pyx_n_u_sspi); Py_VISIT(traverse_module_state->__pyx_n_s_sspilib); Py_VISIT(traverse_module_state->__pyx_kp_u_sspilib_module_not_found_please); Py_VISIT(traverse_module_state->__pyx_n_s_started); Py_VISIT(traverse_module_state->__pyx_n_s_startswith); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_n_s_status_msg); Py_VISIT(traverse_module_state->__pyx_n_s_step); Py_VISIT(traverse_module_state->__pyx_n_s_stmt_name); Py_VISIT(traverse_module_state->__pyx_n_s_str); Py_VISIT(traverse_module_state->__pyx_n_s_stringprep); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_n_u_table_am_handler); Py_VISIT(traverse_module_state->__pyx_n_s_target_codec); Py_VISIT(traverse_module_state->__pyx_n_s_target_name); Py_VISIT(traverse_module_state->__pyx_n_s_tb); Py_VISIT(traverse_module_state->__pyx_n_u_tcvn); Py_VISIT(traverse_module_state->__pyx_n_u_tcvn5712); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_u_text); Py_VISIT(traverse_module_state->__pyx_kp_u_text_2); Py_VISIT(traverse_module_state->__pyx_kp_u_text_binary_or_tuple); Py_VISIT(traverse_module_state->__pyx_kp_u_text_or_binary); Py_VISIT(traverse_module_state->__pyx_kp_u_text_or_binary_2); Py_VISIT(traverse_module_state->__pyx_kp_u_the_number_of_columns_in_the_res); Py_VISIT(traverse_module_state->__pyx_kp_u_the_number_of_query_arguments_ca); Py_VISIT(traverse_module_state->__pyx_kp_u_the_server_expects_x_argument_s); Py_VISIT(traverse_module_state->__pyx_kp_u_there_is_no); Py_VISIT(traverse_module_state->__pyx_n_s_throw); Py_VISIT(traverse_module_state->__pyx_n_s_ti); Py_VISIT(traverse_module_state->__pyx_n_u_tid); Py_VISIT(traverse_module_state->__pyx_n_s_time); Py_VISIT(traverse_module_state->__pyx_n_u_time); Py_VISIT(traverse_module_state->__pyx_kp_u_time_with_timezone); Py_VISIT(traverse_module_state->__pyx_kp_u_time_without_timezone); Py_VISIT(traverse_module_state->__pyx_n_s_timeout); Py_VISIT(traverse_module_state->__pyx_n_s_timer); Py_VISIT(traverse_module_state->__pyx_n_u_timestamp); Py_VISIT(traverse_module_state->__pyx_kp_u_timestamp_with_timezone); Py_VISIT(traverse_module_state->__pyx_kp_u_timestamp_without_timezone); Py_VISIT(traverse_module_state->__pyx_n_u_timestamptz); Py_VISIT(traverse_module_state->__pyx_n_u_timetz); Py_VISIT(traverse_module_state->__pyx_n_u_tinterval); Py_VISIT(traverse_module_state->__pyx_kp_u_to); Py_VISIT(traverse_module_state->__pyx_n_s_to_bytes); Py_VISIT(traverse_module_state->__pyx_n_s_token_bytes); Py_VISIT(traverse_module_state->__pyx_kp_u_too_many_elements_in_array_value); Py_VISIT(traverse_module_state->__pyx_kp_u_too_many_elements_in_composite_t); Py_VISIT(traverse_module_state->__pyx_kp_u_too_many_elements_in_multirange); Py_VISIT(traverse_module_state->__pyx_n_s_transport); Py_VISIT(traverse_module_state->__pyx_n_u_trigger); Py_VISIT(traverse_module_state->__pyx_n_u_tsm_handler); Py_VISIT(traverse_module_state->__pyx_n_u_tsquery); Py_VISIT(traverse_module_state->__pyx_n_u_tsvector); Py_VISIT(traverse_module_state->__pyx_n_u_tuple); Py_VISIT(traverse_module_state->__pyx_n_u_txid_snapshot); Py_VISIT(traverse_module_state->__pyx_kp_u_type_does_not_support_the_tuple); Py_VISIT(traverse_module_state->__pyx_kp_u_type_record_missing_base_type_fo); Py_VISIT(traverse_module_state->__pyx_kp_u_type_record_missing_base_type_fo_2); Py_VISIT(traverse_module_state->__pyx_kp_u_type_record_missing_base_type_fo_3); Py_VISIT(traverse_module_state->__pyx_kp_u_type_record_missing_field_types); Py_VISIT(traverse_module_state->__pyx_n_s_typeinfos); Py_VISIT(traverse_module_state->__pyx_n_s_typekind); Py_VISIT(traverse_module_state->__pyx_n_s_typename); Py_VISIT(traverse_module_state->__pyx_n_s_typeoid); Py_VISIT(traverse_module_state->__pyx_n_s_types); Py_VISIT(traverse_module_state->__pyx_n_s_typeschema); Py_VISIT(traverse_module_state->__pyx_n_s_typoid); Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_NULL_element_in_multi); Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_array_dimension_size); Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_array_dimensions_valu); Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_character_r_at_positi); Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_codec_type); Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_data_format); Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_data_type_of_composit); Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_end_of_string); Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_error_while_performin); Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_exchange_format); Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_multirange_size_value); Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_number_of_attributes); Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_trailing_bytes_in_buf); Py_VISIT(traverse_module_state->__pyx_kp_u_unhandled_standard_data_type); Py_VISIT(traverse_module_state->__pyx_n_u_unicode); Py_VISIT(traverse_module_state->__pyx_n_s_unicodedata); Py_VISIT(traverse_module_state->__pyx_n_u_unknown); Py_VISIT(traverse_module_state->__pyx_kp_u_unknown_error_in_protocol_implem); Py_VISIT(traverse_module_state->__pyx_kp_u_unsupported_SASL_Authentication); Py_VISIT(traverse_module_state->__pyx_kp_u_unsupported_authentication_metho); Py_VISIT(traverse_module_state->__pyx_n_s_update); Py_VISIT(traverse_module_state->__pyx_n_s_upper); Py_VISIT(traverse_module_state->__pyx_n_s_upper_inc); Py_VISIT(traverse_module_state->__pyx_n_s_usage); Py_VISIT(traverse_module_state->__pyx_n_s_use_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_user); Py_VISIT(traverse_module_state->__pyx_n_u_user); Py_VISIT(traverse_module_state->__pyx_kp_u_utf_8); Py_VISIT(traverse_module_state->__pyx_n_u_utf_8_2); Py_VISIT(traverse_module_state->__pyx_n_u_uuid); Py_VISIT(traverse_module_state->__pyx_kp_b_v); Py_VISIT(traverse_module_state->__pyx_n_u_varbit); Py_VISIT(traverse_module_state->__pyx_n_u_varchar); Py_VISIT(traverse_module_state->__pyx_n_u_void); Py_VISIT(traverse_module_state->__pyx_n_u_vscii); Py_VISIT(traverse_module_state->__pyx_n_s_w); Py_VISIT(traverse_module_state->__pyx_n_s_wait); Py_VISIT(traverse_module_state->__pyx_n_s_wait_for); Py_VISIT(traverse_module_state->__pyx_n_s_wait_for_cancellation); Py_VISIT(traverse_module_state->__pyx_n_s_waiter); Py_VISIT(traverse_module_state->__pyx_kp_u_waiter_is_not_done_while_handlin); Py_VISIT(traverse_module_state->__pyx_n_u_was); Py_VISIT(traverse_module_state->__pyx_n_s_wbuf); Py_VISIT(traverse_module_state->__pyx_n_s_weakref); Py_VISIT(traverse_module_state->__pyx_n_u_were); Py_VISIT(traverse_module_state->__pyx_n_u_win); Py_VISIT(traverse_module_state->__pyx_n_u_win1250); Py_VISIT(traverse_module_state->__pyx_n_u_win1251); Py_VISIT(traverse_module_state->__pyx_n_u_win1252); Py_VISIT(traverse_module_state->__pyx_n_u_win1253); Py_VISIT(traverse_module_state->__pyx_n_u_win1254); Py_VISIT(traverse_module_state->__pyx_n_u_win1255); Py_VISIT(traverse_module_state->__pyx_n_u_win1256); Py_VISIT(traverse_module_state->__pyx_n_u_win1257); Py_VISIT(traverse_module_state->__pyx_n_u_win1258); Py_VISIT(traverse_module_state->__pyx_n_u_win866); Py_VISIT(traverse_module_state->__pyx_n_u_win874); Py_VISIT(traverse_module_state->__pyx_n_u_win932); Py_VISIT(traverse_module_state->__pyx_n_u_win936); Py_VISIT(traverse_module_state->__pyx_n_u_win949); Py_VISIT(traverse_module_state->__pyx_n_u_win950); Py_VISIT(traverse_module_state->__pyx_n_u_windows1250); Py_VISIT(traverse_module_state->__pyx_n_u_windows1251); Py_VISIT(traverse_module_state->__pyx_n_u_windows1252); Py_VISIT(traverse_module_state->__pyx_n_u_windows1253); Py_VISIT(traverse_module_state->__pyx_n_u_windows1254); Py_VISIT(traverse_module_state->__pyx_n_u_windows1255); Py_VISIT(traverse_module_state->__pyx_n_u_windows1256); Py_VISIT(traverse_module_state->__pyx_n_u_windows1257); Py_VISIT(traverse_module_state->__pyx_n_u_windows1258); Py_VISIT(traverse_module_state->__pyx_n_u_windows866); Py_VISIT(traverse_module_state->__pyx_n_u_windows874); Py_VISIT(traverse_module_state->__pyx_n_u_windows932); Py_VISIT(traverse_module_state->__pyx_n_u_windows936); Py_VISIT(traverse_module_state->__pyx_n_u_windows949); Py_VISIT(traverse_module_state->__pyx_n_u_windows950); Py_VISIT(traverse_module_state->__pyx_n_s_with_msg); Py_VISIT(traverse_module_state->__pyx_n_s_write); Py_VISIT(traverse_module_state->__pyx_n_s_writelines); Py_VISIT(traverse_module_state->__pyx_n_s_writing_allowed); Py_VISIT(traverse_module_state->__pyx_n_s_x); Py_VISIT(traverse_module_state->__pyx_n_s_xformat); Py_VISIT(traverse_module_state->__pyx_n_u_xid); Py_VISIT(traverse_module_state->__pyx_n_u_xid8); Py_VISIT(traverse_module_state->__pyx_n_u_xml); Py_VISIT(traverse_module_state->__pyx_n_s_y); Py_VISIT(traverse_module_state->__pyx_kp_u_you_need_values_from_server_to_g); Py_VISIT(traverse_module_state->__pyx_n_s_zip); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_4); Py_VISIT(traverse_module_state->__pyx_int_6); Py_VISIT(traverse_module_state->__pyx_int_16); Py_VISIT(traverse_module_state->__pyx_int_17); Py_VISIT(traverse_module_state->__pyx_int_18); Py_VISIT(traverse_module_state->__pyx_int_19); Py_VISIT(traverse_module_state->__pyx_int_20); Py_VISIT(traverse_module_state->__pyx_int_21); Py_VISIT(traverse_module_state->__pyx_int_23); Py_VISIT(traverse_module_state->__pyx_int_24); Py_VISIT(traverse_module_state->__pyx_int_25); Py_VISIT(traverse_module_state->__pyx_int_26); Py_VISIT(traverse_module_state->__pyx_int_27); Py_VISIT(traverse_module_state->__pyx_int_28); Py_VISIT(traverse_module_state->__pyx_int_29); Py_VISIT(traverse_module_state->__pyx_int_32); Py_VISIT(traverse_module_state->__pyx_int_40); Py_VISIT(traverse_module_state->__pyx_int_114); Py_VISIT(traverse_module_state->__pyx_int_142); Py_VISIT(traverse_module_state->__pyx_int_194); Py_VISIT(traverse_module_state->__pyx_int_210); Py_VISIT(traverse_module_state->__pyx_int_269); Py_VISIT(traverse_module_state->__pyx_int_325); Py_VISIT(traverse_module_state->__pyx_int_600); Py_VISIT(traverse_module_state->__pyx_int_601); Py_VISIT(traverse_module_state->__pyx_int_602); Py_VISIT(traverse_module_state->__pyx_int_603); Py_VISIT(traverse_module_state->__pyx_int_604); Py_VISIT(traverse_module_state->__pyx_int_628); Py_VISIT(traverse_module_state->__pyx_int_650); Py_VISIT(traverse_module_state->__pyx_int_700); Py_VISIT(traverse_module_state->__pyx_int_701); Py_VISIT(traverse_module_state->__pyx_int_702); Py_VISIT(traverse_module_state->__pyx_int_703); Py_VISIT(traverse_module_state->__pyx_int_704); Py_VISIT(traverse_module_state->__pyx_int_705); Py_VISIT(traverse_module_state->__pyx_int_718); Py_VISIT(traverse_module_state->__pyx_int_774); Py_VISIT(traverse_module_state->__pyx_int_790); Py_VISIT(traverse_module_state->__pyx_int_829); Py_VISIT(traverse_module_state->__pyx_int_869); Py_VISIT(traverse_module_state->__pyx_int_1009); Py_VISIT(traverse_module_state->__pyx_int_1028); Py_VISIT(traverse_module_state->__pyx_int_1033); Py_VISIT(traverse_module_state->__pyx_int_1042); Py_VISIT(traverse_module_state->__pyx_int_1043); Py_VISIT(traverse_module_state->__pyx_int_1082); Py_VISIT(traverse_module_state->__pyx_int_1083); Py_VISIT(traverse_module_state->__pyx_int_1114); Py_VISIT(traverse_module_state->__pyx_int_1184); Py_VISIT(traverse_module_state->__pyx_int_1186); Py_VISIT(traverse_module_state->__pyx_int_1266); Py_VISIT(traverse_module_state->__pyx_int_1560); Py_VISIT(traverse_module_state->__pyx_int_1562); Py_VISIT(traverse_module_state->__pyx_int_1700); Py_VISIT(traverse_module_state->__pyx_int_1790); Py_VISIT(traverse_module_state->__pyx_int_2202); Py_VISIT(traverse_module_state->__pyx_int_2203); Py_VISIT(traverse_module_state->__pyx_int_2204); Py_VISIT(traverse_module_state->__pyx_int_2205); Py_VISIT(traverse_module_state->__pyx_int_2206); Py_VISIT(traverse_module_state->__pyx_int_2249); Py_VISIT(traverse_module_state->__pyx_int_2275); Py_VISIT(traverse_module_state->__pyx_int_2276); Py_VISIT(traverse_module_state->__pyx_int_2277); Py_VISIT(traverse_module_state->__pyx_int_2278); Py_VISIT(traverse_module_state->__pyx_int_2279); Py_VISIT(traverse_module_state->__pyx_int_2280); Py_VISIT(traverse_module_state->__pyx_int_2281); Py_VISIT(traverse_module_state->__pyx_int_2282); Py_VISIT(traverse_module_state->__pyx_int_2283); Py_VISIT(traverse_module_state->__pyx_int_2776); Py_VISIT(traverse_module_state->__pyx_int_2950); Py_VISIT(traverse_module_state->__pyx_int_2970); Py_VISIT(traverse_module_state->__pyx_int_3115); Py_VISIT(traverse_module_state->__pyx_int_3220); Py_VISIT(traverse_module_state->__pyx_int_3310); Py_VISIT(traverse_module_state->__pyx_int_3361); Py_VISIT(traverse_module_state->__pyx_int_3402); Py_VISIT(traverse_module_state->__pyx_int_3500); Py_VISIT(traverse_module_state->__pyx_int_3614); Py_VISIT(traverse_module_state->__pyx_int_3615); Py_VISIT(traverse_module_state->__pyx_int_3642); Py_VISIT(traverse_module_state->__pyx_int_3734); Py_VISIT(traverse_module_state->__pyx_int_3769); Py_VISIT(traverse_module_state->__pyx_int_3802); Py_VISIT(traverse_module_state->__pyx_int_3831); Py_VISIT(traverse_module_state->__pyx_int_3838); Py_VISIT(traverse_module_state->__pyx_int_4072); Py_VISIT(traverse_module_state->__pyx_int_4089); Py_VISIT(traverse_module_state->__pyx_int_4096); Py_VISIT(traverse_module_state->__pyx_int_4191); Py_VISIT(traverse_module_state->__pyx_int_4537); Py_VISIT(traverse_module_state->__pyx_int_4538); Py_VISIT(traverse_module_state->__pyx_int_4600); Py_VISIT(traverse_module_state->__pyx_int_4601); Py_VISIT(traverse_module_state->__pyx_int_5017); Py_VISIT(traverse_module_state->__pyx_int_5038); Py_VISIT(traverse_module_state->__pyx_int_5069); Py_VISIT(traverse_module_state->__pyx_int_5077); Py_VISIT(traverse_module_state->__pyx_int_5078); Py_VISIT(traverse_module_state->__pyx_int_5079); Py_VISIT(traverse_module_state->__pyx_int_5080); Py_VISIT(traverse_module_state->__pyx_int_32768); Py_VISIT(traverse_module_state->__pyx_int_524288); Py_VISIT(traverse_module_state->__pyx_int_40941617); Py_VISIT(traverse_module_state->__pyx_int_89793719); Py_VISIT(traverse_module_state->__pyx_int_120810133); Py_VISIT(traverse_module_state->__pyx_int_134522893); Py_VISIT(traverse_module_state->__pyx_int_175807176); Py_VISIT(traverse_module_state->__pyx_int_228230485); Py_VISIT(traverse_module_state->__pyx_int_232227937); Py_VISIT(traverse_module_state->__pyx_int_245762207); Py_VISIT(traverse_module_state->__pyx_int_252635979); Py_VISIT(traverse_module_state->__pyx_k__6); Py_VISIT(traverse_module_state->__pyx_k__7); Py_VISIT(traverse_module_state->__pyx_slice__4); Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_slice__43); Py_VISIT(traverse_module_state->__pyx_tuple__12); Py_VISIT(traverse_module_state->__pyx_tuple__13); Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__16); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__18); Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__20); Py_VISIT(traverse_module_state->__pyx_tuple__21); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__25); Py_VISIT(traverse_module_state->__pyx_tuple__26); Py_VISIT(traverse_module_state->__pyx_tuple__27); Py_VISIT(traverse_module_state->__pyx_tuple__28); Py_VISIT(traverse_module_state->__pyx_tuple__29); Py_VISIT(traverse_module_state->__pyx_tuple__30); Py_VISIT(traverse_module_state->__pyx_tuple__49); Py_VISIT(traverse_module_state->__pyx_tuple__56); Py_VISIT(traverse_module_state->__pyx_tuple__60); Py_VISIT(traverse_module_state->__pyx_tuple__61); Py_VISIT(traverse_module_state->__pyx_tuple__62); Py_VISIT(traverse_module_state->__pyx_tuple__63); Py_VISIT(traverse_module_state->__pyx_tuple__64); Py_VISIT(traverse_module_state->__pyx_tuple__65); Py_VISIT(traverse_module_state->__pyx_tuple__67); Py_VISIT(traverse_module_state->__pyx_tuple__69); Py_VISIT(traverse_module_state->__pyx_tuple__71); Py_VISIT(traverse_module_state->__pyx_tuple__74); Py_VISIT(traverse_module_state->__pyx_tuple__76); Py_VISIT(traverse_module_state->__pyx_tuple__79); Py_VISIT(traverse_module_state->__pyx_tuple__83); Py_VISIT(traverse_module_state->__pyx_tuple__85); Py_VISIT(traverse_module_state->__pyx_tuple__87); Py_VISIT(traverse_module_state->__pyx_tuple__89); Py_VISIT(traverse_module_state->__pyx_tuple__93); Py_VISIT(traverse_module_state->__pyx_tuple__95); Py_VISIT(traverse_module_state->__pyx_tuple__103); Py_VISIT(traverse_module_state->__pyx_tuple__105); Py_VISIT(traverse_module_state->__pyx_tuple__107); Py_VISIT(traverse_module_state->__pyx_tuple__116); Py_VISIT(traverse_module_state->__pyx_tuple__121); Py_VISIT(traverse_module_state->__pyx_tuple__122); Py_VISIT(traverse_module_state->__pyx_tuple__123); Py_VISIT(traverse_module_state->__pyx_tuple__124); Py_VISIT(traverse_module_state->__pyx_tuple__125); Py_VISIT(traverse_module_state->__pyx_tuple__126); Py_VISIT(traverse_module_state->__pyx_tuple__127); Py_VISIT(traverse_module_state->__pyx_tuple__128); Py_VISIT(traverse_module_state->__pyx_tuple__129); Py_VISIT(traverse_module_state->__pyx_tuple__130); Py_VISIT(traverse_module_state->__pyx_tuple__134); Py_VISIT(traverse_module_state->__pyx_tuple__135); Py_VISIT(traverse_module_state->__pyx_tuple__137); Py_VISIT(traverse_module_state->__pyx_tuple__143); Py_VISIT(traverse_module_state->__pyx_tuple__145); Py_VISIT(traverse_module_state->__pyx_tuple__147); Py_VISIT(traverse_module_state->__pyx_tuple__153); Py_VISIT(traverse_module_state->__pyx_tuple__156); Py_VISIT(traverse_module_state->__pyx_tuple__159); Py_VISIT(traverse_module_state->__pyx_tuple__161); Py_VISIT(traverse_module_state->__pyx_tuple__163); Py_VISIT(traverse_module_state->__pyx_codeobj__46); Py_VISIT(traverse_module_state->__pyx_codeobj__47); Py_VISIT(traverse_module_state->__pyx_codeobj__48); Py_VISIT(traverse_module_state->__pyx_codeobj__50); Py_VISIT(traverse_module_state->__pyx_codeobj__51); Py_VISIT(traverse_module_state->__pyx_codeobj__52); Py_VISIT(traverse_module_state->__pyx_codeobj__53); Py_VISIT(traverse_module_state->__pyx_codeobj__54); Py_VISIT(traverse_module_state->__pyx_codeobj__55); Py_VISIT(traverse_module_state->__pyx_codeobj__57); Py_VISIT(traverse_module_state->__pyx_codeobj__58); Py_VISIT(traverse_module_state->__pyx_codeobj__59); Py_VISIT(traverse_module_state->__pyx_codeobj__66); Py_VISIT(traverse_module_state->__pyx_codeobj__68); Py_VISIT(traverse_module_state->__pyx_codeobj__70); Py_VISIT(traverse_module_state->__pyx_codeobj__72); Py_VISIT(traverse_module_state->__pyx_codeobj__73); Py_VISIT(traverse_module_state->__pyx_codeobj__75); Py_VISIT(traverse_module_state->__pyx_codeobj__77); Py_VISIT(traverse_module_state->__pyx_codeobj__78); Py_VISIT(traverse_module_state->__pyx_codeobj__80); Py_VISIT(traverse_module_state->__pyx_codeobj__81); Py_VISIT(traverse_module_state->__pyx_codeobj__82); Py_VISIT(traverse_module_state->__pyx_codeobj__84); Py_VISIT(traverse_module_state->__pyx_codeobj__86); Py_VISIT(traverse_module_state->__pyx_codeobj__88); Py_VISIT(traverse_module_state->__pyx_codeobj__90); Py_VISIT(traverse_module_state->__pyx_codeobj__91); Py_VISIT(traverse_module_state->__pyx_codeobj__92); Py_VISIT(traverse_module_state->__pyx_codeobj__94); Py_VISIT(traverse_module_state->__pyx_codeobj__96); Py_VISIT(traverse_module_state->__pyx_codeobj__97); Py_VISIT(traverse_module_state->__pyx_codeobj__98); Py_VISIT(traverse_module_state->__pyx_codeobj__99); Py_VISIT(traverse_module_state->__pyx_codeobj__100); Py_VISIT(traverse_module_state->__pyx_codeobj__101); Py_VISIT(traverse_module_state->__pyx_codeobj__102); Py_VISIT(traverse_module_state->__pyx_codeobj__104); Py_VISIT(traverse_module_state->__pyx_codeobj__106); Py_VISIT(traverse_module_state->__pyx_codeobj__108); Py_VISIT(traverse_module_state->__pyx_codeobj__109); Py_VISIT(traverse_module_state->__pyx_codeobj__110); Py_VISIT(traverse_module_state->__pyx_codeobj__111); Py_VISIT(traverse_module_state->__pyx_codeobj__112); Py_VISIT(traverse_module_state->__pyx_codeobj__113); Py_VISIT(traverse_module_state->__pyx_codeobj__114); Py_VISIT(traverse_module_state->__pyx_codeobj__115); Py_VISIT(traverse_module_state->__pyx_codeobj__117); Py_VISIT(traverse_module_state->__pyx_codeobj__118); Py_VISIT(traverse_module_state->__pyx_codeobj__119); Py_VISIT(traverse_module_state->__pyx_codeobj__120); Py_VISIT(traverse_module_state->__pyx_codeobj__131); Py_VISIT(traverse_module_state->__pyx_codeobj__132); Py_VISIT(traverse_module_state->__pyx_codeobj__133); Py_VISIT(traverse_module_state->__pyx_codeobj__136); Py_VISIT(traverse_module_state->__pyx_codeobj__138); Py_VISIT(traverse_module_state->__pyx_codeobj__139); Py_VISIT(traverse_module_state->__pyx_codeobj__140); Py_VISIT(traverse_module_state->__pyx_codeobj__141); Py_VISIT(traverse_module_state->__pyx_codeobj__142); Py_VISIT(traverse_module_state->__pyx_codeobj__144); Py_VISIT(traverse_module_state->__pyx_codeobj__146); Py_VISIT(traverse_module_state->__pyx_codeobj__148); Py_VISIT(traverse_module_state->__pyx_codeobj__149); Py_VISIT(traverse_module_state->__pyx_codeobj__150); Py_VISIT(traverse_module_state->__pyx_codeobj__151); Py_VISIT(traverse_module_state->__pyx_codeobj__152); Py_VISIT(traverse_module_state->__pyx_codeobj__154); Py_VISIT(traverse_module_state->__pyx_codeobj__155); Py_VISIT(traverse_module_state->__pyx_codeobj__157); Py_VISIT(traverse_module_state->__pyx_codeobj__158); Py_VISIT(traverse_module_state->__pyx_codeobj__160); Py_VISIT(traverse_module_state->__pyx_codeobj__162); Py_VISIT(traverse_module_state->__pyx_codeobj__164); Py_VISIT(traverse_module_state->__pyx_codeobj__165); Py_VISIT(traverse_module_state->__pyx_codeobj__166); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_7cpython_4bool_bool __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_7cpython_7complex_complex __pyx_mstate_global->__pyx_ptype_7cpython_7complex_complex #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer #define __pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer #define __pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_7asyncpg_8protocol_8protocol_Codec __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol_Codec #define __pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig #define __pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings #define __pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication #define __pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol #define __pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState #define __pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol #define __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr #define __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password #define __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr #define __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr #define __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr #define __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr #define __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare #define __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute #define __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many #define __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr #define __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind #define __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute #define __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal #define __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query #define __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out #define __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in #define __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement #define __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close #define __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation __pyx_mstate_global->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation #endif #define __pyx_ptype_7asyncpg_8protocol_8protocol_Codec __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec #define __pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig #define __pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings #define __pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication #define __pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol #define __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState #define __pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol #define __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr #define __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password #define __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr #define __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr #define __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr #define __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr #define __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare #define __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute #define __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many #define __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr #define __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind #define __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute #define __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal #define __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query #define __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out #define __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in #define __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement #define __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close #define __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation #define __pyx_n_s_AF_UNIX __pyx_mstate_global->__pyx_n_s_AF_UNIX #define __pyx_n_u_AF_UNIX __pyx_mstate_global->__pyx_n_u_AF_UNIX #define __pyx_n_s_ARRAY_TYPES __pyx_mstate_global->__pyx_n_s_ARRAY_TYPES #define __pyx_n_s_AUTHENTICATION_METHODS __pyx_mstate_global->__pyx_n_s_AUTHENTICATION_METHODS #define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError #define __pyx_n_s_AsyncIterable __pyx_mstate_global->__pyx_n_s_AsyncIterable #define __pyx_n_s_Attribute __pyx_mstate_global->__pyx_n_s_Attribute #define __pyx_n_s_AttributeError __pyx_mstate_global->__pyx_n_s_AttributeError #define __pyx_n_s_BUILTIN_TYPE_NAME_MAP __pyx_mstate_global->__pyx_n_s_BUILTIN_TYPE_NAME_MAP #define __pyx_n_s_BUILTIN_TYPE_OID_MAP __pyx_mstate_global->__pyx_n_s_BUILTIN_TYPE_OID_MAP #define __pyx_n_s_BaseProtocol __pyx_mstate_global->__pyx_n_s_BaseProtocol #define __pyx_n_s_BaseProtocol___reduce_cython __pyx_mstate_global->__pyx_n_s_BaseProtocol___reduce_cython #define __pyx_n_s_BaseProtocol___setstate_cython __pyx_mstate_global->__pyx_n_s_BaseProtocol___setstate_cython #define __pyx_n_s_BaseProtocol__create_future_fall __pyx_mstate_global->__pyx_n_s_BaseProtocol__create_future_fall #define __pyx_n_s_BaseProtocol__get_timeout __pyx_mstate_global->__pyx_n_s_BaseProtocol__get_timeout #define __pyx_n_s_BaseProtocol__is_cancelling __pyx_mstate_global->__pyx_n_s_BaseProtocol__is_cancelling #define __pyx_n_s_BaseProtocol__on_timeout __pyx_mstate_global->__pyx_n_s_BaseProtocol__on_timeout #define __pyx_n_s_BaseProtocol__on_waiter_complete __pyx_mstate_global->__pyx_n_s_BaseProtocol__on_waiter_complete #define __pyx_n_s_BaseProtocol__request_cancel __pyx_mstate_global->__pyx_n_s_BaseProtocol__request_cancel #define __pyx_n_s_BaseProtocol__wait_for_cancellat __pyx_mstate_global->__pyx_n_s_BaseProtocol__wait_for_cancellat #define __pyx_n_s_BaseProtocol_abort __pyx_mstate_global->__pyx_n_s_BaseProtocol_abort #define __pyx_n_s_BaseProtocol_bind __pyx_mstate_global->__pyx_n_s_BaseProtocol_bind #define __pyx_n_s_BaseProtocol_bind_execute __pyx_mstate_global->__pyx_n_s_BaseProtocol_bind_execute #define __pyx_n_s_BaseProtocol_bind_execute_many __pyx_mstate_global->__pyx_n_s_BaseProtocol_bind_execute_many #define __pyx_n_s_BaseProtocol_close __pyx_mstate_global->__pyx_n_s_BaseProtocol_close #define __pyx_n_s_BaseProtocol_close_portal __pyx_mstate_global->__pyx_n_s_BaseProtocol_close_portal #define __pyx_n_s_BaseProtocol_close_statement __pyx_mstate_global->__pyx_n_s_BaseProtocol_close_statement #define __pyx_n_s_BaseProtocol_connection_lost __pyx_mstate_global->__pyx_n_s_BaseProtocol_connection_lost #define __pyx_n_s_BaseProtocol_connection_made __pyx_mstate_global->__pyx_n_s_BaseProtocol_connection_made #define __pyx_n_s_BaseProtocol_copy_in __pyx_mstate_global->__pyx_n_s_BaseProtocol_copy_in #define __pyx_n_s_BaseProtocol_copy_out __pyx_mstate_global->__pyx_n_s_BaseProtocol_copy_out #define __pyx_n_s_BaseProtocol_data_received __pyx_mstate_global->__pyx_n_s_BaseProtocol_data_received #define __pyx_n_s_BaseProtocol_execute __pyx_mstate_global->__pyx_n_s_BaseProtocol_execute #define __pyx_n_s_BaseProtocol_get_record_class __pyx_mstate_global->__pyx_n_s_BaseProtocol_get_record_class #define __pyx_n_s_BaseProtocol_get_server_pid __pyx_mstate_global->__pyx_n_s_BaseProtocol_get_server_pid #define __pyx_n_s_BaseProtocol_get_settings __pyx_mstate_global->__pyx_n_s_BaseProtocol_get_settings #define __pyx_n_s_BaseProtocol_is_closed __pyx_mstate_global->__pyx_n_s_BaseProtocol_is_closed #define __pyx_n_s_BaseProtocol_is_connected __pyx_mstate_global->__pyx_n_s_BaseProtocol_is_connected #define __pyx_n_s_BaseProtocol_pause_writing __pyx_mstate_global->__pyx_n_s_BaseProtocol_pause_writing #define __pyx_n_s_BaseProtocol_prepare __pyx_mstate_global->__pyx_n_s_BaseProtocol_prepare #define __pyx_n_s_BaseProtocol_query __pyx_mstate_global->__pyx_n_s_BaseProtocol_query #define __pyx_n_s_BaseProtocol_resume_writing __pyx_mstate_global->__pyx_n_s_BaseProtocol_resume_writing #define __pyx_n_s_BaseProtocol_set_connection __pyx_mstate_global->__pyx_n_s_BaseProtocol_set_connection #define __pyx_kp_u_Bind_expected_a_sequence_got __pyx_mstate_global->__pyx_kp_u_Bind_expected_a_sequence_got #define __pyx_n_s_BufferError __pyx_mstate_global->__pyx_n_s_BufferError #define __pyx_n_s_CancelledError __pyx_mstate_global->__pyx_n_s_CancelledError #define __pyx_kp_u_Check_the_query_against_the_pass __pyx_mstate_global->__pyx_kp_u_Check_the_query_against_the_pass #define __pyx_n_s_ClientSecurityContext __pyx_mstate_global->__pyx_n_s_ClientSecurityContext #define __pyx_kp_b_Client_Key __pyx_mstate_global->__pyx_kp_b_Client_Key #define __pyx_n_s_Codec __pyx_mstate_global->__pyx_n_s_Codec #define __pyx_n_s_Codec___reduce_cython __pyx_mstate_global->__pyx_n_s_Codec___reduce_cython #define __pyx_n_s_Codec___setstate_cython __pyx_mstate_global->__pyx_n_s_Codec___setstate_cython #define __pyx_kp_u_Codec_oid_elem_oid_core __pyx_mstate_global->__pyx_kp_u_Codec_oid_elem_oid_core #define __pyx_n_s_ConnectionDoesNotExistError __pyx_mstate_global->__pyx_n_s_ConnectionDoesNotExistError #define __pyx_n_s_ConnectionResetError __pyx_mstate_global->__pyx_n_s_ConnectionResetError #define __pyx_n_s_ConnectionSettings __pyx_mstate_global->__pyx_n_s_ConnectionSettings #define __pyx_n_s_ConnectionSettings___reduce_cyth __pyx_mstate_global->__pyx_n_s_ConnectionSettings___reduce_cyth #define __pyx_n_s_ConnectionSettings___setstate_cy __pyx_mstate_global->__pyx_n_s_ConnectionSettings___setstate_cy #define __pyx_n_s_ConnectionSettings_add_python_co __pyx_mstate_global->__pyx_n_s_ConnectionSettings_add_python_co #define __pyx_n_s_ConnectionSettings_clear_type_ca __pyx_mstate_global->__pyx_n_s_ConnectionSettings_clear_type_ca #define __pyx_n_s_ConnectionSettings_get_data_code __pyx_mstate_global->__pyx_n_s_ConnectionSettings_get_data_code #define __pyx_n_s_ConnectionSettings_get_text_code __pyx_mstate_global->__pyx_n_s_ConnectionSettings_get_text_code #define __pyx_kp_u_ConnectionSettings_r __pyx_mstate_global->__pyx_kp_u_ConnectionSettings_r #define __pyx_n_s_ConnectionSettings_register_data __pyx_mstate_global->__pyx_n_s_ConnectionSettings_register_data #define __pyx_n_s_ConnectionSettings_remove_python __pyx_mstate_global->__pyx_n_s_ConnectionSettings_remove_python #define __pyx_n_s_ConnectionSettings_set_builtin_t __pyx_mstate_global->__pyx_n_s_ConnectionSettings_set_builtin_t #define __pyx_kp_u_Consider_declaring_an_explicit_c __pyx_mstate_global->__pyx_kp_u_Consider_declaring_an_explicit_c #define __pyx_n_s_CoreProtocol __pyx_mstate_global->__pyx_n_s_CoreProtocol #define __pyx_n_s_CoreProtocol___reduce_cython __pyx_mstate_global->__pyx_n_s_CoreProtocol___reduce_cython #define __pyx_n_s_CoreProtocol___setstate_cython __pyx_mstate_global->__pyx_n_s_CoreProtocol___setstate_cython #define __pyx_n_s_CoreProtocol_is_in_transaction __pyx_mstate_global->__pyx_n_s_CoreProtocol_is_in_transaction #define __pyx_n_s_DEFAULT_CLIENT_NONCE_BYTES __pyx_mstate_global->__pyx_n_s_DEFAULT_CLIENT_NONCE_BYTES #define __pyx_n_s_DIGEST __pyx_mstate_global->__pyx_n_s_DIGEST #define __pyx_n_s_DataCodecConfig __pyx_mstate_global->__pyx_n_s_DataCodecConfig #define __pyx_n_s_DataCodecConfig___reduce_cython __pyx_mstate_global->__pyx_n_s_DataCodecConfig___reduce_cython #define __pyx_n_s_DataCodecConfig___setstate_cytho __pyx_mstate_global->__pyx_n_s_DataCodecConfig___setstate_cytho #define __pyx_n_s_DataCodecConfig__set_builtin_typ __pyx_mstate_global->__pyx_n_s_DataCodecConfig__set_builtin_typ #define __pyx_n_s_DataCodecConfig_add_python_codec __pyx_mstate_global->__pyx_n_s_DataCodecConfig_add_python_codec #define __pyx_n_s_DataCodecConfig_add_types __pyx_mstate_global->__pyx_n_s_DataCodecConfig_add_types #define __pyx_n_s_DataCodecConfig_clear_type_cache __pyx_mstate_global->__pyx_n_s_DataCodecConfig_clear_type_cache #define __pyx_n_s_DataCodecConfig_declare_fallback __pyx_mstate_global->__pyx_n_s_DataCodecConfig_declare_fallback #define __pyx_n_s_DataCodecConfig_remove_python_co __pyx_mstate_global->__pyx_n_s_DataCodecConfig_remove_python_co #define __pyx_n_s_DataCodecConfig_set_builtin_type __pyx_mstate_global->__pyx_n_s_DataCodecConfig_set_builtin_type #define __pyx_n_s_DataError __pyx_mstate_global->__pyx_n_s_DataError #define __pyx_n_s_Event __pyx_mstate_global->__pyx_n_s_Event #define __pyx_n_s_Future __pyx_mstate_global->__pyx_n_s_Future #define __pyx_kp_u_GSSAPI_SSPI_authentication_is_on __pyx_mstate_global->__pyx_kp_u_GSSAPI_SSPI_authentication_is_on #define __pyx_n_s_IPPROTO_TCP __pyx_mstate_global->__pyx_n_s_IPPROTO_TCP #define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0 #define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2 #define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0_3 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_3 #define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError #define __pyx_n_s_InterfaceError __pyx_mstate_global->__pyx_n_s_InterfaceError #define __pyx_n_s_InternalClientError __pyx_mstate_global->__pyx_n_s_InternalClientError #define __pyx_n_s_Iterable __pyx_mstate_global->__pyx_n_s_Iterable #define __pyx_n_s_IterableABC __pyx_mstate_global->__pyx_n_s_IterableABC #define __pyx_n_u_Kerberos __pyx_mstate_global->__pyx_n_u_Kerberos #define __pyx_n_s_KeyError __pyx_mstate_global->__pyx_n_s_KeyError #define __pyx_n_s_Mapping __pyx_mstate_global->__pyx_n_s_Mapping #define __pyx_n_s_MappingABC __pyx_mstate_global->__pyx_n_s_MappingABC #define __pyx_n_s_ModuleNotFoundError __pyx_mstate_global->__pyx_n_s_ModuleNotFoundError #define __pyx_n_u_NA __pyx_mstate_global->__pyx_n_u_NA #define __pyx_n_u_NFKC __pyx_mstate_global->__pyx_n_u_NFKC #define __pyx_n_s_NO_TIMEOUT __pyx_mstate_global->__pyx_n_s_NO_TIMEOUT #define __pyx_n_b_NULL __pyx_mstate_global->__pyx_n_b_NULL #define __pyx_n_s_Name __pyx_mstate_global->__pyx_n_s_Name #define __pyx_n_s_NameType __pyx_mstate_global->__pyx_n_s_NameType #define __pyx_n_u_Negotiate __pyx_mstate_global->__pyx_n_u_Negotiate #define __pyx_n_s_NotImplementedError __pyx_mstate_global->__pyx_n_s_NotImplementedError #define __pyx_kp_u_Note_that_parameters_are_suppor __pyx_mstate_global->__pyx_kp_u_Note_that_parameters_are_suppor #define __pyx_kp_u_OID __pyx_mstate_global->__pyx_kp_u_OID #define __pyx_kp_u_OID_value_too_large_r __pyx_mstate_global->__pyx_kp_u_OID_value_too_large_r #define __pyx_n_s_OrderedDict __pyx_mstate_global->__pyx_n_s_OrderedDict #define __pyx_n_s_OutdatedSchemaCacheError __pyx_mstate_global->__pyx_n_s_OutdatedSchemaCacheError #define __pyx_n_s_OverflowError __pyx_mstate_global->__pyx_n_s_OverflowError #define __pyx_kp_b_PGCOPY __pyx_mstate_global->__pyx_kp_b_PGCOPY #define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError #define __pyx_kp_u_PostgreSQL_does_not_implement_an __pyx_mstate_global->__pyx_kp_u_PostgreSQL_does_not_implement_an #define __pyx_n_s_PostgresError __pyx_mstate_global->__pyx_n_s_PostgresError #define __pyx_n_s_PreparedStatementState __pyx_mstate_global->__pyx_n_s_PreparedStatementState #define __pyx_n_s_PreparedStatementState___reduce __pyx_mstate_global->__pyx_n_s_PreparedStatementState___reduce #define __pyx_n_s_PreparedStatementState___setstat __pyx_mstate_global->__pyx_n_s_PreparedStatementState___setstat #define __pyx_n_s_PreparedStatementState__get_attr __pyx_mstate_global->__pyx_n_s_PreparedStatementState__get_attr #define __pyx_n_s_PreparedStatementState__get_para __pyx_mstate_global->__pyx_n_s_PreparedStatementState__get_para #define __pyx_n_s_PreparedStatementState__init_cod __pyx_mstate_global->__pyx_n_s_PreparedStatementState__init_cod #define __pyx_n_s_PreparedStatementState__init_typ __pyx_mstate_global->__pyx_n_s_PreparedStatementState__init_typ #define __pyx_n_s_PreparedStatementState_attach __pyx_mstate_global->__pyx_n_s_PreparedStatementState_attach #define __pyx_n_s_PreparedStatementState_detach __pyx_mstate_global->__pyx_n_s_PreparedStatementState_detach #define __pyx_n_s_PreparedStatementState_mark_clos __pyx_mstate_global->__pyx_n_s_PreparedStatementState_mark_clos #define __pyx_n_s_PreparedStatementState_mark_unpr __pyx_mstate_global->__pyx_n_s_PreparedStatementState_mark_unpr #define __pyx_n_s_Protocol __pyx_mstate_global->__pyx_n_s_Protocol #define __pyx_n_s_ProtocolError __pyx_mstate_global->__pyx_n_s_ProtocolError #define __pyx_n_s_REQUIREMENTS_CLIENT_FINAL_MESSAG __pyx_mstate_global->__pyx_n_s_REQUIREMENTS_CLIENT_FINAL_MESSAG #define __pyx_n_s_REQUIREMENTS_CLIENT_PROOF __pyx_mstate_global->__pyx_n_s_REQUIREMENTS_CLIENT_PROOF #define __pyx_n_u_ROLLBACK __pyx_mstate_global->__pyx_n_u_ROLLBACK #define __pyx_n_s_Range __pyx_mstate_global->__pyx_n_s_Range #define __pyx_n_s_Record __pyx_mstate_global->__pyx_n_s_Record #define __pyx_n_s_SASLPREP_PROHIBITED __pyx_mstate_global->__pyx_n_s_SASLPREP_PROHIBITED #define __pyx_n_s_SCRAMAuthentication __pyx_mstate_global->__pyx_n_s_SCRAMAuthentication #define __pyx_n_s_SCRAMAuthentication___reduce_cyt __pyx_mstate_global->__pyx_n_s_SCRAMAuthentication___reduce_cyt #define __pyx_n_s_SCRAMAuthentication___setstate_c __pyx_mstate_global->__pyx_n_s_SCRAMAuthentication___setstate_c #define __pyx_n_s_SCRAMAuthentication__bytes_xor_l __pyx_mstate_global->__pyx_n_s_SCRAMAuthentication__bytes_xor_l #define __pyx_n_s_SCRAMAuthentication__normalize_p __pyx_mstate_global->__pyx_n_s_SCRAMAuthentication__normalize_p #define __pyx_kp_b_SCRAM_SHA_256 __pyx_mstate_global->__pyx_kp_b_SCRAM_SHA_256 #define __pyx_n_s_SecurityContext __pyx_mstate_global->__pyx_n_s_SecurityContext #define __pyx_n_s_Sequence __pyx_mstate_global->__pyx_n_s_Sequence #define __pyx_n_s_SequenceABC __pyx_mstate_global->__pyx_n_s_SequenceABC #define __pyx_kp_b_Server_Key __pyx_mstate_global->__pyx_kp_b_Server_Key #define __pyx_n_s_Sized __pyx_mstate_global->__pyx_n_s_Sized #define __pyx_n_s_SizedABC __pyx_mstate_global->__pyx_n_s_SizedABC #define __pyx_n_s_StopAsyncIteration __pyx_mstate_global->__pyx_n_s_StopAsyncIteration #define __pyx_n_s_StopIteration __pyx_mstate_global->__pyx_n_s_StopIteration #define __pyx_n_s_TCP_NODELAY __pyx_mstate_global->__pyx_n_s_TCP_NODELAY #define __pyx_n_s_TimeoutError __pyx_mstate_global->__pyx_n_s_TimeoutError #define __pyx_n_u_TimeoutError __pyx_mstate_global->__pyx_n_u_TimeoutError #define __pyx_n_s_Timer __pyx_mstate_global->__pyx_n_s_Timer #define __pyx_n_s_Timer___enter __pyx_mstate_global->__pyx_n_s_Timer___enter #define __pyx_n_s_Timer___exit __pyx_mstate_global->__pyx_n_s_Timer___exit #define __pyx_n_s_Timer___init __pyx_mstate_global->__pyx_n_s_Timer___init #define __pyx_n_s_Timer_get_remaining_budget __pyx_mstate_global->__pyx_n_s_Timer_get_remaining_budget #define __pyx_n_s_Timer_has_budget_greater_than __pyx_mstate_global->__pyx_n_s_Timer_has_budget_greater_than #define __pyx_kp_u_TimoutError_was_not_raised __pyx_mstate_global->__pyx_kp_u_TimoutError_was_not_raised #define __pyx_n_s_Type __pyx_mstate_global->__pyx_n_s_Type #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError #define __pyx_n_s_UnicodeEncodeError __pyx_mstate_global->__pyx_n_s_UnicodeEncodeError #define __pyx_n_s_UnsupportedClientFeatureError __pyx_mstate_global->__pyx_n_s_UnsupportedClientFeatureError #define __pyx_n_s_UserCredential __pyx_mstate_global->__pyx_n_s_UserCredential #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError #define __pyx_kp_b__15 __pyx_mstate_global->__pyx_kp_b__15 #define __pyx_n_s__167 __pyx_mstate_global->__pyx_n_s__167 #define __pyx_n_u__2 __pyx_mstate_global->__pyx_n_u__2 #define __pyx_kp_b__23 __pyx_mstate_global->__pyx_kp_b__23 #define __pyx_kp_b__31 __pyx_mstate_global->__pyx_kp_b__31 #define __pyx_kp_b__32 __pyx_mstate_global->__pyx_kp_b__32 #define __pyx_kp_u__33 __pyx_mstate_global->__pyx_kp_u__33 #define __pyx_kp_b__34 __pyx_mstate_global->__pyx_kp_b__34 #define __pyx_kp_u__34 __pyx_mstate_global->__pyx_kp_u__34 #define __pyx_kp_u__35 __pyx_mstate_global->__pyx_kp_u__35 #define __pyx_kp_u__36 __pyx_mstate_global->__pyx_kp_u__36 #define __pyx_n_s__37 __pyx_mstate_global->__pyx_n_s__37 #define __pyx_kp_u__38 __pyx_mstate_global->__pyx_kp_u__38 #define __pyx_kp_u__39 __pyx_mstate_global->__pyx_kp_u__39 #define __pyx_kp_u__40 __pyx_mstate_global->__pyx_kp_u__40 #define __pyx_kp_u__41 __pyx_mstate_global->__pyx_kp_u__41 #define __pyx_kp_u__42 __pyx_mstate_global->__pyx_kp_u__42 #define __pyx_kp_u__44 __pyx_mstate_global->__pyx_kp_u__44 #define __pyx_kp_u__45 __pyx_mstate_global->__pyx_kp_u__45 #define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 #define __pyx_kp_u__8 __pyx_mstate_global->__pyx_kp_u__8 #define __pyx_kp_u_a_sized_iterable_container_expec __pyx_mstate_global->__pyx_kp_u_a_sized_iterable_container_expec #define __pyx_n_s_abc __pyx_mstate_global->__pyx_n_s_abc #define __pyx_n_u_abc __pyx_mstate_global->__pyx_n_u_abc #define __pyx_n_s_abort __pyx_mstate_global->__pyx_n_s_abort #define __pyx_n_u_abstime __pyx_mstate_global->__pyx_n_u_abstime #define __pyx_n_u_aclitem __pyx_mstate_global->__pyx_n_u_aclitem #define __pyx_n_s_add_done_callback __pyx_mstate_global->__pyx_n_s_add_done_callback #define __pyx_n_s_add_python_codec __pyx_mstate_global->__pyx_n_s_add_python_codec #define __pyx_n_s_add_types __pyx_mstate_global->__pyx_n_s_add_types #define __pyx_n_s_addr __pyx_mstate_global->__pyx_n_s_addr #define __pyx_n_s_aiter __pyx_mstate_global->__pyx_n_s_aiter #define __pyx_n_s_aiter_2 __pyx_mstate_global->__pyx_n_s_aiter_2 #define __pyx_n_s_alias_oid __pyx_mstate_global->__pyx_n_s_alias_oid #define __pyx_n_s_alias_to __pyx_mstate_global->__pyx_n_s_alias_to #define __pyx_kp_u_already_connected __pyx_mstate_global->__pyx_kp_u_already_connected #define __pyx_n_u_alt __pyx_mstate_global->__pyx_n_u_alt #define __pyx_n_s_amount __pyx_mstate_global->__pyx_n_s_amount #define __pyx_n_s_anext __pyx_mstate_global->__pyx_n_s_anext #define __pyx_n_s_any __pyx_mstate_global->__pyx_n_s_any #define __pyx_n_u_any __pyx_mstate_global->__pyx_n_u_any #define __pyx_n_u_anyarray __pyx_mstate_global->__pyx_n_u_anyarray #define __pyx_n_u_anycompatible __pyx_mstate_global->__pyx_n_u_anycompatible #define __pyx_n_u_anycompatiblearray __pyx_mstate_global->__pyx_n_u_anycompatiblearray #define __pyx_n_u_anycompatiblemultirange __pyx_mstate_global->__pyx_n_u_anycompatiblemultirange #define __pyx_n_u_anycompatiblenonarray __pyx_mstate_global->__pyx_n_u_anycompatiblenonarray #define __pyx_n_u_anycompatiblerange __pyx_mstate_global->__pyx_n_u_anycompatiblerange #define __pyx_n_u_anyelement __pyx_mstate_global->__pyx_n_u_anyelement #define __pyx_n_u_anyenum __pyx_mstate_global->__pyx_n_u_anyenum #define __pyx_n_u_anymultirange __pyx_mstate_global->__pyx_n_u_anymultirange #define __pyx_n_u_anynonarray __pyx_mstate_global->__pyx_n_u_anynonarray #define __pyx_n_u_anyrange __pyx_mstate_global->__pyx_n_u_anyrange #define __pyx_n_s_apg_exc __pyx_mstate_global->__pyx_n_s_apg_exc #define __pyx_n_s_apg_exc_base __pyx_mstate_global->__pyx_n_s_apg_exc_base #define __pyx_n_s_apg_types __pyx_mstate_global->__pyx_n_s_apg_types #define __pyx_n_s_arg_bufs __pyx_mstate_global->__pyx_n_s_arg_bufs #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args #define __pyx_n_s_args_buf __pyx_mstate_global->__pyx_n_s_args_buf #define __pyx_n_u_array __pyx_mstate_global->__pyx_n_u_array #define __pyx_n_s_array_element_oid __pyx_mstate_global->__pyx_n_s_array_element_oid #define __pyx_kp_u_array_length_overflow __pyx_mstate_global->__pyx_kp_u_array_length_overflow #define __pyx_n_u_ascii __pyx_mstate_global->__pyx_n_u_ascii #define __pyx_n_s_asyncio __pyx_mstate_global->__pyx_n_s_asyncio #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_asyncio_tasks __pyx_mstate_global->__pyx_n_s_asyncio_tasks #define __pyx_n_s_asyncpg __pyx_mstate_global->__pyx_n_s_asyncpg #define __pyx_kp_u_asyncpg_Protocol_has_no_referenc __pyx_mstate_global->__pyx_kp_u_asyncpg_Protocol_has_no_referenc #define __pyx_n_s_asyncpg_exceptions __pyx_mstate_global->__pyx_n_s_asyncpg_exceptions #define __pyx_kp_s_asyncpg_protocol_codecs_base_pyx __pyx_mstate_global->__pyx_kp_s_asyncpg_protocol_codecs_base_pyx #define __pyx_kp_s_asyncpg_protocol_coreproto_pyx __pyx_mstate_global->__pyx_kp_s_asyncpg_protocol_coreproto_pyx #define __pyx_kp_s_asyncpg_protocol_prepared_stmt_p __pyx_mstate_global->__pyx_kp_s_asyncpg_protocol_prepared_stmt_p #define __pyx_n_s_asyncpg_protocol_protocol __pyx_mstate_global->__pyx_n_s_asyncpg_protocol_protocol #define __pyx_kp_s_asyncpg_protocol_protocol_pyx __pyx_mstate_global->__pyx_kp_s_asyncpg_protocol_protocol_pyx #define __pyx_kp_s_asyncpg_protocol_settings_pyx __pyx_mstate_global->__pyx_kp_s_asyncpg_protocol_settings_pyx #define __pyx_n_s_attach __pyx_mstate_global->__pyx_n_s_attach #define __pyx_n_s_attrname __pyx_mstate_global->__pyx_n_s_attrname #define __pyx_n_u_attrnames __pyx_mstate_global->__pyx_n_u_attrnames #define __pyx_n_u_attrtypoids __pyx_mstate_global->__pyx_n_u_attrtypoids #define __pyx_n_s_auth_msg __pyx_mstate_global->__pyx_n_s_auth_msg #define __pyx_n_s_authentication_method __pyx_mstate_global->__pyx_n_s_authentication_method #define __pyx_n_s_await __pyx_mstate_global->__pyx_n_s_await #define __pyx_n_s_b64decode __pyx_mstate_global->__pyx_n_s_b64decode #define __pyx_n_s_b64encode __pyx_mstate_global->__pyx_n_s_b64encode #define __pyx_n_s_base __pyx_mstate_global->__pyx_n_s_base #define __pyx_n_s_base64 __pyx_mstate_global->__pyx_n_s_base64 #define __pyx_n_s_base_codec __pyx_mstate_global->__pyx_n_s_base_codec #define __pyx_kp_u_base_codec_is_mutually_exclusive __pyx_mstate_global->__pyx_kp_u_base_codec_is_mutually_exclusive #define __pyx_n_s_base_type __pyx_mstate_global->__pyx_n_s_base_type #define __pyx_n_u_basetype __pyx_mstate_global->__pyx_n_u_basetype #define __pyx_n_u_basetype_name __pyx_mstate_global->__pyx_n_u_basetype_name #define __pyx_n_u_big __pyx_mstate_global->__pyx_n_u_big #define __pyx_n_u_bigint __pyx_mstate_global->__pyx_n_u_bigint #define __pyx_n_u_binary __pyx_mstate_global->__pyx_n_u_binary #define __pyx_n_s_bind __pyx_mstate_global->__pyx_n_s_bind #define __pyx_n_s_bind_execute __pyx_mstate_global->__pyx_n_s_bind_execute #define __pyx_n_s_bind_execute_many __pyx_mstate_global->__pyx_n_s_bind_execute_many #define __pyx_n_s_bind_execute_many_locals_genexpr __pyx_mstate_global->__pyx_n_s_bind_execute_many_locals_genexpr #define __pyx_n_u_bit __pyx_mstate_global->__pyx_n_u_bit #define __pyx_kp_u_bit_varying __pyx_mstate_global->__pyx_kp_u_bit_varying #define __pyx_n_s_bool __pyx_mstate_global->__pyx_n_s_bool #define __pyx_n_u_bool __pyx_mstate_global->__pyx_n_u_bool #define __pyx_n_u_box __pyx_mstate_global->__pyx_n_u_box #define __pyx_n_u_bpchar __pyx_mstate_global->__pyx_n_u_bpchar #define __pyx_n_s_budget __pyx_mstate_global->__pyx_n_s_budget #define __pyx_n_s_budget_2 __pyx_mstate_global->__pyx_n_s_budget_2 #define __pyx_n_s_buffer __pyx_mstate_global->__pyx_n_s_buffer #define __pyx_n_s_builtins __pyx_mstate_global->__pyx_n_s_builtins #define __pyx_n_u_bytea __pyx_mstate_global->__pyx_n_u_bytea #define __pyx_n_s_byteorder __pyx_mstate_global->__pyx_n_s_byteorder #define __pyx_kp_u_bytes __pyx_mstate_global->__pyx_kp_u_bytes #define __pyx_n_b_c __pyx_mstate_global->__pyx_n_b_c #define __pyx_kp_b_c_2 __pyx_mstate_global->__pyx_kp_b_c_2 #define __pyx_kp_b_c_3 __pyx_mstate_global->__pyx_kp_b_c_3 #define __pyx_n_s_c_decoder __pyx_mstate_global->__pyx_n_s_c_decoder #define __pyx_n_s_c_encoder __pyx_mstate_global->__pyx_n_s_c_encoder #define __pyx_n_s_call_exception_handler __pyx_mstate_global->__pyx_n_s_call_exception_handler #define __pyx_n_s_call_later __pyx_mstate_global->__pyx_n_s_call_later #define __pyx_n_s_cancel __pyx_mstate_global->__pyx_n_s_cancel #define __pyx_n_s_cancel_current_command __pyx_mstate_global->__pyx_n_s_cancel_current_command #define __pyx_n_s_cancelled __pyx_mstate_global->__pyx_n_s_cancelled #define __pyx_kp_u_cannot_alias __pyx_mstate_global->__pyx_kp_u_cannot_alias #define __pyx_kp_u_cannot_close_prepared_statement __pyx_mstate_global->__pyx_kp_u_cannot_close_prepared_statement #define __pyx_kp_u_cannot_decode_type_text_encoding __pyx_mstate_global->__pyx_kp_u_cannot_decode_type_text_encoding #define __pyx_kp_u_cannot_decode_type_text_encoding_2 __pyx_mstate_global->__pyx_kp_u_cannot_decode_type_text_encoding_2 #define __pyx_kp_u_cannot_perform_operation_another __pyx_mstate_global->__pyx_kp_u_cannot_perform_operation_another #define __pyx_kp_u_cannot_perform_operation_another_2 __pyx_mstate_global->__pyx_kp_u_cannot_perform_operation_another_2 #define __pyx_kp_u_cannot_perform_operation_connect __pyx_mstate_global->__pyx_kp_u_cannot_perform_operation_connect #define __pyx_kp_u_cannot_process_message __pyx_mstate_global->__pyx_kp_u_cannot_process_message #define __pyx_kp_u_cannot_register_core_codec_for_O __pyx_mstate_global->__pyx_kp_u_cannot_register_core_codec_for_O #define __pyx_kp_u_cannot_switch_to_idle_state_prot __pyx_mstate_global->__pyx_kp_u_cannot_switch_to_idle_state_prot #define __pyx_kp_u_cannot_switch_to_state_another_o __pyx_mstate_global->__pyx_kp_u_cannot_switch_to_state_another_o #define __pyx_kp_u_cannot_switch_to_state_protocol __pyx_mstate_global->__pyx_kp_u_cannot_switch_to_state_protocol #define __pyx_n_s_cause __pyx_mstate_global->__pyx_n_s_cause #define __pyx_n_u_char __pyx_mstate_global->__pyx_n_u_char #define __pyx_n_u_character __pyx_mstate_global->__pyx_n_u_character #define __pyx_kp_u_character_varying __pyx_mstate_global->__pyx_kp_u_character_varying #define __pyx_n_s_chr __pyx_mstate_global->__pyx_n_s_chr #define __pyx_n_s_chunk __pyx_mstate_global->__pyx_n_s_chunk #define __pyx_n_u_cid __pyx_mstate_global->__pyx_n_u_cid #define __pyx_n_u_cidr __pyx_mstate_global->__pyx_n_u_cidr #define __pyx_n_u_circle __pyx_mstate_global->__pyx_n_u_circle #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem #define __pyx_n_s_cleanup __pyx_mstate_global->__pyx_n_s_cleanup #define __pyx_n_s_clear __pyx_mstate_global->__pyx_n_s_clear #define __pyx_n_s_clear_type_cache __pyx_mstate_global->__pyx_n_s_clear_type_cache #define __pyx_n_u_client_channel_binding __pyx_mstate_global->__pyx_n_u_client_channel_binding #define __pyx_n_b_client_encoding __pyx_mstate_global->__pyx_n_b_client_encoding #define __pyx_n_u_client_encoding __pyx_mstate_global->__pyx_n_u_client_encoding #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close #define __pyx_n_s_close_portal __pyx_mstate_global->__pyx_n_s_close_portal #define __pyx_n_s_close_statement __pyx_mstate_global->__pyx_n_s_close_statement #define __pyx_n_s_codec __pyx_mstate_global->__pyx_n_s_codec #define __pyx_kp_u_codec_for __pyx_mstate_global->__pyx_kp_u_codec_for #define __pyx_n_s_codec_set __pyx_mstate_global->__pyx_n_s_codec_set #define __pyx_n_s_codec_str __pyx_mstate_global->__pyx_n_s_codec_str #define __pyx_n_s_codecs __pyx_mstate_global->__pyx_n_s_codecs #define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections #define __pyx_n_s_collections_abc __pyx_mstate_global->__pyx_n_s_collections_abc #define __pyx_n_s_command_timeout __pyx_mstate_global->__pyx_n_s_command_timeout #define __pyx_n_s_comp_elem_codecs __pyx_mstate_global->__pyx_n_s_comp_elem_codecs #define __pyx_n_s_comp_type_attrs __pyx_mstate_global->__pyx_n_s_comp_type_attrs #define __pyx_n_s_compat __pyx_mstate_global->__pyx_n_s_compat #define __pyx_n_u_composite __pyx_mstate_global->__pyx_n_u_composite #define __pyx_n_s_con __pyx_mstate_global->__pyx_n_s_con #define __pyx_n_s_con_params __pyx_mstate_global->__pyx_n_s_con_params #define __pyx_n_s_config __pyx_mstate_global->__pyx_n_s_config #define __pyx_n_s_connected_fut __pyx_mstate_global->__pyx_n_s_connected_fut #define __pyx_n_s_connection __pyx_mstate_global->__pyx_n_s_connection #define __pyx_n_s_connection_lost __pyx_mstate_global->__pyx_n_s_connection_lost #define __pyx_n_s_connection_made __pyx_mstate_global->__pyx_n_s_connection_made #define __pyx_kp_u_connection_was_closed_in_the_mid __pyx_mstate_global->__pyx_kp_u_connection_was_closed_in_the_mid #define __pyx_n_s_copy_in __pyx_mstate_global->__pyx_n_s_copy_in #define __pyx_n_s_copy_in_locals_lambda __pyx_mstate_global->__pyx_n_s_copy_in_locals_lambda #define __pyx_n_s_copy_out __pyx_mstate_global->__pyx_n_s_copy_out #define __pyx_n_s_copy_out_locals_lambda __pyx_mstate_global->__pyx_n_s_copy_out_locals_lambda #define __pyx_n_s_copy_stmt __pyx_mstate_global->__pyx_n_s_copy_stmt #define __pyx_n_s_core_codec __pyx_mstate_global->__pyx_n_s_core_codec #define __pyx_kp_u_could_not_get_iterations __pyx_mstate_global->__pyx_kp_u_could_not_get_iterations #define __pyx_kp_u_could_not_get_nonce __pyx_mstate_global->__pyx_kp_u_could_not_get_nonce #define __pyx_kp_u_could_not_get_salt __pyx_mstate_global->__pyx_kp_u_could_not_get_salt #define __pyx_kp_u_could_not_get_server_signature __pyx_mstate_global->__pyx_kp_u_could_not_get_server_signature #define __pyx_kp_u_could_not_verify_server_signatur __pyx_mstate_global->__pyx_kp_u_could_not_verify_server_signatur #define __pyx_n_u_cp1250 __pyx_mstate_global->__pyx_n_u_cp1250 #define __pyx_n_u_cp1251 __pyx_mstate_global->__pyx_n_u_cp1251 #define __pyx_n_u_cp1252 __pyx_mstate_global->__pyx_n_u_cp1252 #define __pyx_n_u_cp1253 __pyx_mstate_global->__pyx_n_u_cp1253 #define __pyx_n_u_cp1254 __pyx_mstate_global->__pyx_n_u_cp1254 #define __pyx_n_u_cp1255 __pyx_mstate_global->__pyx_n_u_cp1255 #define __pyx_n_u_cp1256 __pyx_mstate_global->__pyx_n_u_cp1256 #define __pyx_n_u_cp1257 __pyx_mstate_global->__pyx_n_u_cp1257 #define __pyx_n_u_cp1258 __pyx_mstate_global->__pyx_n_u_cp1258 #define __pyx_n_u_cp1521 __pyx_mstate_global->__pyx_n_u_cp1521 #define __pyx_n_u_cp866 __pyx_mstate_global->__pyx_n_u_cp866 #define __pyx_n_u_cp874 __pyx_mstate_global->__pyx_n_u_cp874 #define __pyx_n_u_cp932 __pyx_mstate_global->__pyx_n_u_cp932 #define __pyx_n_u_cp936 __pyx_mstate_global->__pyx_n_u_cp936 #define __pyx_n_u_cp949 __pyx_mstate_global->__pyx_n_u_cp949 #define __pyx_n_u_cp950 __pyx_mstate_global->__pyx_n_u_cp950 #define __pyx_n_s_create_future __pyx_mstate_global->__pyx_n_s_create_future #define __pyx_n_s_create_future_fallback __pyx_mstate_global->__pyx_n_s_create_future_fallback #define __pyx_n_s_create_record __pyx_mstate_global->__pyx_n_s_create_record #define __pyx_n_s_credential __pyx_mstate_global->__pyx_n_s_credential #define __pyx_n_u_cstring __pyx_mstate_global->__pyx_n_u_cstring #define __pyx_n_b_d __pyx_mstate_global->__pyx_n_b_d #define __pyx_n_s_d __pyx_mstate_global->__pyx_n_s_d #define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data #define __pyx_n_s_data_gen __pyx_mstate_global->__pyx_n_s_data_gen #define __pyx_n_s_data_received __pyx_mstate_global->__pyx_n_s_data_received #define __pyx_n_s_data_type __pyx_mstate_global->__pyx_n_s_data_type #define __pyx_n_s_database __pyx_mstate_global->__pyx_n_s_database #define __pyx_n_u_database __pyx_mstate_global->__pyx_n_u_database #define __pyx_n_u_date __pyx_mstate_global->__pyx_n_u_date #define __pyx_n_u_decimal __pyx_mstate_global->__pyx_n_u_decimal #define __pyx_n_s_declare_fallback_codec __pyx_mstate_global->__pyx_n_s_declare_fallback_codec #define __pyx_n_s_decode __pyx_mstate_global->__pyx_n_s_decode #define __pyx_kp_u_decode_row_statement_is_None __pyx_mstate_global->__pyx_kp_u_decode_row_statement_is_None #define __pyx_n_s_decoder __pyx_mstate_global->__pyx_n_s_decoder #define __pyx_n_s_desc __pyx_mstate_global->__pyx_n_s_desc #define __pyx_n_s_detach __pyx_mstate_global->__pyx_n_s_detach #define __pyx_n_s_detail __pyx_mstate_global->__pyx_n_s_detail #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2 #define __pyx_n_s_digest __pyx_mstate_global->__pyx_n_s_digest #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc #define __pyx_n_s_done __pyx_mstate_global->__pyx_n_s_done #define __pyx_kp_u_double_precision __pyx_mstate_global->__pyx_kp_u_double_precision #define __pyx_kp_u_duplicate_GSSAPI_SSPI_authentica __pyx_mstate_global->__pyx_kp_u_duplicate_GSSAPI_SSPI_authentica #define __pyx_n_b_e __pyx_mstate_global->__pyx_n_b_e #define __pyx_n_s_e __pyx_mstate_global->__pyx_n_s_e #define __pyx_n_s_elem __pyx_mstate_global->__pyx_n_s_elem #define __pyx_n_s_elem_codec __pyx_mstate_global->__pyx_n_s_elem_codec #define __pyx_n_s_elem_delim __pyx_mstate_global->__pyx_n_s_elem_delim #define __pyx_n_s_elem_format __pyx_mstate_global->__pyx_n_s_elem_format #define __pyx_n_u_elemdelim __pyx_mstate_global->__pyx_n_u_elemdelim #define __pyx_n_s_element_names __pyx_mstate_global->__pyx_n_s_element_names #define __pyx_n_s_elems __pyx_mstate_global->__pyx_n_s_elems #define __pyx_n_u_elemtype __pyx_mstate_global->__pyx_n_u_elemtype #define __pyx_n_u_elemtype_name __pyx_mstate_global->__pyx_n_u_elemtype_name #define __pyx_n_s_empty __pyx_mstate_global->__pyx_n_s_empty #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode #define __pyx_n_s_encoder __pyx_mstate_global->__pyx_n_s_encoder #define __pyx_n_s_enter __pyx_mstate_global->__pyx_n_s_enter #define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate #define __pyx_n_s_et __pyx_mstate_global->__pyx_n_s_et #define __pyx_n_u_euc_cn __pyx_mstate_global->__pyx_n_u_euc_cn #define __pyx_n_u_euc_jis_2004 __pyx_mstate_global->__pyx_n_u_euc_jis_2004 #define __pyx_n_u_euc_jp __pyx_mstate_global->__pyx_n_u_euc_jp #define __pyx_n_u_euc_kr __pyx_mstate_global->__pyx_n_u_euc_kr #define __pyx_n_u_euccn __pyx_mstate_global->__pyx_n_u_euccn #define __pyx_n_u_eucjp __pyx_mstate_global->__pyx_n_u_eucjp #define __pyx_n_u_euckr __pyx_mstate_global->__pyx_n_u_euckr #define __pyx_n_u_event_trigger __pyx_mstate_global->__pyx_n_u_event_trigger #define __pyx_n_s_ex __pyx_mstate_global->__pyx_n_s_ex #define __pyx_n_s_exc __pyx_mstate_global->__pyx_n_s_exc #define __pyx_n_s_exception __pyx_mstate_global->__pyx_n_s_exception #define __pyx_n_s_exceptions __pyx_mstate_global->__pyx_n_s_exceptions #define __pyx_n_s_execute __pyx_mstate_global->__pyx_n_s_execute #define __pyx_n_s_exit __pyx_mstate_global->__pyx_n_s_exit #define __pyx_kp_u_expected_0_1_or_2_elements_in_ra __pyx_mstate_global->__pyx_kp_u_expected_0_1_or_2_elements_in_ra #define __pyx_kp_u_expected_a_sequence_got __pyx_mstate_global->__pyx_kp_u_expected_a_sequence_got #define __pyx_kp_u_expected_a_sequence_got_type_r __pyx_mstate_global->__pyx_kp_u_expected_a_sequence_got_type_r #define __pyx_n_s_f __pyx_mstate_global->__pyx_n_s_f #define __pyx_n_s_family __pyx_mstate_global->__pyx_n_s_family #define __pyx_n_u_fdw_handler __pyx_mstate_global->__pyx_n_u_fdw_handler #define __pyx_n_u_float4 __pyx_mstate_global->__pyx_n_u_float4 #define __pyx_n_u_float8 __pyx_mstate_global->__pyx_n_u_float8 #define __pyx_n_s_fmt __pyx_mstate_global->__pyx_n_s_fmt #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format #define __pyx_n_s_formats __pyx_mstate_global->__pyx_n_s_formats #define __pyx_n_s_fut __pyx_mstate_global->__pyx_n_s_fut #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_genexpr __pyx_mstate_global->__pyx_n_s_genexpr #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get #define __pyx_n_s_get_attributes __pyx_mstate_global->__pyx_n_s_get_attributes #define __pyx_n_s_get_data_codec __pyx_mstate_global->__pyx_n_s_get_data_codec #define __pyx_n_s_get_extra_info __pyx_mstate_global->__pyx_n_s_get_extra_info #define __pyx_n_s_get_parameters __pyx_mstate_global->__pyx_n_s_get_parameters #define __pyx_n_s_get_record_class __pyx_mstate_global->__pyx_n_s_get_record_class #define __pyx_n_s_get_remaining_budget __pyx_mstate_global->__pyx_n_s_get_remaining_budget #define __pyx_n_s_get_server_pid __pyx_mstate_global->__pyx_n_s_get_server_pid #define __pyx_n_s_get_settings __pyx_mstate_global->__pyx_n_s_get_settings #define __pyx_n_s_get_text_codec __pyx_mstate_global->__pyx_n_s_get_text_codec #define __pyx_n_s_get_timeout __pyx_mstate_global->__pyx_n_s_get_timeout #define __pyx_n_s_getattribute __pyx_mstate_global->__pyx_n_s_getattribute #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_kp_u_got_result_for_unknown_protocol __pyx_mstate_global->__pyx_kp_u_got_result_for_unknown_protocol #define __pyx_n_s_group __pyx_mstate_global->__pyx_n_s_group #define __pyx_n_u_gss __pyx_mstate_global->__pyx_n_u_gss #define __pyx_n_s_gssapi __pyx_mstate_global->__pyx_n_s_gssapi #define __pyx_n_u_gssapi __pyx_mstate_global->__pyx_n_u_gssapi #define __pyx_kp_u_gssapi_module_not_found_please_i __pyx_mstate_global->__pyx_kp_u_gssapi_module_not_found_please_i #define __pyx_n_s_gsslib __pyx_mstate_global->__pyx_n_s_gsslib #define __pyx_n_u_gtsvector __pyx_mstate_global->__pyx_n_u_gtsvector #define __pyx_n_s_has_budget_greater_than __pyx_mstate_global->__pyx_n_s_has_budget_greater_than #define __pyx_n_s_has_text_elements __pyx_mstate_global->__pyx_n_s_has_text_elements #define __pyx_n_s_hashlib __pyx_mstate_global->__pyx_n_s_hashlib #define __pyx_n_s_hexdigest __pyx_mstate_global->__pyx_n_s_hexdigest #define __pyx_n_s_hint __pyx_mstate_global->__pyx_n_s_hint #define __pyx_n_s_hmac __pyx_mstate_global->__pyx_n_s_hmac #define __pyx_n_s_hostbased_service __pyx_mstate_global->__pyx_n_s_hostbased_service #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i #define __pyx_kp_b_i_d __pyx_mstate_global->__pyx_kp_b_i_d #define __pyx_n_s_ignore_custom_codec __pyx_mstate_global->__pyx_n_s_ignore_custom_codec #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_kp_u_in_element __pyx_mstate_global->__pyx_kp_u_in_element #define __pyx_n_s_in_table_a1 __pyx_mstate_global->__pyx_n_s_in_table_a1 #define __pyx_n_s_in_table_b1 __pyx_mstate_global->__pyx_n_s_in_table_b1 #define __pyx_n_s_in_table_c12 __pyx_mstate_global->__pyx_n_s_in_table_c12 #define __pyx_n_s_in_table_c21_c22 __pyx_mstate_global->__pyx_n_s_in_table_c21_c22 #define __pyx_n_s_in_table_c3 __pyx_mstate_global->__pyx_n_s_in_table_c3 #define __pyx_n_s_in_table_c4 __pyx_mstate_global->__pyx_n_s_in_table_c4 #define __pyx_n_s_in_table_c5 __pyx_mstate_global->__pyx_n_s_in_table_c5 #define __pyx_n_s_in_table_c6 __pyx_mstate_global->__pyx_n_s_in_table_c6 #define __pyx_n_s_in_table_c7 __pyx_mstate_global->__pyx_n_s_in_table_c7 #define __pyx_n_s_in_table_c8 __pyx_mstate_global->__pyx_n_s_in_table_c8 #define __pyx_n_s_in_table_c9 __pyx_mstate_global->__pyx_n_s_in_table_c9 #define __pyx_n_s_in_table_d1 __pyx_mstate_global->__pyx_n_s_in_table_d1 #define __pyx_n_s_in_table_d2 __pyx_mstate_global->__pyx_n_s_in_table_d2 #define __pyx_kp_u_inconsistent_sub_array_dimension __pyx_mstate_global->__pyx_kp_u_inconsistent_sub_array_dimension #define __pyx_n_u_index_am_handler __pyx_mstate_global->__pyx_n_u_index_am_handler #define __pyx_n_u_inet __pyx_mstate_global->__pyx_n_u_inet #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init #define __pyx_n_s_init_codecs __pyx_mstate_global->__pyx_n_s_init_codecs #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass #define __pyx_n_s_init_types __pyx_mstate_global->__pyx_n_s_init_types #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing #define __pyx_n_u_initiate __pyx_mstate_global->__pyx_n_u_initiate #define __pyx_kp_u_input_of_anonymous_composite_typ __pyx_mstate_global->__pyx_kp_u_input_of_anonymous_composite_typ #define __pyx_n_s_inspect __pyx_mstate_global->__pyx_n_s_inspect #define __pyx_n_s_int __pyx_mstate_global->__pyx_n_s_int #define __pyx_n_u_int __pyx_mstate_global->__pyx_n_u_int #define __pyx_n_u_int2 __pyx_mstate_global->__pyx_n_u_int2 #define __pyx_n_u_int4 __pyx_mstate_global->__pyx_n_u_int4 #define __pyx_n_u_int8 __pyx_mstate_global->__pyx_n_u_int8 #define __pyx_n_u_integer __pyx_mstate_global->__pyx_n_u_integer #define __pyx_n_u_internal __pyx_mstate_global->__pyx_n_u_internal #define __pyx_n_u_interval __pyx_mstate_global->__pyx_n_u_interval #define __pyx_kp_u_invalid_array_element __pyx_mstate_global->__pyx_kp_u_invalid_array_element #define __pyx_kp_u_invalid_array_element_at_index __pyx_mstate_global->__pyx_kp_u_invalid_array_element_at_index #define __pyx_kp_u_invalid_data_format __pyx_mstate_global->__pyx_kp_u_invalid_data_format #define __pyx_kp_u_invalid_format_argument_expected __pyx_mstate_global->__pyx_kp_u_invalid_format_argument_expected #define __pyx_kp_u_invalid_input_for_query_argument __pyx_mstate_global->__pyx_kp_u_invalid_input_for_query_argument #define __pyx_kp_u_invalid_input_in_executemany_arg __pyx_mstate_global->__pyx_kp_u_invalid_input_in_executemany_arg #define __pyx_kp_u_invalid_nonce __pyx_mstate_global->__pyx_kp_u_invalid_nonce #define __pyx_kp_u_invalid_timeout_value_expected_n __pyx_mstate_global->__pyx_kp_u_invalid_timeout_value_expected_n #define __pyx_n_s_is_cancelling __pyx_mstate_global->__pyx_n_s_is_cancelling #define __pyx_n_s_is_closed __pyx_mstate_global->__pyx_n_s_is_closed #define __pyx_n_s_is_connected __pyx_mstate_global->__pyx_n_s_is_connected #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_n_s_is_in_transaction __pyx_mstate_global->__pyx_n_s_is_in_transaction #define __pyx_n_s_isempty __pyx_mstate_global->__pyx_n_s_isempty #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_item __pyx_mstate_global->__pyx_n_s_item #define __pyx_n_s_items __pyx_mstate_global->__pyx_n_s_items #define __pyx_n_s_iterator __pyx_mstate_global->__pyx_n_s_iterator #define __pyx_n_u_json __pyx_mstate_global->__pyx_n_u_json #define __pyx_n_u_jsonb __pyx_mstate_global->__pyx_n_u_jsonb #define __pyx_n_u_jsonpath __pyx_mstate_global->__pyx_n_u_jsonpath #define __pyx_n_u_kerberosv5 __pyx_mstate_global->__pyx_n_u_kerberosv5 #define __pyx_n_u_kind __pyx_mstate_global->__pyx_n_u_kind #define __pyx_n_u_koi8_r __pyx_mstate_global->__pyx_n_u_koi8_r #define __pyx_n_u_koi8_u __pyx_mstate_global->__pyx_n_u_koi8_u #define __pyx_n_u_koi8r __pyx_mstate_global->__pyx_n_u_koi8r #define __pyx_n_u_koi8u __pyx_mstate_global->__pyx_n_u_koi8u #define __pyx_n_s_krbsrvname __pyx_mstate_global->__pyx_n_s_krbsrvname #define __pyx_n_u_language_handler __pyx_mstate_global->__pyx_n_u_language_handler #define __pyx_n_s_limit __pyx_mstate_global->__pyx_n_s_limit #define __pyx_n_u_line __pyx_mstate_global->__pyx_n_u_line #define __pyx_kp_u_list_tuple_or_Range_object_expec __pyx_mstate_global->__pyx_kp_u_list_tuple_or_Range_object_expec #define __pyx_n_s_lookup __pyx_mstate_global->__pyx_n_s_lookup #define __pyx_n_s_loop __pyx_mstate_global->__pyx_n_s_loop #define __pyx_n_s_lower __pyx_mstate_global->__pyx_n_s_lower #define __pyx_n_s_lower_inc __pyx_mstate_global->__pyx_n_s_lower_inc #define __pyx_n_u_lseg __pyx_mstate_global->__pyx_n_u_lseg #define __pyx_n_b_m __pyx_mstate_global->__pyx_n_b_m #define __pyx_n_u_macaddr __pyx_mstate_global->__pyx_n_u_macaddr #define __pyx_n_u_macaddr8 __pyx_mstate_global->__pyx_n_u_macaddr8 #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_kp_u_malformed_array_literal_r __pyx_mstate_global->__pyx_kp_u_malformed_array_literal_r #define __pyx_n_s_mapping __pyx_mstate_global->__pyx_n_s_mapping #define __pyx_n_s_mark_closed __pyx_mstate_global->__pyx_n_s_mark_closed #define __pyx_n_s_mark_unprepared __pyx_mstate_global->__pyx_n_s_mark_unprepared #define __pyx_n_b_md5 __pyx_mstate_global->__pyx_n_b_md5 #define __pyx_n_s_md5 __pyx_mstate_global->__pyx_n_s_md5 #define __pyx_n_u_md5 __pyx_mstate_global->__pyx_n_u_md5 #define __pyx_n_u_message __pyx_mstate_global->__pyx_n_u_message #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass #define __pyx_n_s_missing __pyx_mstate_global->__pyx_n_s_missing #define __pyx_kp_u_missing_after_array_dimensions __pyx_mstate_global->__pyx_kp_u_missing_after_array_dimensions #define __pyx_kp_u_missing_after_array_dimensions_2 __pyx_mstate_global->__pyx_kp_u_missing_after_array_dimensions_2 #define __pyx_kp_u_missing_array_dimension_value __pyx_mstate_global->__pyx_kp_u_missing_array_dimension_value #define __pyx_kp_u_missing_codec_information_for_OI __pyx_mstate_global->__pyx_kp_u_missing_codec_information_for_OI #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module #define __pyx_n_u_money __pyx_mstate_global->__pyx_n_u_money #define __pyx_n_s_monotonic __pyx_mstate_global->__pyx_n_s_monotonic #define __pyx_n_s_more __pyx_mstate_global->__pyx_n_s_more #define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries #define __pyx_n_u_multirange __pyx_mstate_global->__pyx_n_u_multirange #define __pyx_kp_b_n __pyx_mstate_global->__pyx_kp_b_n #define __pyx_kp_b_n_2 __pyx_mstate_global->__pyx_kp_b_n_2 #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_u_name __pyx_mstate_global->__pyx_n_u_name #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 #define __pyx_kp_u_named_prepared_statements_cannot __pyx_mstate_global->__pyx_kp_u_named_prepared_statements_cannot #define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new #define __pyx_n_s_new_2 __pyx_mstate_global->__pyx_n_s_new_2 #define __pyx_kp_u_no_binary_format_encoder_for_typ __pyx_mstate_global->__pyx_kp_u_no_binary_format_encoder_for_typ #define __pyx_kp_u_no_codec_for_composite_attribute __pyx_mstate_global->__pyx_kp_u_no_codec_for_composite_attribute #define __pyx_kp_u_no_decoder_for_OID __pyx_mstate_global->__pyx_kp_u_no_decoder_for_OID #define __pyx_kp_u_no_decoder_for_composite_type_el __pyx_mstate_global->__pyx_kp_u_no_decoder_for_composite_type_el #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non #define __pyx_kp_u_no_encoder_for_OID __pyx_mstate_global->__pyx_kp_u_no_encoder_for_OID #define __pyx_kp_u_non_homogeneous_array __pyx_mstate_global->__pyx_kp_u_non_homogeneous_array #define __pyx_n_s_normalize __pyx_mstate_global->__pyx_n_s_normalize #define __pyx_kp_u_not_connected __pyx_mstate_global->__pyx_kp_u_not_connected #define __pyx_n_u_ns __pyx_mstate_global->__pyx_n_u_ns #define __pyx_n_s_num_cols __pyx_mstate_global->__pyx_n_s_num_cols #define __pyx_kp_u_number_of_array_dimensions_excee __pyx_mstate_global->__pyx_kp_u_number_of_array_dimensions_excee #define __pyx_n_u_numeric __pyx_mstate_global->__pyx_n_u_numeric #define __pyx_n_s_object __pyx_mstate_global->__pyx_n_s_object #define __pyx_kp_u_of_executemany_sequence __pyx_mstate_global->__pyx_kp_u_of_executemany_sequence #define __pyx_n_s_oid __pyx_mstate_global->__pyx_n_s_oid #define __pyx_n_u_oid __pyx_mstate_global->__pyx_n_u_oid #define __pyx_kp_u_oid_2 __pyx_mstate_global->__pyx_kp_u_oid_2 #define __pyx_n_s_on_error __pyx_mstate_global->__pyx_n_s_on_error #define __pyx_kp_u_on_result__prepare_statement_is __pyx_mstate_global->__pyx_kp_u_on_result__prepare_statement_is #define __pyx_kp_u_on_result_waiter_is_None __pyx_mstate_global->__pyx_kp_u_on_result_waiter_is_None #define __pyx_kp_u_on_result_waiter_is_done __pyx_mstate_global->__pyx_kp_u_on_result_waiter_is_done #define __pyx_n_s_on_timeout __pyx_mstate_global->__pyx_n_s_on_timeout #define __pyx_n_s_on_waiter_completed __pyx_mstate_global->__pyx_n_s_on_waiter_completed #define __pyx_n_u_opaque __pyx_mstate_global->__pyx_n_u_opaque #define __pyx_kp_b_p __pyx_mstate_global->__pyx_kp_b_p #define __pyx_n_s_p_oid __pyx_mstate_global->__pyx_n_s_p_oid #define __pyx_kp_u_parse_data_msgs_first_message_i __pyx_mstate_global->__pyx_kp_u_parse_data_msgs_first_message_i #define __pyx_kp_u_parse_data_msgs_result_is_not_a __pyx_mstate_global->__pyx_kp_u_parse_data_msgs_result_is_not_a #define __pyx_n_s_password __pyx_mstate_global->__pyx_n_s_password #define __pyx_n_u_password __pyx_mstate_global->__pyx_n_u_password #define __pyx_n_u_password_iterations __pyx_mstate_global->__pyx_n_u_password_iterations #define __pyx_n_u_password_salt __pyx_mstate_global->__pyx_n_u_password_salt #define __pyx_n_u_path __pyx_mstate_global->__pyx_n_u_path #define __pyx_n_s_pause_reading __pyx_mstate_global->__pyx_n_s_pause_reading #define __pyx_n_s_pause_writing __pyx_mstate_global->__pyx_n_s_pause_writing #define __pyx_n_u_pg_brin_bloom_summary __pyx_mstate_global->__pyx_n_u_pg_brin_bloom_summary #define __pyx_n_u_pg_brin_minmax_multi_summary __pyx_mstate_global->__pyx_n_u_pg_brin_minmax_multi_summary #define __pyx_n_u_pg_catalog __pyx_mstate_global->__pyx_n_u_pg_catalog #define __pyx_kp_u_pg_contrib_hstore __pyx_mstate_global->__pyx_kp_u_pg_contrib_hstore #define __pyx_n_u_pg_ddl_command __pyx_mstate_global->__pyx_n_u_pg_ddl_command #define __pyx_n_u_pg_dependencies __pyx_mstate_global->__pyx_n_u_pg_dependencies #define __pyx_n_u_pg_lsn __pyx_mstate_global->__pyx_n_u_pg_lsn #define __pyx_n_u_pg_mcv_list __pyx_mstate_global->__pyx_n_u_pg_mcv_list #define __pyx_n_u_pg_ndistinct __pyx_mstate_global->__pyx_n_u_pg_ndistinct #define __pyx_n_u_pg_node_tree __pyx_mstate_global->__pyx_n_u_pg_node_tree #define __pyx_n_u_pg_snapshot __pyx_mstate_global->__pyx_n_u_pg_snapshot #define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle #define __pyx_n_u_point __pyx_mstate_global->__pyx_n_u_point #define __pyx_n_u_polygon __pyx_mstate_global->__pyx_n_u_polygon #define __pyx_n_s_pop __pyx_mstate_global->__pyx_n_s_pop #define __pyx_n_s_portal_name __pyx_mstate_global->__pyx_n_s_portal_name #define __pyx_n_s_position __pyx_mstate_global->__pyx_n_s_position #define __pyx_n_u_postgres __pyx_mstate_global->__pyx_n_u_postgres #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare #define __pyx_n_s_prepare_2 __pyx_mstate_global->__pyx_n_s_prepare_2 #define __pyx_n_s_process_log_message __pyx_mstate_global->__pyx_n_s_process_log_message #define __pyx_n_s_process_notification __pyx_mstate_global->__pyx_n_s_process_notification #define __pyx_n_s_protocol __pyx_mstate_global->__pyx_n_s_protocol #define __pyx_kp_u_protocol_is_in_an_unexpected_st __pyx_mstate_global->__pyx_kp_u_protocol_is_in_an_unexpected_st #define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError #define __pyx_n_s_pyx_capi __pyx_mstate_global->__pyx_n_s_pyx_capi #define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum #define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type #define __pyx_n_s_pyx_unpickle_BaseProtocol __pyx_mstate_global->__pyx_n_s_pyx_unpickle_BaseProtocol #define __pyx_n_s_pyx_unpickle_CoreProtocol __pyx_mstate_global->__pyx_n_s_pyx_unpickle_CoreProtocol #define __pyx_n_s_pyx_unpickle_DataCodecConfig __pyx_mstate_global->__pyx_n_s_pyx_unpickle_DataCodecConfig #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_n_s_query __pyx_mstate_global->__pyx_n_s_query #define __pyx_kp_u_query_argument __pyx_mstate_global->__pyx_kp_u_query_argument #define __pyx_n_b_r __pyx_mstate_global->__pyx_n_b_r #define __pyx_kp_b_r_2 __pyx_mstate_global->__pyx_kp_b_r_2 #define __pyx_kp_b_r_3 __pyx_mstate_global->__pyx_kp_b_r_3 #define __pyx_kp_u_r_is_not_a_valid_element_of_com __pyx_mstate_global->__pyx_kp_u_r_is_not_a_valid_element_of_com #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range #define __pyx_n_u_range __pyx_mstate_global->__pyx_n_u_range #define __pyx_n_u_range_subtype __pyx_mstate_global->__pyx_n_u_range_subtype #define __pyx_n_u_range_subtype_name __pyx_mstate_global->__pyx_n_u_range_subtype_name #define __pyx_n_s_range_subtype_oid __pyx_mstate_global->__pyx_n_s_range_subtype_oid #define __pyx_n_s_rdesc __pyx_mstate_global->__pyx_n_s_rdesc #define __pyx_n_s_re __pyx_mstate_global->__pyx_n_s_re #define __pyx_n_s_reader __pyx_mstate_global->__pyx_n_s_reader #define __pyx_kp_u_reader_is_not_an_asynchronous_it __pyx_mstate_global->__pyx_kp_u_reader_is_not_an_asynchronous_it #define __pyx_n_u_real __pyx_mstate_global->__pyx_n_u_real #define __pyx_n_s_rec __pyx_mstate_global->__pyx_n_s_rec #define __pyx_n_u_record __pyx_mstate_global->__pyx_n_u_record #define __pyx_n_s_record_class __pyx_mstate_global->__pyx_n_s_record_class #define __pyx_n_s_record_stmt __pyx_mstate_global->__pyx_n_s_record_stmt #define __pyx_n_s_records __pyx_mstate_global->__pyx_n_s_records #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_ref __pyx_mstate_global->__pyx_n_s_ref #define __pyx_n_u_refcursor __pyx_mstate_global->__pyx_n_u_refcursor #define __pyx_n_u_regclass __pyx_mstate_global->__pyx_n_u_regclass #define __pyx_n_u_regcollation __pyx_mstate_global->__pyx_n_u_regcollation #define __pyx_n_u_regconfig __pyx_mstate_global->__pyx_n_u_regconfig #define __pyx_n_u_regdictionary __pyx_mstate_global->__pyx_n_u_regdictionary #define __pyx_n_s_register_data_types __pyx_mstate_global->__pyx_n_s_register_data_types #define __pyx_n_u_regnamespace __pyx_mstate_global->__pyx_n_u_regnamespace #define __pyx_n_u_regoper __pyx_mstate_global->__pyx_n_u_regoper #define __pyx_n_u_regoperator __pyx_mstate_global->__pyx_n_u_regoperator #define __pyx_n_u_regproc __pyx_mstate_global->__pyx_n_u_regproc #define __pyx_n_u_regprocedure __pyx_mstate_global->__pyx_n_u_regprocedure #define __pyx_n_u_regrole __pyx_mstate_global->__pyx_n_u_regrole #define __pyx_n_u_regtype __pyx_mstate_global->__pyx_n_u_regtype #define __pyx_n_s_release __pyx_mstate_global->__pyx_n_s_release #define __pyx_n_u_reltime __pyx_mstate_global->__pyx_n_u_reltime #define __pyx_n_s_remove_python_codec __pyx_mstate_global->__pyx_n_s_remove_python_codec #define __pyx_n_s_request_cancel __pyx_mstate_global->__pyx_n_s_request_cancel #define __pyx_n_s_result __pyx_mstate_global->__pyx_n_s_result #define __pyx_n_s_resume_reading __pyx_mstate_global->__pyx_n_s_resume_reading #define __pyx_n_s_resume_writing __pyx_mstate_global->__pyx_n_s_resume_writing #define __pyx_n_s_return_extra __pyx_mstate_global->__pyx_n_s_return_extra #define __pyx_n_s_return_rows __pyx_mstate_global->__pyx_n_s_return_rows #define __pyx_n_s_reversed __pyx_mstate_global->__pyx_n_s_reversed #define __pyx_n_s_row __pyx_mstate_global->__pyx_n_s_row #define __pyx_kp_b_s __pyx_mstate_global->__pyx_kp_b_s #define __pyx_n_s_s_2 __pyx_mstate_global->__pyx_n_s_s_2 #define __pyx_n_u_s_2 __pyx_mstate_global->__pyx_n_u_s_2 #define __pyx_n_u_scalar __pyx_mstate_global->__pyx_n_u_scalar #define __pyx_n_s_schema __pyx_mstate_global->__pyx_n_s_schema #define __pyx_kp_u_scram_sha_256 __pyx_mstate_global->__pyx_kp_u_scram_sha_256 #define __pyx_n_s_search __pyx_mstate_global->__pyx_n_s_search #define __pyx_n_s_secrets __pyx_mstate_global->__pyx_n_s_secrets #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send #define __pyx_n_u_server_first_message __pyx_mstate_global->__pyx_n_u_server_first_message #define __pyx_n_u_server_nonce __pyx_mstate_global->__pyx_n_u_server_nonce #define __pyx_n_s_server_settings __pyx_mstate_global->__pyx_n_s_server_settings #define __pyx_n_s_set __pyx_mstate_global->__pyx_n_s_set #define __pyx_n_s_set_builtin_type_codec __pyx_mstate_global->__pyx_n_s_set_builtin_type_codec #define __pyx_n_s_set_builtin_type_codec_2 __pyx_mstate_global->__pyx_n_s_set_builtin_type_codec_2 #define __pyx_n_s_set_connection __pyx_mstate_global->__pyx_n_s_set_connection #define __pyx_n_s_set_exception __pyx_mstate_global->__pyx_n_s_set_exception #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name #define __pyx_n_s_set_result __pyx_mstate_global->__pyx_n_s_set_result #define __pyx_n_s_setsockopt __pyx_mstate_global->__pyx_n_s_setsockopt #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_settings __pyx_mstate_global->__pyx_n_s_settings #define __pyx_n_s_sha256 __pyx_mstate_global->__pyx_n_s_sha256 #define __pyx_n_u_shift_jis __pyx_mstate_global->__pyx_n_u_shift_jis #define __pyx_n_u_shift_jis_2004 __pyx_mstate_global->__pyx_n_u_shift_jis_2004 #define __pyx_n_s_sink __pyx_mstate_global->__pyx_n_s_sink #define __pyx_kp_u_size_of_encoded_multirange_datum __pyx_mstate_global->__pyx_kp_u_size_of_encoded_multirange_datum #define __pyx_n_u_sjis __pyx_mstate_global->__pyx_n_u_sjis #define __pyx_n_s_sleep __pyx_mstate_global->__pyx_n_s_sleep #define __pyx_n_u_smallint __pyx_mstate_global->__pyx_n_u_smallint #define __pyx_n_u_smgr __pyx_mstate_global->__pyx_n_u_smgr #define __pyx_n_s_sock __pyx_mstate_global->__pyx_n_s_sock #define __pyx_n_s_socket __pyx_mstate_global->__pyx_n_s_socket #define __pyx_n_u_socket __pyx_mstate_global->__pyx_n_u_socket #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec #define __pyx_kp_u_specified_array_dimensions_do_no __pyx_mstate_global->__pyx_kp_u_specified_array_dimensions_do_no #define __pyx_n_u_sql_ascii __pyx_mstate_global->__pyx_n_u_sql_ascii #define __pyx_n_u_sspi __pyx_mstate_global->__pyx_n_u_sspi #define __pyx_n_s_sspilib __pyx_mstate_global->__pyx_n_s_sspilib #define __pyx_kp_u_sspilib_module_not_found_please __pyx_mstate_global->__pyx_kp_u_sspilib_module_not_found_please #define __pyx_n_s_started __pyx_mstate_global->__pyx_n_s_started #define __pyx_n_s_startswith __pyx_mstate_global->__pyx_n_s_startswith #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_n_s_status_msg __pyx_mstate_global->__pyx_n_s_status_msg #define __pyx_n_s_step __pyx_mstate_global->__pyx_n_s_step #define __pyx_n_s_stmt_name __pyx_mstate_global->__pyx_n_s_stmt_name #define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str #define __pyx_n_s_stringprep __pyx_mstate_global->__pyx_n_s_stringprep #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_n_u_table_am_handler __pyx_mstate_global->__pyx_n_u_table_am_handler #define __pyx_n_s_target_codec __pyx_mstate_global->__pyx_n_s_target_codec #define __pyx_n_s_target_name __pyx_mstate_global->__pyx_n_s_target_name #define __pyx_n_s_tb __pyx_mstate_global->__pyx_n_s_tb #define __pyx_n_u_tcvn __pyx_mstate_global->__pyx_n_u_tcvn #define __pyx_n_u_tcvn5712 __pyx_mstate_global->__pyx_n_u_tcvn5712 #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_u_text __pyx_mstate_global->__pyx_n_u_text #define __pyx_kp_u_text_2 __pyx_mstate_global->__pyx_kp_u_text_2 #define __pyx_kp_u_text_binary_or_tuple __pyx_mstate_global->__pyx_kp_u_text_binary_or_tuple #define __pyx_kp_u_text_or_binary __pyx_mstate_global->__pyx_kp_u_text_or_binary #define __pyx_kp_u_text_or_binary_2 __pyx_mstate_global->__pyx_kp_u_text_or_binary_2 #define __pyx_kp_u_the_number_of_columns_in_the_res __pyx_mstate_global->__pyx_kp_u_the_number_of_columns_in_the_res #define __pyx_kp_u_the_number_of_query_arguments_ca __pyx_mstate_global->__pyx_kp_u_the_number_of_query_arguments_ca #define __pyx_kp_u_the_server_expects_x_argument_s __pyx_mstate_global->__pyx_kp_u_the_server_expects_x_argument_s #define __pyx_kp_u_there_is_no __pyx_mstate_global->__pyx_kp_u_there_is_no #define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw #define __pyx_n_s_ti __pyx_mstate_global->__pyx_n_s_ti #define __pyx_n_u_tid __pyx_mstate_global->__pyx_n_u_tid #define __pyx_n_s_time __pyx_mstate_global->__pyx_n_s_time #define __pyx_n_u_time __pyx_mstate_global->__pyx_n_u_time #define __pyx_kp_u_time_with_timezone __pyx_mstate_global->__pyx_kp_u_time_with_timezone #define __pyx_kp_u_time_without_timezone __pyx_mstate_global->__pyx_kp_u_time_without_timezone #define __pyx_n_s_timeout __pyx_mstate_global->__pyx_n_s_timeout #define __pyx_n_s_timer __pyx_mstate_global->__pyx_n_s_timer #define __pyx_n_u_timestamp __pyx_mstate_global->__pyx_n_u_timestamp #define __pyx_kp_u_timestamp_with_timezone __pyx_mstate_global->__pyx_kp_u_timestamp_with_timezone #define __pyx_kp_u_timestamp_without_timezone __pyx_mstate_global->__pyx_kp_u_timestamp_without_timezone #define __pyx_n_u_timestamptz __pyx_mstate_global->__pyx_n_u_timestamptz #define __pyx_n_u_timetz __pyx_mstate_global->__pyx_n_u_timetz #define __pyx_n_u_tinterval __pyx_mstate_global->__pyx_n_u_tinterval #define __pyx_kp_u_to __pyx_mstate_global->__pyx_kp_u_to #define __pyx_n_s_to_bytes __pyx_mstate_global->__pyx_n_s_to_bytes #define __pyx_n_s_token_bytes __pyx_mstate_global->__pyx_n_s_token_bytes #define __pyx_kp_u_too_many_elements_in_array_value __pyx_mstate_global->__pyx_kp_u_too_many_elements_in_array_value #define __pyx_kp_u_too_many_elements_in_composite_t __pyx_mstate_global->__pyx_kp_u_too_many_elements_in_composite_t #define __pyx_kp_u_too_many_elements_in_multirange __pyx_mstate_global->__pyx_kp_u_too_many_elements_in_multirange #define __pyx_n_s_transport __pyx_mstate_global->__pyx_n_s_transport #define __pyx_n_u_trigger __pyx_mstate_global->__pyx_n_u_trigger #define __pyx_n_u_tsm_handler __pyx_mstate_global->__pyx_n_u_tsm_handler #define __pyx_n_u_tsquery __pyx_mstate_global->__pyx_n_u_tsquery #define __pyx_n_u_tsvector __pyx_mstate_global->__pyx_n_u_tsvector #define __pyx_n_u_tuple __pyx_mstate_global->__pyx_n_u_tuple #define __pyx_n_u_txid_snapshot __pyx_mstate_global->__pyx_n_u_txid_snapshot #define __pyx_kp_u_type_does_not_support_the_tuple __pyx_mstate_global->__pyx_kp_u_type_does_not_support_the_tuple #define __pyx_kp_u_type_record_missing_base_type_fo __pyx_mstate_global->__pyx_kp_u_type_record_missing_base_type_fo #define __pyx_kp_u_type_record_missing_base_type_fo_2 __pyx_mstate_global->__pyx_kp_u_type_record_missing_base_type_fo_2 #define __pyx_kp_u_type_record_missing_base_type_fo_3 __pyx_mstate_global->__pyx_kp_u_type_record_missing_base_type_fo_3 #define __pyx_kp_u_type_record_missing_field_types __pyx_mstate_global->__pyx_kp_u_type_record_missing_field_types #define __pyx_n_s_typeinfos __pyx_mstate_global->__pyx_n_s_typeinfos #define __pyx_n_s_typekind __pyx_mstate_global->__pyx_n_s_typekind #define __pyx_n_s_typename __pyx_mstate_global->__pyx_n_s_typename #define __pyx_n_s_typeoid __pyx_mstate_global->__pyx_n_s_typeoid #define __pyx_n_s_types __pyx_mstate_global->__pyx_n_s_types #define __pyx_n_s_typeschema __pyx_mstate_global->__pyx_n_s_typeschema #define __pyx_n_s_typoid __pyx_mstate_global->__pyx_n_s_typoid #define __pyx_kp_u_unexpected_NULL_element_in_multi __pyx_mstate_global->__pyx_kp_u_unexpected_NULL_element_in_multi #define __pyx_kp_u_unexpected_array_dimension_size __pyx_mstate_global->__pyx_kp_u_unexpected_array_dimension_size #define __pyx_kp_u_unexpected_array_dimensions_valu __pyx_mstate_global->__pyx_kp_u_unexpected_array_dimensions_valu #define __pyx_kp_u_unexpected_character_r_at_positi __pyx_mstate_global->__pyx_kp_u_unexpected_character_r_at_positi #define __pyx_kp_u_unexpected_codec_type __pyx_mstate_global->__pyx_kp_u_unexpected_codec_type #define __pyx_kp_u_unexpected_data_format __pyx_mstate_global->__pyx_kp_u_unexpected_data_format #define __pyx_kp_u_unexpected_data_type_of_composit __pyx_mstate_global->__pyx_kp_u_unexpected_data_type_of_composit #define __pyx_kp_u_unexpected_end_of_string __pyx_mstate_global->__pyx_kp_u_unexpected_end_of_string #define __pyx_kp_u_unexpected_error_while_performin __pyx_mstate_global->__pyx_kp_u_unexpected_error_while_performin #define __pyx_kp_u_unexpected_exchange_format __pyx_mstate_global->__pyx_kp_u_unexpected_exchange_format #define __pyx_kp_u_unexpected_multirange_size_value __pyx_mstate_global->__pyx_kp_u_unexpected_multirange_size_value #define __pyx_kp_u_unexpected_number_of_attributes __pyx_mstate_global->__pyx_kp_u_unexpected_number_of_attributes #define __pyx_kp_u_unexpected_trailing_bytes_in_buf __pyx_mstate_global->__pyx_kp_u_unexpected_trailing_bytes_in_buf #define __pyx_kp_u_unhandled_standard_data_type __pyx_mstate_global->__pyx_kp_u_unhandled_standard_data_type #define __pyx_n_u_unicode __pyx_mstate_global->__pyx_n_u_unicode #define __pyx_n_s_unicodedata __pyx_mstate_global->__pyx_n_s_unicodedata #define __pyx_n_u_unknown __pyx_mstate_global->__pyx_n_u_unknown #define __pyx_kp_u_unknown_error_in_protocol_implem __pyx_mstate_global->__pyx_kp_u_unknown_error_in_protocol_implem #define __pyx_kp_u_unsupported_SASL_Authentication __pyx_mstate_global->__pyx_kp_u_unsupported_SASL_Authentication #define __pyx_kp_u_unsupported_authentication_metho __pyx_mstate_global->__pyx_kp_u_unsupported_authentication_metho #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update #define __pyx_n_s_upper __pyx_mstate_global->__pyx_n_s_upper #define __pyx_n_s_upper_inc __pyx_mstate_global->__pyx_n_s_upper_inc #define __pyx_n_s_usage __pyx_mstate_global->__pyx_n_s_usage #define __pyx_n_s_use_setstate __pyx_mstate_global->__pyx_n_s_use_setstate #define __pyx_n_s_user __pyx_mstate_global->__pyx_n_s_user #define __pyx_n_u_user __pyx_mstate_global->__pyx_n_u_user #define __pyx_kp_u_utf_8 __pyx_mstate_global->__pyx_kp_u_utf_8 #define __pyx_n_u_utf_8_2 __pyx_mstate_global->__pyx_n_u_utf_8_2 #define __pyx_n_u_uuid __pyx_mstate_global->__pyx_n_u_uuid #define __pyx_kp_b_v __pyx_mstate_global->__pyx_kp_b_v #define __pyx_n_u_varbit __pyx_mstate_global->__pyx_n_u_varbit #define __pyx_n_u_varchar __pyx_mstate_global->__pyx_n_u_varchar #define __pyx_n_u_void __pyx_mstate_global->__pyx_n_u_void #define __pyx_n_u_vscii __pyx_mstate_global->__pyx_n_u_vscii #define __pyx_n_s_w __pyx_mstate_global->__pyx_n_s_w #define __pyx_n_s_wait __pyx_mstate_global->__pyx_n_s_wait #define __pyx_n_s_wait_for __pyx_mstate_global->__pyx_n_s_wait_for #define __pyx_n_s_wait_for_cancellation __pyx_mstate_global->__pyx_n_s_wait_for_cancellation #define __pyx_n_s_waiter __pyx_mstate_global->__pyx_n_s_waiter #define __pyx_kp_u_waiter_is_not_done_while_handlin __pyx_mstate_global->__pyx_kp_u_waiter_is_not_done_while_handlin #define __pyx_n_u_was __pyx_mstate_global->__pyx_n_u_was #define __pyx_n_s_wbuf __pyx_mstate_global->__pyx_n_s_wbuf #define __pyx_n_s_weakref __pyx_mstate_global->__pyx_n_s_weakref #define __pyx_n_u_were __pyx_mstate_global->__pyx_n_u_were #define __pyx_n_u_win __pyx_mstate_global->__pyx_n_u_win #define __pyx_n_u_win1250 __pyx_mstate_global->__pyx_n_u_win1250 #define __pyx_n_u_win1251 __pyx_mstate_global->__pyx_n_u_win1251 #define __pyx_n_u_win1252 __pyx_mstate_global->__pyx_n_u_win1252 #define __pyx_n_u_win1253 __pyx_mstate_global->__pyx_n_u_win1253 #define __pyx_n_u_win1254 __pyx_mstate_global->__pyx_n_u_win1254 #define __pyx_n_u_win1255 __pyx_mstate_global->__pyx_n_u_win1255 #define __pyx_n_u_win1256 __pyx_mstate_global->__pyx_n_u_win1256 #define __pyx_n_u_win1257 __pyx_mstate_global->__pyx_n_u_win1257 #define __pyx_n_u_win1258 __pyx_mstate_global->__pyx_n_u_win1258 #define __pyx_n_u_win866 __pyx_mstate_global->__pyx_n_u_win866 #define __pyx_n_u_win874 __pyx_mstate_global->__pyx_n_u_win874 #define __pyx_n_u_win932 __pyx_mstate_global->__pyx_n_u_win932 #define __pyx_n_u_win936 __pyx_mstate_global->__pyx_n_u_win936 #define __pyx_n_u_win949 __pyx_mstate_global->__pyx_n_u_win949 #define __pyx_n_u_win950 __pyx_mstate_global->__pyx_n_u_win950 #define __pyx_n_u_windows1250 __pyx_mstate_global->__pyx_n_u_windows1250 #define __pyx_n_u_windows1251 __pyx_mstate_global->__pyx_n_u_windows1251 #define __pyx_n_u_windows1252 __pyx_mstate_global->__pyx_n_u_windows1252 #define __pyx_n_u_windows1253 __pyx_mstate_global->__pyx_n_u_windows1253 #define __pyx_n_u_windows1254 __pyx_mstate_global->__pyx_n_u_windows1254 #define __pyx_n_u_windows1255 __pyx_mstate_global->__pyx_n_u_windows1255 #define __pyx_n_u_windows1256 __pyx_mstate_global->__pyx_n_u_windows1256 #define __pyx_n_u_windows1257 __pyx_mstate_global->__pyx_n_u_windows1257 #define __pyx_n_u_windows1258 __pyx_mstate_global->__pyx_n_u_windows1258 #define __pyx_n_u_windows866 __pyx_mstate_global->__pyx_n_u_windows866 #define __pyx_n_u_windows874 __pyx_mstate_global->__pyx_n_u_windows874 #define __pyx_n_u_windows932 __pyx_mstate_global->__pyx_n_u_windows932 #define __pyx_n_u_windows936 __pyx_mstate_global->__pyx_n_u_windows936 #define __pyx_n_u_windows949 __pyx_mstate_global->__pyx_n_u_windows949 #define __pyx_n_u_windows950 __pyx_mstate_global->__pyx_n_u_windows950 #define __pyx_n_s_with_msg __pyx_mstate_global->__pyx_n_s_with_msg #define __pyx_n_s_write __pyx_mstate_global->__pyx_n_s_write #define __pyx_n_s_writelines __pyx_mstate_global->__pyx_n_s_writelines #define __pyx_n_s_writing_allowed __pyx_mstate_global->__pyx_n_s_writing_allowed #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x #define __pyx_n_s_xformat __pyx_mstate_global->__pyx_n_s_xformat #define __pyx_n_u_xid __pyx_mstate_global->__pyx_n_u_xid #define __pyx_n_u_xid8 __pyx_mstate_global->__pyx_n_u_xid8 #define __pyx_n_u_xml __pyx_mstate_global->__pyx_n_u_xml #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y #define __pyx_kp_u_you_need_values_from_server_to_g __pyx_mstate_global->__pyx_kp_u_you_need_values_from_server_to_g #define __pyx_n_s_zip __pyx_mstate_global->__pyx_n_s_zip #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_4 __pyx_mstate_global->__pyx_int_4 #define __pyx_int_6 __pyx_mstate_global->__pyx_int_6 #define __pyx_int_16 __pyx_mstate_global->__pyx_int_16 #define __pyx_int_17 __pyx_mstate_global->__pyx_int_17 #define __pyx_int_18 __pyx_mstate_global->__pyx_int_18 #define __pyx_int_19 __pyx_mstate_global->__pyx_int_19 #define __pyx_int_20 __pyx_mstate_global->__pyx_int_20 #define __pyx_int_21 __pyx_mstate_global->__pyx_int_21 #define __pyx_int_23 __pyx_mstate_global->__pyx_int_23 #define __pyx_int_24 __pyx_mstate_global->__pyx_int_24 #define __pyx_int_25 __pyx_mstate_global->__pyx_int_25 #define __pyx_int_26 __pyx_mstate_global->__pyx_int_26 #define __pyx_int_27 __pyx_mstate_global->__pyx_int_27 #define __pyx_int_28 __pyx_mstate_global->__pyx_int_28 #define __pyx_int_29 __pyx_mstate_global->__pyx_int_29 #define __pyx_int_32 __pyx_mstate_global->__pyx_int_32 #define __pyx_int_40 __pyx_mstate_global->__pyx_int_40 #define __pyx_int_114 __pyx_mstate_global->__pyx_int_114 #define __pyx_int_142 __pyx_mstate_global->__pyx_int_142 #define __pyx_int_194 __pyx_mstate_global->__pyx_int_194 #define __pyx_int_210 __pyx_mstate_global->__pyx_int_210 #define __pyx_int_269 __pyx_mstate_global->__pyx_int_269 #define __pyx_int_325 __pyx_mstate_global->__pyx_int_325 #define __pyx_int_600 __pyx_mstate_global->__pyx_int_600 #define __pyx_int_601 __pyx_mstate_global->__pyx_int_601 #define __pyx_int_602 __pyx_mstate_global->__pyx_int_602 #define __pyx_int_603 __pyx_mstate_global->__pyx_int_603 #define __pyx_int_604 __pyx_mstate_global->__pyx_int_604 #define __pyx_int_628 __pyx_mstate_global->__pyx_int_628 #define __pyx_int_650 __pyx_mstate_global->__pyx_int_650 #define __pyx_int_700 __pyx_mstate_global->__pyx_int_700 #define __pyx_int_701 __pyx_mstate_global->__pyx_int_701 #define __pyx_int_702 __pyx_mstate_global->__pyx_int_702 #define __pyx_int_703 __pyx_mstate_global->__pyx_int_703 #define __pyx_int_704 __pyx_mstate_global->__pyx_int_704 #define __pyx_int_705 __pyx_mstate_global->__pyx_int_705 #define __pyx_int_718 __pyx_mstate_global->__pyx_int_718 #define __pyx_int_774 __pyx_mstate_global->__pyx_int_774 #define __pyx_int_790 __pyx_mstate_global->__pyx_int_790 #define __pyx_int_829 __pyx_mstate_global->__pyx_int_829 #define __pyx_int_869 __pyx_mstate_global->__pyx_int_869 #define __pyx_int_1009 __pyx_mstate_global->__pyx_int_1009 #define __pyx_int_1028 __pyx_mstate_global->__pyx_int_1028 #define __pyx_int_1033 __pyx_mstate_global->__pyx_int_1033 #define __pyx_int_1042 __pyx_mstate_global->__pyx_int_1042 #define __pyx_int_1043 __pyx_mstate_global->__pyx_int_1043 #define __pyx_int_1082 __pyx_mstate_global->__pyx_int_1082 #define __pyx_int_1083 __pyx_mstate_global->__pyx_int_1083 #define __pyx_int_1114 __pyx_mstate_global->__pyx_int_1114 #define __pyx_int_1184 __pyx_mstate_global->__pyx_int_1184 #define __pyx_int_1186 __pyx_mstate_global->__pyx_int_1186 #define __pyx_int_1266 __pyx_mstate_global->__pyx_int_1266 #define __pyx_int_1560 __pyx_mstate_global->__pyx_int_1560 #define __pyx_int_1562 __pyx_mstate_global->__pyx_int_1562 #define __pyx_int_1700 __pyx_mstate_global->__pyx_int_1700 #define __pyx_int_1790 __pyx_mstate_global->__pyx_int_1790 #define __pyx_int_2202 __pyx_mstate_global->__pyx_int_2202 #define __pyx_int_2203 __pyx_mstate_global->__pyx_int_2203 #define __pyx_int_2204 __pyx_mstate_global->__pyx_int_2204 #define __pyx_int_2205 __pyx_mstate_global->__pyx_int_2205 #define __pyx_int_2206 __pyx_mstate_global->__pyx_int_2206 #define __pyx_int_2249 __pyx_mstate_global->__pyx_int_2249 #define __pyx_int_2275 __pyx_mstate_global->__pyx_int_2275 #define __pyx_int_2276 __pyx_mstate_global->__pyx_int_2276 #define __pyx_int_2277 __pyx_mstate_global->__pyx_int_2277 #define __pyx_int_2278 __pyx_mstate_global->__pyx_int_2278 #define __pyx_int_2279 __pyx_mstate_global->__pyx_int_2279 #define __pyx_int_2280 __pyx_mstate_global->__pyx_int_2280 #define __pyx_int_2281 __pyx_mstate_global->__pyx_int_2281 #define __pyx_int_2282 __pyx_mstate_global->__pyx_int_2282 #define __pyx_int_2283 __pyx_mstate_global->__pyx_int_2283 #define __pyx_int_2776 __pyx_mstate_global->__pyx_int_2776 #define __pyx_int_2950 __pyx_mstate_global->__pyx_int_2950 #define __pyx_int_2970 __pyx_mstate_global->__pyx_int_2970 #define __pyx_int_3115 __pyx_mstate_global->__pyx_int_3115 #define __pyx_int_3220 __pyx_mstate_global->__pyx_int_3220 #define __pyx_int_3310 __pyx_mstate_global->__pyx_int_3310 #define __pyx_int_3361 __pyx_mstate_global->__pyx_int_3361 #define __pyx_int_3402 __pyx_mstate_global->__pyx_int_3402 #define __pyx_int_3500 __pyx_mstate_global->__pyx_int_3500 #define __pyx_int_3614 __pyx_mstate_global->__pyx_int_3614 #define __pyx_int_3615 __pyx_mstate_global->__pyx_int_3615 #define __pyx_int_3642 __pyx_mstate_global->__pyx_int_3642 #define __pyx_int_3734 __pyx_mstate_global->__pyx_int_3734 #define __pyx_int_3769 __pyx_mstate_global->__pyx_int_3769 #define __pyx_int_3802 __pyx_mstate_global->__pyx_int_3802 #define __pyx_int_3831 __pyx_mstate_global->__pyx_int_3831 #define __pyx_int_3838 __pyx_mstate_global->__pyx_int_3838 #define __pyx_int_4072 __pyx_mstate_global->__pyx_int_4072 #define __pyx_int_4089 __pyx_mstate_global->__pyx_int_4089 #define __pyx_int_4096 __pyx_mstate_global->__pyx_int_4096 #define __pyx_int_4191 __pyx_mstate_global->__pyx_int_4191 #define __pyx_int_4537 __pyx_mstate_global->__pyx_int_4537 #define __pyx_int_4538 __pyx_mstate_global->__pyx_int_4538 #define __pyx_int_4600 __pyx_mstate_global->__pyx_int_4600 #define __pyx_int_4601 __pyx_mstate_global->__pyx_int_4601 #define __pyx_int_5017 __pyx_mstate_global->__pyx_int_5017 #define __pyx_int_5038 __pyx_mstate_global->__pyx_int_5038 #define __pyx_int_5069 __pyx_mstate_global->__pyx_int_5069 #define __pyx_int_5077 __pyx_mstate_global->__pyx_int_5077 #define __pyx_int_5078 __pyx_mstate_global->__pyx_int_5078 #define __pyx_int_5079 __pyx_mstate_global->__pyx_int_5079 #define __pyx_int_5080 __pyx_mstate_global->__pyx_int_5080 #define __pyx_int_32768 __pyx_mstate_global->__pyx_int_32768 #define __pyx_int_524288 __pyx_mstate_global->__pyx_int_524288 #define __pyx_int_40941617 __pyx_mstate_global->__pyx_int_40941617 #define __pyx_int_89793719 __pyx_mstate_global->__pyx_int_89793719 #define __pyx_int_120810133 __pyx_mstate_global->__pyx_int_120810133 #define __pyx_int_134522893 __pyx_mstate_global->__pyx_int_134522893 #define __pyx_int_175807176 __pyx_mstate_global->__pyx_int_175807176 #define __pyx_int_228230485 __pyx_mstate_global->__pyx_int_228230485 #define __pyx_int_232227937 __pyx_mstate_global->__pyx_int_232227937 #define __pyx_int_245762207 __pyx_mstate_global->__pyx_int_245762207 #define __pyx_int_252635979 __pyx_mstate_global->__pyx_int_252635979 #define __pyx_k_ __pyx_mstate_global->__pyx_k_ #define __pyx_k__6 __pyx_mstate_global->__pyx_k__6 #define __pyx_k__7 __pyx_mstate_global->__pyx_k__7 #define __pyx_k__9 __pyx_mstate_global->__pyx_k__9 #define __pyx_k__10 __pyx_mstate_global->__pyx_k__10 #define __pyx_k__11 __pyx_mstate_global->__pyx_k__11 #define __pyx_slice__4 __pyx_mstate_global->__pyx_slice__4 #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_slice__43 __pyx_mstate_global->__pyx_slice__43 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 #define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 #define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 #define __pyx_tuple__49 __pyx_mstate_global->__pyx_tuple__49 #define __pyx_tuple__56 __pyx_mstate_global->__pyx_tuple__56 #define __pyx_tuple__60 __pyx_mstate_global->__pyx_tuple__60 #define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61 #define __pyx_tuple__62 __pyx_mstate_global->__pyx_tuple__62 #define __pyx_tuple__63 __pyx_mstate_global->__pyx_tuple__63 #define __pyx_tuple__64 __pyx_mstate_global->__pyx_tuple__64 #define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65 #define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67 #define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69 #define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71 #define __pyx_tuple__74 __pyx_mstate_global->__pyx_tuple__74 #define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76 #define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79 #define __pyx_tuple__83 __pyx_mstate_global->__pyx_tuple__83 #define __pyx_tuple__85 __pyx_mstate_global->__pyx_tuple__85 #define __pyx_tuple__87 __pyx_mstate_global->__pyx_tuple__87 #define __pyx_tuple__89 __pyx_mstate_global->__pyx_tuple__89 #define __pyx_tuple__93 __pyx_mstate_global->__pyx_tuple__93 #define __pyx_tuple__95 __pyx_mstate_global->__pyx_tuple__95 #define __pyx_tuple__103 __pyx_mstate_global->__pyx_tuple__103 #define __pyx_tuple__105 __pyx_mstate_global->__pyx_tuple__105 #define __pyx_tuple__107 __pyx_mstate_global->__pyx_tuple__107 #define __pyx_tuple__116 __pyx_mstate_global->__pyx_tuple__116 #define __pyx_tuple__121 __pyx_mstate_global->__pyx_tuple__121 #define __pyx_tuple__122 __pyx_mstate_global->__pyx_tuple__122 #define __pyx_tuple__123 __pyx_mstate_global->__pyx_tuple__123 #define __pyx_tuple__124 __pyx_mstate_global->__pyx_tuple__124 #define __pyx_tuple__125 __pyx_mstate_global->__pyx_tuple__125 #define __pyx_tuple__126 __pyx_mstate_global->__pyx_tuple__126 #define __pyx_tuple__127 __pyx_mstate_global->__pyx_tuple__127 #define __pyx_tuple__128 __pyx_mstate_global->__pyx_tuple__128 #define __pyx_tuple__129 __pyx_mstate_global->__pyx_tuple__129 #define __pyx_tuple__130 __pyx_mstate_global->__pyx_tuple__130 #define __pyx_tuple__134 __pyx_mstate_global->__pyx_tuple__134 #define __pyx_tuple__135 __pyx_mstate_global->__pyx_tuple__135 #define __pyx_tuple__137 __pyx_mstate_global->__pyx_tuple__137 #define __pyx_tuple__143 __pyx_mstate_global->__pyx_tuple__143 #define __pyx_tuple__145 __pyx_mstate_global->__pyx_tuple__145 #define __pyx_tuple__147 __pyx_mstate_global->__pyx_tuple__147 #define __pyx_tuple__153 __pyx_mstate_global->__pyx_tuple__153 #define __pyx_tuple__156 __pyx_mstate_global->__pyx_tuple__156 #define __pyx_tuple__159 __pyx_mstate_global->__pyx_tuple__159 #define __pyx_tuple__161 __pyx_mstate_global->__pyx_tuple__161 #define __pyx_tuple__163 __pyx_mstate_global->__pyx_tuple__163 #define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 #define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47 #define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 #define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50 #define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51 #define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52 #define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53 #define __pyx_codeobj__54 __pyx_mstate_global->__pyx_codeobj__54 #define __pyx_codeobj__55 __pyx_mstate_global->__pyx_codeobj__55 #define __pyx_codeobj__57 __pyx_mstate_global->__pyx_codeobj__57 #define __pyx_codeobj__58 __pyx_mstate_global->__pyx_codeobj__58 #define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59 #define __pyx_codeobj__66 __pyx_mstate_global->__pyx_codeobj__66 #define __pyx_codeobj__68 __pyx_mstate_global->__pyx_codeobj__68 #define __pyx_codeobj__70 __pyx_mstate_global->__pyx_codeobj__70 #define __pyx_codeobj__72 __pyx_mstate_global->__pyx_codeobj__72 #define __pyx_codeobj__73 __pyx_mstate_global->__pyx_codeobj__73 #define __pyx_codeobj__75 __pyx_mstate_global->__pyx_codeobj__75 #define __pyx_codeobj__77 __pyx_mstate_global->__pyx_codeobj__77 #define __pyx_codeobj__78 __pyx_mstate_global->__pyx_codeobj__78 #define __pyx_codeobj__80 __pyx_mstate_global->__pyx_codeobj__80 #define __pyx_codeobj__81 __pyx_mstate_global->__pyx_codeobj__81 #define __pyx_codeobj__82 __pyx_mstate_global->__pyx_codeobj__82 #define __pyx_codeobj__84 __pyx_mstate_global->__pyx_codeobj__84 #define __pyx_codeobj__86 __pyx_mstate_global->__pyx_codeobj__86 #define __pyx_codeobj__88 __pyx_mstate_global->__pyx_codeobj__88 #define __pyx_codeobj__90 __pyx_mstate_global->__pyx_codeobj__90 #define __pyx_codeobj__91 __pyx_mstate_global->__pyx_codeobj__91 #define __pyx_codeobj__92 __pyx_mstate_global->__pyx_codeobj__92 #define __pyx_codeobj__94 __pyx_mstate_global->__pyx_codeobj__94 #define __pyx_codeobj__96 __pyx_mstate_global->__pyx_codeobj__96 #define __pyx_codeobj__97 __pyx_mstate_global->__pyx_codeobj__97 #define __pyx_codeobj__98 __pyx_mstate_global->__pyx_codeobj__98 #define __pyx_codeobj__99 __pyx_mstate_global->__pyx_codeobj__99 #define __pyx_codeobj__100 __pyx_mstate_global->__pyx_codeobj__100 #define __pyx_codeobj__101 __pyx_mstate_global->__pyx_codeobj__101 #define __pyx_codeobj__102 __pyx_mstate_global->__pyx_codeobj__102 #define __pyx_codeobj__104 __pyx_mstate_global->__pyx_codeobj__104 #define __pyx_codeobj__106 __pyx_mstate_global->__pyx_codeobj__106 #define __pyx_codeobj__108 __pyx_mstate_global->__pyx_codeobj__108 #define __pyx_codeobj__109 __pyx_mstate_global->__pyx_codeobj__109 #define __pyx_codeobj__110 __pyx_mstate_global->__pyx_codeobj__110 #define __pyx_codeobj__111 __pyx_mstate_global->__pyx_codeobj__111 #define __pyx_codeobj__112 __pyx_mstate_global->__pyx_codeobj__112 #define __pyx_codeobj__113 __pyx_mstate_global->__pyx_codeobj__113 #define __pyx_codeobj__114 __pyx_mstate_global->__pyx_codeobj__114 #define __pyx_codeobj__115 __pyx_mstate_global->__pyx_codeobj__115 #define __pyx_codeobj__117 __pyx_mstate_global->__pyx_codeobj__117 #define __pyx_codeobj__118 __pyx_mstate_global->__pyx_codeobj__118 #define __pyx_codeobj__119 __pyx_mstate_global->__pyx_codeobj__119 #define __pyx_codeobj__120 __pyx_mstate_global->__pyx_codeobj__120 #define __pyx_codeobj__131 __pyx_mstate_global->__pyx_codeobj__131 #define __pyx_codeobj__132 __pyx_mstate_global->__pyx_codeobj__132 #define __pyx_codeobj__133 __pyx_mstate_global->__pyx_codeobj__133 #define __pyx_codeobj__136 __pyx_mstate_global->__pyx_codeobj__136 #define __pyx_codeobj__138 __pyx_mstate_global->__pyx_codeobj__138 #define __pyx_codeobj__139 __pyx_mstate_global->__pyx_codeobj__139 #define __pyx_codeobj__140 __pyx_mstate_global->__pyx_codeobj__140 #define __pyx_codeobj__141 __pyx_mstate_global->__pyx_codeobj__141 #define __pyx_codeobj__142 __pyx_mstate_global->__pyx_codeobj__142 #define __pyx_codeobj__144 __pyx_mstate_global->__pyx_codeobj__144 #define __pyx_codeobj__146 __pyx_mstate_global->__pyx_codeobj__146 #define __pyx_codeobj__148 __pyx_mstate_global->__pyx_codeobj__148 #define __pyx_codeobj__149 __pyx_mstate_global->__pyx_codeobj__149 #define __pyx_codeobj__150 __pyx_mstate_global->__pyx_codeobj__150 #define __pyx_codeobj__151 __pyx_mstate_global->__pyx_codeobj__151 #define __pyx_codeobj__152 __pyx_mstate_global->__pyx_codeobj__152 #define __pyx_codeobj__154 __pyx_mstate_global->__pyx_codeobj__154 #define __pyx_codeobj__155 __pyx_mstate_global->__pyx_codeobj__155 #define __pyx_codeobj__157 __pyx_mstate_global->__pyx_codeobj__157 #define __pyx_codeobj__158 __pyx_mstate_global->__pyx_codeobj__158 #define __pyx_codeobj__160 __pyx_mstate_global->__pyx_codeobj__160 #define __pyx_codeobj__162 __pyx_mstate_global->__pyx_codeobj__162 #define __pyx_codeobj__164 __pyx_mstate_global->__pyx_codeobj__164 #define __pyx_codeobj__165 __pyx_mstate_global->__pyx_codeobj__165 #define __pyx_codeobj__166 __pyx_mstate_global->__pyx_codeobj__166 /* #### Code section: module_code ### */ /* "cpython/complex.pxd":19 * * @property * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<< * return self.cval.real * */ static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) { double __pyx_r; /* "cpython/complex.pxd":20 * @property * cdef inline double real(self) noexcept: * return self.cval.real # <<<<<<<<<<<<<< * * @property */ __pyx_r = __pyx_v_self->cval.real; goto __pyx_L0; /* "cpython/complex.pxd":19 * * @property * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<< * return self.cval.real * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/complex.pxd":23 * * @property * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<< * return self.cval.imag * */ static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) { double __pyx_r; /* "cpython/complex.pxd":24 * @property * cdef inline double imag(self) noexcept: * return self.cval.imag # <<<<<<<<<<<<<< * * # PyTypeObject PyComplex_Type */ __pyx_r = __pyx_v_self->cval.imag; goto __pyx_L0; /* "cpython/complex.pxd":23 * * @property * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<< * return self.cval.imag * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "cpython/contextvars.pxd":112 * * * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the default value of the context variable, */ static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value *__pyx_optional_args) { PyObject *__pyx_v_default_value = ((PyObject *)Py_None); PyObject *__pyx_v_value; PyObject *__pyx_v_pyvalue = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_value", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_default_value = __pyx_optional_args->default_value; } } /* "cpython/contextvars.pxd":117 * or None if no such value or default was found. * """ * cdef PyObject *value = NULL # <<<<<<<<<<<<<< * PyContextVar_Get(var, NULL, &value) * if value is NULL: */ __pyx_v_value = NULL; /* "cpython/contextvars.pxd":118 * """ * cdef PyObject *value = NULL * PyContextVar_Get(var, NULL, &value) # <<<<<<<<<<<<<< * if value is NULL: * # context variable does not have a default */ __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 118, __pyx_L1_error) /* "cpython/contextvars.pxd":119 * cdef PyObject *value = NULL * PyContextVar_Get(var, NULL, &value) * if value is NULL: # <<<<<<<<<<<<<< * # context variable does not have a default * pyvalue = default_value */ __pyx_t_2 = (__pyx_v_value == NULL); if (__pyx_t_2) { /* "cpython/contextvars.pxd":121 * if value is NULL: * # context variable does not have a default * pyvalue = default_value # <<<<<<<<<<<<<< * else: * # value or default value of context variable */ __Pyx_INCREF(__pyx_v_default_value); __pyx_v_pyvalue = __pyx_v_default_value; /* "cpython/contextvars.pxd":119 * cdef PyObject *value = NULL * PyContextVar_Get(var, NULL, &value) * if value is NULL: # <<<<<<<<<<<<<< * # context variable does not have a default * pyvalue = default_value */ goto __pyx_L3; } /* "cpython/contextvars.pxd":124 * else: * # value or default value of context variable * pyvalue = value # <<<<<<<<<<<<<< * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue */ /*else*/ { __pyx_t_3 = ((PyObject *)__pyx_v_value); __Pyx_INCREF(__pyx_t_3); __pyx_v_pyvalue = __pyx_t_3; __pyx_t_3 = 0; /* "cpython/contextvars.pxd":125 * # value or default value of context variable * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<< * return pyvalue * */ Py_XDECREF(__pyx_v_value); } __pyx_L3:; /* "cpython/contextvars.pxd":126 * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_pyvalue); __pyx_r = __pyx_v_pyvalue; goto __pyx_L0; /* "cpython/contextvars.pxd":112 * * * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the default value of the context variable, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cpython.contextvars.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_pyvalue); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cpython/contextvars.pxd":129 * * * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the provided default value if no such value was found. */ static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_default(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default *__pyx_optional_args) { PyObject *__pyx_v_default_value = ((PyObject *)Py_None); PyObject *__pyx_v_value; PyObject *__pyx_v_pyvalue = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_value_no_default", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_default_value = __pyx_optional_args->default_value; } } /* "cpython/contextvars.pxd":135 * Ignores the default value of the context variable, if any. * """ * cdef PyObject *value = NULL # <<<<<<<<<<<<<< * PyContextVar_Get(var, default_value, &value) * # value of context variable or 'default_value' */ __pyx_v_value = NULL; /* "cpython/contextvars.pxd":136 * """ * cdef PyObject *value = NULL * PyContextVar_Get(var, default_value, &value) # <<<<<<<<<<<<<< * # value of context variable or 'default_value' * pyvalue = value */ __pyx_t_1 = PyContextVar_Get(__pyx_v_var, ((PyObject *)__pyx_v_default_value), (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 136, __pyx_L1_error) /* "cpython/contextvars.pxd":138 * PyContextVar_Get(var, default_value, &value) * # value of context variable or 'default_value' * pyvalue = value # <<<<<<<<<<<<<< * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue */ __pyx_t_2 = ((PyObject *)__pyx_v_value); __Pyx_INCREF(__pyx_t_2); __pyx_v_pyvalue = __pyx_t_2; __pyx_t_2 = 0; /* "cpython/contextvars.pxd":139 * # value of context variable or 'default_value' * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<< * return pyvalue */ Py_XDECREF(__pyx_v_value); /* "cpython/contextvars.pxd":140 * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_pyvalue); __pyx_r = __pyx_v_pyvalue; goto __pyx_L0; /* "cpython/contextvars.pxd":129 * * * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the provided default value if no such value was found. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cpython.contextvars.get_value_no_default", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_pyvalue); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/frb.pxd":14 * ssize_t len * * inline ssize_t frb_get_len(FRBuffer *frb): # <<<<<<<<<<<<<< * return frb.len * */ static CYTHON_INLINE Py_ssize_t __pyx_f_7asyncpg_7pgproto_7pgproto_frb_get_len(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_frb) { Py_ssize_t __pyx_r; /* "asyncpg/pgproto/frb.pxd":15 * * inline ssize_t frb_get_len(FRBuffer *frb): * return frb.len # <<<<<<<<<<<<<< * * inline void frb_set_len(FRBuffer *frb, ssize_t new_len): */ __pyx_r = __pyx_v_frb->len; goto __pyx_L0; /* "asyncpg/pgproto/frb.pxd":14 * ssize_t len * * inline ssize_t frb_get_len(FRBuffer *frb): # <<<<<<<<<<<<<< * return frb.len * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "asyncpg/pgproto/frb.pxd":17 * return frb.len * * inline void frb_set_len(FRBuffer *frb, ssize_t new_len): # <<<<<<<<<<<<<< * frb.len = new_len * */ static CYTHON_INLINE void __pyx_f_7asyncpg_7pgproto_7pgproto_frb_set_len(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_frb, Py_ssize_t __pyx_v_new_len) { /* "asyncpg/pgproto/frb.pxd":18 * * inline void frb_set_len(FRBuffer *frb, ssize_t new_len): * frb.len = new_len # <<<<<<<<<<<<<< * * inline void frb_init(FRBuffer *frb, const char *buf, ssize_t len): */ __pyx_v_frb->len = __pyx_v_new_len; /* "asyncpg/pgproto/frb.pxd":17 * return frb.len * * inline void frb_set_len(FRBuffer *frb, ssize_t new_len): # <<<<<<<<<<<<<< * frb.len = new_len * */ /* function exit code */ } /* "asyncpg/pgproto/frb.pxd":20 * frb.len = new_len * * inline void frb_init(FRBuffer *frb, const char *buf, ssize_t len): # <<<<<<<<<<<<<< * frb.buf = buf * frb.len = len */ static CYTHON_INLINE void __pyx_f_7asyncpg_7pgproto_7pgproto_frb_init(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_frb, char const *__pyx_v_buf, Py_ssize_t __pyx_v_len) { /* "asyncpg/pgproto/frb.pxd":21 * * inline void frb_init(FRBuffer *frb, const char *buf, ssize_t len): * frb.buf = buf # <<<<<<<<<<<<<< * frb.len = len * */ __pyx_v_frb->buf = __pyx_v_buf; /* "asyncpg/pgproto/frb.pxd":22 * inline void frb_init(FRBuffer *frb, const char *buf, ssize_t len): * frb.buf = buf * frb.len = len # <<<<<<<<<<<<<< * * inline const char* frb_read(FRBuffer *frb, ssize_t n) except NULL: */ __pyx_v_frb->len = __pyx_v_len; /* "asyncpg/pgproto/frb.pxd":20 * frb.len = new_len * * inline void frb_init(FRBuffer *frb, const char *buf, ssize_t len): # <<<<<<<<<<<<<< * frb.buf = buf * frb.len = len */ /* function exit code */ } /* "asyncpg/pgproto/frb.pxd":24 * frb.len = len * * inline const char* frb_read(FRBuffer *frb, ssize_t n) except NULL: # <<<<<<<<<<<<<< * cdef const char *result * */ static CYTHON_INLINE char const *__pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_frb, Py_ssize_t __pyx_v_n) { char const *__pyx_v_result; char const *__pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("frb_read", 1); /* "asyncpg/pgproto/frb.pxd":27 * cdef const char *result * * frb_check(frb, n) # <<<<<<<<<<<<<< * * result = frb.buf */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_check(__pyx_v_frb, __pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/pgproto/frb.pxd":29 * frb_check(frb, n) * * result = frb.buf # <<<<<<<<<<<<<< * frb.buf += n * frb.len -= n */ __pyx_t_2 = __pyx_v_frb->buf; __pyx_v_result = __pyx_t_2; /* "asyncpg/pgproto/frb.pxd":30 * * result = frb.buf * frb.buf += n # <<<<<<<<<<<<<< * frb.len -= n * */ __pyx_v_frb->buf = (__pyx_v_frb->buf + __pyx_v_n); /* "asyncpg/pgproto/frb.pxd":31 * result = frb.buf * frb.buf += n * frb.len -= n # <<<<<<<<<<<<<< * * return result */ __pyx_v_frb->len = (__pyx_v_frb->len - __pyx_v_n); /* "asyncpg/pgproto/frb.pxd":33 * frb.len -= n * * return result # <<<<<<<<<<<<<< * * inline const char* frb_read_all(FRBuffer *frb): */ __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/pgproto/frb.pxd":24 * frb.len = len * * inline const char* frb_read(FRBuffer *frb, ssize_t n) except NULL: # <<<<<<<<<<<<<< * cdef const char *result * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.frb_read", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/frb.pxd":35 * return result * * inline const char* frb_read_all(FRBuffer *frb): # <<<<<<<<<<<<<< * cdef const char *result * result = frb.buf */ static CYTHON_INLINE char const *__pyx_f_7asyncpg_7pgproto_7pgproto_frb_read_all(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_frb) { char const *__pyx_v_result; char const *__pyx_r; char const *__pyx_t_1; /* "asyncpg/pgproto/frb.pxd":37 * inline const char* frb_read_all(FRBuffer *frb): * cdef const char *result * result = frb.buf # <<<<<<<<<<<<<< * frb.buf += frb.len * frb.len = 0 */ __pyx_t_1 = __pyx_v_frb->buf; __pyx_v_result = __pyx_t_1; /* "asyncpg/pgproto/frb.pxd":38 * cdef const char *result * result = frb.buf * frb.buf += frb.len # <<<<<<<<<<<<<< * frb.len = 0 * return result */ __pyx_v_frb->buf = (__pyx_v_frb->buf + __pyx_v_frb->len); /* "asyncpg/pgproto/frb.pxd":39 * result = frb.buf * frb.buf += frb.len * frb.len = 0 # <<<<<<<<<<<<<< * return result * */ __pyx_v_frb->len = 0; /* "asyncpg/pgproto/frb.pxd":40 * frb.buf += frb.len * frb.len = 0 * return result # <<<<<<<<<<<<<< * * inline FRBuffer *frb_slice_from(FRBuffer *frb, */ __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/pgproto/frb.pxd":35 * return result * * inline const char* frb_read_all(FRBuffer *frb): # <<<<<<<<<<<<<< * cdef const char *result * result = frb.buf */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "asyncpg/pgproto/frb.pxd":42 * return result * * inline FRBuffer *frb_slice_from(FRBuffer *frb, # <<<<<<<<<<<<<< * FRBuffer* source, ssize_t len): * frb.buf = frb_read(source, len) */ static CYTHON_INLINE struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_f_7asyncpg_7pgproto_7pgproto_frb_slice_from(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_frb, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_source, Py_ssize_t __pyx_v_len) { struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_r; char const *__pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "asyncpg/pgproto/frb.pxd":44 * inline FRBuffer *frb_slice_from(FRBuffer *frb, * FRBuffer* source, ssize_t len): * frb.buf = frb_read(source, len) # <<<<<<<<<<<<<< * frb.len = len * return frb */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_source, __pyx_v_len); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(9, 44, __pyx_L1_error) __pyx_v_frb->buf = __pyx_t_1; /* "asyncpg/pgproto/frb.pxd":45 * FRBuffer* source, ssize_t len): * frb.buf = frb_read(source, len) * frb.len = len # <<<<<<<<<<<<<< * return frb * */ __pyx_v_frb->len = __pyx_v_len; /* "asyncpg/pgproto/frb.pxd":46 * frb.buf = frb_read(source, len) * frb.len = len * return frb # <<<<<<<<<<<<<< * * object frb_check(FRBuffer *frb, ssize_t n) */ __pyx_r = __pyx_v_frb; goto __pyx_L0; /* "asyncpg/pgproto/frb.pxd":42 * return result * * inline FRBuffer *frb_slice_from(FRBuffer *frb, # <<<<<<<<<<<<<< * FRBuffer* source, ssize_t len): * frb.buf = frb_read(source, len) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.pgproto.pgproto.frb_slice_from", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; return __pyx_r; } /* "asyncpg/pgproto/buffer.pxd":28 * bint _message_mode * * cdef inline len(self): # <<<<<<<<<<<<<< * return self._length * */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("len", 1); /* "asyncpg/pgproto/buffer.pxd":29 * * cdef inline len(self): * return self._length # <<<<<<<<<<<<<< * * cdef inline write_len_prefixed_utf8(self, str s): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pxd":28 * bint _message_mode * * cdef inline len(self): # <<<<<<<<<<<<<< * return self._length * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.len", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pxd":31 * return self._length * * cdef inline write_len_prefixed_utf8(self, str s): # <<<<<<<<<<<<<< * return self.write_len_prefixed_bytes(s.encode('utf-8')) * */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_s) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write_len_prefixed_utf8", 1); /* "asyncpg/pgproto/buffer.pxd":32 * * cdef inline write_len_prefixed_utf8(self, str s): * return self.write_len_prefixed_bytes(s.encode('utf-8')) # <<<<<<<<<<<<<< * * cdef inline _check_readonly(self) */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_s == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); __PYX_ERR(10, 32, __pyx_L1_error) } __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_self->__pyx_vtab)->write_len_prefixed_bytes(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pxd":31 * return self._length * * cdef inline write_len_prefixed_utf8(self, str s): # <<<<<<<<<<<<<< * return self.write_len_prefixed_bytes(s.encode('utf-8')) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.write_len_prefixed_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pxd":100 * bint _current_message_ready * * cdef inline len(self): # <<<<<<<<<<<<<< * return self._length * */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_len(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("len", 1); /* "asyncpg/pgproto/buffer.pxd":101 * * cdef inline len(self): * return self._length # <<<<<<<<<<<<<< * * cdef inline char get_message_type(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pxd":100 * bint _current_message_ready * * cdef inline len(self): # <<<<<<<<<<<<<< * return self._length * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.pgproto.pgproto.ReadBuffer.len", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/pgproto/buffer.pxd":103 * return self._length * * cdef inline char get_message_type(self): # <<<<<<<<<<<<<< * return self._current_message_type * */ static CYTHON_INLINE char __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_type(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { char __pyx_r; /* "asyncpg/pgproto/buffer.pxd":104 * * cdef inline char get_message_type(self): * return self._current_message_type # <<<<<<<<<<<<<< * * cdef inline int32_t get_message_length(self): */ __pyx_r = __pyx_v_self->_current_message_type; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pxd":103 * return self._length * * cdef inline char get_message_type(self): # <<<<<<<<<<<<<< * return self._current_message_type * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "asyncpg/pgproto/buffer.pxd":106 * return self._current_message_type * * cdef inline int32_t get_message_length(self): # <<<<<<<<<<<<<< * return self._current_message_len * */ static CYTHON_INLINE int32_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_length(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) { int32_t __pyx_r; /* "asyncpg/pgproto/buffer.pxd":107 * * cdef inline int32_t get_message_length(self): * return self._current_message_len # <<<<<<<<<<<<<< * * cdef feed_data(self, data) */ __pyx_r = __pyx_v_self->_current_message_len; goto __pyx_L0; /* "asyncpg/pgproto/buffer.pxd":106 * return self._current_message_type * * cdef inline int32_t get_message_length(self): # <<<<<<<<<<<<<< * return self._current_message_len * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "asyncpg/protocol/encodings.pyx":62 * * * cdef get_python_encoding(pg_encoding): # <<<<<<<<<<<<<< * return ENCODINGS_MAP.get(pg_encoding.lower(), pg_encoding.lower()) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_get_python_encoding(PyObject *__pyx_v_pg_encoding) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_python_encoding", 1); /* "asyncpg/protocol/encodings.pyx":63 * * cdef get_python_encoding(pg_encoding): * return ENCODINGS_MAP.get(pg_encoding.lower(), pg_encoding.lower()) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_7asyncpg_8protocol_8protocol_ENCODINGS_MAP == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(11, 63, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pg_encoding, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pg_encoding, __pyx_n_s_lower); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_7asyncpg_8protocol_8protocol_ENCODINGS_MAP, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/protocol/encodings.pyx":62 * * * cdef get_python_encoding(pg_encoding): # <<<<<<<<<<<<<< * return ENCODINGS_MAP.get(pg_encoding.lower(), pg_encoding.lower()) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol.get_python_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/settings.pyx":14 * cdef class ConnectionSettings(pgproto.CodecContext): * * def __cinit__(self): # <<<<<<<<<<<<<< * self._encoding = 'utf-8' * self._is_utf8 = True */ /* Python wrapper */ static int __pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings___cinit__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 1); /* "asyncpg/protocol/settings.pyx":15 * * def __cinit__(self): * self._encoding = 'utf-8' # <<<<<<<<<<<<<< * self._is_utf8 = True * self._settings = {} */ __Pyx_INCREF(__pyx_kp_u_utf_8); __Pyx_GIVEREF(__pyx_kp_u_utf_8); __Pyx_GOTREF(__pyx_v_self->_encoding); __Pyx_DECREF(__pyx_v_self->_encoding); __pyx_v_self->_encoding = __pyx_kp_u_utf_8; /* "asyncpg/protocol/settings.pyx":16 * def __cinit__(self): * self._encoding = 'utf-8' * self._is_utf8 = True # <<<<<<<<<<<<<< * self._settings = {} * self._codec = codecs.lookup('utf-8') */ __pyx_v_self->_is_utf8 = 1; /* "asyncpg/protocol/settings.pyx":17 * self._encoding = 'utf-8' * self._is_utf8 = True * self._settings = {} # <<<<<<<<<<<<<< * self._codec = codecs.lookup('utf-8') * self._data_codecs = DataCodecConfig() */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_settings); __Pyx_DECREF(__pyx_v_self->_settings); __pyx_v_self->_settings = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/settings.pyx":18 * self._is_utf8 = True * self._settings = {} * self._codec = codecs.lookup('utf-8') # <<<<<<<<<<<<<< * self._data_codecs = DataCodecConfig() * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_codecs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lookup); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_utf_8}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_codec); __Pyx_DECREF(__pyx_v_self->_codec); __pyx_v_self->_codec = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/settings.pyx":19 * self._settings = {} * self._codec = codecs.lookup('utf-8') * self._data_codecs = DataCodecConfig() # <<<<<<<<<<<<<< * * cdef add_setting(self, str name, str val): */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF((PyObject *)__pyx_v_self->_data_codecs); __Pyx_DECREF((PyObject *)__pyx_v_self->_data_codecs); __pyx_v_self->_data_codecs = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/settings.pyx":14 * cdef class ConnectionSettings(pgproto.CodecContext): * * def __cinit__(self): # <<<<<<<<<<<<<< * self._encoding = 'utf-8' * self._is_utf8 = True */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/settings.pyx":21 * self._data_codecs = DataCodecConfig() * * cdef add_setting(self, str name, str val): # <<<<<<<<<<<<<< * self._settings[name] = val * if name == 'client_encoding': */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_add_setting(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_val) { PyObject *__pyx_v_py_enc = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_setting", 1); /* "asyncpg/protocol/settings.pyx":22 * * cdef add_setting(self, str name, str val): * self._settings[name] = val # <<<<<<<<<<<<<< * if name == 'client_encoding': * py_enc = get_python_encoding(val) */ if (unlikely(__pyx_v_self->_settings == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 22, __pyx_L1_error) } if (unlikely((PyDict_SetItem(__pyx_v_self->_settings, __pyx_v_name, __pyx_v_val) < 0))) __PYX_ERR(1, 22, __pyx_L1_error) /* "asyncpg/protocol/settings.pyx":23 * cdef add_setting(self, str name, str val): * self._settings[name] = val * if name == 'client_encoding': # <<<<<<<<<<<<<< * py_enc = get_python_encoding(val) * self._codec = codecs.lookup(py_enc) */ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_client_encoding, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 23, __pyx_L1_error) if (__pyx_t_1) { /* "asyncpg/protocol/settings.pyx":24 * self._settings[name] = val * if name == 'client_encoding': * py_enc = get_python_encoding(val) # <<<<<<<<<<<<<< * self._codec = codecs.lookup(py_enc) * self._encoding = self._codec.name */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_get_python_encoding(__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_py_enc = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/settings.pyx":25 * if name == 'client_encoding': * py_enc = get_python_encoding(val) * self._codec = codecs.lookup(py_enc) # <<<<<<<<<<<<<< * self._encoding = self._codec.name * self._is_utf8 = self._encoding == 'utf-8' */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_codecs); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lookup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_py_enc}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->_codec); __Pyx_DECREF(__pyx_v_self->_codec); __pyx_v_self->_codec = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/settings.pyx":26 * py_enc = get_python_encoding(val) * self._codec = codecs.lookup(py_enc) * self._encoding = self._codec.name # <<<<<<<<<<<<<< * self._is_utf8 = self._encoding == 'utf-8' * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_codec, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->_encoding); __Pyx_DECREF(__pyx_v_self->_encoding); __pyx_v_self->_encoding = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/settings.pyx":27 * self._codec = codecs.lookup(py_enc) * self._encoding = self._codec.name * self._is_utf8 = self._encoding == 'utf-8' # <<<<<<<<<<<<<< * * cdef is_encoding_utf8(self): */ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_encoding, __pyx_kp_u_utf_8, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 27, __pyx_L1_error) __pyx_v_self->_is_utf8 = __pyx_t_1; /* "asyncpg/protocol/settings.pyx":23 * cdef add_setting(self, str name, str val): * self._settings[name] = val * if name == 'client_encoding': # <<<<<<<<<<<<<< * py_enc = get_python_encoding(val) * self._codec = codecs.lookup(py_enc) */ } /* "asyncpg/protocol/settings.pyx":21 * self._data_codecs = DataCodecConfig() * * cdef add_setting(self, str name, str val): # <<<<<<<<<<<<<< * self._settings[name] = val * if name == 'client_encoding': */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.add_setting", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_py_enc); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/settings.pyx":29 * self._is_utf8 = self._encoding == 'utf-8' * * cdef is_encoding_utf8(self): # <<<<<<<<<<<<<< * return self._is_utf8 * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_is_encoding_utf8(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_encoding_utf8", 1); /* "asyncpg/protocol/settings.pyx":30 * * cdef is_encoding_utf8(self): * return self._is_utf8 # <<<<<<<<<<<<<< * * cpdef get_text_codec(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_is_utf8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/settings.pyx":29 * self._is_utf8 = self._encoding == 'utf-8' * * cdef is_encoding_utf8(self): # <<<<<<<<<<<<<< * return self._is_utf8 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.is_encoding_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/settings.pyx":32 * return self._is_utf8 * * cpdef get_text_codec(self): # <<<<<<<<<<<<<< * return self._codec * */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_3get_text_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_text_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_text_codec", 1); /* "asyncpg/protocol/settings.pyx":33 * * cpdef get_text_codec(self): * return self._codec # <<<<<<<<<<<<<< * * cpdef inline register_data_types(self, types): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_codec); __pyx_r = __pyx_v_self->_codec; goto __pyx_L0; /* "asyncpg/protocol/settings.pyx":32 * return self._is_utf8 * * cpdef get_text_codec(self): # <<<<<<<<<<<<<< * return self._codec * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_3get_text_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_3get_text_codec = {"get_text_codec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_3get_text_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_3get_text_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_text_codec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_text_codec", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_text_codec", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_2get_text_codec(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_2get_text_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_text_codec", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_text_codec(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.get_text_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/settings.pyx":35 * return self._codec * * cpdef inline register_data_types(self, types): # <<<<<<<<<<<<<< * self._data_codecs.add_types(types) * */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_5register_data_types(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_register_data_types(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_types, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("register_data_types", 1); /* "asyncpg/protocol/settings.pyx":36 * * cpdef inline register_data_types(self, types): * self._data_codecs.add_types(types) # <<<<<<<<<<<<<< * * cpdef inline add_python_codec(self, typeoid, typename, typeschema, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_data_codecs), __pyx_n_s_add_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_types}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/settings.pyx":35 * return self._codec * * cpdef inline register_data_types(self, types): # <<<<<<<<<<<<<< * self._data_codecs.add_types(types) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.register_data_types", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_5register_data_types(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_5register_data_types = {"register_data_types", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_5register_data_types, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_5register_data_types(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_types = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("register_data_types (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_types,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_types)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 35, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "register_data_types") < 0)) __PYX_ERR(1, 35, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_types = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("register_data_types", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 35, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.register_data_types", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_4register_data_types(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self), __pyx_v_types); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_4register_data_types(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_types) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("register_data_types", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_register_data_types(__pyx_v_self, __pyx_v_types, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.register_data_types", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/settings.pyx":38 * self._data_codecs.add_types(types) * * cpdef inline add_python_codec(self, typeoid, typename, typeschema, # <<<<<<<<<<<<<< * typeinfos, typekind, encoder, decoder, * format): */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_7add_python_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_add_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typeinfos, PyObject *__pyx_v_typekind, PyObject *__pyx_v_encoder, PyObject *__pyx_v_decoder, PyObject *__pyx_v_format, CYTHON_UNUSED int __pyx_skip_dispatch) { enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v__format; enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_v_xformat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_python_codec", 1); /* "asyncpg/protocol/settings.pyx":45 * ClientExchangeFormat xformat * * if format == 'binary': # <<<<<<<<<<<<<< * _format = PG_FORMAT_BINARY * xformat = PG_XFORMAT_OBJECT */ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_format, __pyx_n_u_binary, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 45, __pyx_L1_error) if (__pyx_t_1) { /* "asyncpg/protocol/settings.pyx":46 * * if format == 'binary': * _format = PG_FORMAT_BINARY # <<<<<<<<<<<<<< * xformat = PG_XFORMAT_OBJECT * elif format == 'text': */ __pyx_v__format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY; /* "asyncpg/protocol/settings.pyx":47 * if format == 'binary': * _format = PG_FORMAT_BINARY * xformat = PG_XFORMAT_OBJECT # <<<<<<<<<<<<<< * elif format == 'text': * _format = PG_FORMAT_TEXT */ __pyx_v_xformat = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT; /* "asyncpg/protocol/settings.pyx":45 * ClientExchangeFormat xformat * * if format == 'binary': # <<<<<<<<<<<<<< * _format = PG_FORMAT_BINARY * xformat = PG_XFORMAT_OBJECT */ goto __pyx_L3; } /* "asyncpg/protocol/settings.pyx":48 * _format = PG_FORMAT_BINARY * xformat = PG_XFORMAT_OBJECT * elif format == 'text': # <<<<<<<<<<<<<< * _format = PG_FORMAT_TEXT * xformat = PG_XFORMAT_OBJECT */ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_format, __pyx_n_u_text, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 48, __pyx_L1_error) if (__pyx_t_1) { /* "asyncpg/protocol/settings.pyx":49 * xformat = PG_XFORMAT_OBJECT * elif format == 'text': * _format = PG_FORMAT_TEXT # <<<<<<<<<<<<<< * xformat = PG_XFORMAT_OBJECT * elif format == 'tuple': */ __pyx_v__format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT; /* "asyncpg/protocol/settings.pyx":50 * elif format == 'text': * _format = PG_FORMAT_TEXT * xformat = PG_XFORMAT_OBJECT # <<<<<<<<<<<<<< * elif format == 'tuple': * _format = PG_FORMAT_ANY */ __pyx_v_xformat = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT; /* "asyncpg/protocol/settings.pyx":48 * _format = PG_FORMAT_BINARY * xformat = PG_XFORMAT_OBJECT * elif format == 'text': # <<<<<<<<<<<<<< * _format = PG_FORMAT_TEXT * xformat = PG_XFORMAT_OBJECT */ goto __pyx_L3; } /* "asyncpg/protocol/settings.pyx":51 * _format = PG_FORMAT_TEXT * xformat = PG_XFORMAT_OBJECT * elif format == 'tuple': # <<<<<<<<<<<<<< * _format = PG_FORMAT_ANY * xformat = PG_XFORMAT_TUPLE */ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_format, __pyx_n_u_tuple, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 51, __pyx_L1_error) if (likely(__pyx_t_1)) { /* "asyncpg/protocol/settings.pyx":52 * xformat = PG_XFORMAT_OBJECT * elif format == 'tuple': * _format = PG_FORMAT_ANY # <<<<<<<<<<<<<< * xformat = PG_XFORMAT_TUPLE * else: */ __pyx_v__format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY; /* "asyncpg/protocol/settings.pyx":53 * elif format == 'tuple': * _format = PG_FORMAT_ANY * xformat = PG_XFORMAT_TUPLE # <<<<<<<<<<<<<< * else: * raise exceptions.InterfaceError( */ __pyx_v_xformat = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE; /* "asyncpg/protocol/settings.pyx":51 * _format = PG_FORMAT_TEXT * xformat = PG_XFORMAT_OBJECT * elif format == 'tuple': # <<<<<<<<<<<<<< * _format = PG_FORMAT_ANY * xformat = PG_XFORMAT_TUPLE */ goto __pyx_L3; } /* "asyncpg/protocol/settings.pyx":55 * xformat = PG_XFORMAT_TUPLE * else: * raise exceptions.InterfaceError( # <<<<<<<<<<<<<< * 'invalid `format` argument, expected {}, got {!r}'.format( * "'text', 'binary' or 'tuple'", format */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/settings.pyx":56 * else: * raise exceptions.InterfaceError( * 'invalid `format` argument, expected {}, got {!r}'.format( # <<<<<<<<<<<<<< * "'text', 'binary' or 'tuple'", format * )) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_format_argument_expected, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "asyncpg/protocol/settings.pyx":57 * raise exceptions.InterfaceError( * 'invalid `format` argument, expected {}, got {!r}'.format( * "'text', 'binary' or 'tuple'", format # <<<<<<<<<<<<<< * )) * */ __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_kp_u_text_binary_or_tuple, __pyx_v_format}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 55, __pyx_L1_error) } __pyx_L3:; /* "asyncpg/protocol/settings.pyx":60 * )) * * self._data_codecs.add_python_codec(typeoid, typename, typeschema, # <<<<<<<<<<<<<< * typekind, typeinfos, * encoder, decoder, */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_data_codecs), __pyx_n_s_add_python_codec); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/settings.pyx":63 * typekind, typeinfos, * encoder, decoder, * _format, xformat) # <<<<<<<<<<<<<< * * cpdef inline remove_python_codec(self, typeoid, typename, typeschema): */ __pyx_t_3 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v__format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_v_xformat); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[10] = {__pyx_t_6, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_typeinfos, __pyx_v_encoder, __pyx_v_decoder, __pyx_t_3, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 9+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/settings.pyx":38 * self._data_codecs.add_types(types) * * cpdef inline add_python_codec(self, typeoid, typename, typeschema, # <<<<<<<<<<<<<< * typeinfos, typekind, encoder, decoder, * format): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.add_python_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_7add_python_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_7add_python_codec = {"add_python_codec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_7add_python_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_7add_python_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_typeoid = 0; PyObject *__pyx_v_typename = 0; PyObject *__pyx_v_typeschema = 0; PyObject *__pyx_v_typeinfos = 0; PyObject *__pyx_v_typekind = 0; PyObject *__pyx_v_encoder = 0; PyObject *__pyx_v_decoder = 0; PyObject *__pyx_v_format = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[8] = {0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_python_codec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typeoid,&__pyx_n_s_typename,&__pyx_n_s_typeschema,&__pyx_n_s_typeinfos,&__pyx_n_s_typekind,&__pyx_n_s_encoder,&__pyx_n_s_decoder,&__pyx_n_s_format,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typeoid)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 38, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typename)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 38, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 8, 8, 1); __PYX_ERR(1, 38, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typeschema)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 38, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 8, 8, 2); __PYX_ERR(1, 38, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typeinfos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 38, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 8, 8, 3); __PYX_ERR(1, 38, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typekind)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 38, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 8, 8, 4); __PYX_ERR(1, 38, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoder)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 38, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 8, 8, 5); __PYX_ERR(1, 38, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_decoder)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 38, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 8, 8, 6); __PYX_ERR(1, 38, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 38, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 8, 8, 7); __PYX_ERR(1, 38, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add_python_codec") < 0)) __PYX_ERR(1, 38, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 8)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); } __pyx_v_typeoid = values[0]; __pyx_v_typename = values[1]; __pyx_v_typeschema = values[2]; __pyx_v_typeinfos = values[3]; __pyx_v_typekind = values[4]; __pyx_v_encoder = values[5]; __pyx_v_decoder = values[6]; __pyx_v_format = values[7]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 8, 8, __pyx_nargs); __PYX_ERR(1, 38, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.add_python_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_6add_python_codec(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self), __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typeinfos, __pyx_v_typekind, __pyx_v_encoder, __pyx_v_decoder, __pyx_v_format); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_6add_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typeinfos, PyObject *__pyx_v_typekind, PyObject *__pyx_v_encoder, PyObject *__pyx_v_decoder, PyObject *__pyx_v_format) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_python_codec", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_add_python_codec(__pyx_v_self, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typeinfos, __pyx_v_typekind, __pyx_v_encoder, __pyx_v_decoder, __pyx_v_format, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.add_python_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/settings.pyx":65 * _format, xformat) * * cpdef inline remove_python_codec(self, typeoid, typename, typeschema): # <<<<<<<<<<<<<< * self._data_codecs.remove_python_codec(typeoid, typename, typeschema) * */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_9remove_python_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_remove_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove_python_codec", 1); /* "asyncpg/protocol/settings.pyx":66 * * cpdef inline remove_python_codec(self, typeoid, typename, typeschema): * self._data_codecs.remove_python_codec(typeoid, typename, typeschema) # <<<<<<<<<<<<<< * * cpdef inline clear_type_cache(self): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_data_codecs), __pyx_n_s_remove_python_codec); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/settings.pyx":65 * _format, xformat) * * cpdef inline remove_python_codec(self, typeoid, typename, typeschema): # <<<<<<<<<<<<<< * self._data_codecs.remove_python_codec(typeoid, typename, typeschema) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.remove_python_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_9remove_python_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_9remove_python_codec = {"remove_python_codec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_9remove_python_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_9remove_python_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_typeoid = 0; PyObject *__pyx_v_typename = 0; PyObject *__pyx_v_typeschema = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("remove_python_codec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typeoid,&__pyx_n_s_typename,&__pyx_n_s_typeschema,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typeoid)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 65, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typename)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 65, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("remove_python_codec", 1, 3, 3, 1); __PYX_ERR(1, 65, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typeschema)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 65, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("remove_python_codec", 1, 3, 3, 2); __PYX_ERR(1, 65, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "remove_python_codec") < 0)) __PYX_ERR(1, 65, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_typeoid = values[0]; __pyx_v_typename = values[1]; __pyx_v_typeschema = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("remove_python_codec", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 65, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.remove_python_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_8remove_python_codec(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self), __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_8remove_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove_python_codec", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_remove_python_codec(__pyx_v_self, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.remove_python_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/settings.pyx":68 * self._data_codecs.remove_python_codec(typeoid, typename, typeschema) * * cpdef inline clear_type_cache(self): # <<<<<<<<<<<<<< * self._data_codecs.clear_type_cache() * */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_11clear_type_cache(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_clear_type_cache(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clear_type_cache", 1); /* "asyncpg/protocol/settings.pyx":69 * * cpdef inline clear_type_cache(self): * self._data_codecs.clear_type_cache() # <<<<<<<<<<<<<< * * cpdef inline set_builtin_type_codec(self, typeoid, typename, typeschema, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_data_codecs), __pyx_n_s_clear_type_cache); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/settings.pyx":68 * self._data_codecs.remove_python_codec(typeoid, typename, typeschema) * * cpdef inline clear_type_cache(self): # <<<<<<<<<<<<<< * self._data_codecs.clear_type_cache() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.clear_type_cache", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_11clear_type_cache(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_11clear_type_cache = {"clear_type_cache", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_11clear_type_cache, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_11clear_type_cache(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clear_type_cache (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("clear_type_cache", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clear_type_cache", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_10clear_type_cache(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_10clear_type_cache(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clear_type_cache", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_clear_type_cache(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.clear_type_cache", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/settings.pyx":71 * self._data_codecs.clear_type_cache() * * cpdef inline set_builtin_type_codec(self, typeoid, typename, typeschema, # <<<<<<<<<<<<<< * typekind, alias_to, format): * cdef: */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_13set_builtin_type_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_set_builtin_type_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typekind, PyObject *__pyx_v_alias_to, PyObject *__pyx_v_format, CYTHON_UNUSED int __pyx_skip_dispatch) { enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v__format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_builtin_type_codec", 1); /* "asyncpg/protocol/settings.pyx":76 * ServerDataFormat _format * * if format is None: # <<<<<<<<<<<<<< * _format = PG_FORMAT_ANY * elif format == 'binary': */ __pyx_t_1 = (__pyx_v_format == Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/settings.pyx":77 * * if format is None: * _format = PG_FORMAT_ANY # <<<<<<<<<<<<<< * elif format == 'binary': * _format = PG_FORMAT_BINARY */ __pyx_v__format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY; /* "asyncpg/protocol/settings.pyx":76 * ServerDataFormat _format * * if format is None: # <<<<<<<<<<<<<< * _format = PG_FORMAT_ANY * elif format == 'binary': */ goto __pyx_L3; } /* "asyncpg/protocol/settings.pyx":78 * if format is None: * _format = PG_FORMAT_ANY * elif format == 'binary': # <<<<<<<<<<<<<< * _format = PG_FORMAT_BINARY * elif format == 'text': */ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_format, __pyx_n_u_binary, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 78, __pyx_L1_error) if (__pyx_t_1) { /* "asyncpg/protocol/settings.pyx":79 * _format = PG_FORMAT_ANY * elif format == 'binary': * _format = PG_FORMAT_BINARY # <<<<<<<<<<<<<< * elif format == 'text': * _format = PG_FORMAT_TEXT */ __pyx_v__format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY; /* "asyncpg/protocol/settings.pyx":78 * if format is None: * _format = PG_FORMAT_ANY * elif format == 'binary': # <<<<<<<<<<<<<< * _format = PG_FORMAT_BINARY * elif format == 'text': */ goto __pyx_L3; } /* "asyncpg/protocol/settings.pyx":80 * elif format == 'binary': * _format = PG_FORMAT_BINARY * elif format == 'text': # <<<<<<<<<<<<<< * _format = PG_FORMAT_TEXT * else: */ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_format, __pyx_n_u_text, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 80, __pyx_L1_error) if (likely(__pyx_t_1)) { /* "asyncpg/protocol/settings.pyx":81 * _format = PG_FORMAT_BINARY * elif format == 'text': * _format = PG_FORMAT_TEXT # <<<<<<<<<<<<<< * else: * raise exceptions.InterfaceError( */ __pyx_v__format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT; /* "asyncpg/protocol/settings.pyx":80 * elif format == 'binary': * _format = PG_FORMAT_BINARY * elif format == 'text': # <<<<<<<<<<<<<< * _format = PG_FORMAT_TEXT * else: */ goto __pyx_L3; } /* "asyncpg/protocol/settings.pyx":83 * _format = PG_FORMAT_TEXT * else: * raise exceptions.InterfaceError( # <<<<<<<<<<<<<< * 'invalid `format` argument, expected {}, got {!r}'.format( * "'text' or 'binary'", format */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/settings.pyx":84 * else: * raise exceptions.InterfaceError( * 'invalid `format` argument, expected {}, got {!r}'.format( # <<<<<<<<<<<<<< * "'text' or 'binary'", format * )) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_format_argument_expected, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "asyncpg/protocol/settings.pyx":85 * raise exceptions.InterfaceError( * 'invalid `format` argument, expected {}, got {!r}'.format( * "'text' or 'binary'", format # <<<<<<<<<<<<<< * )) * */ __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_kp_u_text_or_binary, __pyx_v_format}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(1, 83, __pyx_L1_error) } __pyx_L3:; /* "asyncpg/protocol/settings.pyx":88 * )) * * self._data_codecs.set_builtin_type_codec(typeoid, typename, typeschema, # <<<<<<<<<<<<<< * typekind, alias_to, _format) * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_data_codecs), __pyx_n_s_set_builtin_type_codec); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/settings.pyx":89 * * self._data_codecs.set_builtin_type_codec(typeoid, typename, typeschema, * typekind, alias_to, _format) # <<<<<<<<<<<<<< * * cpdef inline Codec get_data_codec(self, uint32_t oid, */ __pyx_t_3 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v__format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_5, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_alias_to, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 6+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/settings.pyx":71 * self._data_codecs.clear_type_cache() * * cpdef inline set_builtin_type_codec(self, typeoid, typename, typeschema, # <<<<<<<<<<<<<< * typekind, alias_to, format): * cdef: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.set_builtin_type_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_13set_builtin_type_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_13set_builtin_type_codec = {"set_builtin_type_codec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_13set_builtin_type_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_13set_builtin_type_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_typeoid = 0; PyObject *__pyx_v_typename = 0; PyObject *__pyx_v_typeschema = 0; PyObject *__pyx_v_typekind = 0; PyObject *__pyx_v_alias_to = 0; PyObject *__pyx_v_format = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_builtin_type_codec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typeoid,&__pyx_n_s_typename,&__pyx_n_s_typeschema,&__pyx_n_s_typekind,&__pyx_n_s_alias_to,&__pyx_n_s_format,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typeoid)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 71, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typename)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 71, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 1, 6, 6, 1); __PYX_ERR(1, 71, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typeschema)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 71, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 1, 6, 6, 2); __PYX_ERR(1, 71, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typekind)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 71, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 1, 6, 6, 3); __PYX_ERR(1, 71, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alias_to)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 71, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 1, 6, 6, 4); __PYX_ERR(1, 71, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 71, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 1, 6, 6, 5); __PYX_ERR(1, 71, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_builtin_type_codec") < 0)) __PYX_ERR(1, 71, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 6)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); } __pyx_v_typeoid = values[0]; __pyx_v_typename = values[1]; __pyx_v_typeschema = values[2]; __pyx_v_typekind = values[3]; __pyx_v_alias_to = values[4]; __pyx_v_format = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 1, 6, 6, __pyx_nargs); __PYX_ERR(1, 71, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.set_builtin_type_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_12set_builtin_type_codec(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self), __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_alias_to, __pyx_v_format); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_12set_builtin_type_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typekind, PyObject *__pyx_v_alias_to, PyObject *__pyx_v_format) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_builtin_type_codec", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_set_builtin_type_codec(__pyx_v_self, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_alias_to, __pyx_v_format, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.set_builtin_type_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/settings.pyx":91 * typekind, alias_to, _format) * * cpdef inline Codec get_data_codec(self, uint32_t oid, # <<<<<<<<<<<<<< * ServerDataFormat format=PG_FORMAT_ANY, * bint ignore_custom_codec=False): */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_15get_data_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, uint32_t __pyx_v_oid, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec *__pyx_optional_args) { enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format = __pyx_k_; /* "asyncpg/protocol/settings.pyx":93 * cpdef inline Codec get_data_codec(self, uint32_t oid, * ServerDataFormat format=PG_FORMAT_ANY, * bint ignore_custom_codec=False): # <<<<<<<<<<<<<< * return self._data_codecs.get_codec(oid, format, ignore_custom_codec) * */ int __pyx_v_ignore_custom_codec = ((int)0); struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_data_codec", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_format = __pyx_optional_args->format; if (__pyx_optional_args->__pyx_n > 1) { __pyx_v_ignore_custom_codec = __pyx_optional_args->ignore_custom_codec; } } } /* "asyncpg/protocol/settings.pyx":94 * ServerDataFormat format=PG_FORMAT_ANY, * bint ignore_custom_codec=False): * return self._data_codecs.get_codec(oid, format, ignore_custom_codec) # <<<<<<<<<<<<<< * * def __getattr__(self, name): */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.ignore_custom_codec = __pyx_v_ignore_custom_codec; __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self->_data_codecs, __pyx_v_oid, __pyx_v_format, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/settings.pyx":91 * typekind, alias_to, _format) * * cpdef inline Codec get_data_codec(self, uint32_t oid, # <<<<<<<<<<<<<< * ServerDataFormat format=PG_FORMAT_ANY, * bint ignore_custom_codec=False): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.get_data_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_15get_data_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_15get_data_codec = {"get_data_codec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_15get_data_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_15get_data_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { uint32_t __pyx_v_oid; enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format; int __pyx_v_ignore_custom_codec; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_data_codec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_oid,&__pyx_n_s_format,&__pyx_n_s_ignore_custom_codec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_oid)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 91, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 91, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ignore_custom_codec); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 91, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_data_codec") < 0)) __PYX_ERR(1, 91, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_oid = __Pyx_PyInt_As_uint32_t(values[0]); if (unlikely((__pyx_v_oid == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 91, __pyx_L3_error) if (values[1]) { __pyx_v_format = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(values[1])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 92, __pyx_L3_error) } else { __pyx_v_format = __pyx_k_; } if (values[2]) { __pyx_v_ignore_custom_codec = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_ignore_custom_codec == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 93, __pyx_L3_error) } else { /* "asyncpg/protocol/settings.pyx":93 * cpdef inline Codec get_data_codec(self, uint32_t oid, * ServerDataFormat format=PG_FORMAT_ANY, * bint ignore_custom_codec=False): # <<<<<<<<<<<<<< * return self._data_codecs.get_codec(oid, format, ignore_custom_codec) * */ __pyx_v_ignore_custom_codec = ((int)0); } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_data_codec", 0, 1, 3, __pyx_nargs); __PYX_ERR(1, 91, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.get_data_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_14get_data_codec(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self), __pyx_v_oid, __pyx_v_format, __pyx_v_ignore_custom_codec); /* "asyncpg/protocol/settings.pyx":91 * typekind, alias_to, _format) * * cpdef inline Codec get_data_codec(self, uint32_t oid, # <<<<<<<<<<<<<< * ServerDataFormat format=PG_FORMAT_ANY, * bint ignore_custom_codec=False): */ /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_14get_data_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, uint32_t __pyx_v_oid, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, int __pyx_v_ignore_custom_codec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_data_codec", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 2; __pyx_t_2.format = __pyx_v_format; __pyx_t_2.ignore_custom_codec = __pyx_v_ignore_custom_codec; __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_8protocol_8protocol_ConnectionSettings->get_data_codec(__pyx_v_self, __pyx_v_oid, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.get_data_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/settings.pyx":96 * return self._data_codecs.get_codec(oid, format, ignore_custom_codec) * * def __getattr__(self, name): # <<<<<<<<<<<<<< * if not name.startswith('_'): * try: */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_17__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_17__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_16__getattr__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self), ((PyObject *)__pyx_v_name)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_16__getattr__(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getattr__", 1); /* "asyncpg/protocol/settings.pyx":97 * * def __getattr__(self, name): * if not name.startswith('_'): # <<<<<<<<<<<<<< * try: * return self._settings[name] */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_u__2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { /* "asyncpg/protocol/settings.pyx":98 * def __getattr__(self, name): * if not name.startswith('_'): * try: # <<<<<<<<<<<<<< * return self._settings[name] * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "asyncpg/protocol/settings.pyx":99 * if not name.startswith('_'): * try: * return self._settings[name] # <<<<<<<<<<<<<< * except KeyError: * raise AttributeError(name) from None */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_self->_settings == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 99, __pyx_L4_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->_settings, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 99, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L8_try_return; /* "asyncpg/protocol/settings.pyx":98 * def __getattr__(self, name): * if not name.startswith('_'): * try: # <<<<<<<<<<<<<< * return self._settings[name] * except KeyError: */ } __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/settings.pyx":100 * try: * return self._settings[name] * except KeyError: # <<<<<<<<<<<<<< * raise AttributeError(name) from None * */ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_10) { __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(1, 100, __pyx_L6_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /* "asyncpg/protocol/settings.pyx":101 * return self._settings[name] * except KeyError: * raise AttributeError(name) from None # <<<<<<<<<<<<<< * * return object.__getattribute__(self, name) */ __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_v_name); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 101, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_Raise(__pyx_t_11, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __PYX_ERR(1, 101, __pyx_L6_except_error) } goto __pyx_L6_except_error; /* "asyncpg/protocol/settings.pyx":98 * def __getattr__(self, name): * if not name.startswith('_'): * try: # <<<<<<<<<<<<<< * return self._settings[name] * except KeyError: */ __pyx_L6_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L8_try_return:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L0; } /* "asyncpg/protocol/settings.pyx":97 * * def __getattr__(self, name): * if not name.startswith('_'): # <<<<<<<<<<<<<< * try: * return self._settings[name] */ } /* "asyncpg/protocol/settings.pyx":103 * raise AttributeError(name) from None * * return object.__getattribute__(self, name) # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_getattribute); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_1, ((PyObject *)__pyx_v_self), __pyx_v_name}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/protocol/settings.pyx":96 * return self._data_codecs.get_codec(oid, format, ignore_custom_codec) * * def __getattr__(self, name): # <<<<<<<<<<<<<< * if not name.startswith('_'): * try: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/settings.pyx":105 * return object.__getattribute__(self, name) * * def __repr__(self): # <<<<<<<<<<<<<< * return ''.format(self._settings) */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_19__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_19__repr__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_18__repr__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_18__repr__(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); /* "asyncpg/protocol/settings.pyx":106 * * def __repr__(self): * return ''.format(self._settings) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_ConnectionSettings_r, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self->_settings}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/settings.pyx":105 * return object.__getattribute__(self, name) * * def __repr__(self): # <<<<<<<<<<<<<< * return ''.format(self._settings) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_21__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_21__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_21__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_21__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_20__reduce_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(2, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_23__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_23__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_23__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_23__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_22__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(2, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":22 * cdef class Codec: * * def __cinit__(self, uint32_t oid): # <<<<<<<<<<<<<< * self.oid = oid * self.type = CODEC_UNDEFINED */ /* Python wrapper */ static int __pyx_pw_7asyncpg_8protocol_8protocol_5Codec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7asyncpg_8protocol_8protocol_5Codec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { uint32_t __pyx_v_oid; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_oid,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_oid)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 22, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(3, 22, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_oid = __Pyx_PyInt_As_uint32_t(values[0]); if (unlikely((__pyx_v_oid == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(3, 22, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 22, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_5Codec___cinit__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_v_self), __pyx_v_oid); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7asyncpg_8protocol_8protocol_5Codec___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, uint32_t __pyx_v_oid) { int __pyx_r; /* "asyncpg/protocol/codecs/base.pyx":23 * * def __cinit__(self, uint32_t oid): * self.oid = oid # <<<<<<<<<<<<<< * self.type = CODEC_UNDEFINED * */ __pyx_v_self->oid = __pyx_v_oid; /* "asyncpg/protocol/codecs/base.pyx":24 * def __cinit__(self, uint32_t oid): * self.oid = oid * self.type = CODEC_UNDEFINED # <<<<<<<<<<<<<< * * cdef init( */ __pyx_v_self->type = __pyx_e_7asyncpg_8protocol_8protocol_CODEC_UNDEFINED; /* "asyncpg/protocol/codecs/base.pyx":22 * cdef class Codec: * * def __cinit__(self, uint32_t oid): # <<<<<<<<<<<<<< * self.oid = oid * self.type = CODEC_UNDEFINED */ /* function exit code */ __pyx_r = 0; return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":26 * self.type = CODEC_UNDEFINED * * cdef init( # <<<<<<<<<<<<<< * self, * str name, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, PyObject *__pyx_v_kind, enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType __pyx_v_type, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_v_xformat, __pyx_t_7asyncpg_8protocol_8protocol_encode_func __pyx_v_c_encoder, __pyx_t_7asyncpg_8protocol_8protocol_decode_func __pyx_v_c_decoder, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_base_codec, PyObject *__pyx_v_py_encoder, PyObject *__pyx_v_py_decoder, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_element_codec, PyObject *__pyx_v_element_type_oids, PyObject *__pyx_v_element_names, PyObject *__pyx_v_element_codecs, Py_UCS4 __pyx_v_element_delimiter) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 1); /* "asyncpg/protocol/codecs/base.pyx":46 * ): * * self.name = name # <<<<<<<<<<<<<< * self.schema = schema * self.kind = kind */ __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_v_name; /* "asyncpg/protocol/codecs/base.pyx":47 * * self.name = name * self.schema = schema # <<<<<<<<<<<<<< * self.kind = kind * self.type = type */ __Pyx_INCREF(__pyx_v_schema); __Pyx_GIVEREF(__pyx_v_schema); __Pyx_GOTREF(__pyx_v_self->schema); __Pyx_DECREF(__pyx_v_self->schema); __pyx_v_self->schema = __pyx_v_schema; /* "asyncpg/protocol/codecs/base.pyx":48 * self.name = name * self.schema = schema * self.kind = kind # <<<<<<<<<<<<<< * self.type = type * self.format = format */ __Pyx_INCREF(__pyx_v_kind); __Pyx_GIVEREF(__pyx_v_kind); __Pyx_GOTREF(__pyx_v_self->kind); __Pyx_DECREF(__pyx_v_self->kind); __pyx_v_self->kind = __pyx_v_kind; /* "asyncpg/protocol/codecs/base.pyx":49 * self.schema = schema * self.kind = kind * self.type = type # <<<<<<<<<<<<<< * self.format = format * self.xformat = xformat */ __pyx_v_self->type = __pyx_v_type; /* "asyncpg/protocol/codecs/base.pyx":50 * self.kind = kind * self.type = type * self.format = format # <<<<<<<<<<<<<< * self.xformat = xformat * self.c_encoder = c_encoder */ __pyx_v_self->format = __pyx_v_format; /* "asyncpg/protocol/codecs/base.pyx":51 * self.type = type * self.format = format * self.xformat = xformat # <<<<<<<<<<<<<< * self.c_encoder = c_encoder * self.c_decoder = c_decoder */ __pyx_v_self->xformat = __pyx_v_xformat; /* "asyncpg/protocol/codecs/base.pyx":52 * self.format = format * self.xformat = xformat * self.c_encoder = c_encoder # <<<<<<<<<<<<<< * self.c_decoder = c_decoder * self.base_codec = base_codec */ __pyx_v_self->c_encoder = __pyx_v_c_encoder; /* "asyncpg/protocol/codecs/base.pyx":53 * self.xformat = xformat * self.c_encoder = c_encoder * self.c_decoder = c_decoder # <<<<<<<<<<<<<< * self.base_codec = base_codec * self.py_encoder = py_encoder */ __pyx_v_self->c_decoder = __pyx_v_c_decoder; /* "asyncpg/protocol/codecs/base.pyx":54 * self.c_encoder = c_encoder * self.c_decoder = c_decoder * self.base_codec = base_codec # <<<<<<<<<<<<<< * self.py_encoder = py_encoder * self.py_decoder = py_decoder */ __Pyx_INCREF((PyObject *)__pyx_v_base_codec); __Pyx_GIVEREF((PyObject *)__pyx_v_base_codec); __Pyx_GOTREF((PyObject *)__pyx_v_self->base_codec); __Pyx_DECREF((PyObject *)__pyx_v_self->base_codec); __pyx_v_self->base_codec = __pyx_v_base_codec; /* "asyncpg/protocol/codecs/base.pyx":55 * self.c_decoder = c_decoder * self.base_codec = base_codec * self.py_encoder = py_encoder # <<<<<<<<<<<<<< * self.py_decoder = py_decoder * self.element_codec = element_codec */ __Pyx_INCREF(__pyx_v_py_encoder); __Pyx_GIVEREF(__pyx_v_py_encoder); __Pyx_GOTREF(__pyx_v_self->py_encoder); __Pyx_DECREF(__pyx_v_self->py_encoder); __pyx_v_self->py_encoder = __pyx_v_py_encoder; /* "asyncpg/protocol/codecs/base.pyx":56 * self.base_codec = base_codec * self.py_encoder = py_encoder * self.py_decoder = py_decoder # <<<<<<<<<<<<<< * self.element_codec = element_codec * self.element_type_oids = element_type_oids */ __Pyx_INCREF(__pyx_v_py_decoder); __Pyx_GIVEREF(__pyx_v_py_decoder); __Pyx_GOTREF(__pyx_v_self->py_decoder); __Pyx_DECREF(__pyx_v_self->py_decoder); __pyx_v_self->py_decoder = __pyx_v_py_decoder; /* "asyncpg/protocol/codecs/base.pyx":57 * self.py_encoder = py_encoder * self.py_decoder = py_decoder * self.element_codec = element_codec # <<<<<<<<<<<<<< * self.element_type_oids = element_type_oids * self.element_codecs = element_codecs */ __Pyx_INCREF((PyObject *)__pyx_v_element_codec); __Pyx_GIVEREF((PyObject *)__pyx_v_element_codec); __Pyx_GOTREF((PyObject *)__pyx_v_self->element_codec); __Pyx_DECREF((PyObject *)__pyx_v_self->element_codec); __pyx_v_self->element_codec = __pyx_v_element_codec; /* "asyncpg/protocol/codecs/base.pyx":58 * self.py_decoder = py_decoder * self.element_codec = element_codec * self.element_type_oids = element_type_oids # <<<<<<<<<<<<<< * self.element_codecs = element_codecs * self.element_delimiter = element_delimiter */ __Pyx_INCREF(__pyx_v_element_type_oids); __Pyx_GIVEREF(__pyx_v_element_type_oids); __Pyx_GOTREF(__pyx_v_self->element_type_oids); __Pyx_DECREF(__pyx_v_self->element_type_oids); __pyx_v_self->element_type_oids = __pyx_v_element_type_oids; /* "asyncpg/protocol/codecs/base.pyx":59 * self.element_codec = element_codec * self.element_type_oids = element_type_oids * self.element_codecs = element_codecs # <<<<<<<<<<<<<< * self.element_delimiter = element_delimiter * self.element_names = element_names */ __Pyx_INCREF(__pyx_v_element_codecs); __Pyx_GIVEREF(__pyx_v_element_codecs); __Pyx_GOTREF(__pyx_v_self->element_codecs); __Pyx_DECREF(__pyx_v_self->element_codecs); __pyx_v_self->element_codecs = __pyx_v_element_codecs; /* "asyncpg/protocol/codecs/base.pyx":60 * self.element_type_oids = element_type_oids * self.element_codecs = element_codecs * self.element_delimiter = element_delimiter # <<<<<<<<<<<<<< * self.element_names = element_names * */ __pyx_v_self->element_delimiter = __pyx_v_element_delimiter; /* "asyncpg/protocol/codecs/base.pyx":61 * self.element_codecs = element_codecs * self.element_delimiter = element_delimiter * self.element_names = element_names # <<<<<<<<<<<<<< * * if base_codec is not None: */ __Pyx_INCREF(__pyx_v_element_names); __Pyx_GIVEREF(__pyx_v_element_names); __Pyx_GOTREF(__pyx_v_self->element_names); __Pyx_DECREF(__pyx_v_self->element_names); __pyx_v_self->element_names = __pyx_v_element_names; /* "asyncpg/protocol/codecs/base.pyx":63 * self.element_names = element_names * * if base_codec is not None: # <<<<<<<<<<<<<< * if c_encoder != NULL or c_decoder != NULL: * raise exceptions.InternalClientError( */ __pyx_t_1 = (((PyObject *)__pyx_v_base_codec) != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":64 * * if base_codec is not None: * if c_encoder != NULL or c_decoder != NULL: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * 'base_codec is mutually exclusive with c_encoder/c_decoder' */ __pyx_t_2 = (__pyx_v_c_encoder != NULL); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L5_bool_binop_done; } __pyx_t_2 = (__pyx_v_c_decoder != NULL); __pyx_t_1 = __pyx_t_2; __pyx_L5_bool_binop_done:; if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/codecs/base.pyx":65 * if base_codec is not None: * if c_encoder != NULL or c_decoder != NULL: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * 'base_codec is mutually exclusive with c_encoder/c_decoder' * ) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_base_codec_is_mutually_exclusive}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(3, 65, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":64 * * if base_codec is not None: * if c_encoder != NULL or c_decoder != NULL: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * 'base_codec is mutually exclusive with c_encoder/c_decoder' */ } /* "asyncpg/protocol/codecs/base.pyx":63 * self.element_names = element_names * * if base_codec is not None: # <<<<<<<<<<<<<< * if c_encoder != NULL or c_decoder != NULL: * raise exceptions.InternalClientError( */ } /* "asyncpg/protocol/codecs/base.pyx":69 * ) * * if element_names is not None: # <<<<<<<<<<<<<< * self.record_desc = record.ApgRecordDesc_New( * element_names, tuple(element_names)) */ __pyx_t_1 = (__pyx_v_element_names != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":71 * if element_names is not None: * self.record_desc = record.ApgRecordDesc_New( * element_names, tuple(element_names)) # <<<<<<<<<<<<<< * else: * self.record_desc = None */ __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_element_names); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/protocol/codecs/base.pyx":70 * * if element_names is not None: * self.record_desc = record.ApgRecordDesc_New( # <<<<<<<<<<<<<< * element_names, tuple(element_names)) * else: */ __pyx_t_5 = ApgRecordDesc_New(__pyx_v_element_names, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->record_desc); __Pyx_DECREF(__pyx_v_self->record_desc); __pyx_v_self->record_desc = __pyx_t_5; __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/base.pyx":69 * ) * * if element_names is not None: # <<<<<<<<<<<<<< * self.record_desc = record.ApgRecordDesc_New( * element_names, tuple(element_names)) */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/base.pyx":73 * element_names, tuple(element_names)) * else: * self.record_desc = None # <<<<<<<<<<<<<< * * if type == CODEC_C: */ /*else*/ { __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->record_desc); __Pyx_DECREF(__pyx_v_self->record_desc); __pyx_v_self->record_desc = Py_None; } __pyx_L7:; /* "asyncpg/protocol/codecs/base.pyx":75 * self.record_desc = None * * if type == CODEC_C: # <<<<<<<<<<<<<< * self.encoder = &self.encode_scalar * self.decoder = &self.decode_scalar */ switch (__pyx_v_type) { case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_C: /* "asyncpg/protocol/codecs/base.pyx":76 * * if type == CODEC_C: * self.encoder = &self.encode_scalar # <<<<<<<<<<<<<< * self.decoder = &self.decode_scalar * elif type == CODEC_ARRAY: */ __pyx_v_self->encoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_scalar)); /* "asyncpg/protocol/codecs/base.pyx":77 * if type == CODEC_C: * self.encoder = &self.encode_scalar * self.decoder = &self.decode_scalar # <<<<<<<<<<<<<< * elif type == CODEC_ARRAY: * if format == PG_FORMAT_BINARY: */ __pyx_v_self->decoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_scalar)); /* "asyncpg/protocol/codecs/base.pyx":75 * self.record_desc = None * * if type == CODEC_C: # <<<<<<<<<<<<<< * self.encoder = &self.encode_scalar * self.decoder = &self.decode_scalar */ break; case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_ARRAY: /* "asyncpg/protocol/codecs/base.pyx":79 * self.decoder = &self.decode_scalar * elif type == CODEC_ARRAY: * if format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * self.encoder = &self.encode_array * self.decoder = &self.decode_array */ __pyx_t_1 = (__pyx_v_format == __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":80 * elif type == CODEC_ARRAY: * if format == PG_FORMAT_BINARY: * self.encoder = &self.encode_array # <<<<<<<<<<<<<< * self.decoder = &self.decode_array * else: */ __pyx_v_self->encoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_array)); /* "asyncpg/protocol/codecs/base.pyx":81 * if format == PG_FORMAT_BINARY: * self.encoder = &self.encode_array * self.decoder = &self.decode_array # <<<<<<<<<<<<<< * else: * self.encoder = &self.encode_array_text */ __pyx_v_self->decoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_array)); /* "asyncpg/protocol/codecs/base.pyx":79 * self.decoder = &self.decode_scalar * elif type == CODEC_ARRAY: * if format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * self.encoder = &self.encode_array * self.decoder = &self.decode_array */ goto __pyx_L8; } /* "asyncpg/protocol/codecs/base.pyx":83 * self.decoder = &self.decode_array * else: * self.encoder = &self.encode_array_text # <<<<<<<<<<<<<< * self.decoder = &self.decode_array_text * elif type == CODEC_RANGE: */ /*else*/ { __pyx_v_self->encoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_array_text)); /* "asyncpg/protocol/codecs/base.pyx":84 * else: * self.encoder = &self.encode_array_text * self.decoder = &self.decode_array_text # <<<<<<<<<<<<<< * elif type == CODEC_RANGE: * if format != PG_FORMAT_BINARY: */ __pyx_v_self->decoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_array_text)); } __pyx_L8:; /* "asyncpg/protocol/codecs/base.pyx":78 * self.encoder = &self.encode_scalar * self.decoder = &self.decode_scalar * elif type == CODEC_ARRAY: # <<<<<<<<<<<<<< * if format == PG_FORMAT_BINARY: * self.encoder = &self.encode_array */ break; case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_RANGE: /* "asyncpg/protocol/codecs/base.pyx":86 * self.decoder = &self.decode_array_text * elif type == CODEC_RANGE: * if format != PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * raise exceptions.UnsupportedClientFeatureError( * 'cannot decode type "{}"."{}": text encoding of ' */ __pyx_t_1 = (__pyx_v_format != __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/codecs/base.pyx":87 * elif type == CODEC_RANGE: * if format != PG_FORMAT_BINARY: * raise exceptions.UnsupportedClientFeatureError( # <<<<<<<<<<<<<< * 'cannot decode type "{}"."{}": text encoding of ' * 'range types is not supported'.format(schema, name)) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UnsupportedClientFeatureError); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":89 * raise exceptions.UnsupportedClientFeatureError( * 'cannot decode type "{}"."{}": text encoding of ' * 'range types is not supported'.format(schema, name)) # <<<<<<<<<<<<<< * self.encoder = &self.encode_range * self.decoder = &self.decode_range */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_cannot_decode_type_text_encoding, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_schema, __pyx_v_name}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(3, 87, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":86 * self.decoder = &self.decode_array_text * elif type == CODEC_RANGE: * if format != PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * raise exceptions.UnsupportedClientFeatureError( * 'cannot decode type "{}"."{}": text encoding of ' */ } /* "asyncpg/protocol/codecs/base.pyx":90 * 'cannot decode type "{}"."{}": text encoding of ' * 'range types is not supported'.format(schema, name)) * self.encoder = &self.encode_range # <<<<<<<<<<<<<< * self.decoder = &self.decode_range * elif type == CODEC_MULTIRANGE: */ __pyx_v_self->encoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_range)); /* "asyncpg/protocol/codecs/base.pyx":91 * 'range types is not supported'.format(schema, name)) * self.encoder = &self.encode_range * self.decoder = &self.decode_range # <<<<<<<<<<<<<< * elif type == CODEC_MULTIRANGE: * if format != PG_FORMAT_BINARY: */ __pyx_v_self->decoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_range)); /* "asyncpg/protocol/codecs/base.pyx":85 * self.encoder = &self.encode_array_text * self.decoder = &self.decode_array_text * elif type == CODEC_RANGE: # <<<<<<<<<<<<<< * if format != PG_FORMAT_BINARY: * raise exceptions.UnsupportedClientFeatureError( */ break; case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_MULTIRANGE: /* "asyncpg/protocol/codecs/base.pyx":93 * self.decoder = &self.decode_range * elif type == CODEC_MULTIRANGE: * if format != PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * raise exceptions.UnsupportedClientFeatureError( * 'cannot decode type "{}"."{}": text encoding of ' */ __pyx_t_1 = (__pyx_v_format != __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/codecs/base.pyx":94 * elif type == CODEC_MULTIRANGE: * if format != PG_FORMAT_BINARY: * raise exceptions.UnsupportedClientFeatureError( # <<<<<<<<<<<<<< * 'cannot decode type "{}"."{}": text encoding of ' * 'range types is not supported'.format(schema, name)) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_UnsupportedClientFeatureError); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":96 * raise exceptions.UnsupportedClientFeatureError( * 'cannot decode type "{}"."{}": text encoding of ' * 'range types is not supported'.format(schema, name)) # <<<<<<<<<<<<<< * self.encoder = &self.encode_multirange * self.decoder = &self.decode_multirange */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_cannot_decode_type_text_encoding, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_schema, __pyx_v_name}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(3, 94, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":93 * self.decoder = &self.decode_range * elif type == CODEC_MULTIRANGE: * if format != PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * raise exceptions.UnsupportedClientFeatureError( * 'cannot decode type "{}"."{}": text encoding of ' */ } /* "asyncpg/protocol/codecs/base.pyx":97 * 'cannot decode type "{}"."{}": text encoding of ' * 'range types is not supported'.format(schema, name)) * self.encoder = &self.encode_multirange # <<<<<<<<<<<<<< * self.decoder = &self.decode_multirange * elif type == CODEC_COMPOSITE: */ __pyx_v_self->encoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_multirange)); /* "asyncpg/protocol/codecs/base.pyx":98 * 'range types is not supported'.format(schema, name)) * self.encoder = &self.encode_multirange * self.decoder = &self.decode_multirange # <<<<<<<<<<<<<< * elif type == CODEC_COMPOSITE: * if format != PG_FORMAT_BINARY: */ __pyx_v_self->decoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_multirange)); /* "asyncpg/protocol/codecs/base.pyx":92 * self.encoder = &self.encode_range * self.decoder = &self.decode_range * elif type == CODEC_MULTIRANGE: # <<<<<<<<<<<<<< * if format != PG_FORMAT_BINARY: * raise exceptions.UnsupportedClientFeatureError( */ break; case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_COMPOSITE: /* "asyncpg/protocol/codecs/base.pyx":100 * self.decoder = &self.decode_multirange * elif type == CODEC_COMPOSITE: * if format != PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * raise exceptions.UnsupportedClientFeatureError( * 'cannot decode type "{}"."{}": text encoding of ' */ __pyx_t_1 = (__pyx_v_format != __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/codecs/base.pyx":101 * elif type == CODEC_COMPOSITE: * if format != PG_FORMAT_BINARY: * raise exceptions.UnsupportedClientFeatureError( # <<<<<<<<<<<<<< * 'cannot decode type "{}"."{}": text encoding of ' * 'composite types is not supported'.format(schema, name)) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UnsupportedClientFeatureError); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":103 * raise exceptions.UnsupportedClientFeatureError( * 'cannot decode type "{}"."{}": text encoding of ' * 'composite types is not supported'.format(schema, name)) # <<<<<<<<<<<<<< * self.encoder = &self.encode_composite * self.decoder = &self.decode_composite */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_cannot_decode_type_text_encoding_2, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_schema, __pyx_v_name}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(3, 101, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":100 * self.decoder = &self.decode_multirange * elif type == CODEC_COMPOSITE: * if format != PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * raise exceptions.UnsupportedClientFeatureError( * 'cannot decode type "{}"."{}": text encoding of ' */ } /* "asyncpg/protocol/codecs/base.pyx":104 * 'cannot decode type "{}"."{}": text encoding of ' * 'composite types is not supported'.format(schema, name)) * self.encoder = &self.encode_composite # <<<<<<<<<<<<<< * self.decoder = &self.decode_composite * elif type == CODEC_PY: */ __pyx_v_self->encoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_composite)); /* "asyncpg/protocol/codecs/base.pyx":105 * 'composite types is not supported'.format(schema, name)) * self.encoder = &self.encode_composite * self.decoder = &self.decode_composite # <<<<<<<<<<<<<< * elif type == CODEC_PY: * self.encoder = &self.encode_in_python */ __pyx_v_self->decoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_composite)); /* "asyncpg/protocol/codecs/base.pyx":99 * self.encoder = &self.encode_multirange * self.decoder = &self.decode_multirange * elif type == CODEC_COMPOSITE: # <<<<<<<<<<<<<< * if format != PG_FORMAT_BINARY: * raise exceptions.UnsupportedClientFeatureError( */ break; case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_PY: /* "asyncpg/protocol/codecs/base.pyx":107 * self.decoder = &self.decode_composite * elif type == CODEC_PY: * self.encoder = &self.encode_in_python # <<<<<<<<<<<<<< * self.decoder = &self.decode_in_python * else: */ __pyx_v_self->encoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_in_python)); /* "asyncpg/protocol/codecs/base.pyx":108 * elif type == CODEC_PY: * self.encoder = &self.encode_in_python * self.decoder = &self.decode_in_python # <<<<<<<<<<<<<< * else: * raise exceptions.InternalClientError( */ __pyx_v_self->decoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_in_python)); /* "asyncpg/protocol/codecs/base.pyx":106 * self.encoder = &self.encode_composite * self.decoder = &self.decode_composite * elif type == CODEC_PY: # <<<<<<<<<<<<<< * self.encoder = &self.encode_in_python * self.decoder = &self.decode_in_python */ break; default: /* "asyncpg/protocol/codecs/base.pyx":110 * self.decoder = &self.decode_in_python * else: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * 'unexpected codec type: {}'.format(type)) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":111 * else: * raise exceptions.InternalClientError( * 'unexpected codec type: {}'.format(type)) # <<<<<<<<<<<<<< * * cdef Codec copy(self): */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_codec_type, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_CodecType(__pyx_v_type); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_8}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(3, 110, __pyx_L1_error) break; } /* "asyncpg/protocol/codecs/base.pyx":26 * self.type = CODEC_UNDEFINED * * cdef init( # <<<<<<<<<<<<<< * self, * str name, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":113 * 'unexpected codec type: {}'.format(type)) * * cdef Codec copy(self): # <<<<<<<<<<<<<< * cdef Codec codec * */ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_copy(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 1); /* "asyncpg/protocol/codecs/base.pyx":116 * cdef Codec codec * * codec = Codec(self.oid) # <<<<<<<<<<<<<< * codec.init(self.name, self.schema, self.kind, * self.type, self.format, self.xformat, */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_self->oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_Codec), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":117 * * codec = Codec(self.oid) * codec.init(self.name, self.schema, self.kind, # <<<<<<<<<<<<<< * self.type, self.format, self.xformat, * self.c_encoder, self.c_decoder, self.base_codec, */ __pyx_t_2 = __pyx_v_self->name; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = __pyx_v_self->schema; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_v_self->kind; __Pyx_INCREF(__pyx_t_3); /* "asyncpg/protocol/codecs/base.pyx":119 * codec.init(self.name, self.schema, self.kind, * self.type, self.format, self.xformat, * self.c_encoder, self.c_decoder, self.base_codec, # <<<<<<<<<<<<<< * self.py_encoder, self.py_decoder, * self.element_codec, */ __pyx_t_4 = ((PyObject *)__pyx_v_self->base_codec); __Pyx_INCREF(__pyx_t_4); /* "asyncpg/protocol/codecs/base.pyx":120 * self.type, self.format, self.xformat, * self.c_encoder, self.c_decoder, self.base_codec, * self.py_encoder, self.py_decoder, # <<<<<<<<<<<<<< * self.element_codec, * self.element_type_oids, self.element_names, */ __pyx_t_5 = __pyx_v_self->py_encoder; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = __pyx_v_self->py_decoder; __Pyx_INCREF(__pyx_t_6); /* "asyncpg/protocol/codecs/base.pyx":121 * self.c_encoder, self.c_decoder, self.base_codec, * self.py_encoder, self.py_decoder, * self.element_codec, # <<<<<<<<<<<<<< * self.element_type_oids, self.element_names, * self.element_codecs, self.element_delimiter) */ __pyx_t_7 = ((PyObject *)__pyx_v_self->element_codec); __Pyx_INCREF(__pyx_t_7); /* "asyncpg/protocol/codecs/base.pyx":122 * self.py_encoder, self.py_decoder, * self.element_codec, * self.element_type_oids, self.element_names, # <<<<<<<<<<<<<< * self.element_codecs, self.element_delimiter) * */ __pyx_t_8 = __pyx_v_self->element_type_oids; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = __pyx_v_self->element_names; __Pyx_INCREF(__pyx_t_9); /* "asyncpg/protocol/codecs/base.pyx":123 * self.element_codec, * self.element_type_oids, self.element_names, * self.element_codecs, self.element_delimiter) # <<<<<<<<<<<<<< * * return codec */ __pyx_t_10 = __pyx_v_self->element_codecs; __Pyx_INCREF(__pyx_t_10); /* "asyncpg/protocol/codecs/base.pyx":117 * * codec = Codec(self.oid) * codec.init(self.name, self.schema, self.kind, # <<<<<<<<<<<<<< * self.type, self.format, self.xformat, * self.c_encoder, self.c_decoder, self.base_codec, */ __pyx_t_11 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, ((PyObject*)__pyx_t_2), ((PyObject*)__pyx_t_1), ((PyObject*)__pyx_t_3), __pyx_v_self->type, __pyx_v_self->format, __pyx_v_self->xformat, __pyx_v_self->c_encoder, __pyx_v_self->c_decoder, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_4), __pyx_t_5, __pyx_t_6, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_7), ((PyObject*)__pyx_t_8), __pyx_t_9, ((PyObject*)__pyx_t_10), __pyx_v_self->element_delimiter); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/codecs/base.pyx":125 * self.element_codecs, self.element_delimiter) * * return codec # <<<<<<<<<<<<<< * * cdef encode_scalar(self, ConnectionSettings settings, WriteBuffer buf, */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_codec); __pyx_r = __pyx_v_codec; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":113 * 'unexpected codec type: {}'.format(type)) * * cdef Codec copy(self): # <<<<<<<<<<<<<< * cdef Codec codec * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":127 * return codec * * cdef encode_scalar(self, ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj): * self.c_encoder(settings, buf, obj) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_scalar(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("encode_scalar", 1); /* "asyncpg/protocol/codecs/base.pyx":129 * cdef encode_scalar(self, ConnectionSettings settings, WriteBuffer buf, * object obj): * self.c_encoder(settings, buf, obj) # <<<<<<<<<<<<<< * * cdef encode_array(self, ConnectionSettings settings, WriteBuffer buf, */ __pyx_t_1 = __pyx_v_self->c_encoder(__pyx_v_settings, __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":127 * return codec * * cdef encode_scalar(self, ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj): * self.c_encoder(settings, buf, obj) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.encode_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":131 * self.c_encoder(settings, buf, obj) * * cdef encode_array(self, ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj): * array_encode(settings, buf, obj, self.element_codec.oid, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_array(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("encode_array", 1); /* "asyncpg/protocol/codecs/base.pyx":133 * cdef encode_array(self, ConnectionSettings settings, WriteBuffer buf, * object obj): * array_encode(settings, buf, obj, self.element_codec.oid, # <<<<<<<<<<<<<< * codec_encode_func_ex, * (self.element_codec)) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_array_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_obj, __pyx_v_self->element_codec->oid, __pyx_f_7asyncpg_8protocol_8protocol_codec_encode_func_ex, ((void *)__pyx_v_self->element_codec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":131 * self.c_encoder(settings, buf, obj) * * cdef encode_array(self, ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj): * array_encode(settings, buf, obj, self.element_codec.oid, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.encode_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":137 * (self.element_codec)) * * cdef encode_array_text(self, ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj): * return textarray_encode(settings, buf, obj, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_array_text(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("encode_array_text", 1); /* "asyncpg/protocol/codecs/base.pyx":139 * cdef encode_array_text(self, ConnectionSettings settings, WriteBuffer buf, * object obj): * return textarray_encode(settings, buf, obj, # <<<<<<<<<<<<<< * codec_encode_func_ex, * (self.element_codec), */ __Pyx_XDECREF(__pyx_r); /* "asyncpg/protocol/codecs/base.pyx":142 * codec_encode_func_ex, * (self.element_codec), * self.element_delimiter) # <<<<<<<<<<<<<< * * cdef encode_range(self, ConnectionSettings settings, WriteBuffer buf, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_textarray_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_obj, __pyx_f_7asyncpg_8protocol_8protocol_codec_encode_func_ex, ((void *)__pyx_v_self->element_codec), __pyx_v_self->element_delimiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":137 * (self.element_codec)) * * cdef encode_array_text(self, ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj): * return textarray_encode(settings, buf, obj, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.encode_array_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":144 * self.element_delimiter) * * cdef encode_range(self, ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj): * range_encode(settings, buf, obj, self.element_codec.oid, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_range(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("encode_range", 1); /* "asyncpg/protocol/codecs/base.pyx":146 * cdef encode_range(self, ConnectionSettings settings, WriteBuffer buf, * object obj): * range_encode(settings, buf, obj, self.element_codec.oid, # <<<<<<<<<<<<<< * codec_encode_func_ex, * (self.element_codec)) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_range_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_obj, __pyx_v_self->element_codec->oid, __pyx_f_7asyncpg_8protocol_8protocol_codec_encode_func_ex, ((void *)__pyx_v_self->element_codec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":144 * self.element_delimiter) * * cdef encode_range(self, ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj): * range_encode(settings, buf, obj, self.element_codec.oid, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.encode_range", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":150 * (self.element_codec)) * * cdef encode_multirange(self, ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj): * multirange_encode(settings, buf, obj, self.element_codec.oid, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_multirange(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("encode_multirange", 1); /* "asyncpg/protocol/codecs/base.pyx":152 * cdef encode_multirange(self, ConnectionSettings settings, WriteBuffer buf, * object obj): * multirange_encode(settings, buf, obj, self.element_codec.oid, # <<<<<<<<<<<<<< * codec_encode_func_ex, * (self.element_codec)) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_multirange_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_obj, __pyx_v_self->element_codec->oid, __pyx_f_7asyncpg_8protocol_8protocol_codec_encode_func_ex, ((void *)__pyx_v_self->element_codec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":150 * (self.element_codec)) * * cdef encode_multirange(self, ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj): * multirange_encode(settings, buf, obj, self.element_codec.oid, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.encode_multirange", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":156 * (self.element_codec)) * * cdef encode_composite(self, ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj): * cdef: */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_composite(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_elem_data = 0; int __pyx_v_i; PyObject *__pyx_v_elem_codecs = 0; Py_ssize_t __pyx_v_count; Py_ssize_t __pyx_v_composite_size; PyObject *__pyx_v_rec = 0; PyObject *__pyx_v_field = NULL; PyObject *__pyx_v_item = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; Py_ssize_t __pyx_t_5; int __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; unsigned int __pyx_t_17; int32_t __pyx_t_18; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("encode_composite", 0); __Pyx_INCREF(__pyx_v_obj); /* "asyncpg/protocol/codecs/base.pyx":161 * WriteBuffer elem_data * int i * list elem_codecs = self.element_codecs # <<<<<<<<<<<<<< * ssize_t count * ssize_t composite_size */ __pyx_t_1 = __pyx_v_self->element_codecs; __Pyx_INCREF(__pyx_t_1); __pyx_v_elem_codecs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":166 * tuple rec * * if isinstance(obj, MappingABC): # <<<<<<<<<<<<<< * # Input is dict-like, form a tuple * composite_size = len(self.element_type_oids) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MappingABC); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(3, 166, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "asyncpg/protocol/codecs/base.pyx":168 * if isinstance(obj, MappingABC): * # Input is dict-like, form a tuple * composite_size = len(self.element_type_oids) # <<<<<<<<<<<<<< * rec = cpython.PyTuple_New(composite_size) * */ __pyx_t_1 = __pyx_v_self->element_type_oids; __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(3, 168, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_composite_size = __pyx_t_3; /* "asyncpg/protocol/codecs/base.pyx":169 * # Input is dict-like, form a tuple * composite_size = len(self.element_type_oids) * rec = cpython.PyTuple_New(composite_size) # <<<<<<<<<<<<<< * * for i in range(composite_size): */ __pyx_t_1 = PyTuple_New(__pyx_v_composite_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rec = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":171 * rec = cpython.PyTuple_New(composite_size) * * for i in range(composite_size): # <<<<<<<<<<<<<< * cpython.Py_INCREF(None) * cpython.PyTuple_SET_ITEM(rec, i, None) */ __pyx_t_4 = __pyx_v_composite_size; __pyx_t_5 = __pyx_t_4; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; /* "asyncpg/protocol/codecs/base.pyx":172 * * for i in range(composite_size): * cpython.Py_INCREF(None) # <<<<<<<<<<<<<< * cpython.PyTuple_SET_ITEM(rec, i, None) * */ Py_INCREF(Py_None); /* "asyncpg/protocol/codecs/base.pyx":173 * for i in range(composite_size): * cpython.Py_INCREF(None) * cpython.PyTuple_SET_ITEM(rec, i, None) # <<<<<<<<<<<<<< * * for field in obj: */ PyTuple_SET_ITEM(__pyx_v_rec, __pyx_v_i, Py_None); } /* "asyncpg/protocol/codecs/base.pyx":175 * cpython.PyTuple_SET_ITEM(rec, i, None) * * for field in obj: # <<<<<<<<<<<<<< * try: * i = self.element_names[field] */ if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) { __pyx_t_1 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_7 = NULL; } else { __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 175, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 175, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(3, 175, __pyx_L1_error) #else __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 175, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(3, 175, __pyx_L1_error) #else __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } } else { __pyx_t_8 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(3, 175, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_8); } __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/base.pyx":176 * * for field in obj: * try: # <<<<<<<<<<<<<< * i = self.element_names[field] * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); /*try:*/ { /* "asyncpg/protocol/codecs/base.pyx":177 * for field in obj: * try: * i = self.element_names[field] # <<<<<<<<<<<<<< * except KeyError: * raise ValueError( */ __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_self->element_names, __pyx_v_field); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 177, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 177, __pyx_L8_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_i = __pyx_t_6; /* "asyncpg/protocol/codecs/base.pyx":176 * * for field in obj: * try: # <<<<<<<<<<<<<< * i = self.element_names[field] * except KeyError: */ } __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L15_try_end; __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/base.pyx":178 * try: * i = self.element_names[field] * except KeyError: # <<<<<<<<<<<<<< * raise ValueError( * '{!r} is not a valid element of composite ' */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.encode_composite", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_12, &__pyx_t_13) < 0) __PYX_ERR(3, 178, __pyx_L10_except_error) __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); /* "asyncpg/protocol/codecs/base.pyx":181 * raise ValueError( * '{!r} is not a valid element of composite ' * 'type {}'.format(field, self.name)) from None # <<<<<<<<<<<<<< * * item = obj[field] */ __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_r_is_not_a_valid_element_of_com, __pyx_n_s_format); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 181, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = NULL; __pyx_t_17 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_15))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_15); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_15, function); __pyx_t_17 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_16, __pyx_v_field, __pyx_v_self->name}; __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_17, 2+__pyx_t_17); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 181, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } /* "asyncpg/protocol/codecs/base.pyx":179 * i = self.element_names[field] * except KeyError: * raise ValueError( # <<<<<<<<<<<<<< * '{!r} is not a valid element of composite ' * 'type {}'.format(field, self.name)) from None */ __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 179, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; /* "asyncpg/protocol/codecs/base.pyx":181 * raise ValueError( * '{!r} is not a valid element of composite ' * 'type {}'.format(field, self.name)) from None # <<<<<<<<<<<<<< * * item = obj[field] */ __Pyx_Raise(__pyx_t_15, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __PYX_ERR(3, 179, __pyx_L10_except_error) } goto __pyx_L10_except_error; /* "asyncpg/protocol/codecs/base.pyx":176 * * for field in obj: * try: # <<<<<<<<<<<<<< * i = self.element_names[field] * except KeyError: */ __pyx_L10_except_error:; __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); goto __pyx_L1_error; __pyx_L15_try_end:; } /* "asyncpg/protocol/codecs/base.pyx":183 * 'type {}'.format(field, self.name)) from None * * item = obj[field] # <<<<<<<<<<<<<< * cpython.Py_INCREF(item) * cpython.PyTuple_SET_ITEM(rec, i, item) */ __pyx_t_13 = __Pyx_PyObject_GetItem(__pyx_v_obj, __pyx_v_field); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_13); __pyx_t_13 = 0; /* "asyncpg/protocol/codecs/base.pyx":184 * * item = obj[field] * cpython.Py_INCREF(item) # <<<<<<<<<<<<<< * cpython.PyTuple_SET_ITEM(rec, i, item) * */ Py_INCREF(__pyx_v_item); /* "asyncpg/protocol/codecs/base.pyx":185 * item = obj[field] * cpython.Py_INCREF(item) * cpython.PyTuple_SET_ITEM(rec, i, item) # <<<<<<<<<<<<<< * * obj = rec */ PyTuple_SET_ITEM(__pyx_v_rec, __pyx_v_i, __pyx_v_item); /* "asyncpg/protocol/codecs/base.pyx":175 * cpython.PyTuple_SET_ITEM(rec, i, None) * * for field in obj: # <<<<<<<<<<<<<< * try: * i = self.element_names[field] */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":187 * cpython.PyTuple_SET_ITEM(rec, i, item) * * obj = rec # <<<<<<<<<<<<<< * * count = len(obj) */ __Pyx_INCREF(__pyx_v_rec); __Pyx_DECREF_SET(__pyx_v_obj, __pyx_v_rec); /* "asyncpg/protocol/codecs/base.pyx":166 * tuple rec * * if isinstance(obj, MappingABC): # <<<<<<<<<<<<<< * # Input is dict-like, form a tuple * composite_size = len(self.element_type_oids) */ } /* "asyncpg/protocol/codecs/base.pyx":189 * obj = rec * * count = len(obj) # <<<<<<<<<<<<<< * if count > _MAXINT32: * raise ValueError('too many elements in composite type record') */ __pyx_t_3 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 189, __pyx_L1_error) __pyx_v_count = __pyx_t_3; /* "asyncpg/protocol/codecs/base.pyx":190 * * count = len(obj) * if count > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('too many elements in composite type record') * */ __pyx_t_2 = (__pyx_v_count > 0x7FFFFFFF); if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/codecs/base.pyx":191 * count = len(obj) * if count > _MAXINT32: * raise ValueError('too many elements in composite type record') # <<<<<<<<<<<<<< * * elem_data = WriteBuffer.new() */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(3, 191, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":190 * * count = len(obj) * if count > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('too many elements in composite type record') * */ } /* "asyncpg/protocol/codecs/base.pyx":193 * raise ValueError('too many elements in composite type record') * * elem_data = WriteBuffer.new() # <<<<<<<<<<<<<< * i = 0 * for item in obj: */ __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_elem_data = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":194 * * elem_data = WriteBuffer.new() * i = 0 # <<<<<<<<<<<<<< * for item in obj: * elem_data.write_int32(self.element_type_oids[i]) */ __pyx_v_i = 0; /* "asyncpg/protocol/codecs/base.pyx":195 * elem_data = WriteBuffer.new() * i = 0 * for item in obj: # <<<<<<<<<<<<<< * elem_data.write_int32(self.element_type_oids[i]) * if item is None: */ if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) { __pyx_t_1 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_7 = NULL; } else { __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 195, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 195, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_13 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_13); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(3, 195, __pyx_L1_error) #else __pyx_t_13 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 195, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_13); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(3, 195, __pyx_L1_error) #else __pyx_t_13 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); #endif } } else { __pyx_t_13 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_13)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(3, 195, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_13); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_13); __pyx_t_13 = 0; /* "asyncpg/protocol/codecs/base.pyx":196 * i = 0 * for item in obj: * elem_data.write_int32(self.element_type_oids[i]) # <<<<<<<<<<<<<< * if item is None: * elem_data.write_int32(-1) */ if (unlikely(__pyx_v_self->element_type_oids == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(3, 196, __pyx_L1_error) } __pyx_t_13 = __Pyx_GetItemInt_Tuple(__pyx_v_self->element_type_oids, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_18 = __Pyx_PyInt_As_int32_t(__pyx_t_13); if (unlikely((__pyx_t_18 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(3, 196, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_elem_data->__pyx_vtab)->write_int32(__pyx_v_elem_data, ((int32_t)__pyx_t_18)); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "asyncpg/protocol/codecs/base.pyx":197 * for item in obj: * elem_data.write_int32(self.element_type_oids[i]) * if item is None: # <<<<<<<<<<<<<< * elem_data.write_int32(-1) * else: */ __pyx_t_2 = (__pyx_v_item == Py_None); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/base.pyx":198 * elem_data.write_int32(self.element_type_oids[i]) * if item is None: * elem_data.write_int32(-1) # <<<<<<<<<<<<<< * else: * (elem_codecs[i]).encode(settings, elem_data, item) */ __pyx_t_13 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_elem_data->__pyx_vtab)->write_int32(__pyx_v_elem_data, -1); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "asyncpg/protocol/codecs/base.pyx":197 * for item in obj: * elem_data.write_int32(self.element_type_oids[i]) * if item is None: # <<<<<<<<<<<<<< * elem_data.write_int32(-1) * else: */ goto __pyx_L22; } /* "asyncpg/protocol/codecs/base.pyx":200 * elem_data.write_int32(-1) * else: * (elem_codecs[i]).encode(settings, elem_data, item) # <<<<<<<<<<<<<< * i += 1 * */ /*else*/ { if (unlikely(__pyx_v_elem_codecs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(3, 200, __pyx_L1_error) } __pyx_t_13 = __Pyx_GetItemInt_List(__pyx_v_elem_codecs, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_12 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode(((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_13), __pyx_v_settings, __pyx_v_elem_data, __pyx_v_item); if (unlikely(!__pyx_t_12)) __PYX_ERR(3, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __pyx_L22:; /* "asyncpg/protocol/codecs/base.pyx":201 * else: * (elem_codecs[i]).encode(settings, elem_data, item) * i += 1 # <<<<<<<<<<<<<< * * record_encode_frame(settings, buf, elem_data, count) */ __pyx_v_i = (__pyx_v_i + 1); /* "asyncpg/protocol/codecs/base.pyx":195 * elem_data = WriteBuffer.new() * i = 0 * for item in obj: # <<<<<<<<<<<<<< * elem_data.write_int32(self.element_type_oids[i]) * if item is None: */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":203 * i += 1 * * record_encode_frame(settings, buf, elem_data, count) # <<<<<<<<<<<<<< * * cdef encode_in_python(self, ConnectionSettings settings, WriteBuffer buf, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_record_encode_frame(__pyx_v_settings, __pyx_v_buf, __pyx_v_elem_data, ((int32_t)__pyx_v_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":156 * (self.element_codec)) * * cdef encode_composite(self, ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj): * cdef: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.encode_composite", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_elem_data); __Pyx_XDECREF(__pyx_v_elem_codecs); __Pyx_XDECREF(__pyx_v_rec); __Pyx_XDECREF(__pyx_v_field); __Pyx_XDECREF(__pyx_v_item); __Pyx_XDECREF(__pyx_v_obj); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":205 * record_encode_frame(settings, buf, elem_data, count) * * cdef encode_in_python(self, ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj): * data = self.py_encoder(obj) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_in_python(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { PyObject *__pyx_v_data = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("encode_in_python", 1); /* "asyncpg/protocol/codecs/base.pyx":207 * cdef encode_in_python(self, ConnectionSettings settings, WriteBuffer buf, * object obj): * data = self.py_encoder(obj) # <<<<<<<<<<<<<< * if self.xformat == PG_XFORMAT_OBJECT: * if self.format == PG_FORMAT_BINARY: */ __Pyx_INCREF(__pyx_v_self->py_encoder); __pyx_t_2 = __pyx_v_self->py_encoder; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_obj}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":208 * object obj): * data = self.py_encoder(obj) * if self.xformat == PG_XFORMAT_OBJECT: # <<<<<<<<<<<<<< * if self.format == PG_FORMAT_BINARY: * pgproto.bytea_encode(settings, buf, data) */ switch (__pyx_v_self->xformat) { case __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT: /* "asyncpg/protocol/codecs/base.pyx":209 * data = self.py_encoder(obj) * if self.xformat == PG_XFORMAT_OBJECT: * if self.format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * pgproto.bytea_encode(settings, buf, data) * elif self.format == PG_FORMAT_TEXT: */ switch (__pyx_v_self->format) { case __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY: /* "asyncpg/protocol/codecs/base.pyx":210 * if self.xformat == PG_XFORMAT_OBJECT: * if self.format == PG_FORMAT_BINARY: * pgproto.bytea_encode(settings, buf, data) # <<<<<<<<<<<<<< * elif self.format == PG_FORMAT_TEXT: * pgproto.text_encode(settings, buf, data) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_bytea_encode(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings), __pyx_v_buf, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":209 * data = self.py_encoder(obj) * if self.xformat == PG_XFORMAT_OBJECT: * if self.format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * pgproto.bytea_encode(settings, buf, data) * elif self.format == PG_FORMAT_TEXT: */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT: /* "asyncpg/protocol/codecs/base.pyx":212 * pgproto.bytea_encode(settings, buf, data) * elif self.format == PG_FORMAT_TEXT: * pgproto.text_encode(settings, buf, data) # <<<<<<<<<<<<<< * else: * raise exceptions.InternalClientError( */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_text_encode(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings), __pyx_v_buf, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":211 * if self.format == PG_FORMAT_BINARY: * pgproto.bytea_encode(settings, buf, data) * elif self.format == PG_FORMAT_TEXT: # <<<<<<<<<<<<<< * pgproto.text_encode(settings, buf, data) * else: */ break; default: /* "asyncpg/protocol/codecs/base.pyx":214 * pgproto.text_encode(settings, buf, data) * else: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * 'unexpected data format: {}'.format(self.format)) * elif self.xformat == PG_XFORMAT_TUPLE: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":215 * else: * raise exceptions.InternalClientError( * 'unexpected data format: {}'.format(self.format)) # <<<<<<<<<<<<<< * elif self.xformat == PG_XFORMAT_TUPLE: * if self.base_codec is not None: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_data_format, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_self->format); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(3, 214, __pyx_L1_error) break; } /* "asyncpg/protocol/codecs/base.pyx":208 * object obj): * data = self.py_encoder(obj) * if self.xformat == PG_XFORMAT_OBJECT: # <<<<<<<<<<<<<< * if self.format == PG_FORMAT_BINARY: * pgproto.bytea_encode(settings, buf, data) */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE: /* "asyncpg/protocol/codecs/base.pyx":217 * 'unexpected data format: {}'.format(self.format)) * elif self.xformat == PG_XFORMAT_TUPLE: * if self.base_codec is not None: # <<<<<<<<<<<<<< * self.base_codec.encode(settings, buf, data) * else: */ __pyx_t_8 = (((PyObject *)__pyx_v_self->base_codec) != Py_None); if (__pyx_t_8) { /* "asyncpg/protocol/codecs/base.pyx":218 * elif self.xformat == PG_XFORMAT_TUPLE: * if self.base_codec is not None: * self.base_codec.encode(settings, buf, data) # <<<<<<<<<<<<<< * else: * self.c_encoder(settings, buf, data) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode(__pyx_v_self->base_codec, __pyx_v_settings, __pyx_v_buf, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":217 * 'unexpected data format: {}'.format(self.format)) * elif self.xformat == PG_XFORMAT_TUPLE: * if self.base_codec is not None: # <<<<<<<<<<<<<< * self.base_codec.encode(settings, buf, data) * else: */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/base.pyx":220 * self.base_codec.encode(settings, buf, data) * else: * self.c_encoder(settings, buf, data) # <<<<<<<<<<<<<< * else: * raise exceptions.InternalClientError( */ /*else*/ { __pyx_t_1 = __pyx_v_self->c_encoder(__pyx_v_settings, __pyx_v_buf, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "asyncpg/protocol/codecs/base.pyx":216 * raise exceptions.InternalClientError( * 'unexpected data format: {}'.format(self.format)) * elif self.xformat == PG_XFORMAT_TUPLE: # <<<<<<<<<<<<<< * if self.base_codec is not None: * self.base_codec.encode(settings, buf, data) */ break; default: /* "asyncpg/protocol/codecs/base.pyx":222 * self.c_encoder(settings, buf, data) * else: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * 'unexpected exchange format: {}'.format(self.xformat)) * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":223 * else: * raise exceptions.InternalClientError( * 'unexpected exchange format: {}'.format(self.xformat)) # <<<<<<<<<<<<<< * * cdef encode(self, ConnectionSettings settings, WriteBuffer buf, */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_exchange_format, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_v_self->xformat); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(3, 222, __pyx_L1_error) break; } /* "asyncpg/protocol/codecs/base.pyx":205 * record_encode_frame(settings, buf, elem_data, count) * * cdef encode_in_python(self, ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj): * data = self.py_encoder(obj) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.encode_in_python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":225 * 'unexpected exchange format: {}'.format(self.xformat)) * * cdef encode(self, ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj): * return self.encoder(self, settings, buf, obj) */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("encode", 1); /* "asyncpg/protocol/codecs/base.pyx":227 * cdef encode(self, ConnectionSettings settings, WriteBuffer buf, * object obj): * return self.encoder(self, settings, buf, obj) # <<<<<<<<<<<<<< * * cdef decode_scalar(self, ConnectionSettings settings, FRBuffer *buf): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_v_self->encoder(__pyx_v_self, __pyx_v_settings, __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":225 * 'unexpected exchange format: {}'.format(self.xformat)) * * cdef encode(self, ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj): * return self.encoder(self, settings, buf, obj) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":229 * return self.encoder(self, settings, buf, obj) * * cdef decode_scalar(self, ConnectionSettings settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return self.c_decoder(settings, buf) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_scalar(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decode_scalar", 1); /* "asyncpg/protocol/codecs/base.pyx":230 * * cdef decode_scalar(self, ConnectionSettings settings, FRBuffer *buf): * return self.c_decoder(settings, buf) # <<<<<<<<<<<<<< * * cdef decode_array(self, ConnectionSettings settings, FRBuffer *buf): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_v_self->c_decoder(__pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":229 * return self.encoder(self, settings, buf, obj) * * cdef decode_scalar(self, ConnectionSettings settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return self.c_decoder(settings, buf) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.decode_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":232 * return self.c_decoder(settings, buf) * * cdef decode_array(self, ConnectionSettings settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return array_decode(settings, buf, codec_decode_func_ex, * (self.element_codec)) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_array(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decode_array", 1); /* "asyncpg/protocol/codecs/base.pyx":233 * * cdef decode_array(self, ConnectionSettings settings, FRBuffer *buf): * return array_decode(settings, buf, codec_decode_func_ex, # <<<<<<<<<<<<<< * (self.element_codec)) * */ __Pyx_XDECREF(__pyx_r); /* "asyncpg/protocol/codecs/base.pyx":234 * cdef decode_array(self, ConnectionSettings settings, FRBuffer *buf): * return array_decode(settings, buf, codec_decode_func_ex, * (self.element_codec)) # <<<<<<<<<<<<<< * * cdef decode_array_text(self, ConnectionSettings settings, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_array_decode(__pyx_v_settings, __pyx_v_buf, __pyx_f_7asyncpg_8protocol_8protocol_codec_decode_func_ex, ((void *)__pyx_v_self->element_codec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":232 * return self.c_decoder(settings, buf) * * cdef decode_array(self, ConnectionSettings settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return array_decode(settings, buf, codec_decode_func_ex, * (self.element_codec)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.decode_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":236 * (self.element_codec)) * * cdef decode_array_text(self, ConnectionSettings settings, # <<<<<<<<<<<<<< * FRBuffer *buf): * return textarray_decode(settings, buf, codec_decode_func_ex, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_array_text(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decode_array_text", 1); /* "asyncpg/protocol/codecs/base.pyx":238 * cdef decode_array_text(self, ConnectionSettings settings, * FRBuffer *buf): * return textarray_decode(settings, buf, codec_decode_func_ex, # <<<<<<<<<<<<<< * (self.element_codec), * self.element_delimiter) */ __Pyx_XDECREF(__pyx_r); /* "asyncpg/protocol/codecs/base.pyx":240 * return textarray_decode(settings, buf, codec_decode_func_ex, * (self.element_codec), * self.element_delimiter) # <<<<<<<<<<<<<< * * cdef decode_range(self, ConnectionSettings settings, FRBuffer *buf): */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_textarray_decode(__pyx_v_settings, __pyx_v_buf, __pyx_f_7asyncpg_8protocol_8protocol_codec_decode_func_ex, ((void *)__pyx_v_self->element_codec), __pyx_v_self->element_delimiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":236 * (self.element_codec)) * * cdef decode_array_text(self, ConnectionSettings settings, # <<<<<<<<<<<<<< * FRBuffer *buf): * return textarray_decode(settings, buf, codec_decode_func_ex, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.decode_array_text", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":242 * self.element_delimiter) * * cdef decode_range(self, ConnectionSettings settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return range_decode(settings, buf, codec_decode_func_ex, * (self.element_codec)) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_range(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decode_range", 1); /* "asyncpg/protocol/codecs/base.pyx":243 * * cdef decode_range(self, ConnectionSettings settings, FRBuffer *buf): * return range_decode(settings, buf, codec_decode_func_ex, # <<<<<<<<<<<<<< * (self.element_codec)) * */ __Pyx_XDECREF(__pyx_r); /* "asyncpg/protocol/codecs/base.pyx":244 * cdef decode_range(self, ConnectionSettings settings, FRBuffer *buf): * return range_decode(settings, buf, codec_decode_func_ex, * (self.element_codec)) # <<<<<<<<<<<<<< * * cdef decode_multirange(self, ConnectionSettings settings, FRBuffer *buf): */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_range_decode(__pyx_v_settings, __pyx_v_buf, __pyx_f_7asyncpg_8protocol_8protocol_codec_decode_func_ex, ((void *)__pyx_v_self->element_codec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":242 * self.element_delimiter) * * cdef decode_range(self, ConnectionSettings settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return range_decode(settings, buf, codec_decode_func_ex, * (self.element_codec)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.decode_range", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":246 * (self.element_codec)) * * cdef decode_multirange(self, ConnectionSettings settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return multirange_decode(settings, buf, codec_decode_func_ex, * (self.element_codec)) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_multirange(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decode_multirange", 1); /* "asyncpg/protocol/codecs/base.pyx":247 * * cdef decode_multirange(self, ConnectionSettings settings, FRBuffer *buf): * return multirange_decode(settings, buf, codec_decode_func_ex, # <<<<<<<<<<<<<< * (self.element_codec)) * */ __Pyx_XDECREF(__pyx_r); /* "asyncpg/protocol/codecs/base.pyx":248 * cdef decode_multirange(self, ConnectionSettings settings, FRBuffer *buf): * return multirange_decode(settings, buf, codec_decode_func_ex, * (self.element_codec)) # <<<<<<<<<<<<<< * * cdef decode_composite(self, ConnectionSettings settings, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_multirange_decode(__pyx_v_settings, __pyx_v_buf, __pyx_f_7asyncpg_8protocol_8protocol_codec_decode_func_ex, ((void *)__pyx_v_self->element_codec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":246 * (self.element_codec)) * * cdef decode_multirange(self, ConnectionSettings settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return multirange_decode(settings, buf, codec_decode_func_ex, * (self.element_codec)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.decode_multirange", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":250 * (self.element_codec)) * * cdef decode_composite(self, ConnectionSettings settings, # <<<<<<<<<<<<<< * FRBuffer *buf): * cdef: */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_composite(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_v_result = 0; Py_ssize_t __pyx_v_elem_count; Py_ssize_t __pyx_v_i; int32_t __pyx_v_elem_len; uint32_t __pyx_v_elem_typ; uint32_t __pyx_v_received_elem_typ; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_elem_codec = 0; struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer __pyx_v_elem_buf; PyObject *__pyx_v_elem = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; unsigned int __pyx_t_10; Py_ssize_t __pyx_t_11; Py_ssize_t __pyx_t_12; Py_ssize_t __pyx_t_13; uint32_t __pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_t_19; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decode_composite", 1); /* "asyncpg/protocol/codecs/base.pyx":262 * FRBuffer elem_buf * * elem_count = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * if elem_count != len(self.element_type_oids): * raise exceptions.OutdatedSchemaCacheError( */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(3, 262, __pyx_L1_error) __pyx_v_elem_count = ((Py_ssize_t)((uint32_t)unpack_int32(__pyx_t_1))); /* "asyncpg/protocol/codecs/base.pyx":263 * * elem_count = hton.unpack_int32(frb_read(buf, 4)) * if elem_count != len(self.element_type_oids): # <<<<<<<<<<<<<< * raise exceptions.OutdatedSchemaCacheError( * 'unexpected number of attributes of composite type: ' */ __pyx_t_2 = __pyx_v_self->element_type_oids; __Pyx_INCREF(__pyx_t_2); if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(3, 263, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 263, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_v_elem_count != __pyx_t_3); if (unlikely(__pyx_t_4)) { /* "asyncpg/protocol/codecs/base.pyx":264 * elem_count = hton.unpack_int32(frb_read(buf, 4)) * if elem_count != len(self.element_type_oids): * raise exceptions.OutdatedSchemaCacheError( # <<<<<<<<<<<<<< * 'unexpected number of attributes of composite type: ' * '{}, expected {}' */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_OutdatedSchemaCacheError); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":267 * 'unexpected number of attributes of composite type: ' * '{}, expected {}' * .format( # <<<<<<<<<<<<<< * elem_count, * len(self.element_type_oids), */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_number_of_attributes, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "asyncpg/protocol/codecs/base.pyx":268 * '{}, expected {}' * .format( * elem_count, # <<<<<<<<<<<<<< * len(self.element_type_oids), * ), */ __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_elem_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* "asyncpg/protocol/codecs/base.pyx":269 * .format( * elem_count, * len(self.element_type_oids), # <<<<<<<<<<<<<< * ), * schema=self.schema, */ __pyx_t_8 = __pyx_v_self->element_type_oids; __Pyx_INCREF(__pyx_t_8); if (unlikely(__pyx_t_8 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(3, 269, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 269, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } /* "asyncpg/protocol/codecs/base.pyx":264 * elem_count = hton.unpack_int32(frb_read(buf, 4)) * if elem_count != len(self.element_type_oids): * raise exceptions.OutdatedSchemaCacheError( # <<<<<<<<<<<<<< * 'unexpected number of attributes of composite type: ' * '{}, expected {}' */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(3, 264, __pyx_L1_error); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":271 * len(self.element_type_oids), * ), * schema=self.schema, # <<<<<<<<<<<<<< * data_type=self.name, * ) */ __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_schema, __pyx_v_self->schema) < 0) __PYX_ERR(3, 271, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":272 * ), * schema=self.schema, * data_type=self.name, # <<<<<<<<<<<<<< * ) * result = record.ApgRecord_New(asyncpg.Record, self.record_desc, elem_count) */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_data_type, __pyx_v_self->name) < 0) __PYX_ERR(3, 271, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":264 * elem_count = hton.unpack_int32(frb_read(buf, 4)) * if elem_count != len(self.element_type_oids): * raise exceptions.OutdatedSchemaCacheError( # <<<<<<<<<<<<<< * 'unexpected number of attributes of composite type: ' * '{}, expected {}' */ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(3, 264, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":263 * * elem_count = hton.unpack_int32(frb_read(buf, 4)) * if elem_count != len(self.element_type_oids): # <<<<<<<<<<<<<< * raise exceptions.OutdatedSchemaCacheError( * 'unexpected number of attributes of composite type: ' */ } /* "asyncpg/protocol/codecs/base.pyx":274 * data_type=self.name, * ) * result = record.ApgRecord_New(asyncpg.Record, self.record_desc, elem_count) # <<<<<<<<<<<<<< * for i in range(elem_count): * elem_typ = self.element_type_oids[i] */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_asyncpg); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Record); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (!(likely(PyType_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("type", __pyx_t_2))) __PYX_ERR(3, 274, __pyx_L1_error) __pyx_t_8 = __pyx_v_self->record_desc; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = ApgRecord_New(((PyTypeObject*)__pyx_t_2), __pyx_t_8, __pyx_v_elem_count); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_result = __pyx_t_6; __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/base.pyx":275 * ) * result = record.ApgRecord_New(asyncpg.Record, self.record_desc, elem_count) * for i in range(elem_count): # <<<<<<<<<<<<<< * elem_typ = self.element_type_oids[i] * received_elem_typ = hton.unpack_int32(frb_read(buf, 4)) */ __pyx_t_11 = __pyx_v_elem_count; __pyx_t_12 = __pyx_t_11; for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { __pyx_v_i = __pyx_t_13; /* "asyncpg/protocol/codecs/base.pyx":276 * result = record.ApgRecord_New(asyncpg.Record, self.record_desc, elem_count) * for i in range(elem_count): * elem_typ = self.element_type_oids[i] # <<<<<<<<<<<<<< * received_elem_typ = hton.unpack_int32(frb_read(buf, 4)) * */ if (unlikely(__pyx_v_self->element_type_oids == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(3, 276, __pyx_L1_error) } __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_self->element_type_oids, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_14 = __Pyx_PyInt_As_uint32_t(__pyx_t_6); if (unlikely((__pyx_t_14 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(3, 276, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_elem_typ = __pyx_t_14; /* "asyncpg/protocol/codecs/base.pyx":277 * for i in range(elem_count): * elem_typ = self.element_type_oids[i] * received_elem_typ = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * * if received_elem_typ != elem_typ: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(3, 277, __pyx_L1_error) __pyx_v_received_elem_typ = ((uint32_t)unpack_int32(__pyx_t_1)); /* "asyncpg/protocol/codecs/base.pyx":279 * received_elem_typ = hton.unpack_int32(frb_read(buf, 4)) * * if received_elem_typ != elem_typ: # <<<<<<<<<<<<<< * raise exceptions.OutdatedSchemaCacheError( * 'unexpected data type of composite type attribute {}: ' */ __pyx_t_4 = (__pyx_v_received_elem_typ != __pyx_v_elem_typ); if (unlikely(__pyx_t_4)) { /* "asyncpg/protocol/codecs/base.pyx":280 * * if received_elem_typ != elem_typ: * raise exceptions.OutdatedSchemaCacheError( # <<<<<<<<<<<<<< * 'unexpected data type of composite type attribute {}: ' * '{!r}, expected {!r}' */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_OutdatedSchemaCacheError); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/base.pyx":283 * 'unexpected data type of composite type attribute {}: ' * '{!r}, expected {!r}' * .format( # <<<<<<<<<<<<<< * i, * BUILTIN_TYPE_OID_MAP.get( */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_data_type_of_composit, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/codecs/base.pyx":284 * '{!r}, expected {!r}' * .format( * i, # <<<<<<<<<<<<<< * BUILTIN_TYPE_OID_MAP.get( * received_elem_typ, received_elem_typ), */ __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "asyncpg/protocol/codecs/base.pyx":285 * .format( * i, * BUILTIN_TYPE_OID_MAP.get( # <<<<<<<<<<<<<< * received_elem_typ, received_elem_typ), * BUILTIN_TYPE_OID_MAP.get( */ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_BUILTIN_TYPE_OID_MAP); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_get); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/codecs/base.pyx":286 * i, * BUILTIN_TYPE_OID_MAP.get( * received_elem_typ, received_elem_typ), # <<<<<<<<<<<<<< * BUILTIN_TYPE_OID_MAP.get( * elem_typ, elem_typ) */ __pyx_t_9 = __Pyx_PyInt_From_uint32_t(__pyx_v_received_elem_typ); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_16 = __Pyx_PyInt_From_uint32_t(__pyx_v_received_elem_typ); if (unlikely(!__pyx_t_16)) __PYX_ERR(3, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_17 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_15))) { __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_15); if (likely(__pyx_t_17)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_15, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_17, __pyx_t_9, __pyx_t_16}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } /* "asyncpg/protocol/codecs/base.pyx":287 * BUILTIN_TYPE_OID_MAP.get( * received_elem_typ, received_elem_typ), * BUILTIN_TYPE_OID_MAP.get( # <<<<<<<<<<<<<< * elem_typ, elem_typ) * ), */ __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_BUILTIN_TYPE_OID_MAP); if (unlikely(!__pyx_t_16)) __PYX_ERR(3, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_get); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; /* "asyncpg/protocol/codecs/base.pyx":288 * received_elem_typ, received_elem_typ), * BUILTIN_TYPE_OID_MAP.get( * elem_typ, elem_typ) # <<<<<<<<<<<<<< * ), * schema=self.schema, */ __pyx_t_16 = __Pyx_PyInt_From_uint32_t(__pyx_v_elem_typ); if (unlikely(!__pyx_t_16)) __PYX_ERR(3, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_17 = __Pyx_PyInt_From_uint32_t(__pyx_v_elem_typ); if (unlikely(!__pyx_t_17)) __PYX_ERR(3, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_18 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_18)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_18, __pyx_t_16, __pyx_t_17}; __pyx_t_15 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_t_5, __pyx_t_7, __pyx_t_15}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 3+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "asyncpg/protocol/codecs/base.pyx":280 * * if received_elem_typ != elem_typ: * raise exceptions.OutdatedSchemaCacheError( # <<<<<<<<<<<<<< * 'unexpected data type of composite type attribute {}: ' * '{!r}, expected {!r}' */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6)) __PYX_ERR(3, 280, __pyx_L1_error); __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/base.pyx":290 * elem_typ, elem_typ) * ), * schema=self.schema, # <<<<<<<<<<<<<< * data_type=self.name, * position=i, */ __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_schema, __pyx_v_self->schema) < 0) __PYX_ERR(3, 290, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":291 * ), * schema=self.schema, * data_type=self.name, # <<<<<<<<<<<<<< * position=i, * ) */ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_data_type, __pyx_v_self->name) < 0) __PYX_ERR(3, 290, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":292 * schema=self.schema, * data_type=self.name, * position=i, # <<<<<<<<<<<<<< * ) * */ __pyx_t_15 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_position, __pyx_t_15) < 0) __PYX_ERR(3, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "asyncpg/protocol/codecs/base.pyx":280 * * if received_elem_typ != elem_typ: * raise exceptions.OutdatedSchemaCacheError( # <<<<<<<<<<<<<< * 'unexpected data type of composite type attribute {}: ' * '{!r}, expected {!r}' */ __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_15, 0, 0, 0); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __PYX_ERR(3, 280, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":279 * received_elem_typ = hton.unpack_int32(frb_read(buf, 4)) * * if received_elem_typ != elem_typ: # <<<<<<<<<<<<<< * raise exceptions.OutdatedSchemaCacheError( * 'unexpected data type of composite type attribute {}: ' */ } /* "asyncpg/protocol/codecs/base.pyx":295 * ) * * elem_len = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * if elem_len == -1: * elem = None */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(3, 295, __pyx_L1_error) __pyx_v_elem_len = unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/base.pyx":296 * * elem_len = hton.unpack_int32(frb_read(buf, 4)) * if elem_len == -1: # <<<<<<<<<<<<<< * elem = None * else: */ __pyx_t_4 = (__pyx_v_elem_len == -1L); if (__pyx_t_4) { /* "asyncpg/protocol/codecs/base.pyx":297 * elem_len = hton.unpack_int32(frb_read(buf, 4)) * if elem_len == -1: * elem = None # <<<<<<<<<<<<<< * else: * elem_codec = self.element_codecs[i] */ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_elem, Py_None); /* "asyncpg/protocol/codecs/base.pyx":296 * * elem_len = hton.unpack_int32(frb_read(buf, 4)) * if elem_len == -1: # <<<<<<<<<<<<<< * elem = None * else: */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/base.pyx":299 * elem = None * else: * elem_codec = self.element_codecs[i] # <<<<<<<<<<<<<< * elem = elem_codec.decode( * settings, frb_slice_from(&elem_buf, buf, elem_len)) */ /*else*/ { if (unlikely(__pyx_v_self->element_codecs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(3, 299, __pyx_L1_error) } __pyx_t_15 = __Pyx_GetItemInt_List(__pyx_v_self->element_codecs, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(3, 299, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_15)); __pyx_t_15 = 0; /* "asyncpg/protocol/codecs/base.pyx":301 * elem_codec = self.element_codecs[i] * elem = elem_codec.decode( * settings, frb_slice_from(&elem_buf, buf, elem_len)) # <<<<<<<<<<<<<< * * cpython.Py_INCREF(elem) */ __pyx_t_19 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_slice_from((&__pyx_v_elem_buf), __pyx_v_buf, __pyx_v_elem_len); if (unlikely(__pyx_t_19 == ((struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)NULL) && PyErr_Occurred())) __PYX_ERR(3, 301, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":300 * else: * elem_codec = self.element_codecs[i] * elem = elem_codec.decode( # <<<<<<<<<<<<<< * settings, frb_slice_from(&elem_buf, buf, elem_len)) * */ __pyx_t_15 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode(__pyx_v_elem_codec, __pyx_v_settings, __pyx_t_19); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_15); __pyx_t_15 = 0; } __pyx_L7:; /* "asyncpg/protocol/codecs/base.pyx":303 * settings, frb_slice_from(&elem_buf, buf, elem_len)) * * cpython.Py_INCREF(elem) # <<<<<<<<<<<<<< * record.ApgRecord_SET_ITEM(result, i, elem) * */ Py_INCREF(__pyx_v_elem); /* "asyncpg/protocol/codecs/base.pyx":304 * * cpython.Py_INCREF(elem) * record.ApgRecord_SET_ITEM(result, i, elem) # <<<<<<<<<<<<<< * * return result */ ApgRecord_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_elem); } /* "asyncpg/protocol/codecs/base.pyx":306 * record.ApgRecord_SET_ITEM(result, i, elem) * * return result # <<<<<<<<<<<<<< * * cdef decode_in_python(self, ConnectionSettings settings, */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":250 * (self.element_codec)) * * cdef decode_composite(self, ConnectionSettings settings, # <<<<<<<<<<<<<< * FRBuffer *buf): * cdef: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_XDECREF(__pyx_t_18); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.decode_composite", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF((PyObject *)__pyx_v_elem_codec); __Pyx_XDECREF(__pyx_v_elem); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":308 * return result * * cdef decode_in_python(self, ConnectionSettings settings, # <<<<<<<<<<<<<< * FRBuffer *buf): * if self.xformat == PG_XFORMAT_OBJECT: */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_in_python(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_v_data = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decode_in_python", 1); /* "asyncpg/protocol/codecs/base.pyx":310 * cdef decode_in_python(self, ConnectionSettings settings, * FRBuffer *buf): * if self.xformat == PG_XFORMAT_OBJECT: # <<<<<<<<<<<<<< * if self.format == PG_FORMAT_BINARY: * data = pgproto.bytea_decode(settings, buf) */ switch (__pyx_v_self->xformat) { case __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT: /* "asyncpg/protocol/codecs/base.pyx":311 * FRBuffer *buf): * if self.xformat == PG_XFORMAT_OBJECT: * if self.format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * data = pgproto.bytea_decode(settings, buf) * elif self.format == PG_FORMAT_TEXT: */ switch (__pyx_v_self->format) { case __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY: /* "asyncpg/protocol/codecs/base.pyx":312 * if self.xformat == PG_XFORMAT_OBJECT: * if self.format == PG_FORMAT_BINARY: * data = pgproto.bytea_decode(settings, buf) # <<<<<<<<<<<<<< * elif self.format == PG_FORMAT_TEXT: * data = pgproto.text_decode(settings, buf) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_bytea_decode(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings), __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":311 * FRBuffer *buf): * if self.xformat == PG_XFORMAT_OBJECT: * if self.format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * data = pgproto.bytea_decode(settings, buf) * elif self.format == PG_FORMAT_TEXT: */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT: /* "asyncpg/protocol/codecs/base.pyx":314 * data = pgproto.bytea_decode(settings, buf) * elif self.format == PG_FORMAT_TEXT: * data = pgproto.text_decode(settings, buf) # <<<<<<<<<<<<<< * else: * raise exceptions.InternalClientError( */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_text_decode(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings), __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":313 * if self.format == PG_FORMAT_BINARY: * data = pgproto.bytea_decode(settings, buf) * elif self.format == PG_FORMAT_TEXT: # <<<<<<<<<<<<<< * data = pgproto.text_decode(settings, buf) * else: */ break; default: /* "asyncpg/protocol/codecs/base.pyx":316 * data = pgproto.text_decode(settings, buf) * else: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * 'unexpected data format: {}'.format(self.format)) * elif self.xformat == PG_XFORMAT_TUPLE: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":317 * else: * raise exceptions.InternalClientError( * 'unexpected data format: {}'.format(self.format)) # <<<<<<<<<<<<<< * elif self.xformat == PG_XFORMAT_TUPLE: * if self.base_codec is not None: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_data_format, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_self->format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(3, 316, __pyx_L1_error) break; } /* "asyncpg/protocol/codecs/base.pyx":310 * cdef decode_in_python(self, ConnectionSettings settings, * FRBuffer *buf): * if self.xformat == PG_XFORMAT_OBJECT: # <<<<<<<<<<<<<< * if self.format == PG_FORMAT_BINARY: * data = pgproto.bytea_decode(settings, buf) */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE: /* "asyncpg/protocol/codecs/base.pyx":319 * 'unexpected data format: {}'.format(self.format)) * elif self.xformat == PG_XFORMAT_TUPLE: * if self.base_codec is not None: # <<<<<<<<<<<<<< * data = self.base_codec.decode(settings, buf) * else: */ __pyx_t_8 = (((PyObject *)__pyx_v_self->base_codec) != Py_None); if (__pyx_t_8) { /* "asyncpg/protocol/codecs/base.pyx":320 * elif self.xformat == PG_XFORMAT_TUPLE: * if self.base_codec is not None: * data = self.base_codec.decode(settings, buf) # <<<<<<<<<<<<<< * else: * data = self.c_decoder(settings, buf) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode(__pyx_v_self->base_codec, __pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":319 * 'unexpected data format: {}'.format(self.format)) * elif self.xformat == PG_XFORMAT_TUPLE: * if self.base_codec is not None: # <<<<<<<<<<<<<< * data = self.base_codec.decode(settings, buf) * else: */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/base.pyx":322 * data = self.base_codec.decode(settings, buf) * else: * data = self.c_decoder(settings, buf) # <<<<<<<<<<<<<< * else: * raise exceptions.InternalClientError( */ /*else*/ { __pyx_t_1 = __pyx_v_self->c_decoder(__pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L3:; /* "asyncpg/protocol/codecs/base.pyx":318 * raise exceptions.InternalClientError( * 'unexpected data format: {}'.format(self.format)) * elif self.xformat == PG_XFORMAT_TUPLE: # <<<<<<<<<<<<<< * if self.base_codec is not None: * data = self.base_codec.decode(settings, buf) */ break; default: /* "asyncpg/protocol/codecs/base.pyx":324 * data = self.c_decoder(settings, buf) * else: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * 'unexpected exchange format: {}'.format(self.xformat)) * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":325 * else: * raise exceptions.InternalClientError( * 'unexpected exchange format: {}'.format(self.xformat)) # <<<<<<<<<<<<<< * * return self.py_decoder(data) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_exchange_format, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_v_self->xformat); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(3, 324, __pyx_L1_error) break; } /* "asyncpg/protocol/codecs/base.pyx":327 * 'unexpected exchange format: {}'.format(self.xformat)) * * return self.py_decoder(data) # <<<<<<<<<<<<<< * * cdef inline decode(self, ConnectionSettings settings, FRBuffer *buf): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->py_decoder); __pyx_t_2 = __pyx_v_self->py_decoder; __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_data}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":308 * return result * * cdef decode_in_python(self, ConnectionSettings settings, # <<<<<<<<<<<<<< * FRBuffer *buf): * if self.xformat == PG_XFORMAT_OBJECT: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.decode_in_python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":329 * return self.py_decoder(data) * * cdef inline decode(self, ConnectionSettings settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return self.decoder(self, settings, buf) * */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decode", 1); /* "asyncpg/protocol/codecs/base.pyx":330 * * cdef inline decode(self, ConnectionSettings settings, FRBuffer *buf): * return self.decoder(self, settings, buf) # <<<<<<<<<<<<<< * * cdef inline has_encoder(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_v_self->decoder(__pyx_v_self, __pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":329 * return self.py_decoder(data) * * cdef inline decode(self, ConnectionSettings settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return self.decoder(self, settings, buf) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":332 * return self.decoder(self, settings, buf) * * cdef inline has_encoder(self): # <<<<<<<<<<<<<< * cdef Codec elem_codec * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_encoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_elem_codec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("has_encoder", 1); /* "asyncpg/protocol/codecs/base.pyx":335 * cdef Codec elem_codec * * if self.c_encoder is not NULL or self.py_encoder is not None: # <<<<<<<<<<<<<< * return True * */ __pyx_t_2 = (__pyx_v_self->c_encoder != NULL); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_self->py_encoder != Py_None); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":336 * * if self.c_encoder is not NULL or self.py_encoder is not None: * return True # <<<<<<<<<<<<<< * * elif ( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":335 * cdef Codec elem_codec * * if self.c_encoder is not NULL or self.py_encoder is not None: # <<<<<<<<<<<<<< * return True * */ } /* "asyncpg/protocol/codecs/base.pyx":340 * elif ( * self.type == CODEC_ARRAY * or self.type == CODEC_RANGE # <<<<<<<<<<<<<< * or self.type == CODEC_MULTIRANGE * ): */ switch (__pyx_v_self->type) { case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_ARRAY: /* "asyncpg/protocol/codecs/base.pyx":339 * * elif ( * self.type == CODEC_ARRAY # <<<<<<<<<<<<<< * or self.type == CODEC_RANGE * or self.type == CODEC_MULTIRANGE */ case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_RANGE: /* "asyncpg/protocol/codecs/base.pyx":340 * elif ( * self.type == CODEC_ARRAY * or self.type == CODEC_RANGE # <<<<<<<<<<<<<< * or self.type == CODEC_MULTIRANGE * ): */ case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_MULTIRANGE: /* "asyncpg/protocol/codecs/base.pyx":341 * self.type == CODEC_ARRAY * or self.type == CODEC_RANGE * or self.type == CODEC_MULTIRANGE # <<<<<<<<<<<<<< * ): * return self.element_codec.has_encoder() */ __pyx_t_1 = 1; /* "asyncpg/protocol/codecs/base.pyx":340 * elif ( * self.type == CODEC_ARRAY * or self.type == CODEC_RANGE # <<<<<<<<<<<<<< * or self.type == CODEC_MULTIRANGE * ): */ break; default: __pyx_t_1 = 0; break; } /* "asyncpg/protocol/codecs/base.pyx":338 * return True * * elif ( # <<<<<<<<<<<<<< * self.type == CODEC_ARRAY * or self.type == CODEC_RANGE */ if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":343 * or self.type == CODEC_MULTIRANGE * ): * return self.element_codec.has_encoder() # <<<<<<<<<<<<<< * * elif self.type == CODEC_COMPOSITE: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_encoder(__pyx_v_self->element_codec); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":338 * return True * * elif ( # <<<<<<<<<<<<<< * self.type == CODEC_ARRAY * or self.type == CODEC_RANGE */ } /* "asyncpg/protocol/codecs/base.pyx":345 * return self.element_codec.has_encoder() * * elif self.type == CODEC_COMPOSITE: # <<<<<<<<<<<<<< * for elem_codec in self.element_codecs: * if not elem_codec.has_encoder(): */ __pyx_t_1 = (__pyx_v_self->type == __pyx_e_7asyncpg_8protocol_8protocol_CODEC_COMPOSITE); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":346 * * elif self.type == CODEC_COMPOSITE: * for elem_codec in self.element_codecs: # <<<<<<<<<<<<<< * if not elem_codec.has_encoder(): * return False */ if (unlikely(__pyx_v_self->element_codecs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(3, 346, __pyx_L1_error) } __pyx_t_3 = __pyx_v_self->element_codecs; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 346, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(3, 346, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(3, 346, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_5)); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/base.pyx":347 * elif self.type == CODEC_COMPOSITE: * for elem_codec in self.element_codecs: * if not elem_codec.has_encoder(): # <<<<<<<<<<<<<< * return False * return True */ __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_encoder(__pyx_v_elem_codec); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(3, 347, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/base.pyx":348 * for elem_codec in self.element_codecs: * if not elem_codec.has_encoder(): * return False # <<<<<<<<<<<<<< * return True * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":347 * elif self.type == CODEC_COMPOSITE: * for elem_codec in self.element_codecs: * if not elem_codec.has_encoder(): # <<<<<<<<<<<<<< * return False * return True */ } /* "asyncpg/protocol/codecs/base.pyx":346 * * elif self.type == CODEC_COMPOSITE: * for elem_codec in self.element_codecs: # <<<<<<<<<<<<<< * if not elem_codec.has_encoder(): * return False */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":349 * if not elem_codec.has_encoder(): * return False * return True # <<<<<<<<<<<<<< * * else: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":345 * return self.element_codec.has_encoder() * * elif self.type == CODEC_COMPOSITE: # <<<<<<<<<<<<<< * for elem_codec in self.element_codecs: * if not elem_codec.has_encoder(): */ } /* "asyncpg/protocol/codecs/base.pyx":352 * * else: * return False # <<<<<<<<<<<<<< * * cdef has_decoder(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; } /* "asyncpg/protocol/codecs/base.pyx":332 * return self.decoder(self, settings, buf) * * cdef inline has_encoder(self): # <<<<<<<<<<<<<< * cdef Codec elem_codec * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.has_encoder", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_elem_codec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":354 * return False * * cdef has_decoder(self): # <<<<<<<<<<<<<< * cdef Codec elem_codec * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_elem_codec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("has_decoder", 1); /* "asyncpg/protocol/codecs/base.pyx":357 * cdef Codec elem_codec * * if self.c_decoder is not NULL or self.py_decoder is not None: # <<<<<<<<<<<<<< * return True * */ __pyx_t_2 = (__pyx_v_self->c_decoder != NULL); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_self->py_decoder != Py_None); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":358 * * if self.c_decoder is not NULL or self.py_decoder is not None: * return True # <<<<<<<<<<<<<< * * elif ( */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":357 * cdef Codec elem_codec * * if self.c_decoder is not NULL or self.py_decoder is not None: # <<<<<<<<<<<<<< * return True * */ } /* "asyncpg/protocol/codecs/base.pyx":362 * elif ( * self.type == CODEC_ARRAY * or self.type == CODEC_RANGE # <<<<<<<<<<<<<< * or self.type == CODEC_MULTIRANGE * ): */ switch (__pyx_v_self->type) { case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_ARRAY: /* "asyncpg/protocol/codecs/base.pyx":361 * * elif ( * self.type == CODEC_ARRAY # <<<<<<<<<<<<<< * or self.type == CODEC_RANGE * or self.type == CODEC_MULTIRANGE */ case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_RANGE: /* "asyncpg/protocol/codecs/base.pyx":362 * elif ( * self.type == CODEC_ARRAY * or self.type == CODEC_RANGE # <<<<<<<<<<<<<< * or self.type == CODEC_MULTIRANGE * ): */ case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_MULTIRANGE: /* "asyncpg/protocol/codecs/base.pyx":363 * self.type == CODEC_ARRAY * or self.type == CODEC_RANGE * or self.type == CODEC_MULTIRANGE # <<<<<<<<<<<<<< * ): * return self.element_codec.has_decoder() */ __pyx_t_1 = 1; /* "asyncpg/protocol/codecs/base.pyx":362 * elif ( * self.type == CODEC_ARRAY * or self.type == CODEC_RANGE # <<<<<<<<<<<<<< * or self.type == CODEC_MULTIRANGE * ): */ break; default: __pyx_t_1 = 0; break; } /* "asyncpg/protocol/codecs/base.pyx":360 * return True * * elif ( # <<<<<<<<<<<<<< * self.type == CODEC_ARRAY * or self.type == CODEC_RANGE */ if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":365 * or self.type == CODEC_MULTIRANGE * ): * return self.element_codec.has_decoder() # <<<<<<<<<<<<<< * * elif self.type == CODEC_COMPOSITE: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder(__pyx_v_self->element_codec); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":360 * return True * * elif ( # <<<<<<<<<<<<<< * self.type == CODEC_ARRAY * or self.type == CODEC_RANGE */ } /* "asyncpg/protocol/codecs/base.pyx":367 * return self.element_codec.has_decoder() * * elif self.type == CODEC_COMPOSITE: # <<<<<<<<<<<<<< * for elem_codec in self.element_codecs: * if not elem_codec.has_decoder(): */ __pyx_t_1 = (__pyx_v_self->type == __pyx_e_7asyncpg_8protocol_8protocol_CODEC_COMPOSITE); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":368 * * elif self.type == CODEC_COMPOSITE: * for elem_codec in self.element_codecs: # <<<<<<<<<<<<<< * if not elem_codec.has_decoder(): * return False */ if (unlikely(__pyx_v_self->element_codecs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(3, 368, __pyx_L1_error) } __pyx_t_3 = __pyx_v_self->element_codecs; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 368, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(3, 368, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(3, 368, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_5)); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/base.pyx":369 * elif self.type == CODEC_COMPOSITE: * for elem_codec in self.element_codecs: * if not elem_codec.has_decoder(): # <<<<<<<<<<<<<< * return False * return True */ __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder(__pyx_v_elem_codec); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(3, 369, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/base.pyx":370 * for elem_codec in self.element_codecs: * if not elem_codec.has_decoder(): * return False # <<<<<<<<<<<<<< * return True * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":369 * elif self.type == CODEC_COMPOSITE: * for elem_codec in self.element_codecs: * if not elem_codec.has_decoder(): # <<<<<<<<<<<<<< * return False * return True */ } /* "asyncpg/protocol/codecs/base.pyx":368 * * elif self.type == CODEC_COMPOSITE: * for elem_codec in self.element_codecs: # <<<<<<<<<<<<<< * if not elem_codec.has_decoder(): * return False */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":371 * if not elem_codec.has_decoder(): * return False * return True # <<<<<<<<<<<<<< * * else: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":367 * return self.element_codec.has_decoder() * * elif self.type == CODEC_COMPOSITE: # <<<<<<<<<<<<<< * for elem_codec in self.element_codecs: * if not elem_codec.has_decoder(): */ } /* "asyncpg/protocol/codecs/base.pyx":374 * * else: * return False # <<<<<<<<<<<<<< * * cdef is_binary(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; } /* "asyncpg/protocol/codecs/base.pyx":354 * return False * * cdef has_decoder(self): # <<<<<<<<<<<<<< * cdef Codec elem_codec * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.has_decoder", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_elem_codec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":376 * return False * * cdef is_binary(self): # <<<<<<<<<<<<<< * return self.format == PG_FORMAT_BINARY * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_is_binary(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_binary", 1); /* "asyncpg/protocol/codecs/base.pyx":377 * * cdef is_binary(self): * return self.format == PG_FORMAT_BINARY # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->format == __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":376 * return False * * cdef is_binary(self): # <<<<<<<<<<<<<< * return self.format == PG_FORMAT_BINARY * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.is_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":379 * return self.format == PG_FORMAT_BINARY * * def __repr__(self): # <<<<<<<<<<<<<< * return ''.format( * self.oid, */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_3__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_3__repr__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_5Codec_2__repr__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Codec_2__repr__(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); /* "asyncpg/protocol/codecs/base.pyx":380 * * def __repr__(self): * return ''.format( # <<<<<<<<<<<<<< * self.oid, * 'NA' if self.element_codec is None else self.element_codec.oid, */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Codec_oid_elem_oid_core, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/codecs/base.pyx":381 * def __repr__(self): * return ''.format( * self.oid, # <<<<<<<<<<<<<< * 'NA' if self.element_codec is None else self.element_codec.oid, * has_core_codec(self.oid)) */ __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_self->oid); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/protocol/codecs/base.pyx":382 * return ''.format( * self.oid, * 'NA' if self.element_codec is None else self.element_codec.oid, # <<<<<<<<<<<<<< * has_core_codec(self.oid)) * */ __pyx_t_5 = (((PyObject *)__pyx_v_self->element_codec) == Py_None); if (__pyx_t_5) { __Pyx_INCREF(__pyx_n_u_NA); __pyx_t_4 = __pyx_n_u_NA; } else { __pyx_t_6 = __Pyx_PyInt_From_uint32_t(__pyx_v_self->element_codec->oid); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __pyx_t_6 = 0; } /* "asyncpg/protocol/codecs/base.pyx":383 * self.oid, * 'NA' if self.element_codec is None else self.element_codec.oid, * has_core_codec(self.oid)) # <<<<<<<<<<<<<< * * @staticmethod */ __pyx_t_7 = __pyx_f_7asyncpg_8protocol_8protocol_has_core_codec(__pyx_v_self->oid); if (unlikely(__pyx_t_7 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(3, 383, __pyx_L1_error) __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":379 * return self.format == PG_FORMAT_BINARY * * def __repr__(self): # <<<<<<<<<<<<<< * return ''.format( * self.oid, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":386 * * @staticmethod * cdef Codec new_array_codec(uint32_t oid, # <<<<<<<<<<<<<< * str name, * str schema, */ static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_array_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_element_codec, Py_UCS4 __pyx_v_element_delimiter) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new_array_codec", 1); /* "asyncpg/protocol/codecs/base.pyx":392 * Py_UCS4 element_delimiter): * cdef Codec codec * codec = Codec(oid) # <<<<<<<<<<<<<< * codec.init(name, schema, 'array', CODEC_ARRAY, element_codec.format, * PG_XFORMAT_OBJECT, NULL, NULL, None, None, None, */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_Codec), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":393 * cdef Codec codec * codec = Codec(oid) * codec.init(name, schema, 'array', CODEC_ARRAY, element_codec.format, # <<<<<<<<<<<<<< * PG_XFORMAT_OBJECT, NULL, NULL, None, None, None, * element_codec, None, None, None, element_delimiter) */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, __pyx_v_name, __pyx_v_schema, __pyx_n_u_array, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_ARRAY, __pyx_v_element_codec->format, __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT, NULL, NULL, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None), Py_None, Py_None, __pyx_v_element_codec, ((PyObject*)Py_None), Py_None, ((PyObject*)Py_None), __pyx_v_element_delimiter); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":396 * PG_XFORMAT_OBJECT, NULL, NULL, None, None, None, * element_codec, None, None, None, element_delimiter) * return codec # <<<<<<<<<<<<<< * * @staticmethod */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_codec); __pyx_r = __pyx_v_codec; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":386 * * @staticmethod * cdef Codec new_array_codec(uint32_t oid, # <<<<<<<<<<<<<< * str name, * str schema, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.new_array_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":399 * * @staticmethod * cdef Codec new_range_codec(uint32_t oid, # <<<<<<<<<<<<<< * str name, * str schema, */ static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_range_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_element_codec) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new_range_codec", 1); /* "asyncpg/protocol/codecs/base.pyx":404 * Codec element_codec): * cdef Codec codec * codec = Codec(oid) # <<<<<<<<<<<<<< * codec.init(name, schema, 'range', CODEC_RANGE, element_codec.format, * PG_XFORMAT_OBJECT, NULL, NULL, None, None, None, */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_Codec), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":405 * cdef Codec codec * codec = Codec(oid) * codec.init(name, schema, 'range', CODEC_RANGE, element_codec.format, # <<<<<<<<<<<<<< * PG_XFORMAT_OBJECT, NULL, NULL, None, None, None, * element_codec, None, None, None, 0) */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, __pyx_v_name, __pyx_v_schema, __pyx_n_u_range, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_RANGE, __pyx_v_element_codec->format, __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT, NULL, NULL, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None), Py_None, Py_None, __pyx_v_element_codec, ((PyObject*)Py_None), Py_None, ((PyObject*)Py_None), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":408 * PG_XFORMAT_OBJECT, NULL, NULL, None, None, None, * element_codec, None, None, None, 0) * return codec # <<<<<<<<<<<<<< * * @staticmethod */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_codec); __pyx_r = __pyx_v_codec; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":399 * * @staticmethod * cdef Codec new_range_codec(uint32_t oid, # <<<<<<<<<<<<<< * str name, * str schema, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.new_range_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":411 * * @staticmethod * cdef Codec new_multirange_codec(uint32_t oid, # <<<<<<<<<<<<<< * str name, * str schema, */ static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_multirange_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_element_codec) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new_multirange_codec", 1); /* "asyncpg/protocol/codecs/base.pyx":416 * Codec element_codec): * cdef Codec codec * codec = Codec(oid) # <<<<<<<<<<<<<< * codec.init(name, schema, 'multirange', CODEC_MULTIRANGE, * element_codec.format, PG_XFORMAT_OBJECT, NULL, NULL, None, */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_Codec), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":417 * cdef Codec codec * codec = Codec(oid) * codec.init(name, schema, 'multirange', CODEC_MULTIRANGE, # <<<<<<<<<<<<<< * element_codec.format, PG_XFORMAT_OBJECT, NULL, NULL, None, * None, None, element_codec, None, None, None, 0) */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, __pyx_v_name, __pyx_v_schema, __pyx_n_u_multirange, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_MULTIRANGE, __pyx_v_element_codec->format, __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT, NULL, NULL, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None), Py_None, Py_None, __pyx_v_element_codec, ((PyObject*)Py_None), Py_None, ((PyObject*)Py_None), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":420 * element_codec.format, PG_XFORMAT_OBJECT, NULL, NULL, None, * None, None, element_codec, None, None, None, 0) * return codec # <<<<<<<<<<<<<< * * @staticmethod */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_codec); __pyx_r = __pyx_v_codec; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":411 * * @staticmethod * cdef Codec new_multirange_codec(uint32_t oid, # <<<<<<<<<<<<<< * str name, * str schema, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.new_multirange_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":423 * * @staticmethod * cdef Codec new_composite_codec(uint32_t oid, # <<<<<<<<<<<<<< * str name, * str schema, */ static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_composite_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, PyObject *__pyx_v_element_codecs, PyObject *__pyx_v_element_type_oids, PyObject *__pyx_v_element_names) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new_composite_codec", 1); /* "asyncpg/protocol/codecs/base.pyx":431 * object element_names): * cdef Codec codec * codec = Codec(oid) # <<<<<<<<<<<<<< * codec.init(name, schema, 'composite', CODEC_COMPOSITE, * format, PG_XFORMAT_OBJECT, NULL, NULL, None, None, None, */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_Codec), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":432 * cdef Codec codec * codec = Codec(oid) * codec.init(name, schema, 'composite', CODEC_COMPOSITE, # <<<<<<<<<<<<<< * format, PG_XFORMAT_OBJECT, NULL, NULL, None, None, None, * None, element_type_oids, element_names, element_codecs, 0) */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, __pyx_v_name, __pyx_v_schema, __pyx_n_u_composite, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_COMPOSITE, __pyx_v_format, __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT, NULL, NULL, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None), Py_None, Py_None, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None), __pyx_v_element_type_oids, __pyx_v_element_names, __pyx_v_element_codecs, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":435 * format, PG_XFORMAT_OBJECT, NULL, NULL, None, None, None, * None, element_type_oids, element_names, element_codecs, 0) * return codec # <<<<<<<<<<<<<< * * @staticmethod */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_codec); __pyx_r = __pyx_v_codec; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":423 * * @staticmethod * cdef Codec new_composite_codec(uint32_t oid, # <<<<<<<<<<<<<< * str name, * str schema, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.new_composite_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":438 * * @staticmethod * cdef Codec new_python_codec(uint32_t oid, # <<<<<<<<<<<<<< * str name, * str schema, */ static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_python_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, PyObject *__pyx_v_kind, PyObject *__pyx_v_encoder, PyObject *__pyx_v_decoder, __pyx_t_7asyncpg_8protocol_8protocol_encode_func __pyx_v_c_encoder, __pyx_t_7asyncpg_8protocol_8protocol_decode_func __pyx_v_c_decoder, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_base_codec, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_v_xformat) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new_python_codec", 1); /* "asyncpg/protocol/codecs/base.pyx":450 * ClientExchangeFormat xformat): * cdef Codec codec * codec = Codec(oid) # <<<<<<<<<<<<<< * codec.init(name, schema, kind, CODEC_PY, format, xformat, * c_encoder, c_decoder, base_codec, encoder, decoder, */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_Codec), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":451 * cdef Codec codec * codec = Codec(oid) * codec.init(name, schema, kind, CODEC_PY, format, xformat, # <<<<<<<<<<<<<< * c_encoder, c_decoder, base_codec, encoder, decoder, * None, None, None, None, 0) */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, __pyx_v_name, __pyx_v_schema, __pyx_v_kind, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_PY, __pyx_v_format, __pyx_v_xformat, __pyx_v_c_encoder, __pyx_v_c_decoder, __pyx_v_base_codec, __pyx_v_encoder, __pyx_v_decoder, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None), ((PyObject*)Py_None), Py_None, ((PyObject*)Py_None), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":454 * c_encoder, c_decoder, base_codec, encoder, decoder, * None, None, None, None, 0) * return codec # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_codec); __pyx_r = __pyx_v_codec; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":438 * * @staticmethod * cdef Codec new_python_codec(uint32_t oid, # <<<<<<<<<<<<<< * str name, * str schema, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.new_python_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_5__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_5Codec_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_5__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_5Codec_4__reduce_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Codec_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(2, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_7__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_5Codec_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_7__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_5Codec_6__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Codec_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(2, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":458 * * # Encode callback for arrays * cdef codec_encode_func_ex(ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj, const void *arg): * return (arg).encode(settings, buf, obj) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_codec_encode_func_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj, void const *__pyx_v_arg) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("codec_encode_func_ex", 1); /* "asyncpg/protocol/codecs/base.pyx":460 * cdef codec_encode_func_ex(ConnectionSettings settings, WriteBuffer buf, * object obj, const void *arg): * return (arg).encode(settings, buf, obj) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode(((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_v_arg), __pyx_v_settings, __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":458 * * # Encode callback for arrays * cdef codec_encode_func_ex(ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj, const void *arg): * return (arg).encode(settings, buf, obj) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.codec_encode_func_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":464 * * # Decode callback for arrays * cdef codec_decode_func_ex(ConnectionSettings settings, FRBuffer *buf, # <<<<<<<<<<<<<< * const void *arg): * return (arg).decode(settings, buf) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_codec_decode_func_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf, void const *__pyx_v_arg) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("codec_decode_func_ex", 1); /* "asyncpg/protocol/codecs/base.pyx":466 * cdef codec_decode_func_ex(ConnectionSettings settings, FRBuffer *buf, * const void *arg): * return (arg).decode(settings, buf) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode(((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_v_arg), __pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":464 * * # Decode callback for arrays * cdef codec_decode_func_ex(ConnectionSettings settings, FRBuffer *buf, # <<<<<<<<<<<<<< * const void *arg): * return (arg).decode(settings, buf) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.codec_decode_func_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":469 * * * cdef uint32_t pylong_as_oid(val) except? 0xFFFFFFFFl: # <<<<<<<<<<<<<< * cdef: * int64_t oid = 0 */ static uint32_t __pyx_f_7asyncpg_8protocol_8protocol_pylong_as_oid(PyObject *__pyx_v_val) { int64_t __pyx_v_oid; int __pyx_v_overflow; uint32_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PY_LONG_LONG __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; unsigned int __pyx_t_11; uint32_t __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pylong_as_oid", 1); /* "asyncpg/protocol/codecs/base.pyx":471 * cdef uint32_t pylong_as_oid(val) except? 0xFFFFFFFFl: * cdef: * int64_t oid = 0 # <<<<<<<<<<<<<< * bint overflow = False * */ __pyx_v_oid = 0; /* "asyncpg/protocol/codecs/base.pyx":472 * cdef: * int64_t oid = 0 * bint overflow = False # <<<<<<<<<<<<<< * * try: */ __pyx_v_overflow = 0; /* "asyncpg/protocol/codecs/base.pyx":474 * bint overflow = False * * try: # <<<<<<<<<<<<<< * oid = cpython.PyLong_AsLongLong(val) * except OverflowError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "asyncpg/protocol/codecs/base.pyx":475 * * try: * oid = cpython.PyLong_AsLongLong(val) # <<<<<<<<<<<<<< * except OverflowError: * overflow = True */ __pyx_t_4 = PyLong_AsLongLong(__pyx_v_val); if (unlikely(__pyx_t_4 == ((PY_LONG_LONG)-1LL) && PyErr_Occurred())) __PYX_ERR(3, 475, __pyx_L3_error) __pyx_v_oid = __pyx_t_4; /* "asyncpg/protocol/codecs/base.pyx":474 * bint overflow = False * * try: # <<<<<<<<<<<<<< * oid = cpython.PyLong_AsLongLong(val) * except OverflowError: */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; /* "asyncpg/protocol/codecs/base.pyx":476 * try: * oid = cpython.PyLong_AsLongLong(val) * except OverflowError: # <<<<<<<<<<<<<< * overflow = True * */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OverflowError); if (__pyx_t_5) { __Pyx_AddTraceback("asyncpg.protocol.protocol.pylong_as_oid", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(3, 476, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /* "asyncpg/protocol/codecs/base.pyx":477 * oid = cpython.PyLong_AsLongLong(val) * except OverflowError: * overflow = True # <<<<<<<<<<<<<< * * if overflow or (oid < 0 or oid > UINT32_MAX): */ __pyx_v_overflow = 1; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; /* "asyncpg/protocol/codecs/base.pyx":474 * bint overflow = False * * try: # <<<<<<<<<<<<<< * oid = cpython.PyLong_AsLongLong(val) * except OverflowError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L8_try_end:; } /* "asyncpg/protocol/codecs/base.pyx":479 * overflow = True * * if overflow or (oid < 0 or oid > UINT32_MAX): # <<<<<<<<<<<<<< * raise OverflowError('OID value too large: {!r}'.format(val)) * */ if (!__pyx_v_overflow) { } else { __pyx_t_9 = __pyx_v_overflow; goto __pyx_L12_bool_binop_done; } __pyx_t_10 = (__pyx_v_oid < 0); if (!__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L12_bool_binop_done; } __pyx_t_10 = (__pyx_v_oid > UINT32_MAX); __pyx_t_9 = __pyx_t_10; __pyx_L12_bool_binop_done:; if (unlikely(__pyx_t_9)) { /* "asyncpg/protocol/codecs/base.pyx":480 * * if overflow or (oid < 0 or oid > UINT32_MAX): * raise OverflowError('OID value too large: {!r}'.format(val)) # <<<<<<<<<<<<<< * * return val */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_OID_value_too_large_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_val}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_OverflowError, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(3, 480, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":479 * overflow = True * * if overflow or (oid < 0 or oid > UINT32_MAX): # <<<<<<<<<<<<<< * raise OverflowError('OID value too large: {!r}'.format(val)) * */ } /* "asyncpg/protocol/codecs/base.pyx":482 * raise OverflowError('OID value too large: {!r}'.format(val)) * * return val # <<<<<<<<<<<<<< * * */ __pyx_t_12 = __Pyx_PyInt_As_uint32_t(__pyx_v_val); if (unlikely((__pyx_t_12 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(3, 482, __pyx_L1_error) __pyx_r = ((uint32_t)__pyx_t_12); goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":469 * * * cdef uint32_t pylong_as_oid(val) except? 0xFFFFFFFFl: # <<<<<<<<<<<<<< * cdef: * int64_t oid = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("asyncpg.protocol.protocol.pylong_as_oid", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0xFFFFFFFFL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":486 * * cdef class DataCodecConfig: * def __init__(self): # <<<<<<<<<<<<<< * # Codec instance cache for derived types: * # composites, arrays, ranges, domains and their combinations. */ /* Python wrapper */ static int __pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig___init__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig___init__(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "asyncpg/protocol/codecs/base.pyx":489 * # Codec instance cache for derived types: * # composites, arrays, ranges, domains and their combinations. * self._derived_type_codecs = {} # <<<<<<<<<<<<<< * # Codec instances set up by the user for the connection. * self._custom_type_codecs = {} */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_derived_type_codecs); __Pyx_DECREF(__pyx_v_self->_derived_type_codecs); __pyx_v_self->_derived_type_codecs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":491 * self._derived_type_codecs = {} * # Codec instances set up by the user for the connection. * self._custom_type_codecs = {} # <<<<<<<<<<<<<< * * def add_types(self, types): */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_custom_type_codecs); __Pyx_DECREF(__pyx_v_self->_custom_type_codecs); __pyx_v_self->_custom_type_codecs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":486 * * cdef class DataCodecConfig: * def __init__(self): # <<<<<<<<<<<<<< * # Codec instance cache for derived types: * # composites, arrays, ranges, domains and their combinations. */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":493 * self._custom_type_codecs = {} * * def add_types(self, types): # <<<<<<<<<<<<<< * cdef: * Codec elem_codec */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_3add_types(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_3add_types = {"add_types", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_3add_types, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_3add_types(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_types = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_types (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_types,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_types)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 493, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add_types") < 0)) __PYX_ERR(3, 493, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_types = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("add_types", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 493, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.add_types", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_2add_types(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self), __pyx_v_types); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_2add_types(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v_types) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_elem_codec = 0; PyObject *__pyx_v_comp_elem_codecs = 0; enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_elem_format; int __pyx_v_has_text_elements; Py_UCS4 __pyx_v_elem_delim; PyObject *__pyx_v_ti = NULL; PyObject *__pyx_v_oid = NULL; PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_schema = NULL; PyObject *__pyx_v_array_element_oid = NULL; PyObject *__pyx_v_range_subtype_oid = NULL; PyObject *__pyx_v_comp_type_attrs = NULL; PyObject *__pyx_v_base_type = NULL; PyObject *__pyx_v_typoid = NULL; PyObject *__pyx_v_element_names = NULL; PyObject *__pyx_v_i = NULL; PyObject *__pyx_v_attrname = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; uint32_t __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; PyObject *__pyx_t_10 = NULL; Py_UCS4 __pyx_t_11; int __pyx_t_12; Py_ssize_t __pyx_t_13; PyObject *__pyx_t_14 = NULL; int __pyx_t_15; PyObject *(*__pyx_t_16)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_types", 1); /* "asyncpg/protocol/codecs/base.pyx":502 * Py_UCS4 elem_delim * * for ti in types: # <<<<<<<<<<<<<< * oid = ti['oid'] * */ if (likely(PyList_CheckExact(__pyx_v_types)) || PyTuple_CheckExact(__pyx_v_types)) { __pyx_t_1 = __pyx_v_types; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 502, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 502, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(3, 502, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 502, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(3, 502, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(3, 502, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_ti, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":503 * * for ti in types: * oid = ti['oid'] # <<<<<<<<<<<<<< * * if self.get_codec(oid, PG_FORMAT_ANY) is not None: */ __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_n_u_oid); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_oid, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":505 * oid = ti['oid'] * * if self.get_codec(oid, PG_FORMAT_ANY) is not None: # <<<<<<<<<<<<<< * continue * */ __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(3, 505, __pyx_L1_error) __pyx_t_4 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_t_5, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = (__pyx_t_4 != Py_None); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":506 * * if self.get_codec(oid, PG_FORMAT_ANY) is not None: * continue # <<<<<<<<<<<<<< * * name = ti['name'] */ goto __pyx_L3_continue; /* "asyncpg/protocol/codecs/base.pyx":505 * oid = ti['oid'] * * if self.get_codec(oid, PG_FORMAT_ANY) is not None: # <<<<<<<<<<<<<< * continue * */ } /* "asyncpg/protocol/codecs/base.pyx":508 * continue * * name = ti['name'] # <<<<<<<<<<<<<< * schema = ti['ns'] * array_element_oid = ti['elemtype'] */ __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_n_u_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":509 * * name = ti['name'] * schema = ti['ns'] # <<<<<<<<<<<<<< * array_element_oid = ti['elemtype'] * range_subtype_oid = ti['range_subtype'] */ __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_n_u_ns); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_schema, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":510 * name = ti['name'] * schema = ti['ns'] * array_element_oid = ti['elemtype'] # <<<<<<<<<<<<<< * range_subtype_oid = ti['range_subtype'] * if ti['attrtypoids']: */ __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_n_u_elemtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_array_element_oid, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":511 * schema = ti['ns'] * array_element_oid = ti['elemtype'] * range_subtype_oid = ti['range_subtype'] # <<<<<<<<<<<<<< * if ti['attrtypoids']: * comp_type_attrs = tuple(ti['attrtypoids']) */ __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_n_u_range_subtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_range_subtype_oid, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":512 * array_element_oid = ti['elemtype'] * range_subtype_oid = ti['range_subtype'] * if ti['attrtypoids']: # <<<<<<<<<<<<<< * comp_type_attrs = tuple(ti['attrtypoids']) * else: */ __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_n_u_attrtypoids); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(3, 512, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":513 * range_subtype_oid = ti['range_subtype'] * if ti['attrtypoids']: * comp_type_attrs = tuple(ti['attrtypoids']) # <<<<<<<<<<<<<< * else: * comp_type_attrs = None */ __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_n_u_attrtypoids); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_comp_type_attrs, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/base.pyx":512 * array_element_oid = ti['elemtype'] * range_subtype_oid = ti['range_subtype'] * if ti['attrtypoids']: # <<<<<<<<<<<<<< * comp_type_attrs = tuple(ti['attrtypoids']) * else: */ goto __pyx_L6; } /* "asyncpg/protocol/codecs/base.pyx":515 * comp_type_attrs = tuple(ti['attrtypoids']) * else: * comp_type_attrs = None # <<<<<<<<<<<<<< * base_type = ti['basetype'] * */ /*else*/ { __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_comp_type_attrs, ((PyObject*)Py_None)); } __pyx_L6:; /* "asyncpg/protocol/codecs/base.pyx":516 * else: * comp_type_attrs = None * base_type = ti['basetype'] # <<<<<<<<<<<<<< * * if array_element_oid: */ __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_n_u_basetype); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_base_type, __pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/base.pyx":518 * base_type = ti['basetype'] * * if array_element_oid: # <<<<<<<<<<<<<< * # Array type (note, there is no separate 'kind' for arrays) * */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_array_element_oid); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(3, 518, __pyx_L1_error) if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":522 * * # Canonicalize type name to "elemtype[]" * if name.startswith('_'): # <<<<<<<<<<<<<< * name = name[1:] * name = '{}[]'.format(name) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_n_u__2}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(3, 522, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":523 * # Canonicalize type name to "elemtype[]" * if name.startswith('_'): * name = name[1:] # <<<<<<<<<<<<<< * name = '{}[]'.format(name) * */ __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_name, 1, 0, NULL, NULL, &__pyx_slice__4, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/base.pyx":522 * * # Canonicalize type name to "elemtype[]" * if name.startswith('_'): # <<<<<<<<<<<<<< * name = name[1:] * name = '{}[]'.format(name) */ } /* "asyncpg/protocol/codecs/base.pyx":524 * if name.startswith('_'): * name = name[1:] * name = '{}[]'.format(name) # <<<<<<<<<<<<<< * * elem_codec = self.get_codec(array_element_oid, PG_FORMAT_ANY) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u__5, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_name}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/base.pyx":526 * name = '{}[]'.format(name) * * elem_codec = self.get_codec(array_element_oid, PG_FORMAT_ANY) # <<<<<<<<<<<<<< * if elem_codec is None: * elem_codec = self.declare_fallback_codec( */ __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_v_array_element_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(3, 526, __pyx_L1_error) __pyx_t_7 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_t_5, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY, NULL)); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_7)); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/base.pyx":527 * * elem_codec = self.get_codec(array_element_oid, PG_FORMAT_ANY) * if elem_codec is None: # <<<<<<<<<<<<<< * elem_codec = self.declare_fallback_codec( * array_element_oid, ti['elemtype_name'], schema) */ __pyx_t_6 = (((PyObject *)__pyx_v_elem_codec) == Py_None); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":528 * elem_codec = self.get_codec(array_element_oid, PG_FORMAT_ANY) * if elem_codec is None: * elem_codec = self.declare_fallback_codec( # <<<<<<<<<<<<<< * array_element_oid, ti['elemtype_name'], schema) * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_declare_fallback_codec); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/codecs/base.pyx":529 * if elem_codec is None: * elem_codec = self.declare_fallback_codec( * array_element_oid, ti['elemtype_name'], schema) # <<<<<<<<<<<<<< * * elem_delim = ti['elemdelim'][0] */ __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_n_u_elemtype_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_10, __pyx_v_array_element_oid, __pyx_t_8, __pyx_v_schema}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/protocol/codecs/base.pyx":528 * elem_codec = self.get_codec(array_element_oid, PG_FORMAT_ANY) * if elem_codec is None: * elem_codec = self.declare_fallback_codec( # <<<<<<<<<<<<<< * array_element_oid, ti['elemtype_name'], schema) * */ if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(3, 528, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_7)); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/base.pyx":527 * * elem_codec = self.get_codec(array_element_oid, PG_FORMAT_ANY) * if elem_codec is None: # <<<<<<<<<<<<<< * elem_codec = self.declare_fallback_codec( * array_element_oid, ti['elemtype_name'], schema) */ } /* "asyncpg/protocol/codecs/base.pyx":531 * array_element_oid, ti['elemtype_name'], schema) * * elem_delim = ti['elemdelim'][0] # <<<<<<<<<<<<<< * * self._derived_type_codecs[oid, elem_codec.format] = \ */ __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_n_u_elemdelim); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_11 = __Pyx_PyObject_AsPy_UCS4(__pyx_t_4); if (unlikely((__pyx_t_11 == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(3, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_elem_delim = ((Py_UCS4)__pyx_t_11); /* "asyncpg/protocol/codecs/base.pyx":535 * self._derived_type_codecs[oid, elem_codec.format] = \ * Codec.new_array_codec( * oid, name, schema, elem_codec, elem_delim) # <<<<<<<<<<<<<< * * elif ti['kind'] == b'c': */ __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(3, 535, __pyx_L1_error) if (!(likely(PyUnicode_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_name))) __PYX_ERR(3, 535, __pyx_L1_error) if (!(likely(PyUnicode_CheckExact(__pyx_v_schema))||((__pyx_v_schema) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_schema))) __PYX_ERR(3, 535, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":534 * * self._derived_type_codecs[oid, elem_codec.format] = \ * Codec.new_array_codec( # <<<<<<<<<<<<<< * oid, name, schema, elem_codec, elem_delim) * */ __pyx_t_4 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_array_codec(__pyx_t_5, ((PyObject*)__pyx_v_name), ((PyObject*)__pyx_v_schema), __pyx_v_elem_codec, __pyx_v_elem_delim)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/codecs/base.pyx":533 * elem_delim = ti['elemdelim'][0] * * self._derived_type_codecs[oid, elem_codec.format] = \ # <<<<<<<<<<<<<< * Codec.new_array_codec( * oid, name, schema, elem_codec, elem_delim) */ if (unlikely(__pyx_v_self->_derived_type_codecs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(3, 533, __pyx_L1_error) } __pyx_t_7 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_elem_codec->format); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_oid); __Pyx_GIVEREF(__pyx_v_oid); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_oid)) __PYX_ERR(3, 533, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(3, 533, __pyx_L1_error); __pyx_t_7 = 0; if (unlikely((PyDict_SetItem(__pyx_v_self->_derived_type_codecs, __pyx_t_8, __pyx_t_4) < 0))) __PYX_ERR(3, 533, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":518 * base_type = ti['basetype'] * * if array_element_oid: # <<<<<<<<<<<<<< * # Array type (note, there is no separate 'kind' for arrays) * */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/base.pyx":537 * oid, name, schema, elem_codec, elem_delim) * * elif ti['kind'] == b'c': # <<<<<<<<<<<<<< * # Composite type * */ __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_n_u_kind); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_c, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(3, 537, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":540 * # Composite type * * if not comp_type_attrs: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * f'type record missing field types for composite {oid}') */ __pyx_t_6 = (__pyx_v_comp_type_attrs != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_comp_type_attrs) != 0); __pyx_t_12 = (!__pyx_t_6); if (unlikely(__pyx_t_12)) { /* "asyncpg/protocol/codecs/base.pyx":541 * * if not comp_type_attrs: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * f'type record missing field types for composite {oid}') * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/base.pyx":542 * if not comp_type_attrs: * raise exceptions.InternalClientError( * f'type record missing field types for composite {oid}') # <<<<<<<<<<<<<< * * comp_elem_codecs = [] */ __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_oid, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_kp_u_type_record_missing_field_types, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_10}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(3, 541, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":540 * # Composite type * * if not comp_type_attrs: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * f'type record missing field types for composite {oid}') */ } /* "asyncpg/protocol/codecs/base.pyx":544 * f'type record missing field types for composite {oid}') * * comp_elem_codecs = [] # <<<<<<<<<<<<<< * has_text_elements = False * */ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_comp_elem_codecs, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":545 * * comp_elem_codecs = [] * has_text_elements = False # <<<<<<<<<<<<<< * * for typoid in comp_type_attrs: */ __pyx_v_has_text_elements = 0; /* "asyncpg/protocol/codecs/base.pyx":547 * has_text_elements = False * * for typoid in comp_type_attrs: # <<<<<<<<<<<<<< * elem_codec = self.get_codec(typoid, PG_FORMAT_ANY) * if elem_codec is None: */ if (unlikely(__pyx_v_comp_type_attrs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(3, 547, __pyx_L1_error) } __pyx_t_4 = __pyx_v_comp_type_attrs; __Pyx_INCREF(__pyx_t_4); __pyx_t_13 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 547, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_7); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(3, 547, __pyx_L1_error) #else __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_XDECREF_SET(__pyx_v_typoid, __pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/base.pyx":548 * * for typoid in comp_type_attrs: * elem_codec = self.get_codec(typoid, PG_FORMAT_ANY) # <<<<<<<<<<<<<< * if elem_codec is None: * raise exceptions.InternalClientError( */ __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_v_typoid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(3, 548, __pyx_L1_error) __pyx_t_7 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_t_5, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY, NULL)); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_7)); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/base.pyx":549 * for typoid in comp_type_attrs: * elem_codec = self.get_codec(typoid, PG_FORMAT_ANY) * if elem_codec is None: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * f'no codec for composite attribute type {typoid}') */ __pyx_t_12 = (((PyObject *)__pyx_v_elem_codec) == Py_None); if (unlikely(__pyx_t_12)) { /* "asyncpg/protocol/codecs/base.pyx":550 * elem_codec = self.get_codec(typoid, PG_FORMAT_ANY) * if elem_codec is None: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * f'no codec for composite attribute type {typoid}') * if elem_codec.format is PG_FORMAT_TEXT: */ __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/codecs/base.pyx":551 * if elem_codec is None: * raise exceptions.InternalClientError( * f'no codec for composite attribute type {typoid}') # <<<<<<<<<<<<<< * if elem_codec.format is PG_FORMAT_TEXT: * has_text_elements = True */ __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_typoid, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_14 = __Pyx_PyUnicode_Concat(__pyx_kp_u_no_codec_for_composite_attribute, __pyx_t_10); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_14}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(3, 550, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":549 * for typoid in comp_type_attrs: * elem_codec = self.get_codec(typoid, PG_FORMAT_ANY) * if elem_codec is None: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * f'no codec for composite attribute type {typoid}') */ } /* "asyncpg/protocol/codecs/base.pyx":552 * raise exceptions.InternalClientError( * f'no codec for composite attribute type {typoid}') * if elem_codec.format is PG_FORMAT_TEXT: # <<<<<<<<<<<<<< * has_text_elements = True * comp_elem_codecs.append(elem_codec) */ __pyx_t_12 = (__pyx_v_elem_codec->format == __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT); if (__pyx_t_12) { /* "asyncpg/protocol/codecs/base.pyx":553 * f'no codec for composite attribute type {typoid}') * if elem_codec.format is PG_FORMAT_TEXT: * has_text_elements = True # <<<<<<<<<<<<<< * comp_elem_codecs.append(elem_codec) * */ __pyx_v_has_text_elements = 1; /* "asyncpg/protocol/codecs/base.pyx":552 * raise exceptions.InternalClientError( * f'no codec for composite attribute type {typoid}') * if elem_codec.format is PG_FORMAT_TEXT: # <<<<<<<<<<<<<< * has_text_elements = True * comp_elem_codecs.append(elem_codec) */ } /* "asyncpg/protocol/codecs/base.pyx":554 * if elem_codec.format is PG_FORMAT_TEXT: * has_text_elements = True * comp_elem_codecs.append(elem_codec) # <<<<<<<<<<<<<< * * element_names = collections.OrderedDict() */ __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_comp_elem_codecs, ((PyObject *)__pyx_v_elem_codec)); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(3, 554, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":547 * has_text_elements = False * * for typoid in comp_type_attrs: # <<<<<<<<<<<<<< * elem_codec = self.get_codec(typoid, PG_FORMAT_ANY) * if elem_codec is None: */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":556 * comp_elem_codecs.append(elem_codec) * * element_names = collections.OrderedDict() # <<<<<<<<<<<<<< * for i, attrname in enumerate(ti['attrnames']): * element_names[attrname] = i */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_collections); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_XDECREF_SET(__pyx_v_element_names, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":557 * * element_names = collections.OrderedDict() * for i, attrname in enumerate(ti['attrnames']): # <<<<<<<<<<<<<< * element_names[attrname] = i * */ __Pyx_INCREF(__pyx_int_0); __pyx_t_4 = __pyx_int_0; __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_n_u_attrnames); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); __pyx_t_13 = 0; __pyx_t_16 = NULL; } else { __pyx_t_13 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_16 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_16)) __PYX_ERR(3, 557, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { if (likely(!__pyx_t_16)) { if (likely(PyList_CheckExact(__pyx_t_7))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 557, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_13); __Pyx_INCREF(__pyx_t_8); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(3, 557, __pyx_L1_error) #else __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 557, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_13); __Pyx_INCREF(__pyx_t_8); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(3, 557, __pyx_L1_error) #else __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } } else { __pyx_t_8 = __pyx_t_16(__pyx_t_7); if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(3, 557, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_8); } __Pyx_XDECREF_SET(__pyx_v_attrname, __pyx_t_8); __pyx_t_8 = 0; __Pyx_INCREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_8; __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/base.pyx":558 * element_names = collections.OrderedDict() * for i, attrname in enumerate(ti['attrnames']): * element_names[attrname] = i # <<<<<<<<<<<<<< * * # If at least one element is text-encoded, we must */ if (unlikely((PyObject_SetItem(__pyx_v_element_names, __pyx_v_attrname, __pyx_v_i) < 0))) __PYX_ERR(3, 558, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":557 * * element_names = collections.OrderedDict() * for i, attrname in enumerate(ti['attrnames']): # <<<<<<<<<<<<<< * element_names[attrname] = i * */ } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":562 * # If at least one element is text-encoded, we must * # encode the whole composite as text. * if has_text_elements: # <<<<<<<<<<<<<< * elem_format = PG_FORMAT_TEXT * else: */ if (__pyx_v_has_text_elements) { /* "asyncpg/protocol/codecs/base.pyx":563 * # encode the whole composite as text. * if has_text_elements: * elem_format = PG_FORMAT_TEXT # <<<<<<<<<<<<<< * else: * elem_format = PG_FORMAT_BINARY */ __pyx_v_elem_format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT; /* "asyncpg/protocol/codecs/base.pyx":562 * # If at least one element is text-encoded, we must * # encode the whole composite as text. * if has_text_elements: # <<<<<<<<<<<<<< * elem_format = PG_FORMAT_TEXT * else: */ goto __pyx_L19; } /* "asyncpg/protocol/codecs/base.pyx":565 * elem_format = PG_FORMAT_TEXT * else: * elem_format = PG_FORMAT_BINARY # <<<<<<<<<<<<<< * * self._derived_type_codecs[oid, elem_format] = \ */ /*else*/ { __pyx_v_elem_format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY; } __pyx_L19:; /* "asyncpg/protocol/codecs/base.pyx":569 * self._derived_type_codecs[oid, elem_format] = \ * Codec.new_composite_codec( * oid, name, schema, elem_format, comp_elem_codecs, # <<<<<<<<<<<<<< * comp_type_attrs, element_names) * */ __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(3, 569, __pyx_L1_error) if (!(likely(PyUnicode_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_name))) __PYX_ERR(3, 569, __pyx_L1_error) if (!(likely(PyUnicode_CheckExact(__pyx_v_schema))||((__pyx_v_schema) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_schema))) __PYX_ERR(3, 569, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":568 * * self._derived_type_codecs[oid, elem_format] = \ * Codec.new_composite_codec( # <<<<<<<<<<<<<< * oid, name, schema, elem_format, comp_elem_codecs, * comp_type_attrs, element_names) */ __pyx_t_4 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_composite_codec(__pyx_t_5, ((PyObject*)__pyx_v_name), ((PyObject*)__pyx_v_schema), __pyx_v_elem_format, __pyx_v_comp_elem_codecs, __pyx_v_comp_type_attrs, __pyx_v_element_names)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/codecs/base.pyx":567 * elem_format = PG_FORMAT_BINARY * * self._derived_type_codecs[oid, elem_format] = \ # <<<<<<<<<<<<<< * Codec.new_composite_codec( * oid, name, schema, elem_format, comp_elem_codecs, */ if (unlikely(__pyx_v_self->_derived_type_codecs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(3, 567, __pyx_L1_error) } __pyx_t_7 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_elem_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_oid); __Pyx_GIVEREF(__pyx_v_oid); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_oid)) __PYX_ERR(3, 567, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(3, 567, __pyx_L1_error); __pyx_t_7 = 0; if (unlikely((PyDict_SetItem(__pyx_v_self->_derived_type_codecs, __pyx_t_8, __pyx_t_4) < 0))) __PYX_ERR(3, 567, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":537 * oid, name, schema, elem_codec, elem_delim) * * elif ti['kind'] == b'c': # <<<<<<<<<<<<<< * # Composite type * */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/base.pyx":572 * comp_type_attrs, element_names) * * elif ti['kind'] == b'd': # <<<<<<<<<<<<<< * # Domain type * */ __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_n_u_kind); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_12 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_d, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(3, 572, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_12) { /* "asyncpg/protocol/codecs/base.pyx":575 * # Domain type * * if not base_type: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * f'type record missing base type for domain {oid}') */ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_base_type); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(3, 575, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_12); if (unlikely(__pyx_t_6)) { /* "asyncpg/protocol/codecs/base.pyx":576 * * if not base_type: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * f'type record missing base type for domain {oid}') * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/base.pyx":577 * if not base_type: * raise exceptions.InternalClientError( * f'type record missing base type for domain {oid}') # <<<<<<<<<<<<<< * * elem_codec = self.get_codec(base_type, PG_FORMAT_ANY) */ __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_oid, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_14 = __Pyx_PyUnicode_Concat(__pyx_kp_u_type_record_missing_base_type_fo, __pyx_t_8); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_14}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(3, 576, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":575 * # Domain type * * if not base_type: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * f'type record missing base type for domain {oid}') */ } /* "asyncpg/protocol/codecs/base.pyx":579 * f'type record missing base type for domain {oid}') * * elem_codec = self.get_codec(base_type, PG_FORMAT_ANY) # <<<<<<<<<<<<<< * if elem_codec is None: * elem_codec = self.declare_fallback_codec( */ __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_v_base_type); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(3, 579, __pyx_L1_error) __pyx_t_4 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_t_5, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_4)); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":580 * * elem_codec = self.get_codec(base_type, PG_FORMAT_ANY) * if elem_codec is None: # <<<<<<<<<<<<<< * elem_codec = self.declare_fallback_codec( * base_type, ti['basetype_name'], schema) */ __pyx_t_6 = (((PyObject *)__pyx_v_elem_codec) == Py_None); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":581 * elem_codec = self.get_codec(base_type, PG_FORMAT_ANY) * if elem_codec is None: * elem_codec = self.declare_fallback_codec( # <<<<<<<<<<<<<< * base_type, ti['basetype_name'], schema) * */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_declare_fallback_codec); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* "asyncpg/protocol/codecs/base.pyx":582 * if elem_codec is None: * elem_codec = self.declare_fallback_codec( * base_type, ti['basetype_name'], schema) # <<<<<<<<<<<<<< * * self._derived_type_codecs[oid, elem_codec.format] = elem_codec */ __pyx_t_14 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_n_u_basetype_name); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_v_base_type, __pyx_t_14, __pyx_v_schema}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } /* "asyncpg/protocol/codecs/base.pyx":581 * elem_codec = self.get_codec(base_type, PG_FORMAT_ANY) * if elem_codec is None: * elem_codec = self.declare_fallback_codec( # <<<<<<<<<<<<<< * base_type, ti['basetype_name'], schema) * */ if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(3, 581, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_4)); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":580 * * elem_codec = self.get_codec(base_type, PG_FORMAT_ANY) * if elem_codec is None: # <<<<<<<<<<<<<< * elem_codec = self.declare_fallback_codec( * base_type, ti['basetype_name'], schema) */ } /* "asyncpg/protocol/codecs/base.pyx":584 * base_type, ti['basetype_name'], schema) * * self._derived_type_codecs[oid, elem_codec.format] = elem_codec # <<<<<<<<<<<<<< * * elif ti['kind'] == b'r': */ if (unlikely(__pyx_v_self->_derived_type_codecs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(3, 584, __pyx_L1_error) } __pyx_t_4 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_elem_codec->format); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_oid); __Pyx_GIVEREF(__pyx_v_oid); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_oid)) __PYX_ERR(3, 584, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4)) __PYX_ERR(3, 584, __pyx_L1_error); __pyx_t_4 = 0; if (unlikely((PyDict_SetItem(__pyx_v_self->_derived_type_codecs, __pyx_t_7, ((PyObject *)__pyx_v_elem_codec)) < 0))) __PYX_ERR(3, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/base.pyx":572 * comp_type_attrs, element_names) * * elif ti['kind'] == b'd': # <<<<<<<<<<<<<< * # Domain type * */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/base.pyx":586 * self._derived_type_codecs[oid, elem_codec.format] = elem_codec * * elif ti['kind'] == b'r': # <<<<<<<<<<<<<< * # Range type * */ __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_n_u_kind); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_7, __pyx_n_b_r, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(3, 586, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":589 * # Range type * * if not range_subtype_oid: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * f'type record missing base type for range {oid}') */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_range_subtype_oid); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(3, 589, __pyx_L1_error) __pyx_t_12 = (!__pyx_t_6); if (unlikely(__pyx_t_12)) { /* "asyncpg/protocol/codecs/base.pyx":590 * * if not range_subtype_oid: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * f'type record missing base type for range {oid}') * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":591 * if not range_subtype_oid: * raise exceptions.InternalClientError( * f'type record missing base type for range {oid}') # <<<<<<<<<<<<<< * * elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY) */ __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_oid, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_kp_u_type_record_missing_base_type_fo_2, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_14))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(3, 590, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":589 * # Range type * * if not range_subtype_oid: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * f'type record missing base type for range {oid}') */ } /* "asyncpg/protocol/codecs/base.pyx":593 * f'type record missing base type for range {oid}') * * elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY) # <<<<<<<<<<<<<< * if elem_codec is None: * elem_codec = self.declare_fallback_codec( */ __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_v_range_subtype_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(3, 593, __pyx_L1_error) __pyx_t_7 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_t_5, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY, NULL)); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_7)); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/base.pyx":594 * * elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY) * if elem_codec is None: # <<<<<<<<<<<<<< * elem_codec = self.declare_fallback_codec( * range_subtype_oid, ti['range_subtype_name'], schema) */ __pyx_t_12 = (((PyObject *)__pyx_v_elem_codec) == Py_None); if (__pyx_t_12) { /* "asyncpg/protocol/codecs/base.pyx":595 * elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY) * if elem_codec is None: * elem_codec = self.declare_fallback_codec( # <<<<<<<<<<<<<< * range_subtype_oid, ti['range_subtype_name'], schema) * */ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_declare_fallback_codec); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); /* "asyncpg/protocol/codecs/base.pyx":596 * if elem_codec is None: * elem_codec = self.declare_fallback_codec( * range_subtype_oid, ti['range_subtype_name'], schema) # <<<<<<<<<<<<<< * * self._derived_type_codecs[oid, elem_codec.format] = \ */ __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_n_u_range_subtype_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_14))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_range_subtype_oid, __pyx_t_8, __pyx_v_schema}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } /* "asyncpg/protocol/codecs/base.pyx":595 * elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY) * if elem_codec is None: * elem_codec = self.declare_fallback_codec( # <<<<<<<<<<<<<< * range_subtype_oid, ti['range_subtype_name'], schema) * */ if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(3, 595, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_7)); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/base.pyx":594 * * elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY) * if elem_codec is None: # <<<<<<<<<<<<<< * elem_codec = self.declare_fallback_codec( * range_subtype_oid, ti['range_subtype_name'], schema) */ } /* "asyncpg/protocol/codecs/base.pyx":599 * * self._derived_type_codecs[oid, elem_codec.format] = \ * Codec.new_range_codec(oid, name, schema, elem_codec) # <<<<<<<<<<<<<< * * elif ti['kind'] == b'm': */ __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(3, 599, __pyx_L1_error) if (!(likely(PyUnicode_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_name))) __PYX_ERR(3, 599, __pyx_L1_error) if (!(likely(PyUnicode_CheckExact(__pyx_v_schema))||((__pyx_v_schema) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_schema))) __PYX_ERR(3, 599, __pyx_L1_error) __pyx_t_7 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_range_codec(__pyx_t_5, ((PyObject*)__pyx_v_name), ((PyObject*)__pyx_v_schema), __pyx_v_elem_codec)); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* "asyncpg/protocol/codecs/base.pyx":598 * range_subtype_oid, ti['range_subtype_name'], schema) * * self._derived_type_codecs[oid, elem_codec.format] = \ # <<<<<<<<<<<<<< * Codec.new_range_codec(oid, name, schema, elem_codec) * */ if (unlikely(__pyx_v_self->_derived_type_codecs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(3, 598, __pyx_L1_error) } __pyx_t_14 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_elem_codec->format); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_oid); __Pyx_GIVEREF(__pyx_v_oid); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_oid)) __PYX_ERR(3, 598, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_14); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_14)) __PYX_ERR(3, 598, __pyx_L1_error); __pyx_t_14 = 0; if (unlikely((PyDict_SetItem(__pyx_v_self->_derived_type_codecs, __pyx_t_8, __pyx_t_7) < 0))) __PYX_ERR(3, 598, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/base.pyx":586 * self._derived_type_codecs[oid, elem_codec.format] = elem_codec * * elif ti['kind'] == b'r': # <<<<<<<<<<<<<< * # Range type * */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/base.pyx":601 * Codec.new_range_codec(oid, name, schema, elem_codec) * * elif ti['kind'] == b'm': # <<<<<<<<<<<<<< * # Multirange type * */ __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_n_u_kind); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_12 = (__Pyx_PyBytes_Equals(__pyx_t_7, __pyx_n_b_m, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(3, 601, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_12) { /* "asyncpg/protocol/codecs/base.pyx":604 * # Multirange type * * if not range_subtype_oid: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * f'type record missing base type for multirange {oid}') */ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_range_subtype_oid); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(3, 604, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_12); if (unlikely(__pyx_t_6)) { /* "asyncpg/protocol/codecs/base.pyx":605 * * if not range_subtype_oid: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * f'type record missing base type for multirange {oid}') * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/base.pyx":606 * if not range_subtype_oid: * raise exceptions.InternalClientError( * f'type record missing base type for multirange {oid}') # <<<<<<<<<<<<<< * * elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY) */ __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_oid, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_type_record_missing_base_type_fo_3, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_14))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_4}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(3, 605, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":604 * # Multirange type * * if not range_subtype_oid: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * f'type record missing base type for multirange {oid}') */ } /* "asyncpg/protocol/codecs/base.pyx":608 * f'type record missing base type for multirange {oid}') * * elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY) # <<<<<<<<<<<<<< * if elem_codec is None: * elem_codec = self.declare_fallback_codec( */ __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_v_range_subtype_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(3, 608, __pyx_L1_error) __pyx_t_7 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_t_5, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY, NULL)); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_7)); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/base.pyx":609 * * elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY) * if elem_codec is None: # <<<<<<<<<<<<<< * elem_codec = self.declare_fallback_codec( * range_subtype_oid, ti['range_subtype_name'], schema) */ __pyx_t_6 = (((PyObject *)__pyx_v_elem_codec) == Py_None); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":610 * elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY) * if elem_codec is None: * elem_codec = self.declare_fallback_codec( # <<<<<<<<<<<<<< * range_subtype_oid, ti['range_subtype_name'], schema) * */ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_declare_fallback_codec); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); /* "asyncpg/protocol/codecs/base.pyx":611 * if elem_codec is None: * elem_codec = self.declare_fallback_codec( * range_subtype_oid, ti['range_subtype_name'], schema) # <<<<<<<<<<<<<< * * self._derived_type_codecs[oid, elem_codec.format] = \ */ __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_n_u_range_subtype_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_14))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_v_range_subtype_oid, __pyx_t_4, __pyx_v_schema}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } /* "asyncpg/protocol/codecs/base.pyx":610 * elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY) * if elem_codec is None: * elem_codec = self.declare_fallback_codec( # <<<<<<<<<<<<<< * range_subtype_oid, ti['range_subtype_name'], schema) * */ if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(3, 610, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_7)); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/base.pyx":609 * * elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY) * if elem_codec is None: # <<<<<<<<<<<<<< * elem_codec = self.declare_fallback_codec( * range_subtype_oid, ti['range_subtype_name'], schema) */ } /* "asyncpg/protocol/codecs/base.pyx":614 * * self._derived_type_codecs[oid, elem_codec.format] = \ * Codec.new_multirange_codec(oid, name, schema, elem_codec) # <<<<<<<<<<<<<< * * elif ti['kind'] == b'e': */ __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(3, 614, __pyx_L1_error) if (!(likely(PyUnicode_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_name))) __PYX_ERR(3, 614, __pyx_L1_error) if (!(likely(PyUnicode_CheckExact(__pyx_v_schema))||((__pyx_v_schema) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_schema))) __PYX_ERR(3, 614, __pyx_L1_error) __pyx_t_7 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_multirange_codec(__pyx_t_5, ((PyObject*)__pyx_v_name), ((PyObject*)__pyx_v_schema), __pyx_v_elem_codec)); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* "asyncpg/protocol/codecs/base.pyx":613 * range_subtype_oid, ti['range_subtype_name'], schema) * * self._derived_type_codecs[oid, elem_codec.format] = \ # <<<<<<<<<<<<<< * Codec.new_multirange_codec(oid, name, schema, elem_codec) * */ if (unlikely(__pyx_v_self->_derived_type_codecs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(3, 613, __pyx_L1_error) } __pyx_t_14 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_elem_codec->format); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_oid); __Pyx_GIVEREF(__pyx_v_oid); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_oid)) __PYX_ERR(3, 613, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_14); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_14)) __PYX_ERR(3, 613, __pyx_L1_error); __pyx_t_14 = 0; if (unlikely((PyDict_SetItem(__pyx_v_self->_derived_type_codecs, __pyx_t_4, __pyx_t_7) < 0))) __PYX_ERR(3, 613, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/base.pyx":601 * Codec.new_range_codec(oid, name, schema, elem_codec) * * elif ti['kind'] == b'm': # <<<<<<<<<<<<<< * # Multirange type * */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/base.pyx":616 * Codec.new_multirange_codec(oid, name, schema, elem_codec) * * elif ti['kind'] == b'e': # <<<<<<<<<<<<<< * # Enum types are essentially text * self._set_builtin_type_codec(oid, name, schema, 'scalar', */ __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_n_u_kind); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_7, __pyx_n_b_e, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(3, 616, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":618 * elif ti['kind'] == b'e': * # Enum types are essentially text * self._set_builtin_type_codec(oid, name, schema, 'scalar', # <<<<<<<<<<<<<< * TEXTOID, PG_FORMAT_ANY) * else: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_builtin_type_codec_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/codecs/base.pyx":619 * # Enum types are essentially text * self._set_builtin_type_codec(oid, name, schema, 'scalar', * TEXTOID, PG_FORMAT_ANY) # <<<<<<<<<<<<<< * else: * self.declare_fallback_codec(oid, name, schema) */ __pyx_t_14 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_8, __pyx_v_oid, __pyx_v_name, __pyx_v_schema, __pyx_n_u_scalar, __pyx_int_25, __pyx_t_14}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 6+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/codecs/base.pyx":616 * Codec.new_multirange_codec(oid, name, schema, elem_codec) * * elif ti['kind'] == b'e': # <<<<<<<<<<<<<< * # Enum types are essentially text * self._set_builtin_type_codec(oid, name, schema, 'scalar', */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/base.pyx":621 * TEXTOID, PG_FORMAT_ANY) * else: * self.declare_fallback_codec(oid, name, schema) # <<<<<<<<<<<<<< * * def add_python_codec(self, typeoid, typename, typeschema, typekind, */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_declare_fallback_codec); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_14 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_14, __pyx_v_oid, __pyx_v_name, __pyx_v_schema}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_L7:; /* "asyncpg/protocol/codecs/base.pyx":502 * Py_UCS4 elem_delim * * for ti in types: # <<<<<<<<<<<<<< * oid = ti['oid'] * */ __pyx_L3_continue:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":493 * self._custom_type_codecs = {} * * def add_types(self, types): # <<<<<<<<<<<<<< * cdef: * Codec elem_codec */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.add_types", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_elem_codec); __Pyx_XDECREF(__pyx_v_comp_elem_codecs); __Pyx_XDECREF(__pyx_v_ti); __Pyx_XDECREF(__pyx_v_oid); __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_schema); __Pyx_XDECREF(__pyx_v_array_element_oid); __Pyx_XDECREF(__pyx_v_range_subtype_oid); __Pyx_XDECREF(__pyx_v_comp_type_attrs); __Pyx_XDECREF(__pyx_v_base_type); __Pyx_XDECREF(__pyx_v_typoid); __Pyx_XDECREF(__pyx_v_element_names); __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_attrname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":623 * self.declare_fallback_codec(oid, name, schema) * * def add_python_codec(self, typeoid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * typeinfos, encoder, decoder, format, xformat): * cdef: */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_5add_python_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_5add_python_codec = {"add_python_codec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_5add_python_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_5add_python_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_typeoid = 0; PyObject *__pyx_v_typename = 0; PyObject *__pyx_v_typeschema = 0; PyObject *__pyx_v_typekind = 0; PyObject *__pyx_v_typeinfos = 0; PyObject *__pyx_v_encoder = 0; PyObject *__pyx_v_decoder = 0; PyObject *__pyx_v_format = 0; PyObject *__pyx_v_xformat = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[9] = {0,0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_python_codec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typeoid,&__pyx_n_s_typename,&__pyx_n_s_typeschema,&__pyx_n_s_typekind,&__pyx_n_s_typeinfos,&__pyx_n_s_encoder,&__pyx_n_s_decoder,&__pyx_n_s_format,&__pyx_n_s_xformat,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typeoid)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 623, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typename)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 623, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 9, 9, 1); __PYX_ERR(3, 623, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typeschema)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 623, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 9, 9, 2); __PYX_ERR(3, 623, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typekind)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 623, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 9, 9, 3); __PYX_ERR(3, 623, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typeinfos)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 623, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 9, 9, 4); __PYX_ERR(3, 623, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoder)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 623, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 9, 9, 5); __PYX_ERR(3, 623, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_decoder)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[6]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 623, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 9, 9, 6); __PYX_ERR(3, 623, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[7]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 623, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 9, 9, 7); __PYX_ERR(3, 623, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xformat)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[8]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 623, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 9, 9, 8); __PYX_ERR(3, 623, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add_python_codec") < 0)) __PYX_ERR(3, 623, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 9)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); } __pyx_v_typeoid = values[0]; __pyx_v_typename = values[1]; __pyx_v_typeschema = values[2]; __pyx_v_typekind = values[3]; __pyx_v_typeinfos = values[4]; __pyx_v_encoder = values[5]; __pyx_v_decoder = values[6]; __pyx_v_format = values[7]; __pyx_v_xformat = values[8]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 9, 9, __pyx_nargs); __PYX_ERR(3, 623, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.add_python_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_4add_python_codec(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self), __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_typeinfos, __pyx_v_encoder, __pyx_v_decoder, __pyx_v_format, __pyx_v_xformat); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_4add_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typekind, PyObject *__pyx_v_typeinfos, PyObject *__pyx_v_encoder, PyObject *__pyx_v_decoder, PyObject *__pyx_v_format, PyObject *__pyx_v_xformat) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_core_codec = 0; __pyx_t_7asyncpg_8protocol_8protocol_encode_func __pyx_v_c_encoder; __pyx_t_7asyncpg_8protocol_8protocol_decode_func __pyx_v_c_decoder; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_base_codec = 0; uint32_t __pyx_v_oid; int __pyx_v_codec_set; PyObject *__pyx_v_formats = NULL; PyObject *__pyx_v_fmt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations uint32_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; Py_ssize_t __pyx_t_7; PyObject *(*__pyx_t_8)(PyObject *); enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_t_9; enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_t_10; struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_core_codec __pyx_t_11; __pyx_t_7asyncpg_8protocol_8protocol_encode_func __pyx_t_12; __pyx_t_7asyncpg_8protocol_8protocol_decode_func __pyx_t_13; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_python_codec", 1); /* "asyncpg/protocol/codecs/base.pyx":626 * typeinfos, encoder, decoder, format, xformat): * cdef: * Codec core_codec = None # <<<<<<<<<<<<<< * encode_func c_encoder = NULL * decode_func c_decoder = NULL */ __Pyx_INCREF(Py_None); __pyx_v_core_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None); /* "asyncpg/protocol/codecs/base.pyx":627 * cdef: * Codec core_codec = None * encode_func c_encoder = NULL # <<<<<<<<<<<<<< * decode_func c_decoder = NULL * Codec base_codec = None */ __pyx_v_c_encoder = NULL; /* "asyncpg/protocol/codecs/base.pyx":628 * Codec core_codec = None * encode_func c_encoder = NULL * decode_func c_decoder = NULL # <<<<<<<<<<<<<< * Codec base_codec = None * uint32_t oid = pylong_as_oid(typeoid) */ __pyx_v_c_decoder = NULL; /* "asyncpg/protocol/codecs/base.pyx":629 * encode_func c_encoder = NULL * decode_func c_decoder = NULL * Codec base_codec = None # <<<<<<<<<<<<<< * uint32_t oid = pylong_as_oid(typeoid) * bint codec_set = False */ __Pyx_INCREF(Py_None); __pyx_v_base_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None); /* "asyncpg/protocol/codecs/base.pyx":630 * decode_func c_decoder = NULL * Codec base_codec = None * uint32_t oid = pylong_as_oid(typeoid) # <<<<<<<<<<<<<< * bint codec_set = False * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_pylong_as_oid(__pyx_v_typeoid); if (unlikely(__pyx_t_1 == ((uint32_t)0xFFFFFFFFL) && PyErr_Occurred())) __PYX_ERR(3, 630, __pyx_L1_error) __pyx_v_oid = __pyx_t_1; /* "asyncpg/protocol/codecs/base.pyx":631 * Codec base_codec = None * uint32_t oid = pylong_as_oid(typeoid) * bint codec_set = False # <<<<<<<<<<<<<< * * # Clear all previous overrides (this also clears type cache). */ __pyx_v_codec_set = 0; /* "asyncpg/protocol/codecs/base.pyx":634 * * # Clear all previous overrides (this also clears type cache). * self.remove_python_codec(typeoid, typename, typeschema) # <<<<<<<<<<<<<< * * if typeinfos: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_remove_python_codec); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":636 * self.remove_python_codec(typeoid, typename, typeschema) * * if typeinfos: # <<<<<<<<<<<<<< * self.add_types(typeinfos) * */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_typeinfos); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(3, 636, __pyx_L1_error) if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":637 * * if typeinfos: * self.add_types(typeinfos) # <<<<<<<<<<<<<< * * if format == PG_FORMAT_ANY: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_types); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_typeinfos}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":636 * self.remove_python_codec(typeoid, typename, typeschema) * * if typeinfos: # <<<<<<<<<<<<<< * self.add_types(typeinfos) * */ } /* "asyncpg/protocol/codecs/base.pyx":639 * self.add_types(typeinfos) * * if format == PG_FORMAT_ANY: # <<<<<<<<<<<<<< * formats = (PG_FORMAT_TEXT, PG_FORMAT_BINARY) * else: */ __pyx_t_2 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_RichCompare(__pyx_v_format, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 639, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(3, 639, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":640 * * if format == PG_FORMAT_ANY: * formats = (PG_FORMAT_TEXT, PG_FORMAT_BINARY) # <<<<<<<<<<<<<< * else: * formats = (format,) */ __pyx_t_3 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(3, 640, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(3, 640, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_v_formats = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":639 * self.add_types(typeinfos) * * if format == PG_FORMAT_ANY: # <<<<<<<<<<<<<< * formats = (PG_FORMAT_TEXT, PG_FORMAT_BINARY) * else: */ goto __pyx_L4; } /* "asyncpg/protocol/codecs/base.pyx":642 * formats = (PG_FORMAT_TEXT, PG_FORMAT_BINARY) * else: * formats = (format,) # <<<<<<<<<<<<<< * * for fmt in formats: */ /*else*/ { __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_format); __Pyx_GIVEREF(__pyx_v_format); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_format)) __PYX_ERR(3, 642, __pyx_L1_error); __pyx_v_formats = __pyx_t_4; __pyx_t_4 = 0; } __pyx_L4:; /* "asyncpg/protocol/codecs/base.pyx":644 * formats = (format,) * * for fmt in formats: # <<<<<<<<<<<<<< * if xformat == PG_XFORMAT_TUPLE: * if typekind == "scalar": */ if (likely(PyList_CheckExact(__pyx_v_formats)) || PyTuple_CheckExact(__pyx_v_formats)) { __pyx_t_4 = __pyx_v_formats; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_formats); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 644, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_4))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 644, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(3, 644, __pyx_L1_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 644, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(3, 644, __pyx_L1_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(3, 644, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_fmt, __pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":645 * * for fmt in formats: * if xformat == PG_XFORMAT_TUPLE: # <<<<<<<<<<<<<< * if typekind == "scalar": * core_codec = get_core_codec(oid, fmt, xformat) */ __pyx_t_2 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_RichCompare(__pyx_v_xformat, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 645, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(3, 645, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":646 * for fmt in formats: * if xformat == PG_XFORMAT_TUPLE: * if typekind == "scalar": # <<<<<<<<<<<<<< * core_codec = get_core_codec(oid, fmt, xformat) * if core_codec is None: */ __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_typekind, __pyx_n_u_scalar, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(3, 646, __pyx_L1_error) if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":647 * if xformat == PG_XFORMAT_TUPLE: * if typekind == "scalar": * core_codec = get_core_codec(oid, fmt, xformat) # <<<<<<<<<<<<<< * if core_codec is None: * continue */ __pyx_t_9 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_fmt)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 647, __pyx_L1_error) __pyx_t_10 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_v_xformat)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 647, __pyx_L1_error) __pyx_t_11.__pyx_n = 1; __pyx_t_11.xformat = __pyx_t_10; __pyx_t_3 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_get_core_codec(__pyx_v_oid, __pyx_t_9, &__pyx_t_11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_core_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_3)); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":648 * if typekind == "scalar": * core_codec = get_core_codec(oid, fmt, xformat) * if core_codec is None: # <<<<<<<<<<<<<< * continue * c_encoder = core_codec.c_encoder */ __pyx_t_6 = (((PyObject *)__pyx_v_core_codec) == Py_None); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":649 * core_codec = get_core_codec(oid, fmt, xformat) * if core_codec is None: * continue # <<<<<<<<<<<<<< * c_encoder = core_codec.c_encoder * c_decoder = core_codec.c_decoder */ goto __pyx_L5_continue; /* "asyncpg/protocol/codecs/base.pyx":648 * if typekind == "scalar": * core_codec = get_core_codec(oid, fmt, xformat) * if core_codec is None: # <<<<<<<<<<<<<< * continue * c_encoder = core_codec.c_encoder */ } /* "asyncpg/protocol/codecs/base.pyx":650 * if core_codec is None: * continue * c_encoder = core_codec.c_encoder # <<<<<<<<<<<<<< * c_decoder = core_codec.c_decoder * elif typekind == "composite": */ __pyx_t_12 = __pyx_v_core_codec->c_encoder; __pyx_v_c_encoder = __pyx_t_12; /* "asyncpg/protocol/codecs/base.pyx":651 * continue * c_encoder = core_codec.c_encoder * c_decoder = core_codec.c_decoder # <<<<<<<<<<<<<< * elif typekind == "composite": * base_codec = self.get_codec(oid, fmt) */ __pyx_t_13 = __pyx_v_core_codec->c_decoder; __pyx_v_c_decoder = __pyx_t_13; /* "asyncpg/protocol/codecs/base.pyx":646 * for fmt in formats: * if xformat == PG_XFORMAT_TUPLE: * if typekind == "scalar": # <<<<<<<<<<<<<< * core_codec = get_core_codec(oid, fmt, xformat) * if core_codec is None: */ goto __pyx_L8; } /* "asyncpg/protocol/codecs/base.pyx":652 * c_encoder = core_codec.c_encoder * c_decoder = core_codec.c_decoder * elif typekind == "composite": # <<<<<<<<<<<<<< * base_codec = self.get_codec(oid, fmt) * if base_codec is None: */ __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_typekind, __pyx_n_u_composite, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(3, 652, __pyx_L1_error) if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":653 * c_decoder = core_codec.c_decoder * elif typekind == "composite": * base_codec = self.get_codec(oid, fmt) # <<<<<<<<<<<<<< * if base_codec is None: * continue */ __pyx_t_9 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_fmt)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 653, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_v_oid, __pyx_t_9, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_base_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_3)); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":654 * elif typekind == "composite": * base_codec = self.get_codec(oid, fmt) * if base_codec is None: # <<<<<<<<<<<<<< * continue * */ __pyx_t_6 = (((PyObject *)__pyx_v_base_codec) == Py_None); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/base.pyx":655 * base_codec = self.get_codec(oid, fmt) * if base_codec is None: * continue # <<<<<<<<<<<<<< * * self._custom_type_codecs[typeoid, fmt] = \ */ goto __pyx_L5_continue; /* "asyncpg/protocol/codecs/base.pyx":654 * elif typekind == "composite": * base_codec = self.get_codec(oid, fmt) * if base_codec is None: # <<<<<<<<<<<<<< * continue * */ } /* "asyncpg/protocol/codecs/base.pyx":652 * c_encoder = core_codec.c_encoder * c_decoder = core_codec.c_decoder * elif typekind == "composite": # <<<<<<<<<<<<<< * base_codec = self.get_codec(oid, fmt) * if base_codec is None: */ } __pyx_L8:; /* "asyncpg/protocol/codecs/base.pyx":645 * * for fmt in formats: * if xformat == PG_XFORMAT_TUPLE: # <<<<<<<<<<<<<< * if typekind == "scalar": * core_codec = get_core_codec(oid, fmt, xformat) */ } /* "asyncpg/protocol/codecs/base.pyx":658 * * self._custom_type_codecs[typeoid, fmt] = \ * Codec.new_python_codec(oid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * encoder, decoder, c_encoder, c_decoder, * base_codec, fmt, xformat) */ if (!(likely(PyUnicode_CheckExact(__pyx_v_typename))||((__pyx_v_typename) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_typename))) __PYX_ERR(3, 658, __pyx_L1_error) if (!(likely(PyUnicode_CheckExact(__pyx_v_typeschema))||((__pyx_v_typeschema) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_typeschema))) __PYX_ERR(3, 658, __pyx_L1_error) if (!(likely(PyUnicode_CheckExact(__pyx_v_typekind))||((__pyx_v_typekind) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_typekind))) __PYX_ERR(3, 658, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":660 * Codec.new_python_codec(oid, typename, typeschema, typekind, * encoder, decoder, c_encoder, c_decoder, * base_codec, fmt, xformat) # <<<<<<<<<<<<<< * codec_set = True * */ __pyx_t_9 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_fmt)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 660, __pyx_L1_error) __pyx_t_10 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_v_xformat)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 660, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":658 * * self._custom_type_codecs[typeoid, fmt] = \ * Codec.new_python_codec(oid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * encoder, decoder, c_encoder, c_decoder, * base_codec, fmt, xformat) */ __pyx_t_3 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_python_codec(__pyx_v_oid, ((PyObject*)__pyx_v_typename), ((PyObject*)__pyx_v_typeschema), ((PyObject*)__pyx_v_typekind), __pyx_v_encoder, __pyx_v_decoder, __pyx_v_c_encoder, __pyx_v_c_decoder, __pyx_v_base_codec, __pyx_t_9, __pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/protocol/codecs/base.pyx":657 * continue * * self._custom_type_codecs[typeoid, fmt] = \ # <<<<<<<<<<<<<< * Codec.new_python_codec(oid, typename, typeschema, typekind, * encoder, decoder, c_encoder, c_decoder, */ if (unlikely(__pyx_v_self->_custom_type_codecs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(3, 657, __pyx_L1_error) } __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_typeoid); __Pyx_GIVEREF(__pyx_v_typeoid); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_typeoid)) __PYX_ERR(3, 657, __pyx_L1_error); __Pyx_INCREF(__pyx_v_fmt); __Pyx_GIVEREF(__pyx_v_fmt); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_fmt)) __PYX_ERR(3, 657, __pyx_L1_error); if (unlikely((PyDict_SetItem(__pyx_v_self->_custom_type_codecs, __pyx_t_2, __pyx_t_3) < 0))) __PYX_ERR(3, 657, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":661 * encoder, decoder, c_encoder, c_decoder, * base_codec, fmt, xformat) * codec_set = True # <<<<<<<<<<<<<< * * if not codec_set: */ __pyx_v_codec_set = 1; /* "asyncpg/protocol/codecs/base.pyx":644 * formats = (format,) * * for fmt in formats: # <<<<<<<<<<<<<< * if xformat == PG_XFORMAT_TUPLE: * if typekind == "scalar": */ __pyx_L5_continue:; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":663 * codec_set = True * * if not codec_set: # <<<<<<<<<<<<<< * raise exceptions.InterfaceError( * "{} type does not support the 'tuple' exchange format".format( */ __pyx_t_6 = (!__pyx_v_codec_set); if (unlikely(__pyx_t_6)) { /* "asyncpg/protocol/codecs/base.pyx":664 * * if not codec_set: * raise exceptions.InterfaceError( # <<<<<<<<<<<<<< * "{} type does not support the 'tuple' exchange format".format( * typename)) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":665 * if not codec_set: * raise exceptions.InterfaceError( * "{} type does not support the 'tuple' exchange format".format( # <<<<<<<<<<<<<< * typename)) * */ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_type_does_not_support_the_tuple, __pyx_n_s_format); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); /* "asyncpg/protocol/codecs/base.pyx":666 * raise exceptions.InterfaceError( * "{} type does not support the 'tuple' exchange format".format( * typename)) # <<<<<<<<<<<<<< * * def remove_python_codec(self, typeoid, typename, typeschema): */ __pyx_t_15 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_14))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_typename}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __pyx_t_14 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_3}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(3, 664, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":663 * codec_set = True * * if not codec_set: # <<<<<<<<<<<<<< * raise exceptions.InterfaceError( * "{} type does not support the 'tuple' exchange format".format( */ } /* "asyncpg/protocol/codecs/base.pyx":623 * self.declare_fallback_codec(oid, name, schema) * * def add_python_codec(self, typeoid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * typeinfos, encoder, decoder, format, xformat): * cdef: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.add_python_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_core_codec); __Pyx_XDECREF((PyObject *)__pyx_v_base_codec); __Pyx_XDECREF(__pyx_v_formats); __Pyx_XDECREF(__pyx_v_fmt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":668 * typename)) * * def remove_python_codec(self, typeoid, typename, typeschema): # <<<<<<<<<<<<<< * for fmt in (PG_FORMAT_BINARY, PG_FORMAT_TEXT): * self._custom_type_codecs.pop((typeoid, fmt), None) */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_7remove_python_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_7remove_python_codec = {"remove_python_codec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_7remove_python_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_7remove_python_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_typeoid = 0; CYTHON_UNUSED PyObject *__pyx_v_typename = 0; CYTHON_UNUSED PyObject *__pyx_v_typeschema = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("remove_python_codec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typeoid,&__pyx_n_s_typename,&__pyx_n_s_typeschema,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typeoid)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 668, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typename)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 668, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("remove_python_codec", 1, 3, 3, 1); __PYX_ERR(3, 668, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typeschema)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 668, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("remove_python_codec", 1, 3, 3, 2); __PYX_ERR(3, 668, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "remove_python_codec") < 0)) __PYX_ERR(3, 668, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_typeoid = values[0]; __pyx_v_typename = values[1]; __pyx_v_typeschema = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("remove_python_codec", 1, 3, 3, __pyx_nargs); __PYX_ERR(3, 668, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.remove_python_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_6remove_python_codec(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self), __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_6remove_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v_typeoid, CYTHON_UNUSED PyObject *__pyx_v_typename, CYTHON_UNUSED PyObject *__pyx_v_typeschema) { PyObject *__pyx_v_fmt = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove_python_codec", 1); /* "asyncpg/protocol/codecs/base.pyx":669 * * def remove_python_codec(self, typeoid, typename, typeschema): * for fmt in (PG_FORMAT_BINARY, PG_FORMAT_TEXT): # <<<<<<<<<<<<<< * self._custom_type_codecs.pop((typeoid, fmt), None) * self.clear_type_cache() */ __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(3, 669, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(3, 669, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (__pyx_t_4 >= 2) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(3, 669, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_fmt, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":670 * def remove_python_codec(self, typeoid, typename, typeschema): * for fmt in (PG_FORMAT_BINARY, PG_FORMAT_TEXT): * self._custom_type_codecs.pop((typeoid, fmt), None) # <<<<<<<<<<<<<< * self.clear_type_cache() * */ if (unlikely(__pyx_v_self->_custom_type_codecs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop"); __PYX_ERR(3, 670, __pyx_L1_error) } __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_typeoid); __Pyx_GIVEREF(__pyx_v_typeoid); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_typeoid)) __PYX_ERR(3, 670, __pyx_L1_error); __Pyx_INCREF(__pyx_v_fmt); __Pyx_GIVEREF(__pyx_v_fmt); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_fmt)) __PYX_ERR(3, 670, __pyx_L1_error); __pyx_t_1 = __Pyx_PyDict_Pop(__pyx_v_self->_custom_type_codecs, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":669 * * def remove_python_codec(self, typeoid, typename, typeschema): * for fmt in (PG_FORMAT_BINARY, PG_FORMAT_TEXT): # <<<<<<<<<<<<<< * self._custom_type_codecs.pop((typeoid, fmt), None) * self.clear_type_cache() */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":671 * for fmt in (PG_FORMAT_BINARY, PG_FORMAT_TEXT): * self._custom_type_codecs.pop((typeoid, fmt), None) * self.clear_type_cache() # <<<<<<<<<<<<<< * * def _set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear_type_cache); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":668 * typename)) * * def remove_python_codec(self, typeoid, typename, typeschema): # <<<<<<<<<<<<<< * for fmt in (PG_FORMAT_BINARY, PG_FORMAT_TEXT): * self._custom_type_codecs.pop((typeoid, fmt), None) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.remove_python_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fmt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":673 * self.clear_type_cache() * * def _set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * alias_to, format=PG_FORMAT_ANY): * cdef: */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_9_set_builtin_type_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_9_set_builtin_type_codec = {"_set_builtin_type_codec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_9_set_builtin_type_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_9_set_builtin_type_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_typeoid = 0; PyObject *__pyx_v_typename = 0; PyObject *__pyx_v_typeschema = 0; PyObject *__pyx_v_typekind = 0; PyObject *__pyx_v_alias_to = 0; PyObject *__pyx_v_format = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_set_builtin_type_codec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typeoid,&__pyx_n_s_typename,&__pyx_n_s_typeschema,&__pyx_n_s_typekind,&__pyx_n_s_alias_to,&__pyx_n_s_format,0}; values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_k__6); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typeoid)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 673, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typename)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 673, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_set_builtin_type_codec", 0, 5, 6, 1); __PYX_ERR(3, 673, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typeschema)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 673, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_set_builtin_type_codec", 0, 5, 6, 2); __PYX_ERR(3, 673, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typekind)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 673, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_set_builtin_type_codec", 0, 5, 6, 3); __PYX_ERR(3, 673, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alias_to)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 673, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_set_builtin_type_codec", 0, 5, 6, 4); __PYX_ERR(3, 673, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 673, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_set_builtin_type_codec") < 0)) __PYX_ERR(3, 673, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_typeoid = values[0]; __pyx_v_typename = values[1]; __pyx_v_typeschema = values[2]; __pyx_v_typekind = values[3]; __pyx_v_alias_to = values[4]; __pyx_v_format = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_set_builtin_type_codec", 0, 5, 6, __pyx_nargs); __PYX_ERR(3, 673, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig._set_builtin_type_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_8_set_builtin_type_codec(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self), __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_alias_to, __pyx_v_format); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_8_set_builtin_type_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typekind, PyObject *__pyx_v_alias_to, PyObject *__pyx_v_format) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_target_codec = 0; CYTHON_UNUSED uint32_t __pyx_v_oid; uint32_t __pyx_v_alias_oid; int __pyx_v_codec_set; PyObject *__pyx_v_formats = NULL; PyObject *__pyx_v_codec_str = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations uint32_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; Py_ssize_t __pyx_t_7; PyObject *(*__pyx_t_8)(PyObject *); enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_t_9; Py_UCS4 __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_set_builtin_type_codec", 0); __Pyx_INCREF(__pyx_v_format); /* "asyncpg/protocol/codecs/base.pyx":678 * Codec codec * Codec target_codec * uint32_t oid = pylong_as_oid(typeoid) # <<<<<<<<<<<<<< * uint32_t alias_oid = 0 * bint codec_set = False */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_pylong_as_oid(__pyx_v_typeoid); if (unlikely(__pyx_t_1 == ((uint32_t)0xFFFFFFFFL) && PyErr_Occurred())) __PYX_ERR(3, 678, __pyx_L1_error) __pyx_v_oid = __pyx_t_1; /* "asyncpg/protocol/codecs/base.pyx":679 * Codec target_codec * uint32_t oid = pylong_as_oid(typeoid) * uint32_t alias_oid = 0 # <<<<<<<<<<<<<< * bint codec_set = False * */ __pyx_v_alias_oid = 0; /* "asyncpg/protocol/codecs/base.pyx":680 * uint32_t oid = pylong_as_oid(typeoid) * uint32_t alias_oid = 0 * bint codec_set = False # <<<<<<<<<<<<<< * * if format == PG_FORMAT_ANY: */ __pyx_v_codec_set = 0; /* "asyncpg/protocol/codecs/base.pyx":682 * bint codec_set = False * * if format == PG_FORMAT_ANY: # <<<<<<<<<<<<<< * formats = (PG_FORMAT_BINARY, PG_FORMAT_TEXT) * else: */ __pyx_t_2 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_RichCompare(__pyx_v_format, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(3, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { /* "asyncpg/protocol/codecs/base.pyx":683 * * if format == PG_FORMAT_ANY: * formats = (PG_FORMAT_BINARY, PG_FORMAT_TEXT) # <<<<<<<<<<<<<< * else: * formats = (format,) */ __pyx_t_3 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(3, 683, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(3, 683, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_v_formats = __pyx_t_5; __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/base.pyx":682 * bint codec_set = False * * if format == PG_FORMAT_ANY: # <<<<<<<<<<<<<< * formats = (PG_FORMAT_BINARY, PG_FORMAT_TEXT) * else: */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/base.pyx":685 * formats = (PG_FORMAT_BINARY, PG_FORMAT_TEXT) * else: * formats = (format,) # <<<<<<<<<<<<<< * * if isinstance(alias_to, int): */ /*else*/ { __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_format); __Pyx_GIVEREF(__pyx_v_format); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_format)) __PYX_ERR(3, 685, __pyx_L1_error); __pyx_v_formats = __pyx_t_5; __pyx_t_5 = 0; } __pyx_L3:; /* "asyncpg/protocol/codecs/base.pyx":687 * formats = (format,) * * if isinstance(alias_to, int): # <<<<<<<<<<<<<< * alias_oid = pylong_as_oid(alias_to) * else: */ __pyx_t_4 = PyInt_Check(__pyx_v_alias_to); if (__pyx_t_4) { /* "asyncpg/protocol/codecs/base.pyx":688 * * if isinstance(alias_to, int): * alias_oid = pylong_as_oid(alias_to) # <<<<<<<<<<<<<< * else: * alias_oid = BUILTIN_TYPE_NAME_MAP.get(alias_to, 0) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_pylong_as_oid(__pyx_v_alias_to); if (unlikely(__pyx_t_1 == ((uint32_t)0xFFFFFFFFL) && PyErr_Occurred())) __PYX_ERR(3, 688, __pyx_L1_error) __pyx_v_alias_oid = __pyx_t_1; /* "asyncpg/protocol/codecs/base.pyx":687 * formats = (format,) * * if isinstance(alias_to, int): # <<<<<<<<<<<<<< * alias_oid = pylong_as_oid(alias_to) * else: */ goto __pyx_L4; } /* "asyncpg/protocol/codecs/base.pyx":690 * alias_oid = pylong_as_oid(alias_to) * else: * alias_oid = BUILTIN_TYPE_NAME_MAP.get(alias_to, 0) # <<<<<<<<<<<<<< * * for format in formats: */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_alias_to, __pyx_int_0}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_1 = __Pyx_PyInt_As_uint32_t(__pyx_t_5); if (unlikely((__pyx_t_1 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(3, 690, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_alias_oid = __pyx_t_1; } __pyx_L4:; /* "asyncpg/protocol/codecs/base.pyx":692 * alias_oid = BUILTIN_TYPE_NAME_MAP.get(alias_to, 0) * * for format in formats: # <<<<<<<<<<<<<< * if alias_oid != 0: * target_codec = self.get_codec(alias_oid, format) */ if (likely(PyList_CheckExact(__pyx_v_formats)) || PyTuple_CheckExact(__pyx_v_formats)) { __pyx_t_5 = __pyx_v_formats; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_formats); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 692, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_5))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 692, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(3, 692, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 692, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(3, 692, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(3, 692, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":693 * * for format in formats: * if alias_oid != 0: # <<<<<<<<<<<<<< * target_codec = self.get_codec(alias_oid, format) * else: */ __pyx_t_4 = (__pyx_v_alias_oid != 0); if (__pyx_t_4) { /* "asyncpg/protocol/codecs/base.pyx":694 * for format in formats: * if alias_oid != 0: * target_codec = self.get_codec(alias_oid, format) # <<<<<<<<<<<<<< * else: * target_codec = get_extra_codec(alias_to, format) */ __pyx_t_9 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 694, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_v_alias_oid, __pyx_t_9, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_target_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_3)); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":693 * * for format in formats: * if alias_oid != 0: # <<<<<<<<<<<<<< * target_codec = self.get_codec(alias_oid, format) * else: */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/base.pyx":696 * target_codec = self.get_codec(alias_oid, format) * else: * target_codec = get_extra_codec(alias_to, format) # <<<<<<<<<<<<<< * * if target_codec is None: */ /*else*/ { if (!(likely(PyUnicode_CheckExact(__pyx_v_alias_to))||((__pyx_v_alias_to) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_alias_to))) __PYX_ERR(3, 696, __pyx_L1_error) __pyx_t_9 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 696, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_get_extra_codec(((PyObject*)__pyx_v_alias_to), __pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_target_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_3)); __pyx_t_3 = 0; } __pyx_L7:; /* "asyncpg/protocol/codecs/base.pyx":698 * target_codec = get_extra_codec(alias_to, format) * * if target_codec is None: # <<<<<<<<<<<<<< * continue * */ __pyx_t_4 = (((PyObject *)__pyx_v_target_codec) == Py_None); if (__pyx_t_4) { /* "asyncpg/protocol/codecs/base.pyx":699 * * if target_codec is None: * continue # <<<<<<<<<<<<<< * * codec = target_codec.copy() */ goto __pyx_L5_continue; /* "asyncpg/protocol/codecs/base.pyx":698 * target_codec = get_extra_codec(alias_to, format) * * if target_codec is None: # <<<<<<<<<<<<<< * continue * */ } /* "asyncpg/protocol/codecs/base.pyx":701 * continue * * codec = target_codec.copy() # <<<<<<<<<<<<<< * codec.oid = typeoid * codec.name = typename */ __pyx_t_3 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_5Codec_copy(__pyx_v_target_codec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_3)); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":702 * * codec = target_codec.copy() * codec.oid = typeoid # <<<<<<<<<<<<<< * codec.name = typename * codec.schema = typeschema */ __pyx_t_1 = __Pyx_PyInt_As_uint32_t(__pyx_v_typeoid); if (unlikely((__pyx_t_1 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(3, 702, __pyx_L1_error) __pyx_v_codec->oid = __pyx_t_1; /* "asyncpg/protocol/codecs/base.pyx":703 * codec = target_codec.copy() * codec.oid = typeoid * codec.name = typename # <<<<<<<<<<<<<< * codec.schema = typeschema * codec.kind = typekind */ if (!(likely(PyUnicode_CheckExact(__pyx_v_typename))||((__pyx_v_typename) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_typename))) __PYX_ERR(3, 703, __pyx_L1_error) __pyx_t_3 = __pyx_v_typename; __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_codec->name); __Pyx_DECREF(__pyx_v_codec->name); __pyx_v_codec->name = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":704 * codec.oid = typeoid * codec.name = typename * codec.schema = typeschema # <<<<<<<<<<<<<< * codec.kind = typekind * */ if (!(likely(PyUnicode_CheckExact(__pyx_v_typeschema))||((__pyx_v_typeschema) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_typeschema))) __PYX_ERR(3, 704, __pyx_L1_error) __pyx_t_3 = __pyx_v_typeschema; __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_codec->schema); __Pyx_DECREF(__pyx_v_codec->schema); __pyx_v_codec->schema = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":705 * codec.name = typename * codec.schema = typeschema * codec.kind = typekind # <<<<<<<<<<<<<< * * self._custom_type_codecs[typeoid, format] = codec */ if (!(likely(PyUnicode_CheckExact(__pyx_v_typekind))||((__pyx_v_typekind) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_typekind))) __PYX_ERR(3, 705, __pyx_L1_error) __pyx_t_3 = __pyx_v_typekind; __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_codec->kind); __Pyx_DECREF(__pyx_v_codec->kind); __pyx_v_codec->kind = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":707 * codec.kind = typekind * * self._custom_type_codecs[typeoid, format] = codec # <<<<<<<<<<<<<< * codec_set = True * */ if (unlikely(__pyx_v_self->_custom_type_codecs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(3, 707, __pyx_L1_error) } __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_typeoid); __Pyx_GIVEREF(__pyx_v_typeoid); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_typeoid)) __PYX_ERR(3, 707, __pyx_L1_error); __Pyx_INCREF(__pyx_v_format); __Pyx_GIVEREF(__pyx_v_format); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_format)) __PYX_ERR(3, 707, __pyx_L1_error); if (unlikely((PyDict_SetItem(__pyx_v_self->_custom_type_codecs, __pyx_t_3, ((PyObject *)__pyx_v_codec)) < 0))) __PYX_ERR(3, 707, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":708 * * self._custom_type_codecs[typeoid, format] = codec * codec_set = True # <<<<<<<<<<<<<< * * if not codec_set: */ __pyx_v_codec_set = 1; /* "asyncpg/protocol/codecs/base.pyx":692 * alias_oid = BUILTIN_TYPE_NAME_MAP.get(alias_to, 0) * * for format in formats: # <<<<<<<<<<<<<< * if alias_oid != 0: * target_codec = self.get_codec(alias_oid, format) */ __pyx_L5_continue:; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/base.pyx":710 * codec_set = True * * if not codec_set: # <<<<<<<<<<<<<< * if format == PG_FORMAT_BINARY: * codec_str = 'binary' */ __pyx_t_4 = (!__pyx_v_codec_set); if (__pyx_t_4) { /* "asyncpg/protocol/codecs/base.pyx":711 * * if not codec_set: * if format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * codec_str = 'binary' * elif format == PG_FORMAT_TEXT: */ __pyx_t_5 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_RichCompare(__pyx_v_format, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 711, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(3, 711, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { /* "asyncpg/protocol/codecs/base.pyx":712 * if not codec_set: * if format == PG_FORMAT_BINARY: * codec_str = 'binary' # <<<<<<<<<<<<<< * elif format == PG_FORMAT_TEXT: * codec_str = 'text' */ __Pyx_INCREF(__pyx_n_u_binary); __pyx_v_codec_str = __pyx_n_u_binary; /* "asyncpg/protocol/codecs/base.pyx":711 * * if not codec_set: * if format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * codec_str = 'binary' * elif format == PG_FORMAT_TEXT: */ goto __pyx_L11; } /* "asyncpg/protocol/codecs/base.pyx":713 * if format == PG_FORMAT_BINARY: * codec_str = 'binary' * elif format == PG_FORMAT_TEXT: # <<<<<<<<<<<<<< * codec_str = 'text' * else: */ __pyx_t_3 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(3, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { /* "asyncpg/protocol/codecs/base.pyx":714 * codec_str = 'binary' * elif format == PG_FORMAT_TEXT: * codec_str = 'text' # <<<<<<<<<<<<<< * else: * codec_str = 'text or binary' */ __Pyx_INCREF(__pyx_n_u_text); __pyx_v_codec_str = __pyx_n_u_text; /* "asyncpg/protocol/codecs/base.pyx":713 * if format == PG_FORMAT_BINARY: * codec_str = 'binary' * elif format == PG_FORMAT_TEXT: # <<<<<<<<<<<<<< * codec_str = 'text' * else: */ goto __pyx_L11; } /* "asyncpg/protocol/codecs/base.pyx":716 * codec_str = 'text' * else: * codec_str = 'text or binary' # <<<<<<<<<<<<<< * * raise exceptions.InterfaceError( */ /*else*/ { __Pyx_INCREF(__pyx_kp_u_text_or_binary_2); __pyx_v_codec_str = __pyx_kp_u_text_or_binary_2; } __pyx_L11:; /* "asyncpg/protocol/codecs/base.pyx":718 * codec_str = 'text or binary' * * raise exceptions.InterfaceError( # <<<<<<<<<<<<<< * f'cannot alias {typename} to {alias_to}: ' * f'there is no {codec_str} codec for {alias_to}') */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":719 * * raise exceptions.InterfaceError( * f'cannot alias {typename} to {alias_to}: ' # <<<<<<<<<<<<<< * f'there is no {codec_str} codec for {alias_to}') * */ __pyx_t_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = 0; __pyx_t_10 = 127; __Pyx_INCREF(__pyx_kp_u_cannot_alias); __pyx_t_7 += 13; __Pyx_GIVEREF(__pyx_kp_u_cannot_alias); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_cannot_alias); __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_typename, __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_10; __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11); __pyx_t_11 = 0; __Pyx_INCREF(__pyx_kp_u_to); __pyx_t_7 += 4; __Pyx_GIVEREF(__pyx_kp_u_to); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_to); __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_alias_to, __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_10; __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_11); __pyx_t_11 = 0; __Pyx_INCREF(__pyx_kp_u_there_is_no); __pyx_t_7 += 14; __Pyx_GIVEREF(__pyx_kp_u_there_is_no); PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u_there_is_no); /* "asyncpg/protocol/codecs/base.pyx":720 * raise exceptions.InterfaceError( * f'cannot alias {typename} to {alias_to}: ' * f'there is no {codec_str} codec for {alias_to}') # <<<<<<<<<<<<<< * * def set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, */ __Pyx_INCREF(__pyx_v_codec_str); __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_codec_str) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_codec_str) : __pyx_t_10; __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_codec_str); __Pyx_GIVEREF(__pyx_v_codec_str); PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_codec_str); __Pyx_INCREF(__pyx_kp_u_codec_for); __pyx_t_7 += 11; __Pyx_GIVEREF(__pyx_kp_u_codec_for); PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_kp_u_codec_for); __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_alias_to, __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_10; __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/codecs/base.pyx":719 * * raise exceptions.InterfaceError( * f'cannot alias {typename} to {alias_to}: ' # <<<<<<<<<<<<<< * f'there is no {codec_str} codec for {alias_to}') * */ __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_3, 8, __pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_11}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(3, 718, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":710 * codec_set = True * * if not codec_set: # <<<<<<<<<<<<<< * if format == PG_FORMAT_BINARY: * codec_str = 'binary' */ } /* "asyncpg/protocol/codecs/base.pyx":673 * self.clear_type_cache() * * def _set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * alias_to, format=PG_FORMAT_ANY): * cdef: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig._set_builtin_type_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XDECREF((PyObject *)__pyx_v_target_codec); __Pyx_XDECREF(__pyx_v_formats); __Pyx_XDECREF(__pyx_v_codec_str); __Pyx_XDECREF(__pyx_v_format); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":722 * f'there is no {codec_str} codec for {alias_to}') * * def set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * alias_to, format=PG_FORMAT_ANY): * self._set_builtin_type_codec(typeoid, typename, typeschema, typekind, */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_11set_builtin_type_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_11set_builtin_type_codec = {"set_builtin_type_codec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_11set_builtin_type_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_11set_builtin_type_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_typeoid = 0; PyObject *__pyx_v_typename = 0; PyObject *__pyx_v_typeschema = 0; PyObject *__pyx_v_typekind = 0; PyObject *__pyx_v_alias_to = 0; PyObject *__pyx_v_format = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_builtin_type_codec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typeoid,&__pyx_n_s_typename,&__pyx_n_s_typeschema,&__pyx_n_s_typekind,&__pyx_n_s_alias_to,&__pyx_n_s_format,0}; values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_k__7); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typeoid)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 722, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typename)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 722, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 0, 5, 6, 1); __PYX_ERR(3, 722, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typeschema)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 722, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 0, 5, 6, 2); __PYX_ERR(3, 722, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typekind)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 722, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 0, 5, 6, 3); __PYX_ERR(3, 722, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alias_to)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 722, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 0, 5, 6, 4); __PYX_ERR(3, 722, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 722, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_builtin_type_codec") < 0)) __PYX_ERR(3, 722, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_typeoid = values[0]; __pyx_v_typename = values[1]; __pyx_v_typeschema = values[2]; __pyx_v_typekind = values[3]; __pyx_v_alias_to = values[4]; __pyx_v_format = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 0, 5, 6, __pyx_nargs); __PYX_ERR(3, 722, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.set_builtin_type_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_10set_builtin_type_codec(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self), __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_alias_to, __pyx_v_format); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_10set_builtin_type_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typekind, PyObject *__pyx_v_alias_to, PyObject *__pyx_v_format) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_builtin_type_codec", 1); /* "asyncpg/protocol/codecs/base.pyx":724 * def set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, * alias_to, format=PG_FORMAT_ANY): * self._set_builtin_type_codec(typeoid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * alias_to, format) * self.clear_type_cache() */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_builtin_type_codec_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/codecs/base.pyx":725 * alias_to, format=PG_FORMAT_ANY): * self._set_builtin_type_codec(typeoid, typename, typeschema, typekind, * alias_to, format) # <<<<<<<<<<<<<< * self.clear_type_cache() * */ __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_3, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_alias_to, __pyx_v_format}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 6+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":726 * self._set_builtin_type_codec(typeoid, typename, typeschema, typekind, * alias_to, format) * self.clear_type_cache() # <<<<<<<<<<<<<< * * def clear_type_cache(self): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear_type_cache); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":722 * f'there is no {codec_str} codec for {alias_to}') * * def set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * alias_to, format=PG_FORMAT_ANY): * self._set_builtin_type_codec(typeoid, typename, typeschema, typekind, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.set_builtin_type_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":728 * self.clear_type_cache() * * def clear_type_cache(self): # <<<<<<<<<<<<<< * self._derived_type_codecs.clear() * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_13clear_type_cache(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_13clear_type_cache = {"clear_type_cache", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_13clear_type_cache, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_13clear_type_cache(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clear_type_cache (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("clear_type_cache", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clear_type_cache", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_12clear_type_cache(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_12clear_type_cache(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clear_type_cache", 1); /* "asyncpg/protocol/codecs/base.pyx":729 * * def clear_type_cache(self): * self._derived_type_codecs.clear() # <<<<<<<<<<<<<< * * def declare_fallback_codec(self, uint32_t oid, str name, str schema): */ if (unlikely(__pyx_v_self->_derived_type_codecs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(3, 729, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_self->_derived_type_codecs); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 729, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":728 * self.clear_type_cache() * * def clear_type_cache(self): # <<<<<<<<<<<<<< * self._derived_type_codecs.clear() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.clear_type_cache", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":731 * self._derived_type_codecs.clear() * * def declare_fallback_codec(self, uint32_t oid, str name, str schema): # <<<<<<<<<<<<<< * cdef Codec codec * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_15declare_fallback_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_15declare_fallback_codec = {"declare_fallback_codec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_15declare_fallback_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_15declare_fallback_codec(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { uint32_t __pyx_v_oid; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_schema = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("declare_fallback_codec (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_oid,&__pyx_n_s_name,&__pyx_n_s_schema,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_oid)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 731, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 731, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("declare_fallback_codec", 1, 3, 3, 1); __PYX_ERR(3, 731, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_schema)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 731, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("declare_fallback_codec", 1, 3, 3, 2); __PYX_ERR(3, 731, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "declare_fallback_codec") < 0)) __PYX_ERR(3, 731, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_oid = __Pyx_PyInt_As_uint32_t(values[0]); if (unlikely((__pyx_v_oid == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(3, 731, __pyx_L3_error) __pyx_v_name = ((PyObject*)values[1]); __pyx_v_schema = ((PyObject*)values[2]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("declare_fallback_codec", 1, 3, 3, __pyx_nargs); __PYX_ERR(3, 731, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.declare_fallback_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(3, 731, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), (&PyUnicode_Type), 1, "schema", 1))) __PYX_ERR(3, 731, __pyx_L1_error) __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_14declare_fallback_codec(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self), __pyx_v_oid, __pyx_v_name, __pyx_v_schema); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_14declare_fallback_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; Py_UCS4 __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("declare_fallback_codec", 1); /* "asyncpg/protocol/codecs/base.pyx":734 * cdef Codec codec * * if oid <= MAXBUILTINOID: # <<<<<<<<<<<<<< * # This is a BKI type, for which asyncpg has no * # defined codec. This should only happen for newly */ __pyx_t_1 = (__pyx_v_oid <= 0x270F); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/codecs/base.pyx":740 * # asyncpg is lacking support. * # * raise exceptions.UnsupportedClientFeatureError( # <<<<<<<<<<<<<< * f'unhandled standard data type {name!r} (OID {oid})') * else: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UnsupportedClientFeatureError); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":741 * # * raise exceptions.UnsupportedClientFeatureError( * f'unhandled standard data type {name!r} (OID {oid})') # <<<<<<<<<<<<<< * else: * # This is a non-BKI type, and as such, has no */ __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_6 = 127; __Pyx_INCREF(__pyx_kp_u_unhandled_standard_data_type); __pyx_t_5 += 29; __Pyx_GIVEREF(__pyx_kp_u_unhandled_standard_data_type); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_unhandled_standard_data_type); __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_name), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6; __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7); __pyx_t_7 = 0; __Pyx_INCREF(__pyx_kp_u_OID); __pyx_t_5 += 6; __Pyx_GIVEREF(__pyx_kp_u_OID); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_OID); __pyx_t_7 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_6; __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_8); __pyx_t_8 = 0; __Pyx_INCREF(__pyx_kp_u__8); __pyx_t_5 += 1; __Pyx_GIVEREF(__pyx_kp_u__8); PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__8); __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_8}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(3, 740, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":734 * cdef Codec codec * * if oid <= MAXBUILTINOID: # <<<<<<<<<<<<<< * # This is a BKI type, for which asyncpg has no * # defined codec. This should only happen for newly */ } /* "asyncpg/protocol/codecs/base.pyx":749 * # using Connection.set_type_codec(). * # * self._set_builtin_type_codec(oid, name, schema, 'scalar', # <<<<<<<<<<<<<< * TEXTOID, PG_FORMAT_TEXT) * */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_builtin_type_codec_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* "asyncpg/protocol/codecs/base.pyx":750 * # * self._set_builtin_type_codec(oid, name, schema, 'scalar', * TEXTOID, PG_FORMAT_TEXT) # <<<<<<<<<<<<<< * * codec = self.get_codec(oid, PG_FORMAT_TEXT) */ __pyx_t_3 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_7, __pyx_t_8, __pyx_v_name, __pyx_v_schema, __pyx_n_u_scalar, __pyx_int_25, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 6+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":752 * TEXTOID, PG_FORMAT_TEXT) * * codec = self.get_codec(oid, PG_FORMAT_TEXT) # <<<<<<<<<<<<<< * * return codec */ __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_v_oid, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2); __pyx_t_2 = 0; } /* "asyncpg/protocol/codecs/base.pyx":754 * codec = self.get_codec(oid, PG_FORMAT_TEXT) * * return codec # <<<<<<<<<<<<<< * * cdef inline Codec get_codec(self, uint32_t oid, ServerDataFormat format, */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_codec); __pyx_r = ((PyObject *)__pyx_v_codec); goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":731 * self._derived_type_codecs.clear() * * def declare_fallback_codec(self, uint32_t oid, str name, str schema): # <<<<<<<<<<<<<< * cdef Codec codec * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.declare_fallback_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":756 * return codec * * cdef inline Codec get_codec(self, uint32_t oid, ServerDataFormat format, # <<<<<<<<<<<<<< * bint ignore_custom_codec=False): * cdef Codec codec */ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, uint32_t __pyx_v_oid, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec *__pyx_optional_args) { /* "asyncpg/protocol/codecs/base.pyx":757 * * cdef inline Codec get_codec(self, uint32_t oid, ServerDataFormat format, * bint ignore_custom_codec=False): # <<<<<<<<<<<<<< * cdef Codec codec * */ int __pyx_v_ignore_custom_codec = ((int)0); struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; struct __pyx_opt_args_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_codec", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_ignore_custom_codec = __pyx_optional_args->ignore_custom_codec; } } /* "asyncpg/protocol/codecs/base.pyx":760 * cdef Codec codec * * if format == PG_FORMAT_ANY: # <<<<<<<<<<<<<< * codec = self.get_codec( * oid, PG_FORMAT_BINARY, ignore_custom_codec) */ __pyx_t_1 = (__pyx_v_format == __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":761 * * if format == PG_FORMAT_ANY: * codec = self.get_codec( # <<<<<<<<<<<<<< * oid, PG_FORMAT_BINARY, ignore_custom_codec) * if codec is None: */ __pyx_t_3.__pyx_n = 1; __pyx_t_3.ignore_custom_codec = __pyx_v_ignore_custom_codec; __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_v_oid, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":763 * codec = self.get_codec( * oid, PG_FORMAT_BINARY, ignore_custom_codec) * if codec is None: # <<<<<<<<<<<<<< * codec = self.get_codec( * oid, PG_FORMAT_TEXT, ignore_custom_codec) */ __pyx_t_1 = (((PyObject *)__pyx_v_codec) == Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":764 * oid, PG_FORMAT_BINARY, ignore_custom_codec) * if codec is None: * codec = self.get_codec( # <<<<<<<<<<<<<< * oid, PG_FORMAT_TEXT, ignore_custom_codec) * return codec */ __pyx_t_3.__pyx_n = 1; __pyx_t_3.ignore_custom_codec = __pyx_v_ignore_custom_codec; __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_v_oid, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2)); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":763 * codec = self.get_codec( * oid, PG_FORMAT_BINARY, ignore_custom_codec) * if codec is None: # <<<<<<<<<<<<<< * codec = self.get_codec( * oid, PG_FORMAT_TEXT, ignore_custom_codec) */ } /* "asyncpg/protocol/codecs/base.pyx":766 * codec = self.get_codec( * oid, PG_FORMAT_TEXT, ignore_custom_codec) * return codec # <<<<<<<<<<<<<< * else: * if not ignore_custom_codec: */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_codec); __pyx_r = __pyx_v_codec; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":760 * cdef Codec codec * * if format == PG_FORMAT_ANY: # <<<<<<<<<<<<<< * codec = self.get_codec( * oid, PG_FORMAT_BINARY, ignore_custom_codec) */ } /* "asyncpg/protocol/codecs/base.pyx":768 * return codec * else: * if not ignore_custom_codec: # <<<<<<<<<<<<<< * codec = self.get_custom_codec(oid, PG_FORMAT_ANY) * if codec is not None: */ /*else*/ { __pyx_t_1 = (!__pyx_v_ignore_custom_codec); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":769 * else: * if not ignore_custom_codec: * codec = self.get_custom_codec(oid, PG_FORMAT_ANY) # <<<<<<<<<<<<<< * if codec is not None: * if codec.format != format: */ __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_custom_codec(__pyx_v_self, __pyx_v_oid, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":770 * if not ignore_custom_codec: * codec = self.get_custom_codec(oid, PG_FORMAT_ANY) * if codec is not None: # <<<<<<<<<<<<<< * if codec.format != format: * # The codec for this OID has been overridden by */ __pyx_t_1 = (((PyObject *)__pyx_v_codec) != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":771 * codec = self.get_custom_codec(oid, PG_FORMAT_ANY) * if codec is not None: * if codec.format != format: # <<<<<<<<<<<<<< * # The codec for this OID has been overridden by * # set_{builtin}_type_codec with a different format. */ __pyx_t_1 = (__pyx_v_codec->format != __pyx_v_format); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":775 * # set_{builtin}_type_codec with a different format. * # We must respect that and not return a core codec. * return None # <<<<<<<<<<<<<< * else: * return codec */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None); __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":771 * codec = self.get_custom_codec(oid, PG_FORMAT_ANY) * if codec is not None: * if codec.format != format: # <<<<<<<<<<<<<< * # The codec for this OID has been overridden by * # set_{builtin}_type_codec with a different format. */ } /* "asyncpg/protocol/codecs/base.pyx":777 * return None * else: * return codec # <<<<<<<<<<<<<< * * codec = get_core_codec(oid, format) */ /*else*/ { __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_codec); __pyx_r = __pyx_v_codec; goto __pyx_L0; } /* "asyncpg/protocol/codecs/base.pyx":770 * if not ignore_custom_codec: * codec = self.get_custom_codec(oid, PG_FORMAT_ANY) * if codec is not None: # <<<<<<<<<<<<<< * if codec.format != format: * # The codec for this OID has been overridden by */ } /* "asyncpg/protocol/codecs/base.pyx":768 * return codec * else: * if not ignore_custom_codec: # <<<<<<<<<<<<<< * codec = self.get_custom_codec(oid, PG_FORMAT_ANY) * if codec is not None: */ } /* "asyncpg/protocol/codecs/base.pyx":779 * return codec * * codec = get_core_codec(oid, format) # <<<<<<<<<<<<<< * if codec is not None: * return codec */ __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_get_core_codec(__pyx_v_oid, __pyx_v_format, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2)); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":780 * * codec = get_core_codec(oid, format) * if codec is not None: # <<<<<<<<<<<<<< * return codec * else: */ __pyx_t_1 = (((PyObject *)__pyx_v_codec) != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":781 * codec = get_core_codec(oid, format) * if codec is not None: * return codec # <<<<<<<<<<<<<< * else: * try: */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_codec); __pyx_r = __pyx_v_codec; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":780 * * codec = get_core_codec(oid, format) * if codec is not None: # <<<<<<<<<<<<<< * return codec * else: */ } /* "asyncpg/protocol/codecs/base.pyx":783 * return codec * else: * try: # <<<<<<<<<<<<<< * return self._derived_type_codecs[oid, format] * except KeyError: */ /*else*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { /* "asyncpg/protocol/codecs/base.pyx":784 * else: * try: * return self._derived_type_codecs[oid, format] # <<<<<<<<<<<<<< * except KeyError: * return None */ __Pyx_XDECREF((PyObject *)__pyx_r); if (unlikely(__pyx_v_self->_derived_type_codecs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(3, 784, __pyx_L9_error) } __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 784, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 784, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 784, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(3, 784, __pyx_L9_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(3, 784, __pyx_L9_error); __pyx_t_2 = 0; __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_self->_derived_type_codecs, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 784, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(3, 784, __pyx_L9_error) __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L13_try_return; /* "asyncpg/protocol/codecs/base.pyx":783 * return codec * else: * try: # <<<<<<<<<<<<<< * return self._derived_type_codecs[oid, format] * except KeyError: */ } __pyx_L9_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/codecs/base.pyx":785 * try: * return self._derived_type_codecs[oid, format] * except KeyError: # <<<<<<<<<<<<<< * return None * */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_9) { __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.get_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_2) < 0) __PYX_ERR(3, 785, __pyx_L11_except_error) __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_2); /* "asyncpg/protocol/codecs/base.pyx":786 * return self._derived_type_codecs[oid, format] * except KeyError: * return None # <<<<<<<<<<<<<< * * cdef inline Codec get_custom_codec( */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None); __Pyx_INCREF(Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L12_except_return; } goto __pyx_L11_except_error; /* "asyncpg/protocol/codecs/base.pyx":783 * return codec * else: * try: # <<<<<<<<<<<<<< * return self._derived_type_codecs[oid, format] * except KeyError: */ __pyx_L11_except_error:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L1_error; __pyx_L13_try_return:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L0; __pyx_L12_except_return:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L0; } } } /* "asyncpg/protocol/codecs/base.pyx":756 * return codec * * cdef inline Codec get_codec(self, uint32_t oid, ServerDataFormat format, # <<<<<<<<<<<<<< * bint ignore_custom_codec=False): * cdef Codec codec */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.get_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":788 * return None * * cdef inline Codec get_custom_codec( # <<<<<<<<<<<<<< * self, * uint32_t oid, */ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_custom_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, uint32_t __pyx_v_oid, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_custom_codec", 1); /* "asyncpg/protocol/codecs/base.pyx":795 * cdef Codec codec * * if format == PG_FORMAT_ANY: # <<<<<<<<<<<<<< * codec = self.get_custom_codec(oid, PG_FORMAT_BINARY) * if codec is None: */ __pyx_t_1 = (__pyx_v_format == __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":796 * * if format == PG_FORMAT_ANY: * codec = self.get_custom_codec(oid, PG_FORMAT_BINARY) # <<<<<<<<<<<<<< * if codec is None: * codec = self.get_custom_codec(oid, PG_FORMAT_TEXT) */ __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_custom_codec(__pyx_v_self, __pyx_v_oid, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":797 * if format == PG_FORMAT_ANY: * codec = self.get_custom_codec(oid, PG_FORMAT_BINARY) * if codec is None: # <<<<<<<<<<<<<< * codec = self.get_custom_codec(oid, PG_FORMAT_TEXT) * else: */ __pyx_t_1 = (((PyObject *)__pyx_v_codec) == Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":798 * codec = self.get_custom_codec(oid, PG_FORMAT_BINARY) * if codec is None: * codec = self.get_custom_codec(oid, PG_FORMAT_TEXT) # <<<<<<<<<<<<<< * else: * codec = self._custom_type_codecs.get((oid, format)) */ __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_custom_codec(__pyx_v_self, __pyx_v_oid, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2)); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":797 * if format == PG_FORMAT_ANY: * codec = self.get_custom_codec(oid, PG_FORMAT_BINARY) * if codec is None: # <<<<<<<<<<<<<< * codec = self.get_custom_codec(oid, PG_FORMAT_TEXT) * else: */ } /* "asyncpg/protocol/codecs/base.pyx":795 * cdef Codec codec * * if format == PG_FORMAT_ANY: # <<<<<<<<<<<<<< * codec = self.get_custom_codec(oid, PG_FORMAT_BINARY) * if codec is None: */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/base.pyx":800 * codec = self.get_custom_codec(oid, PG_FORMAT_TEXT) * else: * codec = self._custom_type_codecs.get((oid, format)) # <<<<<<<<<<<<<< * * return codec */ /*else*/ { if (unlikely(__pyx_v_self->_custom_type_codecs == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(3, 800, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(3, 800, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(3, 800, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_custom_type_codecs, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(3, 800, __pyx_L1_error) __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; /* "asyncpg/protocol/codecs/base.pyx":802 * codec = self._custom_type_codecs.get((oid, format)) * * return codec # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_codec); __pyx_r = __pyx_v_codec; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":788 * return None * * cdef inline Codec get_custom_codec( # <<<<<<<<<<<<<< * self, * uint32_t oid, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.get_custom_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_17__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_17__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_17__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_16__reduce_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_16__reduce_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = (self._custom_type_codecs, self._derived_type_codecs) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->_custom_type_codecs); __Pyx_GIVEREF(__pyx_v_self->_custom_type_codecs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->_custom_type_codecs)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->_derived_type_codecs); __Pyx_GIVEREF(__pyx_v_self->_derived_type_codecs); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->_derived_type_codecs)) __PYX_ERR(2, 5, __pyx_L1_error); __pyx_v_state = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":6 * cdef bint use_setstate * state = (self._custom_type_codecs, self._derived_type_codecs) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__dict = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":7 * state = (self._custom_type_codecs, self._derived_type_codecs) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_2 = (__pyx_v__dict != Py_None); if (__pyx_t_2) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(2, 8, __pyx_L1_error); __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = self._custom_type_codecs is not None or self._derived_type_codecs is not None */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = (self._custom_type_codecs, self._derived_type_codecs) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = self._custom_type_codecs is not None or self._derived_type_codecs is not None # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, None), state */ /*else*/ { __pyx_t_4 = (__pyx_v_self->_custom_type_codecs != ((PyObject*)Py_None)); if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__pyx_v_self->_derived_type_codecs != ((PyObject*)Py_None)); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; __pyx_v_use_setstate = __pyx_t_2; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = self._custom_type_codecs is not None or self._derived_type_codecs is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, None), state * else: */ if (__pyx_v_use_setstate) { /* "(tree fragment)":13 * use_setstate = self._custom_type_codecs is not None or self._derived_type_codecs is not None * if use_setstate: * return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_DataCodecConfig); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_int_228230485); __Pyx_GIVEREF(__pyx_int_228230485); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_228230485)) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(2, 13, __pyx_L1_error); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state)) __PYX_ERR(2, 13, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = self._custom_type_codecs is not None or self._derived_type_codecs is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, None), state * else: * return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_DataCodecConfig__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_DataCodecConfig); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_int_228230485); __Pyx_GIVEREF(__pyx_int_228230485); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_228230485)) __PYX_ERR(2, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(2, 15, __pyx_L1_error); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_DataCodecConfig__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_19__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_19__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_19__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 16, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 16, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 16, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_18__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_18__setstate_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":17 * return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_DataCodecConfig__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 17, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_DataCodecConfig__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_DataCodecConfig__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":805 * * * cdef inline Codec get_core_codec( # <<<<<<<<<<<<<< * uint32_t oid, ServerDataFormat format, * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): */ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_get_core_codec(uint32_t __pyx_v_oid, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_core_codec *__pyx_optional_args) { enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_v_xformat = __pyx_k__9; void *__pyx_v_ptr; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("get_core_codec", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_xformat = __pyx_optional_args->xformat; } } /* "asyncpg/protocol/codecs/base.pyx":809 * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): * cdef: * void *ptr = NULL # <<<<<<<<<<<<<< * * if oid > MAXSUPPORTEDOID: */ __pyx_v_ptr = NULL; /* "asyncpg/protocol/codecs/base.pyx":811 * void *ptr = NULL * * if oid > MAXSUPPORTEDOID: # <<<<<<<<<<<<<< * return None * if format == PG_FORMAT_BINARY: */ __pyx_t_1 = (__pyx_v_oid > 0x13D8); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":812 * * if oid > MAXSUPPORTEDOID: * return None # <<<<<<<<<<<<<< * if format == PG_FORMAT_BINARY: * ptr = binary_codec_map[oid * xformat] */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None); __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":811 * void *ptr = NULL * * if oid > MAXSUPPORTEDOID: # <<<<<<<<<<<<<< * return None * if format == PG_FORMAT_BINARY: */ } /* "asyncpg/protocol/codecs/base.pyx":813 * if oid > MAXSUPPORTEDOID: * return None * if format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * ptr = binary_codec_map[oid * xformat] * elif format == PG_FORMAT_TEXT: */ switch (__pyx_v_format) { case __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY: /* "asyncpg/protocol/codecs/base.pyx":814 * return None * if format == PG_FORMAT_BINARY: * ptr = binary_codec_map[oid * xformat] # <<<<<<<<<<<<<< * elif format == PG_FORMAT_TEXT: * ptr = text_codec_map[oid * xformat] */ __pyx_v_ptr = (__pyx_v_7asyncpg_8protocol_8protocol_binary_codec_map[(__pyx_v_oid * __pyx_v_xformat)]); /* "asyncpg/protocol/codecs/base.pyx":813 * if oid > MAXSUPPORTEDOID: * return None * if format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * ptr = binary_codec_map[oid * xformat] * elif format == PG_FORMAT_TEXT: */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT: /* "asyncpg/protocol/codecs/base.pyx":816 * ptr = binary_codec_map[oid * xformat] * elif format == PG_FORMAT_TEXT: * ptr = text_codec_map[oid * xformat] # <<<<<<<<<<<<<< * * if ptr is NULL: */ __pyx_v_ptr = (__pyx_v_7asyncpg_8protocol_8protocol_text_codec_map[(__pyx_v_oid * __pyx_v_xformat)]); /* "asyncpg/protocol/codecs/base.pyx":815 * if format == PG_FORMAT_BINARY: * ptr = binary_codec_map[oid * xformat] * elif format == PG_FORMAT_TEXT: # <<<<<<<<<<<<<< * ptr = text_codec_map[oid * xformat] * */ break; default: break; } /* "asyncpg/protocol/codecs/base.pyx":818 * ptr = text_codec_map[oid * xformat] * * if ptr is NULL: # <<<<<<<<<<<<<< * return None * else: */ __pyx_t_1 = (__pyx_v_ptr == NULL); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":819 * * if ptr is NULL: * return None # <<<<<<<<<<<<<< * else: * return ptr */ __Pyx_XDECREF((PyObject *)__pyx_r); __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None); __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":818 * ptr = text_codec_map[oid * xformat] * * if ptr is NULL: # <<<<<<<<<<<<<< * return None * else: */ } /* "asyncpg/protocol/codecs/base.pyx":821 * return None * else: * return ptr # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_v_ptr)); __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_v_ptr); goto __pyx_L0; } /* "asyncpg/protocol/codecs/base.pyx":805 * * * cdef inline Codec get_core_codec( # <<<<<<<<<<<<<< * uint32_t oid, ServerDataFormat format, * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":824 * * * cdef inline Codec get_any_core_codec( # <<<<<<<<<<<<<< * uint32_t oid, ServerDataFormat format, * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): */ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_get_any_core_codec(uint32_t __pyx_v_oid, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_any_core_codec *__pyx_optional_args) { enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_v_xformat = __pyx_k__10; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_core_codec __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_any_core_codec", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_xformat = __pyx_optional_args->xformat; } } /* "asyncpg/protocol/codecs/base.pyx":831 * Codec codec * * if format == PG_FORMAT_ANY: # <<<<<<<<<<<<<< * codec = get_core_codec(oid, PG_FORMAT_BINARY, xformat) * if codec is None: */ __pyx_t_1 = (__pyx_v_format == __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":832 * * if format == PG_FORMAT_ANY: * codec = get_core_codec(oid, PG_FORMAT_BINARY, xformat) # <<<<<<<<<<<<<< * if codec is None: * codec = get_core_codec(oid, PG_FORMAT_TEXT, xformat) */ __pyx_t_3.__pyx_n = 1; __pyx_t_3.xformat = __pyx_v_xformat; __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_get_core_codec(__pyx_v_oid, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":833 * if format == PG_FORMAT_ANY: * codec = get_core_codec(oid, PG_FORMAT_BINARY, xformat) * if codec is None: # <<<<<<<<<<<<<< * codec = get_core_codec(oid, PG_FORMAT_TEXT, xformat) * else: */ __pyx_t_1 = (((PyObject *)__pyx_v_codec) == Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/base.pyx":834 * codec = get_core_codec(oid, PG_FORMAT_BINARY, xformat) * if codec is None: * codec = get_core_codec(oid, PG_FORMAT_TEXT, xformat) # <<<<<<<<<<<<<< * else: * codec = get_core_codec(oid, format, xformat) */ __pyx_t_3.__pyx_n = 1; __pyx_t_3.xformat = __pyx_v_xformat; __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_get_core_codec(__pyx_v_oid, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2)); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":833 * if format == PG_FORMAT_ANY: * codec = get_core_codec(oid, PG_FORMAT_BINARY, xformat) * if codec is None: # <<<<<<<<<<<<<< * codec = get_core_codec(oid, PG_FORMAT_TEXT, xformat) * else: */ } /* "asyncpg/protocol/codecs/base.pyx":831 * Codec codec * * if format == PG_FORMAT_ANY: # <<<<<<<<<<<<<< * codec = get_core_codec(oid, PG_FORMAT_BINARY, xformat) * if codec is None: */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/base.pyx":836 * codec = get_core_codec(oid, PG_FORMAT_TEXT, xformat) * else: * codec = get_core_codec(oid, format, xformat) # <<<<<<<<<<<<<< * * return codec */ /*else*/ { __pyx_t_3.__pyx_n = 1; __pyx_t_3.xformat = __pyx_v_xformat; __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_get_core_codec(__pyx_v_oid, __pyx_v_format, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2); __pyx_t_2 = 0; } __pyx_L3:; /* "asyncpg/protocol/codecs/base.pyx":838 * codec = get_core_codec(oid, format, xformat) * * return codec # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_codec); __pyx_r = __pyx_v_codec; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":824 * * * cdef inline Codec get_any_core_codec( # <<<<<<<<<<<<<< * uint32_t oid, ServerDataFormat format, * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.get_any_core_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":841 * * * cdef inline int has_core_codec(uint32_t oid): # <<<<<<<<<<<<<< * return binary_codec_map[oid] != NULL or text_codec_map[oid] != NULL * */ static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol_has_core_codec(uint32_t __pyx_v_oid) { int __pyx_r; int __pyx_t_1; int __pyx_t_2; /* "asyncpg/protocol/codecs/base.pyx":842 * * cdef inline int has_core_codec(uint32_t oid): * return binary_codec_map[oid] != NULL or text_codec_map[oid] != NULL # <<<<<<<<<<<<<< * * */ __pyx_t_2 = ((__pyx_v_7asyncpg_8protocol_8protocol_binary_codec_map[__pyx_v_oid]) != NULL); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L3_bool_binop_done; } __pyx_t_2 = ((__pyx_v_7asyncpg_8protocol_8protocol_text_codec_map[__pyx_v_oid]) != NULL); __pyx_t_1 = __pyx_t_2; __pyx_L3_bool_binop_done:; __pyx_r = __pyx_t_1; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":841 * * * cdef inline int has_core_codec(uint32_t oid): # <<<<<<<<<<<<<< * return binary_codec_map[oid] != NULL or text_codec_map[oid] != NULL * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":845 * * * cdef register_core_codec(uint32_t oid, # <<<<<<<<<<<<<< * encode_func encode, * decode_func decode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(uint32_t __pyx_v_oid, __pyx_t_7asyncpg_8protocol_8protocol_encode_func __pyx_v_encode, __pyx_t_7asyncpg_8protocol_8protocol_decode_func __pyx_v_decode, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_register_core_codec *__pyx_optional_args) { enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_v_xformat = __pyx_k__11; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_kind = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("register_core_codec", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_xformat = __pyx_optional_args->xformat; } } /* "asyncpg/protocol/codecs/base.pyx":851 * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): * * if oid > MAXSUPPORTEDOID: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * 'cannot register core codec for OID {}: it is greater ' */ __pyx_t_1 = (__pyx_v_oid > 0x13D8); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/codecs/base.pyx":852 * * if oid > MAXSUPPORTEDOID: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * 'cannot register core codec for OID {}: it is greater ' * 'than MAXSUPPORTEDOID ({})'.format(oid, MAXSUPPORTEDOID)) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":854 * raise exceptions.InternalClientError( * 'cannot register core codec for OID {}: it is greater ' * 'than MAXSUPPORTEDOID ({})'.format(oid, MAXSUPPORTEDOID)) # <<<<<<<<<<<<<< * * cdef: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_cannot_register_core_codec_for_O, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_int_5080}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(3, 852, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":851 * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): * * if oid > MAXSUPPORTEDOID: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * 'cannot register core codec for OID {}: it is greater ' */ } /* "asyncpg/protocol/codecs/base.pyx":861 * str kind * * name = BUILTIN_TYPE_OID_MAP[oid] # <<<<<<<<<<<<<< * kind = 'array' if oid in ARRAY_TYPES else 'scalar' * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BUILTIN_TYPE_OID_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_oid, uint32_t, 0, __Pyx_PyInt_From_uint32_t, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(3, 861, __pyx_L1_error) __pyx_v_name = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":862 * * name = BUILTIN_TYPE_OID_MAP[oid] * kind = 'array' if oid in ARRAY_TYPES else 'scalar' # <<<<<<<<<<<<<< * * codec = Codec(oid) */ __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_v_7asyncpg_8protocol_8protocol_ARRAY_TYPES, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(3, 862, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { __Pyx_INCREF(__pyx_n_u_array); __pyx_t_4 = __pyx_n_u_array; } else { __Pyx_INCREF(__pyx_n_u_scalar); __pyx_t_4 = __pyx_n_u_scalar; } __pyx_v_kind = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":864 * kind = 'array' if oid in ARRAY_TYPES else 'scalar' * * codec = Codec(oid) # <<<<<<<<<<<<<< * codec.init(name, 'pg_catalog', kind, CODEC_C, format, xformat, * encode, decode, None, None, None, None, None, None, None, 0) */ __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_Codec), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":865 * * codec = Codec(oid) * codec.init(name, 'pg_catalog', kind, CODEC_C, format, xformat, # <<<<<<<<<<<<<< * encode, decode, None, None, None, None, None, None, None, 0) * cpython.Py_INCREF(codec) # immortalize */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, __pyx_v_name, __pyx_n_u_pg_catalog, __pyx_v_kind, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_C, __pyx_v_format, __pyx_v_xformat, __pyx_v_encode, __pyx_v_decode, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None), Py_None, Py_None, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None), ((PyObject*)Py_None), Py_None, ((PyObject*)Py_None), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":867 * codec.init(name, 'pg_catalog', kind, CODEC_C, format, xformat, * encode, decode, None, None, None, None, None, None, None, 0) * cpython.Py_INCREF(codec) # immortalize # <<<<<<<<<<<<<< * * if format == PG_FORMAT_BINARY: */ Py_INCREF(((PyObject *)__pyx_v_codec)); /* "asyncpg/protocol/codecs/base.pyx":869 * cpython.Py_INCREF(codec) # immortalize * * if format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * binary_codec_map[oid * xformat] = codec * elif format == PG_FORMAT_TEXT: */ switch (__pyx_v_format) { case __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY: /* "asyncpg/protocol/codecs/base.pyx":870 * * if format == PG_FORMAT_BINARY: * binary_codec_map[oid * xformat] = codec # <<<<<<<<<<<<<< * elif format == PG_FORMAT_TEXT: * text_codec_map[oid * xformat] = codec */ (__pyx_v_7asyncpg_8protocol_8protocol_binary_codec_map[(__pyx_v_oid * __pyx_v_xformat)]) = ((void *)__pyx_v_codec); /* "asyncpg/protocol/codecs/base.pyx":869 * cpython.Py_INCREF(codec) # immortalize * * if format == PG_FORMAT_BINARY: # <<<<<<<<<<<<<< * binary_codec_map[oid * xformat] = codec * elif format == PG_FORMAT_TEXT: */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT: /* "asyncpg/protocol/codecs/base.pyx":872 * binary_codec_map[oid * xformat] = codec * elif format == PG_FORMAT_TEXT: * text_codec_map[oid * xformat] = codec # <<<<<<<<<<<<<< * else: * raise exceptions.InternalClientError( */ (__pyx_v_7asyncpg_8protocol_8protocol_text_codec_map[(__pyx_v_oid * __pyx_v_xformat)]) = ((void *)__pyx_v_codec); /* "asyncpg/protocol/codecs/base.pyx":871 * if format == PG_FORMAT_BINARY: * binary_codec_map[oid * xformat] = codec * elif format == PG_FORMAT_TEXT: # <<<<<<<<<<<<<< * text_codec_map[oid * xformat] = codec * else: */ break; default: /* "asyncpg/protocol/codecs/base.pyx":874 * text_codec_map[oid * xformat] = codec * else: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * 'invalid data format: {}'.format(format)) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/base.pyx":875 * else: * raise exceptions.InternalClientError( * 'invalid data format: {}'.format(format)) # <<<<<<<<<<<<<< * * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_data_format, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(3, 874, __pyx_L1_error) break; } /* "asyncpg/protocol/codecs/base.pyx":845 * * * cdef register_core_codec(uint32_t oid, # <<<<<<<<<<<<<< * encode_func encode, * decode_func decode, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("asyncpg.protocol.protocol.register_core_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_kind); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":878 * * * cdef register_extra_codec(str name, # <<<<<<<<<<<<<< * encode_func encode, * decode_func decode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_register_extra_codec(PyObject *__pyx_v_name, __pyx_t_7asyncpg_8protocol_8protocol_encode_func __pyx_v_encode, __pyx_t_7asyncpg_8protocol_8protocol_decode_func __pyx_v_decode, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; PyObject *__pyx_v_kind = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("register_extra_codec", 1); /* "asyncpg/protocol/codecs/base.pyx":886 * str kind * * kind = 'scalar' # <<<<<<<<<<<<<< * * codec = Codec(INVALIDOID) */ __Pyx_INCREF(__pyx_n_u_scalar); __pyx_v_kind = __pyx_n_u_scalar; /* "asyncpg/protocol/codecs/base.pyx":888 * kind = 'scalar' * * codec = Codec(INVALIDOID) # <<<<<<<<<<<<<< * codec.init(name, None, kind, CODEC_C, format, PG_XFORMAT_OBJECT, * encode, decode, None, None, None, None, None, None, None, 0) */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_Codec), __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":889 * * codec = Codec(INVALIDOID) * codec.init(name, None, kind, CODEC_C, format, PG_XFORMAT_OBJECT, # <<<<<<<<<<<<<< * encode, decode, None, None, None, None, None, None, None, 0) * EXTRA_CODECS[name, format] = codec */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, __pyx_v_name, ((PyObject*)Py_None), __pyx_v_kind, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_C, __pyx_v_format, __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT, __pyx_v_encode, __pyx_v_decode, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None), Py_None, Py_None, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None), ((PyObject*)Py_None), Py_None, ((PyObject*)Py_None), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/base.pyx":891 * codec.init(name, None, kind, CODEC_C, format, PG_XFORMAT_OBJECT, * encode, decode, None, None, None, None, None, None, None, 0) * EXTRA_CODECS[name, format] = codec # <<<<<<<<<<<<<< * * */ if (unlikely(__pyx_v_7asyncpg_8protocol_8protocol_EXTRA_CODECS == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(3, 891, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_name)) __PYX_ERR(3, 891, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(3, 891, __pyx_L1_error); __pyx_t_1 = 0; if (unlikely((PyDict_SetItem(__pyx_v_7asyncpg_8protocol_8protocol_EXTRA_CODECS, __pyx_t_2, ((PyObject *)__pyx_v_codec)) < 0))) __PYX_ERR(3, 891, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":878 * * * cdef register_extra_codec(str name, # <<<<<<<<<<<<<< * encode_func encode, * decode_func decode, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.register_extra_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XDECREF(__pyx_v_kind); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/base.pyx":894 * * * cdef inline Codec get_extra_codec(str name, ServerDataFormat format): # <<<<<<<<<<<<<< * return EXTRA_CODECS.get((name, format)) */ static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_get_extra_codec(PyObject *__pyx_v_name, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_extra_codec", 1); /* "asyncpg/protocol/codecs/base.pyx":895 * * cdef inline Codec get_extra_codec(str name, ServerDataFormat format): * return EXTRA_CODECS.get((name, format)) # <<<<<<<<<<<<<< */ __Pyx_XDECREF((PyObject *)__pyx_r); if (unlikely(__pyx_v_7asyncpg_8protocol_8protocol_EXTRA_CODECS == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(3, 895, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_name)) __PYX_ERR(3, 895, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(3, 895, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_7asyncpg_8protocol_8protocol_EXTRA_CODECS, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(3, 895, __pyx_L1_error) __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/base.pyx":894 * * * cdef inline Codec get_extra_codec(str name, ServerDataFormat format): # <<<<<<<<<<<<<< * return EXTRA_CODECS.get((name, format)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.get_extra_codec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/textutils.pyx":8 * * * cdef inline uint32_t _apg_tolower(uint32_t c): # <<<<<<<<<<<<<< * if c >= 'A' and c <= 'Z': * return c + 'a' - 'A' */ static CYTHON_INLINE uint32_t __pyx_f_7asyncpg_8protocol_8protocol__apg_tolower(uint32_t __pyx_v_c) { uint32_t __pyx_r; int __pyx_t_1; int __pyx_t_2; /* "asyncpg/protocol/codecs/textutils.pyx":9 * * cdef inline uint32_t _apg_tolower(uint32_t c): * if c >= 'A' and c <= 'Z': # <<<<<<<<<<<<<< * return c + 'a' - 'A' * else: */ __pyx_t_2 = (__pyx_v_c >= ((uint32_t)((Py_UCS4)65))); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_c <= ((uint32_t)((Py_UCS4)90))); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/protocol/codecs/textutils.pyx":10 * cdef inline uint32_t _apg_tolower(uint32_t c): * if c >= 'A' and c <= 'Z': * return c + 'a' - 'A' # <<<<<<<<<<<<<< * else: * return c */ __pyx_r = ((__pyx_v_c + ((uint32_t)((Py_UCS4)97))) - ((uint32_t)((Py_UCS4)65))); goto __pyx_L0; /* "asyncpg/protocol/codecs/textutils.pyx":9 * * cdef inline uint32_t _apg_tolower(uint32_t c): * if c >= 'A' and c <= 'Z': # <<<<<<<<<<<<<< * return c + 'a' - 'A' * else: */ } /* "asyncpg/protocol/codecs/textutils.pyx":12 * return c + 'a' - 'A' * else: * return c # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_r = __pyx_v_c; goto __pyx_L0; } /* "asyncpg/protocol/codecs/textutils.pyx":8 * * * cdef inline uint32_t _apg_tolower(uint32_t c): # <<<<<<<<<<<<<< * if c >= 'A' and c <= 'Z': * return c + 'a' - 'A' */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "asyncpg/protocol/codecs/textutils.pyx":15 * * * cdef int apg_strcasecmp(const Py_UCS4 *s1, const Py_UCS4 *s2): # <<<<<<<<<<<<<< * cdef: * uint32_t c1 */ static int __pyx_f_7asyncpg_8protocol_8protocol_apg_strcasecmp(Py_UCS4 const *__pyx_v_s1, Py_UCS4 const *__pyx_v_s2) { uint32_t __pyx_v_c1; uint32_t __pyx_v_c2; int __pyx_v_i; int __pyx_r; int __pyx_t_1; uint32_t __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "asyncpg/protocol/codecs/textutils.pyx":19 * uint32_t c1 * uint32_t c2 * int i = 0 # <<<<<<<<<<<<<< * * while True: */ __pyx_v_i = 0; /* "asyncpg/protocol/codecs/textutils.pyx":21 * int i = 0 * * while True: # <<<<<<<<<<<<<< * c1 = s1[i] * c2 = s2[i] */ while (1) { /* "asyncpg/protocol/codecs/textutils.pyx":22 * * while True: * c1 = s1[i] # <<<<<<<<<<<<<< * c2 = s2[i] * */ __pyx_v_c1 = (__pyx_v_s1[__pyx_v_i]); /* "asyncpg/protocol/codecs/textutils.pyx":23 * while True: * c1 = s1[i] * c2 = s2[i] # <<<<<<<<<<<<<< * * if c1 != c2: */ __pyx_v_c2 = (__pyx_v_s2[__pyx_v_i]); /* "asyncpg/protocol/codecs/textutils.pyx":25 * c2 = s2[i] * * if c1 != c2: # <<<<<<<<<<<<<< * c1 = _apg_tolower(c1) * c2 = _apg_tolower(c2) */ __pyx_t_1 = (__pyx_v_c1 != __pyx_v_c2); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/textutils.pyx":26 * * if c1 != c2: * c1 = _apg_tolower(c1) # <<<<<<<<<<<<<< * c2 = _apg_tolower(c2) * if c1 != c2: */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__apg_tolower(__pyx_v_c1); if (unlikely(__pyx_t_2 == ((uint32_t)-1) && PyErr_Occurred())) __PYX_ERR(12, 26, __pyx_L1_error) __pyx_v_c1 = __pyx_t_2; /* "asyncpg/protocol/codecs/textutils.pyx":27 * if c1 != c2: * c1 = _apg_tolower(c1) * c2 = _apg_tolower(c2) # <<<<<<<<<<<<<< * if c1 != c2: * return c1 - c2 */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__apg_tolower(__pyx_v_c2); if (unlikely(__pyx_t_2 == ((uint32_t)-1) && PyErr_Occurred())) __PYX_ERR(12, 27, __pyx_L1_error) __pyx_v_c2 = __pyx_t_2; /* "asyncpg/protocol/codecs/textutils.pyx":28 * c1 = _apg_tolower(c1) * c2 = _apg_tolower(c2) * if c1 != c2: # <<<<<<<<<<<<<< * return c1 - c2 * */ __pyx_t_1 = (__pyx_v_c1 != __pyx_v_c2); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/textutils.pyx":29 * c2 = _apg_tolower(c2) * if c1 != c2: * return c1 - c2 # <<<<<<<<<<<<<< * * if c1 == 0 or c2 == 0: */ __pyx_r = (((int32_t)__pyx_v_c1) - ((int32_t)__pyx_v_c2)); goto __pyx_L0; /* "asyncpg/protocol/codecs/textutils.pyx":28 * c1 = _apg_tolower(c1) * c2 = _apg_tolower(c2) * if c1 != c2: # <<<<<<<<<<<<<< * return c1 - c2 * */ } /* "asyncpg/protocol/codecs/textutils.pyx":25 * c2 = s2[i] * * if c1 != c2: # <<<<<<<<<<<<<< * c1 = _apg_tolower(c1) * c2 = _apg_tolower(c2) */ } /* "asyncpg/protocol/codecs/textutils.pyx":31 * return c1 - c2 * * if c1 == 0 or c2 == 0: # <<<<<<<<<<<<<< * break * */ __pyx_t_3 = (__pyx_v_c1 == 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L8_bool_binop_done; } __pyx_t_3 = (__pyx_v_c2 == 0); __pyx_t_1 = __pyx_t_3; __pyx_L8_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/protocol/codecs/textutils.pyx":32 * * if c1 == 0 or c2 == 0: * break # <<<<<<<<<<<<<< * * i += 1 */ goto __pyx_L4_break; /* "asyncpg/protocol/codecs/textutils.pyx":31 * return c1 - c2 * * if c1 == 0 or c2 == 0: # <<<<<<<<<<<<<< * break * */ } /* "asyncpg/protocol/codecs/textutils.pyx":34 * break * * i += 1 # <<<<<<<<<<<<<< * * return 0 */ __pyx_v_i = (__pyx_v_i + 1); } __pyx_L4_break:; /* "asyncpg/protocol/codecs/textutils.pyx":36 * i += 1 * * return 0 # <<<<<<<<<<<<<< * * */ __pyx_r = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/textutils.pyx":15 * * * cdef int apg_strcasecmp(const Py_UCS4 *s1, const Py_UCS4 *s2): # <<<<<<<<<<<<<< * cdef: * uint32_t c1 */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.apg_strcasecmp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "asyncpg/protocol/codecs/textutils.pyx":39 * * * cdef int apg_strcasecmp_char(const char *s1, const char *s2): # <<<<<<<<<<<<<< * cdef: * uint8_t c1 */ static int __pyx_f_7asyncpg_8protocol_8protocol_apg_strcasecmp_char(char const *__pyx_v_s1, char const *__pyx_v_s2) { uint8_t __pyx_v_c1; uint8_t __pyx_v_c2; int __pyx_v_i; int __pyx_r; int __pyx_t_1; uint32_t __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "asyncpg/protocol/codecs/textutils.pyx":43 * uint8_t c1 * uint8_t c2 * int i = 0 # <<<<<<<<<<<<<< * * while True: */ __pyx_v_i = 0; /* "asyncpg/protocol/codecs/textutils.pyx":45 * int i = 0 * * while True: # <<<<<<<<<<<<<< * c1 = s1[i] * c2 = s2[i] */ while (1) { /* "asyncpg/protocol/codecs/textutils.pyx":46 * * while True: * c1 = s1[i] # <<<<<<<<<<<<<< * c2 = s2[i] * */ __pyx_v_c1 = ((uint8_t)(__pyx_v_s1[__pyx_v_i])); /* "asyncpg/protocol/codecs/textutils.pyx":47 * while True: * c1 = s1[i] * c2 = s2[i] # <<<<<<<<<<<<<< * * if c1 != c2: */ __pyx_v_c2 = ((uint8_t)(__pyx_v_s2[__pyx_v_i])); /* "asyncpg/protocol/codecs/textutils.pyx":49 * c2 = s2[i] * * if c1 != c2: # <<<<<<<<<<<<<< * c1 = _apg_tolower(c1) * c2 = _apg_tolower(c2) */ __pyx_t_1 = (__pyx_v_c1 != __pyx_v_c2); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/textutils.pyx":50 * * if c1 != c2: * c1 = _apg_tolower(c1) # <<<<<<<<<<<<<< * c2 = _apg_tolower(c2) * if c1 != c2: */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__apg_tolower(__pyx_v_c1); if (unlikely(__pyx_t_2 == ((uint32_t)-1) && PyErr_Occurred())) __PYX_ERR(12, 50, __pyx_L1_error) __pyx_v_c1 = ((uint8_t)__pyx_t_2); /* "asyncpg/protocol/codecs/textutils.pyx":51 * if c1 != c2: * c1 = _apg_tolower(c1) * c2 = _apg_tolower(c2) # <<<<<<<<<<<<<< * if c1 != c2: * return c1 - c2 */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__apg_tolower(__pyx_v_c2); if (unlikely(__pyx_t_2 == ((uint32_t)-1) && PyErr_Occurred())) __PYX_ERR(12, 51, __pyx_L1_error) __pyx_v_c2 = ((uint8_t)__pyx_t_2); /* "asyncpg/protocol/codecs/textutils.pyx":52 * c1 = _apg_tolower(c1) * c2 = _apg_tolower(c2) * if c1 != c2: # <<<<<<<<<<<<<< * return c1 - c2 * */ __pyx_t_1 = (__pyx_v_c1 != __pyx_v_c2); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/textutils.pyx":53 * c2 = _apg_tolower(c2) * if c1 != c2: * return c1 - c2 # <<<<<<<<<<<<<< * * if c1 == 0 or c2 == 0: */ __pyx_r = (((int8_t)__pyx_v_c1) - ((int8_t)__pyx_v_c2)); goto __pyx_L0; /* "asyncpg/protocol/codecs/textutils.pyx":52 * c1 = _apg_tolower(c1) * c2 = _apg_tolower(c2) * if c1 != c2: # <<<<<<<<<<<<<< * return c1 - c2 * */ } /* "asyncpg/protocol/codecs/textutils.pyx":49 * c2 = s2[i] * * if c1 != c2: # <<<<<<<<<<<<<< * c1 = _apg_tolower(c1) * c2 = _apg_tolower(c2) */ } /* "asyncpg/protocol/codecs/textutils.pyx":55 * return c1 - c2 * * if c1 == 0 or c2 == 0: # <<<<<<<<<<<<<< * break * */ __pyx_t_3 = (__pyx_v_c1 == 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L8_bool_binop_done; } __pyx_t_3 = (__pyx_v_c2 == 0); __pyx_t_1 = __pyx_t_3; __pyx_L8_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/protocol/codecs/textutils.pyx":56 * * if c1 == 0 or c2 == 0: * break # <<<<<<<<<<<<<< * * i += 1 */ goto __pyx_L4_break; /* "asyncpg/protocol/codecs/textutils.pyx":55 * return c1 - c2 * * if c1 == 0 or c2 == 0: # <<<<<<<<<<<<<< * break * */ } /* "asyncpg/protocol/codecs/textutils.pyx":58 * break * * i += 1 # <<<<<<<<<<<<<< * * return 0 */ __pyx_v_i = (__pyx_v_i + 1); } __pyx_L4_break:; /* "asyncpg/protocol/codecs/textutils.pyx":60 * i += 1 * * return 0 # <<<<<<<<<<<<<< * * */ __pyx_r = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/textutils.pyx":39 * * * cdef int apg_strcasecmp_char(const char *s1, const char *s2): # <<<<<<<<<<<<<< * cdef: * uint8_t c1 */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.apg_strcasecmp_char", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "asyncpg/protocol/codecs/textutils.pyx":63 * * * cdef inline bint apg_ascii_isspace(Py_UCS4 ch): # <<<<<<<<<<<<<< * return ( * ch == ' ' or */ static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace(Py_UCS4 __pyx_v_ch) { int __pyx_r; int __pyx_t_1; /* "asyncpg/protocol/codecs/textutils.pyx":65 * cdef inline bint apg_ascii_isspace(Py_UCS4 ch): * return ( * ch == ' ' or # <<<<<<<<<<<<<< * ch == '\n' or * ch == '\r' or */ switch (__pyx_v_ch) { case 32: case 10: /* "asyncpg/protocol/codecs/textutils.pyx":66 * return ( * ch == ' ' or * ch == '\n' or # <<<<<<<<<<<<<< * ch == '\r' or * ch == '\t' or */ case 13: /* "asyncpg/protocol/codecs/textutils.pyx":67 * ch == ' ' or * ch == '\n' or * ch == '\r' or # <<<<<<<<<<<<<< * ch == '\t' or * ch == '\v' or */ case 9: /* "asyncpg/protocol/codecs/textutils.pyx":68 * ch == '\n' or * ch == '\r' or * ch == '\t' or # <<<<<<<<<<<<<< * ch == '\v' or * ch == '\f' */ case 11: /* "asyncpg/protocol/codecs/textutils.pyx":69 * ch == '\r' or * ch == '\t' or * ch == '\v' or # <<<<<<<<<<<<<< * ch == '\f' * ) */ case 12: /* "asyncpg/protocol/codecs/textutils.pyx":65 * cdef inline bint apg_ascii_isspace(Py_UCS4 ch): * return ( * ch == ' ' or # <<<<<<<<<<<<<< * ch == '\n' or * ch == '\r' or */ __pyx_t_1 = 1; break; default: __pyx_t_1 = 0; break; } __pyx_r = __pyx_t_1; goto __pyx_L0; /* "asyncpg/protocol/codecs/textutils.pyx":63 * * * cdef inline bint apg_ascii_isspace(Py_UCS4 ch): # <<<<<<<<<<<<<< * return ( * ch == ' ' or */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "asyncpg/protocol/codecs/textutils.pyx":74 * * * cdef Py_UCS4 *apg_parse_int32(Py_UCS4 *buf, int32_t *num): # <<<<<<<<<<<<<< * cdef: * Py_UCS4 *p */ static Py_UCS4 *__pyx_f_7asyncpg_8protocol_8protocol_apg_parse_int32(Py_UCS4 *__pyx_v_buf, int32_t *__pyx_v_num) { Py_UCS4 *__pyx_v_p; int32_t __pyx_v_n; int32_t __pyx_v_neg; Py_UCS4 *__pyx_r; int __pyx_t_1; int __pyx_t_2; /* "asyncpg/protocol/codecs/textutils.pyx":77 * cdef: * Py_UCS4 *p * int32_t n = 0 # <<<<<<<<<<<<<< * int32_t neg = 0 * */ __pyx_v_n = 0; /* "asyncpg/protocol/codecs/textutils.pyx":78 * Py_UCS4 *p * int32_t n = 0 * int32_t neg = 0 # <<<<<<<<<<<<<< * * if buf[0] == '-': */ __pyx_v_neg = 0; /* "asyncpg/protocol/codecs/textutils.pyx":80 * int32_t neg = 0 * * if buf[0] == '-': # <<<<<<<<<<<<<< * neg = 1 * buf += 1 */ __pyx_t_1 = ((__pyx_v_buf[0]) == 45); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/textutils.pyx":81 * * if buf[0] == '-': * neg = 1 # <<<<<<<<<<<<<< * buf += 1 * elif buf[0] == '+': */ __pyx_v_neg = 1; /* "asyncpg/protocol/codecs/textutils.pyx":82 * if buf[0] == '-': * neg = 1 * buf += 1 # <<<<<<<<<<<<<< * elif buf[0] == '+': * buf += 1 */ __pyx_v_buf = (__pyx_v_buf + 1); /* "asyncpg/protocol/codecs/textutils.pyx":80 * int32_t neg = 0 * * if buf[0] == '-': # <<<<<<<<<<<<<< * neg = 1 * buf += 1 */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/textutils.pyx":83 * neg = 1 * buf += 1 * elif buf[0] == '+': # <<<<<<<<<<<<<< * buf += 1 * */ __pyx_t_1 = ((__pyx_v_buf[0]) == 43); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/textutils.pyx":84 * buf += 1 * elif buf[0] == '+': * buf += 1 # <<<<<<<<<<<<<< * * p = buf */ __pyx_v_buf = (__pyx_v_buf + 1); /* "asyncpg/protocol/codecs/textutils.pyx":83 * neg = 1 * buf += 1 * elif buf[0] == '+': # <<<<<<<<<<<<<< * buf += 1 * */ } __pyx_L3:; /* "asyncpg/protocol/codecs/textutils.pyx":86 * buf += 1 * * p = buf # <<<<<<<<<<<<<< * while p[0] >= '0' and p[0] <= '9': * n = 10 * n - (p[0] - '0') */ __pyx_v_p = __pyx_v_buf; /* "asyncpg/protocol/codecs/textutils.pyx":87 * * p = buf * while p[0] >= '0' and p[0] <= '9': # <<<<<<<<<<<<<< * n = 10 * n - (p[0] - '0') * p += 1 */ while (1) { __pyx_t_2 = (((int)(__pyx_v_p[0])) >= ((int)((Py_UCS4)48))); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = (((int)(__pyx_v_p[0])) <= ((int)((Py_UCS4)57))); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (!__pyx_t_1) break; /* "asyncpg/protocol/codecs/textutils.pyx":88 * p = buf * while p[0] >= '0' and p[0] <= '9': * n = 10 * n - (p[0] - '0') # <<<<<<<<<<<<<< * p += 1 * */ __pyx_v_n = ((10 * __pyx_v_n) - (((int)(__pyx_v_p[0])) - ((int32_t)((Py_UCS4)48)))); /* "asyncpg/protocol/codecs/textutils.pyx":89 * while p[0] >= '0' and p[0] <= '9': * n = 10 * n - (p[0] - '0') * p += 1 # <<<<<<<<<<<<<< * * if p == buf: */ __pyx_v_p = (__pyx_v_p + 1); } /* "asyncpg/protocol/codecs/textutils.pyx":91 * p += 1 * * if p == buf: # <<<<<<<<<<<<<< * return NULL * */ __pyx_t_1 = (__pyx_v_p == __pyx_v_buf); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/textutils.pyx":92 * * if p == buf: * return NULL # <<<<<<<<<<<<<< * * if not neg: */ __pyx_r = NULL; goto __pyx_L0; /* "asyncpg/protocol/codecs/textutils.pyx":91 * p += 1 * * if p == buf: # <<<<<<<<<<<<<< * return NULL * */ } /* "asyncpg/protocol/codecs/textutils.pyx":94 * return NULL * * if not neg: # <<<<<<<<<<<<<< * n = -n * */ __pyx_t_1 = (!(__pyx_v_neg != 0)); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/textutils.pyx":95 * * if not neg: * n = -n # <<<<<<<<<<<<<< * * num[0] = n */ __pyx_v_n = (-__pyx_v_n); /* "asyncpg/protocol/codecs/textutils.pyx":94 * return NULL * * if not neg: # <<<<<<<<<<<<<< * n = -n * */ } /* "asyncpg/protocol/codecs/textutils.pyx":97 * n = -n * * num[0] = n # <<<<<<<<<<<<<< * * return p */ (__pyx_v_num[0]) = __pyx_v_n; /* "asyncpg/protocol/codecs/textutils.pyx":99 * num[0] = n * * return p # <<<<<<<<<<<<<< */ __pyx_r = __pyx_v_p; goto __pyx_L0; /* "asyncpg/protocol/codecs/textutils.pyx":74 * * * cdef Py_UCS4 *apg_parse_int32(Py_UCS4 *buf, int32_t *num): # <<<<<<<<<<<<<< * cdef: * Py_UCS4 *p */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "asyncpg/protocol/codecs/pgproto.pyx":8 * * * cdef init_bits_codecs(): # <<<<<<<<<<<<<< * register_core_codec(BITOID, * pgproto.bits_encode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_bits_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init_bits_codecs", 1); /* "asyncpg/protocol/codecs/pgproto.pyx":9 * * cdef init_bits_codecs(): * register_core_codec(BITOID, # <<<<<<<<<<<<<< * pgproto.bits_encode, * pgproto.bits_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x618, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bits_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bits_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":14 * PG_FORMAT_BINARY) * * register_core_codec(VARBITOID, # <<<<<<<<<<<<<< * pgproto.bits_encode, * pgproto.bits_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x61A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bits_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bits_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":8 * * * cdef init_bits_codecs(): # <<<<<<<<<<<<<< * register_core_codec(BITOID, * pgproto.bits_encode, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.init_bits_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/pgproto.pyx":20 * * * cdef init_bytea_codecs(): # <<<<<<<<<<<<<< * register_core_codec(BYTEAOID, * pgproto.bytea_encode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_bytea_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init_bytea_codecs", 1); /* "asyncpg/protocol/codecs/pgproto.pyx":21 * * cdef init_bytea_codecs(): * register_core_codec(BYTEAOID, # <<<<<<<<<<<<<< * pgproto.bytea_encode, * pgproto.bytea_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(17, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":26 * PG_FORMAT_BINARY) * * register_core_codec(CHAROID, # <<<<<<<<<<<<<< * pgproto.bytea_encode, * pgproto.bytea_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(18, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":20 * * * cdef init_bytea_codecs(): # <<<<<<<<<<<<<< * register_core_codec(BYTEAOID, * pgproto.bytea_encode, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.init_bytea_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/pgproto.pyx":32 * * * cdef init_datetime_codecs(): # <<<<<<<<<<<<<< * register_core_codec(DATEOID, * pgproto.date_encode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_datetime_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_7asyncpg_8protocol_8protocol_register_core_codec __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init_datetime_codecs", 1); /* "asyncpg/protocol/codecs/pgproto.pyx":33 * * cdef init_datetime_codecs(): * register_core_codec(DATEOID, # <<<<<<<<<<<<<< * pgproto.date_encode, * pgproto.date_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x43A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_date_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_date_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":38 * PG_FORMAT_BINARY) * * register_core_codec(DATEOID, # <<<<<<<<<<<<<< * pgproto.date_encode_tuple, * pgproto.date_decode_tuple, */ __pyx_t_2.__pyx_n = 1; __pyx_t_2.xformat = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE; __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x43A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_date_encode_tuple), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_date_decode_tuple), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":44 * PG_XFORMAT_TUPLE) * * register_core_codec(TIMEOID, # <<<<<<<<<<<<<< * pgproto.time_encode, * pgproto.time_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x43B, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_time_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_time_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":49 * PG_FORMAT_BINARY) * * register_core_codec(TIMEOID, # <<<<<<<<<<<<<< * pgproto.time_encode_tuple, * pgproto.time_decode_tuple, */ __pyx_t_2.__pyx_n = 1; __pyx_t_2.xformat = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE; __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x43B, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_time_encode_tuple), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_time_decode_tuple), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":55 * PG_XFORMAT_TUPLE) * * register_core_codec(TIMETZOID, # <<<<<<<<<<<<<< * pgproto.timetz_encode, * pgproto.timetz_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x4F2, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":60 * PG_FORMAT_BINARY) * * register_core_codec(TIMETZOID, # <<<<<<<<<<<<<< * pgproto.timetz_encode_tuple, * pgproto.timetz_decode_tuple, */ __pyx_t_2.__pyx_n = 1; __pyx_t_2.xformat = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE; __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x4F2, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_encode_tuple), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_decode_tuple), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":66 * PG_XFORMAT_TUPLE) * * register_core_codec(TIMESTAMPOID, # <<<<<<<<<<<<<< * pgproto.timestamp_encode, * pgproto.timestamp_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x45A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":71 * PG_FORMAT_BINARY) * * register_core_codec(TIMESTAMPOID, # <<<<<<<<<<<<<< * pgproto.timestamp_encode_tuple, * pgproto.timestamp_decode_tuple, */ __pyx_t_2.__pyx_n = 1; __pyx_t_2.xformat = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE; __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x45A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_encode_tuple), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_decode_tuple), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":77 * PG_XFORMAT_TUPLE) * * register_core_codec(TIMESTAMPTZOID, # <<<<<<<<<<<<<< * pgproto.timestamptz_encode, * pgproto.timestamptz_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x4A0, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timestamptz_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timestamptz_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":82 * PG_FORMAT_BINARY) * * register_core_codec(TIMESTAMPTZOID, # <<<<<<<<<<<<<< * pgproto.timestamp_encode_tuple, * pgproto.timestamp_decode_tuple, */ __pyx_t_2.__pyx_n = 1; __pyx_t_2.xformat = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE; __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x4A0, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_encode_tuple), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_decode_tuple), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":88 * PG_XFORMAT_TUPLE) * * register_core_codec(INTERVALOID, # <<<<<<<<<<<<<< * pgproto.interval_encode, * pgproto.interval_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x4A2, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_interval_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_interval_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":93 * PG_FORMAT_BINARY) * * register_core_codec(INTERVALOID, # <<<<<<<<<<<<<< * pgproto.interval_encode_tuple, * pgproto.interval_decode_tuple, */ __pyx_t_2.__pyx_n = 1; __pyx_t_2.xformat = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE; __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x4A2, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_interval_encode_tuple), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_interval_decode_tuple), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":102 * # interpret the value, and simply return and pass it as text. * # * register_core_codec(ABSTIMEOID, # <<<<<<<<<<<<<< * pgproto.text_encode, * pgproto.text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x2BE, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":107 * PG_FORMAT_TEXT) * * register_core_codec(RELTIMEOID, # <<<<<<<<<<<<<< * pgproto.text_encode, * pgproto.text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x2BF, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":112 * PG_FORMAT_TEXT) * * register_core_codec(TINTERVALOID, # <<<<<<<<<<<<<< * pgproto.text_encode, * pgproto.text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x2C0, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":32 * * * cdef init_datetime_codecs(): # <<<<<<<<<<<<<< * register_core_codec(DATEOID, * pgproto.date_encode, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.init_datetime_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/pgproto.pyx":118 * * * cdef init_float_codecs(): # <<<<<<<<<<<<<< * register_core_codec(FLOAT4OID, * pgproto.float4_encode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_float_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init_float_codecs", 1); /* "asyncpg/protocol/codecs/pgproto.pyx":119 * * cdef init_float_codecs(): * register_core_codec(FLOAT4OID, # <<<<<<<<<<<<<< * pgproto.float4_encode, * pgproto.float4_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x2BC, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_float4_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_float4_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":124 * PG_FORMAT_BINARY) * * register_core_codec(FLOAT8OID, # <<<<<<<<<<<<<< * pgproto.float8_encode, * pgproto.float8_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x2BD, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_float8_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_float8_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":118 * * * cdef init_float_codecs(): # <<<<<<<<<<<<<< * register_core_codec(FLOAT4OID, * pgproto.float4_encode, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.init_float_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/pgproto.pyx":130 * * * cdef init_geometry_codecs(): # <<<<<<<<<<<<<< * register_core_codec(BOXOID, * pgproto.box_encode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_geometry_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init_geometry_codecs", 1); /* "asyncpg/protocol/codecs/pgproto.pyx":131 * * cdef init_geometry_codecs(): * register_core_codec(BOXOID, # <<<<<<<<<<<<<< * pgproto.box_encode, * pgproto.box_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x25B, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_box_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_box_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":136 * PG_FORMAT_BINARY) * * register_core_codec(LINEOID, # <<<<<<<<<<<<<< * pgproto.line_encode, * pgproto.line_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x274, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_line_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_line_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":141 * PG_FORMAT_BINARY) * * register_core_codec(LSEGOID, # <<<<<<<<<<<<<< * pgproto.lseg_encode, * pgproto.lseg_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x259, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_lseg_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_lseg_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":146 * PG_FORMAT_BINARY) * * register_core_codec(POINTOID, # <<<<<<<<<<<<<< * pgproto.point_encode, * pgproto.point_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x258, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_point_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_point_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":151 * PG_FORMAT_BINARY) * * register_core_codec(PATHOID, # <<<<<<<<<<<<<< * pgproto.path_encode, * pgproto.path_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x25A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_path_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_path_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":156 * PG_FORMAT_BINARY) * * register_core_codec(POLYGONOID, # <<<<<<<<<<<<<< * pgproto.poly_encode, * pgproto.poly_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x25C, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_poly_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_poly_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":161 * PG_FORMAT_BINARY) * * register_core_codec(CIRCLEOID, # <<<<<<<<<<<<<< * pgproto.circle_encode, * pgproto.circle_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x2CE, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_circle_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_circle_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":130 * * * cdef init_geometry_codecs(): # <<<<<<<<<<<<<< * register_core_codec(BOXOID, * pgproto.box_encode, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.init_geometry_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/pgproto.pyx":167 * * * cdef init_hstore_codecs(): # <<<<<<<<<<<<<< * register_extra_codec('pg_contrib.hstore', * pgproto.hstore_encode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_hstore_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init_hstore_codecs", 1); /* "asyncpg/protocol/codecs/pgproto.pyx":168 * * cdef init_hstore_codecs(): * register_extra_codec('pg_contrib.hstore', # <<<<<<<<<<<<<< * pgproto.hstore_encode, * pgproto.hstore_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_extra_codec(__pyx_kp_u_pg_contrib_hstore, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_hstore_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_hstore_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":167 * * * cdef init_hstore_codecs(): # <<<<<<<<<<<<<< * register_extra_codec('pg_contrib.hstore', * pgproto.hstore_encode, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.init_hstore_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/pgproto.pyx":174 * * * cdef init_json_codecs(): # <<<<<<<<<<<<<< * register_core_codec(JSONOID, * pgproto.text_encode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_json_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init_json_codecs", 1); /* "asyncpg/protocol/codecs/pgproto.pyx":175 * * cdef init_json_codecs(): * register_core_codec(JSONOID, # <<<<<<<<<<<<<< * pgproto.text_encode, * pgproto.text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x72, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":179 * pgproto.text_decode, * PG_FORMAT_BINARY) * register_core_codec(JSONBOID, # <<<<<<<<<<<<<< * pgproto.jsonb_encode, * pgproto.jsonb_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xEDA, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_jsonb_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_jsonb_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":183 * pgproto.jsonb_decode, * PG_FORMAT_BINARY) * register_core_codec(JSONPATHOID, # <<<<<<<<<<<<<< * pgproto.jsonpath_encode, * pgproto.jsonpath_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xFE8, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_jsonpath_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_jsonpath_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":174 * * * cdef init_json_codecs(): # <<<<<<<<<<<<<< * register_core_codec(JSONOID, * pgproto.text_encode, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.init_json_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/pgproto.pyx":189 * * * cdef init_int_codecs(): # <<<<<<<<<<<<<< * * register_core_codec(BOOLOID, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_int_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init_int_codecs", 1); /* "asyncpg/protocol/codecs/pgproto.pyx":191 * cdef init_int_codecs(): * * register_core_codec(BOOLOID, # <<<<<<<<<<<<<< * pgproto.bool_encode, * pgproto.bool_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(16, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bool_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bool_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":196 * PG_FORMAT_BINARY) * * register_core_codec(INT2OID, # <<<<<<<<<<<<<< * pgproto.int2_encode, * pgproto.int2_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(21, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_int2_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_int2_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":201 * PG_FORMAT_BINARY) * * register_core_codec(INT4OID, # <<<<<<<<<<<<<< * pgproto.int4_encode, * pgproto.int4_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(23, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_int4_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_int4_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":206 * PG_FORMAT_BINARY) * * register_core_codec(INT8OID, # <<<<<<<<<<<<<< * pgproto.int8_encode, * pgproto.int8_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(20, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_int8_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_int8_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":189 * * * cdef init_int_codecs(): # <<<<<<<<<<<<<< * * register_core_codec(BOOLOID, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.init_int_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/pgproto.pyx":212 * * * cdef init_pseudo_codecs(): # <<<<<<<<<<<<<< * # Void type is returned by SELECT void_returning_function() * register_core_codec(VOIDOID, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_pseudo_codecs(void) { PyObject *__pyx_v_oid_types = NULL; PyObject *__pyx_v_oid_type = NULL; PyObject *__pyx_v_oid8_types = NULL; PyObject *__pyx_v_reg_types = NULL; PyObject *__pyx_v_reg_type = NULL; PyObject *__pyx_v_no_io_types = NULL; PyObject *__pyx_v_no_io_type = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; uint32_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init_pseudo_codecs", 1); /* "asyncpg/protocol/codecs/pgproto.pyx":214 * cdef init_pseudo_codecs(): * # Void type is returned by SELECT void_returning_function() * register_core_codec(VOIDOID, # <<<<<<<<<<<<<< * pgproto.void_encode, * pgproto.void_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x8E6, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_void_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_void_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":220 * * # Unknown type, always decoded as text * register_core_codec(UNKNOWNOID, # <<<<<<<<<<<<<< * pgproto.text_encode, * pgproto.text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x2C1, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":226 * * # OID and friends * oid_types = [ # <<<<<<<<<<<<<< * OIDOID, XIDOID, CIDOID * ] */ __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_26); __Pyx_GIVEREF(__pyx_int_26); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_26)) __PYX_ERR(13, 226, __pyx_L1_error); __Pyx_INCREF(__pyx_int_28); __Pyx_GIVEREF(__pyx_int_28); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_28)) __PYX_ERR(13, 226, __pyx_L1_error); __Pyx_INCREF(__pyx_int_29); __Pyx_GIVEREF(__pyx_int_29); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_int_29)) __PYX_ERR(13, 226, __pyx_L1_error); __pyx_v_oid_types = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":230 * ] * * for oid_type in oid_types: # <<<<<<<<<<<<<< * register_core_codec(oid_type, * pgproto.uint4_encode, */ __pyx_t_1 = __pyx_v_oid_types; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(13, 230, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(13, 230, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_oid_type, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":231 * * for oid_type in oid_types: * register_core_codec(oid_type, # <<<<<<<<<<<<<< * pgproto.uint4_encode, * pgproto.uint4_decode, */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid_type); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 231, __pyx_L1_error) /* "asyncpg/protocol/codecs/pgproto.pyx":234 * pgproto.uint4_encode, * pgproto.uint4_decode, * PG_FORMAT_BINARY) # <<<<<<<<<<<<<< * * # 64-bit OID types */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(__pyx_t_4, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_uint4_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_uint4_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":230 * ] * * for oid_type in oid_types: # <<<<<<<<<<<<<< * register_core_codec(oid_type, * pgproto.uint4_encode, */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":237 * * # 64-bit OID types * oid8_types = [ # <<<<<<<<<<<<<< * XID8OID, * ] */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_5069); __Pyx_GIVEREF(__pyx_int_5069); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_5069)) __PYX_ERR(13, 237, __pyx_L1_error); __pyx_v_oid8_types = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":241 * ] * * for oid_type in oid8_types: # <<<<<<<<<<<<<< * register_core_codec(oid_type, * pgproto.uint8_encode, */ __pyx_t_1 = __pyx_v_oid8_types; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(13, 241, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(13, 241, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_oid_type, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":242 * * for oid_type in oid8_types: * register_core_codec(oid_type, # <<<<<<<<<<<<<< * pgproto.uint8_encode, * pgproto.uint8_decode, */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid_type); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 242, __pyx_L1_error) /* "asyncpg/protocol/codecs/pgproto.pyx":245 * pgproto.uint8_encode, * pgproto.uint8_decode, * PG_FORMAT_BINARY) # <<<<<<<<<<<<<< * * # reg* types -- these are really system catalog OIDs, but */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(__pyx_t_4, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_uint8_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_uint8_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":241 * ] * * for oid_type in oid8_types: # <<<<<<<<<<<<<< * register_core_codec(oid_type, * pgproto.uint8_encode, */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":252 * # useful. * # * reg_types = [ # <<<<<<<<<<<<<< * REGPROCOID, REGPROCEDUREOID, REGOPEROID, REGOPERATOROID, * REGCLASSOID, REGTYPEOID, REGCONFIGOID, REGDICTIONARYOID, */ __pyx_t_1 = PyList_New(12); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_24); __Pyx_GIVEREF(__pyx_int_24); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_24)) __PYX_ERR(13, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_int_2202); __Pyx_GIVEREF(__pyx_int_2202); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_2202)) __PYX_ERR(13, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_int_2203); __Pyx_GIVEREF(__pyx_int_2203); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_int_2203)) __PYX_ERR(13, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_int_2204); __Pyx_GIVEREF(__pyx_int_2204); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_int_2204)) __PYX_ERR(13, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_int_2205); __Pyx_GIVEREF(__pyx_int_2205); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_int_2205)) __PYX_ERR(13, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_int_2206); __Pyx_GIVEREF(__pyx_int_2206); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_int_2206)) __PYX_ERR(13, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_int_3734); __Pyx_GIVEREF(__pyx_int_3734); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 6, __pyx_int_3734)) __PYX_ERR(13, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_int_3769); __Pyx_GIVEREF(__pyx_int_3769); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 7, __pyx_int_3769)) __PYX_ERR(13, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_int_4089); __Pyx_GIVEREF(__pyx_int_4089); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 8, __pyx_int_4089)) __PYX_ERR(13, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_int_4096); __Pyx_GIVEREF(__pyx_int_4096); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 9, __pyx_int_4096)) __PYX_ERR(13, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_int_1790); __Pyx_GIVEREF(__pyx_int_1790); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 10, __pyx_int_1790)) __PYX_ERR(13, 252, __pyx_L1_error); __Pyx_INCREF(__pyx_int_4191); __Pyx_GIVEREF(__pyx_int_4191); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 11, __pyx_int_4191)) __PYX_ERR(13, 252, __pyx_L1_error); __pyx_v_reg_types = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":258 * ] * * for reg_type in reg_types: # <<<<<<<<<<<<<< * register_core_codec(reg_type, * pgproto.text_encode, */ __pyx_t_1 = __pyx_v_reg_types; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(13, 258, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(13, 258, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_reg_type, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":259 * * for reg_type in reg_types: * register_core_codec(reg_type, # <<<<<<<<<<<<<< * pgproto.text_encode, * pgproto.text_decode, */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_reg_type); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 259, __pyx_L1_error) /* "asyncpg/protocol/codecs/pgproto.pyx":262 * pgproto.text_encode, * pgproto.text_decode, * PG_FORMAT_TEXT) # <<<<<<<<<<<<<< * * # cstring type is used by Postgres' I/O functions */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(__pyx_t_4, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":258 * ] * * for reg_type in reg_types: # <<<<<<<<<<<<<< * register_core_codec(reg_type, * pgproto.text_encode, */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":265 * * # cstring type is used by Postgres' I/O functions * register_core_codec(CSTRINGOID, # <<<<<<<<<<<<<< * pgproto.text_encode, * pgproto.text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x8E3, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":271 * * # various system pseudotypes with no I/O * no_io_types = [ # <<<<<<<<<<<<<< * ANYOID, TRIGGEROID, EVENT_TRIGGEROID, LANGUAGE_HANDLEROID, * FDW_HANDLEROID, TSM_HANDLEROID, INTERNALOID, OPAQUEOID, */ __pyx_t_1 = PyList_New(21); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_2276); __Pyx_GIVEREF(__pyx_int_2276); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_2276)) __PYX_ERR(13, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_int_2279); __Pyx_GIVEREF(__pyx_int_2279); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_2279)) __PYX_ERR(13, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_int_3838); __Pyx_GIVEREF(__pyx_int_3838); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_int_3838)) __PYX_ERR(13, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_int_2280); __Pyx_GIVEREF(__pyx_int_2280); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_int_2280)) __PYX_ERR(13, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_int_3115); __Pyx_GIVEREF(__pyx_int_3115); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_int_3115)) __PYX_ERR(13, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_int_3310); __Pyx_GIVEREF(__pyx_int_3310); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_int_3310)) __PYX_ERR(13, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_int_2281); __Pyx_GIVEREF(__pyx_int_2281); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 6, __pyx_int_2281)) __PYX_ERR(13, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_int_2282); __Pyx_GIVEREF(__pyx_int_2282); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 7, __pyx_int_2282)) __PYX_ERR(13, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_int_2283); __Pyx_GIVEREF(__pyx_int_2283); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 8, __pyx_int_2283)) __PYX_ERR(13, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_int_2776); __Pyx_GIVEREF(__pyx_int_2776); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 9, __pyx_int_2776)) __PYX_ERR(13, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_int_5077); __Pyx_GIVEREF(__pyx_int_5077); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 10, __pyx_int_5077)) __PYX_ERR(13, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_int_5078); __Pyx_GIVEREF(__pyx_int_5078); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 11, __pyx_int_5078)) __PYX_ERR(13, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_int_5079); __Pyx_GIVEREF(__pyx_int_5079); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 12, __pyx_int_5079)) __PYX_ERR(13, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_int_5080); __Pyx_GIVEREF(__pyx_int_5080); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 13, __pyx_int_5080)) __PYX_ERR(13, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_int_4538); __Pyx_GIVEREF(__pyx_int_4538); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 14, __pyx_int_4538)) __PYX_ERR(13, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_int_3831); __Pyx_GIVEREF(__pyx_int_3831); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 15, __pyx_int_3831)) __PYX_ERR(13, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_int_4537); __Pyx_GIVEREF(__pyx_int_4537); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 16, __pyx_int_4537)) __PYX_ERR(13, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_int_2277); __Pyx_GIVEREF(__pyx_int_2277); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 17, __pyx_int_2277)) __PYX_ERR(13, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_int_32); __Pyx_GIVEREF(__pyx_int_32); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 18, __pyx_int_32)) __PYX_ERR(13, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_int_325); __Pyx_GIVEREF(__pyx_int_325); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 19, __pyx_int_325)) __PYX_ERR(13, 271, __pyx_L1_error); __Pyx_INCREF(__pyx_int_269); __Pyx_GIVEREF(__pyx_int_269); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 20, __pyx_int_269)) __PYX_ERR(13, 271, __pyx_L1_error); __pyx_v_no_io_types = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":281 * ] * * register_core_codec(ANYENUMOID, # <<<<<<<<<<<<<< * NULL, * pgproto.text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xDAC, NULL, ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":286 * PG_FORMAT_TEXT) * * for no_io_type in no_io_types: # <<<<<<<<<<<<<< * register_core_codec(no_io_type, * NULL, */ __pyx_t_1 = __pyx_v_no_io_types; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(13, 286, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(13, 286, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_no_io_type, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":287 * * for no_io_type in no_io_types: * register_core_codec(no_io_type, # <<<<<<<<<<<<<< * NULL, * NULL, */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_no_io_type); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 287, __pyx_L1_error) /* "asyncpg/protocol/codecs/pgproto.pyx":290 * NULL, * NULL, * PG_FORMAT_BINARY) # <<<<<<<<<<<<<< * * # ACL specification string */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(__pyx_t_4, NULL, NULL, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":286 * PG_FORMAT_TEXT) * * for no_io_type in no_io_types: # <<<<<<<<<<<<<< * register_core_codec(no_io_type, * NULL, */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":293 * * # ACL specification string * register_core_codec(ACLITEMOID, # <<<<<<<<<<<<<< * pgproto.text_encode, * pgproto.text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x409, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":299 * * # Postgres' serialized expression tree type * register_core_codec(PG_NODE_TREEOID, # <<<<<<<<<<<<<< * NULL, * pgproto.text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xC2, NULL, ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":305 * * # pg_lsn type -- a pointer to a location in the XLOG. * register_core_codec(PG_LSNOID, # <<<<<<<<<<<<<< * pgproto.int8_encode, * pgproto.int8_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xC94, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_int8_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_int8_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":310 * PG_FORMAT_BINARY) * * register_core_codec(SMGROID, # <<<<<<<<<<<<<< * pgproto.text_encode, * pgproto.text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xD2, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":317 * # pg_dependencies and pg_ndistinct are special types * # used in pg_statistic_ext columns. * register_core_codec(PG_DEPENDENCIESOID, # <<<<<<<<<<<<<< * pgproto.text_encode, * pgproto.text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xD4A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":322 * PG_FORMAT_TEXT) * * register_core_codec(PG_NDISTINCTOID, # <<<<<<<<<<<<<< * pgproto.text_encode, * pgproto.text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xD21, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":329 * # pg_mcv_list is a special type used in pg_statistic_ext_data * # system catalog * register_core_codec(PG_MCV_LISTOID, # <<<<<<<<<<<<<< * pgproto.bytea_encode, * pgproto.bytea_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x1399, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":337 * # to be sent, but since I/O functions for these exist, add decoders * # nonetheless. * register_core_codec(PG_BRIN_BLOOM_SUMMARYOID, # <<<<<<<<<<<<<< * NULL, * pgproto.bytea_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x11F8, NULL, ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":342 * PG_FORMAT_BINARY) * * register_core_codec(PG_BRIN_MINMAX_MULTI_SUMMARYOID, # <<<<<<<<<<<<<< * NULL, * pgproto.bytea_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x11F9, NULL, ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":212 * * * cdef init_pseudo_codecs(): # <<<<<<<<<<<<<< * # Void type is returned by SELECT void_returning_function() * register_core_codec(VOIDOID, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.init_pseudo_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_oid_types); __Pyx_XDECREF(__pyx_v_oid_type); __Pyx_XDECREF(__pyx_v_oid8_types); __Pyx_XDECREF(__pyx_v_reg_types); __Pyx_XDECREF(__pyx_v_reg_type); __Pyx_XDECREF(__pyx_v_no_io_types); __Pyx_XDECREF(__pyx_v_no_io_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/pgproto.pyx":348 * * * cdef init_text_codecs(): # <<<<<<<<<<<<<< * textoids = [ * NAMEOID, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_text_codecs(void) { PyObject *__pyx_v_textoids = NULL; PyObject *__pyx_v_oid = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; uint32_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init_text_codecs", 1); /* "asyncpg/protocol/codecs/pgproto.pyx":349 * * cdef init_text_codecs(): * textoids = [ # <<<<<<<<<<<<<< * NAMEOID, * BPCHAROID, */ __pyx_t_1 = PyList_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_19); __Pyx_GIVEREF(__pyx_int_19); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_19)) __PYX_ERR(13, 349, __pyx_L1_error); __Pyx_INCREF(__pyx_int_1042); __Pyx_GIVEREF(__pyx_int_1042); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_1042)) __PYX_ERR(13, 349, __pyx_L1_error); __Pyx_INCREF(__pyx_int_1043); __Pyx_GIVEREF(__pyx_int_1043); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_int_1043)) __PYX_ERR(13, 349, __pyx_L1_error); __Pyx_INCREF(__pyx_int_25); __Pyx_GIVEREF(__pyx_int_25); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_int_25)) __PYX_ERR(13, 349, __pyx_L1_error); __Pyx_INCREF(__pyx_int_142); __Pyx_GIVEREF(__pyx_int_142); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_int_142)) __PYX_ERR(13, 349, __pyx_L1_error); __pyx_v_textoids = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":357 * ] * * for oid in textoids: # <<<<<<<<<<<<<< * register_core_codec(oid, * pgproto.text_encode, */ __pyx_t_1 = __pyx_v_textoids; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(13, 357, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(13, 357, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_oid, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":358 * * for oid in textoids: * register_core_codec(oid, # <<<<<<<<<<<<<< * pgproto.text_encode, * pgproto.text_decode, */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 358, __pyx_L1_error) /* "asyncpg/protocol/codecs/pgproto.pyx":361 * pgproto.text_encode, * pgproto.text_decode, * PG_FORMAT_BINARY) # <<<<<<<<<<<<<< * * register_core_codec(oid, */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(__pyx_t_4, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":363 * PG_FORMAT_BINARY) * * register_core_codec(oid, # <<<<<<<<<<<<<< * pgproto.text_encode, * pgproto.text_decode, */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 363, __pyx_L1_error) /* "asyncpg/protocol/codecs/pgproto.pyx":366 * pgproto.text_encode, * pgproto.text_decode, * PG_FORMAT_TEXT) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(__pyx_t_4, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":357 * ] * * for oid in textoids: # <<<<<<<<<<<<<< * register_core_codec(oid, * pgproto.text_encode, */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":348 * * * cdef init_text_codecs(): # <<<<<<<<<<<<<< * textoids = [ * NAMEOID, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.init_text_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_textoids); __Pyx_XDECREF(__pyx_v_oid); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/pgproto.pyx":369 * * * cdef init_tid_codecs(): # <<<<<<<<<<<<<< * register_core_codec(TIDOID, * pgproto.tid_encode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_tid_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init_tid_codecs", 1); /* "asyncpg/protocol/codecs/pgproto.pyx":370 * * cdef init_tid_codecs(): * register_core_codec(TIDOID, # <<<<<<<<<<<<<< * pgproto.tid_encode, * pgproto.tid_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(27, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_tid_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_tid_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":369 * * * cdef init_tid_codecs(): # <<<<<<<<<<<<<< * register_core_codec(TIDOID, * pgproto.tid_encode, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.init_tid_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/pgproto.pyx":376 * * * cdef init_txid_codecs(): # <<<<<<<<<<<<<< * register_core_codec(TXID_SNAPSHOTOID, * pgproto.pg_snapshot_encode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_txid_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init_txid_codecs", 1); /* "asyncpg/protocol/codecs/pgproto.pyx":377 * * cdef init_txid_codecs(): * register_core_codec(TXID_SNAPSHOTOID, # <<<<<<<<<<<<<< * pgproto.pg_snapshot_encode, * pgproto.pg_snapshot_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xB9A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":382 * PG_FORMAT_BINARY) * * register_core_codec(PG_SNAPSHOTOID, # <<<<<<<<<<<<<< * pgproto.pg_snapshot_encode, * pgproto.pg_snapshot_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x13AE, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":376 * * * cdef init_txid_codecs(): # <<<<<<<<<<<<<< * register_core_codec(TXID_SNAPSHOTOID, * pgproto.pg_snapshot_encode, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.init_txid_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/pgproto.pyx":388 * * * cdef init_tsearch_codecs(): # <<<<<<<<<<<<<< * ts_oids = [ * TSQUERYOID, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_tsearch_codecs(void) { PyObject *__pyx_v_ts_oids = NULL; PyObject *__pyx_v_oid = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; uint32_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init_tsearch_codecs", 1); /* "asyncpg/protocol/codecs/pgproto.pyx":389 * * cdef init_tsearch_codecs(): * ts_oids = [ # <<<<<<<<<<<<<< * TSQUERYOID, * TSVECTOROID, */ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_3615); __Pyx_GIVEREF(__pyx_int_3615); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_3615)) __PYX_ERR(13, 389, __pyx_L1_error); __Pyx_INCREF(__pyx_int_3614); __Pyx_GIVEREF(__pyx_int_3614); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_3614)) __PYX_ERR(13, 389, __pyx_L1_error); __pyx_v_ts_oids = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":394 * ] * * for oid in ts_oids: # <<<<<<<<<<<<<< * register_core_codec(oid, * pgproto.text_encode, */ __pyx_t_1 = __pyx_v_ts_oids; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(13, 394, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(13, 394, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_oid, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":395 * * for oid in ts_oids: * register_core_codec(oid, # <<<<<<<<<<<<<< * pgproto.text_encode, * pgproto.text_decode, */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 395, __pyx_L1_error) /* "asyncpg/protocol/codecs/pgproto.pyx":398 * pgproto.text_encode, * pgproto.text_decode, * PG_FORMAT_TEXT) # <<<<<<<<<<<<<< * * register_core_codec(GTSVECTOROID, */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(__pyx_t_4, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":394 * ] * * for oid in ts_oids: # <<<<<<<<<<<<<< * register_core_codec(oid, * pgproto.text_encode, */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":400 * PG_FORMAT_TEXT) * * register_core_codec(GTSVECTOROID, # <<<<<<<<<<<<<< * NULL, * pgproto.text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xE3A, NULL, ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":388 * * * cdef init_tsearch_codecs(): # <<<<<<<<<<<<<< * ts_oids = [ * TSQUERYOID, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.init_tsearch_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ts_oids); __Pyx_XDECREF(__pyx_v_oid); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/pgproto.pyx":406 * * * cdef init_uuid_codecs(): # <<<<<<<<<<<<<< * register_core_codec(UUIDOID, * pgproto.uuid_encode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_uuid_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init_uuid_codecs", 1); /* "asyncpg/protocol/codecs/pgproto.pyx":407 * * cdef init_uuid_codecs(): * register_core_codec(UUIDOID, # <<<<<<<<<<<<<< * pgproto.uuid_encode, * pgproto.uuid_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xB86, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_uuid_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_uuid_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":406 * * * cdef init_uuid_codecs(): # <<<<<<<<<<<<<< * register_core_codec(UUIDOID, * pgproto.uuid_encode, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.init_uuid_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/pgproto.pyx":413 * * * cdef init_numeric_codecs(): # <<<<<<<<<<<<<< * register_core_codec(NUMERICOID, * pgproto.numeric_encode_text, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_numeric_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init_numeric_codecs", 1); /* "asyncpg/protocol/codecs/pgproto.pyx":414 * * cdef init_numeric_codecs(): * register_core_codec(NUMERICOID, # <<<<<<<<<<<<<< * pgproto.numeric_encode_text, * pgproto.numeric_decode_text, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x6A4, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_encode_text), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_text), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":419 * PG_FORMAT_TEXT) * * register_core_codec(NUMERICOID, # <<<<<<<<<<<<<< * pgproto.numeric_encode_binary, * pgproto.numeric_decode_binary, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x6A4, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_encode_binary), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_binary), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":413 * * * cdef init_numeric_codecs(): # <<<<<<<<<<<<<< * register_core_codec(NUMERICOID, * pgproto.numeric_encode_text, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.init_numeric_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/pgproto.pyx":425 * * * cdef init_network_codecs(): # <<<<<<<<<<<<<< * register_core_codec(CIDROID, * pgproto.cidr_encode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_network_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init_network_codecs", 1); /* "asyncpg/protocol/codecs/pgproto.pyx":426 * * cdef init_network_codecs(): * register_core_codec(CIDROID, # <<<<<<<<<<<<<< * pgproto.cidr_encode, * pgproto.cidr_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x28A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_cidr_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_cidr_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":431 * PG_FORMAT_BINARY) * * register_core_codec(INETOID, # <<<<<<<<<<<<<< * pgproto.inet_encode, * pgproto.inet_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x365, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_inet_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_inet_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":436 * PG_FORMAT_BINARY) * * register_core_codec(MACADDROID, # <<<<<<<<<<<<<< * pgproto.text_encode, * pgproto.text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x33D, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":441 * PG_FORMAT_TEXT) * * register_core_codec(MACADDR8OID, # <<<<<<<<<<<<<< * pgproto.text_encode, * pgproto.text_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x306, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":425 * * * cdef init_network_codecs(): # <<<<<<<<<<<<<< * register_core_codec(CIDROID, * pgproto.cidr_encode, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.init_network_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/pgproto.pyx":447 * * * cdef init_monetary_codecs(): # <<<<<<<<<<<<<< * moneyoids = [ * MONEYOID, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_monetary_codecs(void) { PyObject *__pyx_v_moneyoids = NULL; PyObject *__pyx_v_oid = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; uint32_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init_monetary_codecs", 1); /* "asyncpg/protocol/codecs/pgproto.pyx":448 * * cdef init_monetary_codecs(): * moneyoids = [ # <<<<<<<<<<<<<< * MONEYOID, * ] */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_790); __Pyx_GIVEREF(__pyx_int_790); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_790)) __PYX_ERR(13, 448, __pyx_L1_error); __pyx_v_moneyoids = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":452 * ] * * for oid in moneyoids: # <<<<<<<<<<<<<< * register_core_codec(oid, * pgproto.text_encode, */ __pyx_t_1 = __pyx_v_moneyoids; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(13, 452, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(13, 452, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_oid, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":453 * * for oid in moneyoids: * register_core_codec(oid, # <<<<<<<<<<<<<< * pgproto.text_encode, * pgproto.text_decode, */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 453, __pyx_L1_error) /* "asyncpg/protocol/codecs/pgproto.pyx":456 * pgproto.text_encode, * pgproto.text_decode, * PG_FORMAT_TEXT) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(__pyx_t_4, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":452 * ] * * for oid in moneyoids: # <<<<<<<<<<<<<< * register_core_codec(oid, * pgproto.text_encode, */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":447 * * * cdef init_monetary_codecs(): # <<<<<<<<<<<<<< * moneyoids = [ * MONEYOID, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.init_monetary_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_moneyoids); __Pyx_XDECREF(__pyx_v_oid); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/pgproto.pyx":459 * * * cdef init_all_pgproto_codecs(): # <<<<<<<<<<<<<< * # Builtin types, in lexicographical order. * init_bits_codecs() */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_all_pgproto_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init_all_pgproto_codecs", 1); /* "asyncpg/protocol/codecs/pgproto.pyx":461 * cdef init_all_pgproto_codecs(): * # Builtin types, in lexicographical order. * init_bits_codecs() # <<<<<<<<<<<<<< * init_bytea_codecs() * init_datetime_codecs() */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_bits_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":462 * # Builtin types, in lexicographical order. * init_bits_codecs() * init_bytea_codecs() # <<<<<<<<<<<<<< * init_datetime_codecs() * init_float_codecs() */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_bytea_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":463 * init_bits_codecs() * init_bytea_codecs() * init_datetime_codecs() # <<<<<<<<<<<<<< * init_float_codecs() * init_geometry_codecs() */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_datetime_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":464 * init_bytea_codecs() * init_datetime_codecs() * init_float_codecs() # <<<<<<<<<<<<<< * init_geometry_codecs() * init_int_codecs() */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_float_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":465 * init_datetime_codecs() * init_float_codecs() * init_geometry_codecs() # <<<<<<<<<<<<<< * init_int_codecs() * init_json_codecs() */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_geometry_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":466 * init_float_codecs() * init_geometry_codecs() * init_int_codecs() # <<<<<<<<<<<<<< * init_json_codecs() * init_monetary_codecs() */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_int_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":467 * init_geometry_codecs() * init_int_codecs() * init_json_codecs() # <<<<<<<<<<<<<< * init_monetary_codecs() * init_network_codecs() */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_json_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":468 * init_int_codecs() * init_json_codecs() * init_monetary_codecs() # <<<<<<<<<<<<<< * init_network_codecs() * init_numeric_codecs() */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_monetary_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":469 * init_json_codecs() * init_monetary_codecs() * init_network_codecs() # <<<<<<<<<<<<<< * init_numeric_codecs() * init_text_codecs() */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_network_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":470 * init_monetary_codecs() * init_network_codecs() * init_numeric_codecs() # <<<<<<<<<<<<<< * init_text_codecs() * init_tid_codecs() */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_numeric_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":471 * init_network_codecs() * init_numeric_codecs() * init_text_codecs() # <<<<<<<<<<<<<< * init_tid_codecs() * init_tsearch_codecs() */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_text_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":472 * init_numeric_codecs() * init_text_codecs() * init_tid_codecs() # <<<<<<<<<<<<<< * init_tsearch_codecs() * init_txid_codecs() */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_tid_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":473 * init_text_codecs() * init_tid_codecs() * init_tsearch_codecs() # <<<<<<<<<<<<<< * init_txid_codecs() * init_uuid_codecs() */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_tsearch_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":474 * init_tid_codecs() * init_tsearch_codecs() * init_txid_codecs() # <<<<<<<<<<<<<< * init_uuid_codecs() * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_txid_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":475 * init_tsearch_codecs() * init_txid_codecs() * init_uuid_codecs() # <<<<<<<<<<<<<< * * # Various pseudotypes and system types */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_uuid_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":478 * * # Various pseudotypes and system types * init_pseudo_codecs() # <<<<<<<<<<<<<< * * # contrib */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_pseudo_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":481 * * # contrib * init_hstore_codecs() # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_hstore_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/pgproto.pyx":459 * * * cdef init_all_pgproto_codecs(): # <<<<<<<<<<<<<< * # Builtin types, in lexicographical order. * init_bits_codecs() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.init_all_pgproto_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":32 * * * cdef inline bint _is_trivial_container(object obj): # <<<<<<<<<<<<<< * return cpython.PyUnicode_Check(obj) or cpython.PyBytes_Check(obj) or \ * cpythonx.PyByteArray_Check(obj) or cpythonx.PyMemoryView_Check(obj) */ static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol__is_trivial_container(PyObject *__pyx_v_obj) { int __pyx_r; int __pyx_t_1; int __pyx_t_2; /* "asyncpg/protocol/codecs/array.pyx":33 * * cdef inline bint _is_trivial_container(object obj): * return cpython.PyUnicode_Check(obj) or cpython.PyBytes_Check(obj) or \ # <<<<<<<<<<<<<< * cpythonx.PyByteArray_Check(obj) or cpythonx.PyMemoryView_Check(obj) * */ __pyx_t_2 = PyUnicode_Check(__pyx_v_obj); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L3_bool_binop_done; } __pyx_t_2 = PyBytes_Check(__pyx_v_obj); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L3_bool_binop_done; } /* "asyncpg/protocol/codecs/array.pyx":34 * cdef inline bint _is_trivial_container(object obj): * return cpython.PyUnicode_Check(obj) or cpython.PyBytes_Check(obj) or \ * cpythonx.PyByteArray_Check(obj) or cpythonx.PyMemoryView_Check(obj) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = (PyByteArray_Check(__pyx_v_obj) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L3_bool_binop_done; } __pyx_t_2 = (PyMemoryView_Check(__pyx_v_obj) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L3_bool_binop_done:; __pyx_r = __pyx_t_1; goto __pyx_L0; /* "asyncpg/protocol/codecs/array.pyx":32 * * * cdef inline bint _is_trivial_container(object obj): # <<<<<<<<<<<<<< * return cpython.PyUnicode_Check(obj) or cpython.PyBytes_Check(obj) or \ * cpythonx.PyByteArray_Check(obj) or cpythonx.PyMemoryView_Check(obj) */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":37 * * * cdef inline _is_array_iterable(object obj): # <<<<<<<<<<<<<< * return ( * isinstance(obj, IterableABC) and */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol__is_array_iterable(PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_is_array_iterable", 1); /* "asyncpg/protocol/codecs/array.pyx":38 * * cdef inline _is_array_iterable(object obj): * return ( # <<<<<<<<<<<<<< * isinstance(obj, IterableABC) and * isinstance(obj, SizedABC) and */ __Pyx_XDECREF(__pyx_r); /* "asyncpg/protocol/codecs/array.pyx":39 * cdef inline _is_array_iterable(object obj): * return ( * isinstance(obj, IterableABC) and # <<<<<<<<<<<<<< * isinstance(obj, SizedABC) and * not _is_trivial_container(obj) and */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_IterableABC); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { } else { __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L3_bool_binop_done; } /* "asyncpg/protocol/codecs/array.pyx":40 * return ( * isinstance(obj, IterableABC) and * isinstance(obj, SizedABC) and # <<<<<<<<<<<<<< * not _is_trivial_container(obj) and * not isinstance(obj, MappingABC) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SizedABC); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { } else { __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L3_bool_binop_done; } /* "asyncpg/protocol/codecs/array.pyx":41 * isinstance(obj, IterableABC) and * isinstance(obj, SizedABC) and * not _is_trivial_container(obj) and # <<<<<<<<<<<<<< * not isinstance(obj, MappingABC) * ) */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__is_trivial_container(__pyx_v_obj); if (unlikely(__pyx_t_3 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(4, 41, __pyx_L1_error) __pyx_t_4 = (!__pyx_t_3); if (__pyx_t_4) { } else { __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L3_bool_binop_done; } /* "asyncpg/protocol/codecs/array.pyx":42 * isinstance(obj, SizedABC) and * not _is_trivial_container(obj) and * not isinstance(obj, MappingABC) # <<<<<<<<<<<<<< * ) * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MappingABC); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = (!__pyx_t_4); __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; __pyx_L3_bool_binop_done:; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/array.pyx":37 * * * cdef inline _is_array_iterable(object obj): # <<<<<<<<<<<<<< * return ( * isinstance(obj, IterableABC) and */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol._is_array_iterable", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":46 * * * cdef inline _is_sub_array_iterable(object obj): # <<<<<<<<<<<<<< * # Sub-arrays have a specialized check, because we treat * # nested tuples as records. */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol__is_sub_array_iterable(PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_is_sub_array_iterable", 1); /* "asyncpg/protocol/codecs/array.pyx":49 * # Sub-arrays have a specialized check, because we treat * # nested tuples as records. * return _is_array_iterable(obj) and not cpython.PyTuple_Check(obj) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__is_array_iterable(__pyx_v_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 49, __pyx_L1_error) if (__pyx_t_3) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L3_bool_binop_done; } __pyx_t_3 = (!PyTuple_Check(__pyx_v_obj)); __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; __pyx_L3_bool_binop_done:; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/array.pyx":46 * * * cdef inline _is_sub_array_iterable(object obj): # <<<<<<<<<<<<<< * # Sub-arrays have a specialized check, because we treat * # nested tuples as records. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol._is_sub_array_iterable", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":52 * * * cdef _get_array_shape(object obj, int32_t *dims, int32_t *ndims): # <<<<<<<<<<<<<< * cdef: * ssize_t mylen = len(obj) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__get_array_shape(PyObject *__pyx_v_obj, int32_t *__pyx_v_dims, int32_t *__pyx_v_ndims) { Py_ssize_t __pyx_v_mylen; Py_ssize_t __pyx_v_elemlen; PyObject *__pyx_v_elem = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; PyObject *(*__pyx_t_8)(PyObject *); Py_ssize_t __pyx_t_9; long __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_array_shape", 1); /* "asyncpg/protocol/codecs/array.pyx":54 * cdef _get_array_shape(object obj, int32_t *dims, int32_t *ndims): * cdef: * ssize_t mylen = len(obj) # <<<<<<<<<<<<<< * ssize_t elemlen = -2 * object it */ __pyx_t_1 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(4, 54, __pyx_L1_error) __pyx_v_mylen = __pyx_t_1; /* "asyncpg/protocol/codecs/array.pyx":55 * cdef: * ssize_t mylen = len(obj) * ssize_t elemlen = -2 # <<<<<<<<<<<<<< * object it * */ __pyx_v_elemlen = -2L; /* "asyncpg/protocol/codecs/array.pyx":58 * object it * * if mylen > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('too many elements in array value') * */ __pyx_t_2 = (__pyx_v_mylen > 0x7FFFFFFF); if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/codecs/array.pyx":59 * * if mylen > _MAXINT32: * raise ValueError('too many elements in array value') # <<<<<<<<<<<<<< * * if ndims[0] > ARRAY_MAXDIM: */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 59, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":58 * object it * * if mylen > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('too many elements in array value') * */ } /* "asyncpg/protocol/codecs/array.pyx":61 * raise ValueError('too many elements in array value') * * if ndims[0] > ARRAY_MAXDIM: # <<<<<<<<<<<<<< * raise ValueError( * 'number of array dimensions ({}) exceed the maximum expected ({})'. */ __pyx_t_2 = ((__pyx_v_ndims[0]) > 6); if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/codecs/array.pyx":63 * if ndims[0] > ARRAY_MAXDIM: * raise ValueError( * 'number of array dimensions ({}) exceed the maximum expected ({})'. # <<<<<<<<<<<<<< * format(ndims[0], ARRAY_MAXDIM)) * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_number_of_array_dimensions_excee, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/codecs/array.pyx":64 * raise ValueError( * 'number of array dimensions ({}) exceed the maximum expected ({})'. * format(ndims[0], ARRAY_MAXDIM)) # <<<<<<<<<<<<<< * * dims[ndims[0] - 1] = mylen */ __pyx_t_5 = __Pyx_PyInt_From_int32_t((__pyx_v_ndims[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_5, __pyx_int_6}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/protocol/codecs/array.pyx":62 * * if ndims[0] > ARRAY_MAXDIM: * raise ValueError( # <<<<<<<<<<<<<< * 'number of array dimensions ({}) exceed the maximum expected ({})'. * format(ndims[0], ARRAY_MAXDIM)) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(4, 62, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":61 * raise ValueError('too many elements in array value') * * if ndims[0] > ARRAY_MAXDIM: # <<<<<<<<<<<<<< * raise ValueError( * 'number of array dimensions ({}) exceed the maximum expected ({})'. */ } /* "asyncpg/protocol/codecs/array.pyx":66 * format(ndims[0], ARRAY_MAXDIM)) * * dims[ndims[0] - 1] = mylen # <<<<<<<<<<<<<< * * for elem in obj: */ (__pyx_v_dims[((__pyx_v_ndims[0]) - 1)]) = ((int32_t)__pyx_v_mylen); /* "asyncpg/protocol/codecs/array.pyx":68 * dims[ndims[0] - 1] = mylen * * for elem in obj: # <<<<<<<<<<<<<< * if _is_sub_array_iterable(elem): * if elemlen == -2: */ if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) { __pyx_t_4 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0; __pyx_t_8 = NULL; } else { __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 68, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_4))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 68, __pyx_L1_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(4, 68, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 68, __pyx_L1_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(4, 68, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(4, 68, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/array.pyx":69 * * for elem in obj: * if _is_sub_array_iterable(elem): # <<<<<<<<<<<<<< * if elemlen == -2: * elemlen = len(elem) */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__is_sub_array_iterable(__pyx_v_elem); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":70 * for elem in obj: * if _is_sub_array_iterable(elem): * if elemlen == -2: # <<<<<<<<<<<<<< * elemlen = len(elem) * if elemlen > _MAXINT32: */ __pyx_t_2 = (__pyx_v_elemlen == -2L); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":71 * if _is_sub_array_iterable(elem): * if elemlen == -2: * elemlen = len(elem) # <<<<<<<<<<<<<< * if elemlen > _MAXINT32: * raise ValueError('too many elements in array value') */ __pyx_t_9 = PyObject_Length(__pyx_v_elem); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(4, 71, __pyx_L1_error) __pyx_v_elemlen = __pyx_t_9; /* "asyncpg/protocol/codecs/array.pyx":72 * if elemlen == -2: * elemlen = len(elem) * if elemlen > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('too many elements in array value') * ndims[0] += 1 */ __pyx_t_2 = (__pyx_v_elemlen > 0x7FFFFFFF); if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/codecs/array.pyx":73 * elemlen = len(elem) * if elemlen > _MAXINT32: * raise ValueError('too many elements in array value') # <<<<<<<<<<<<<< * ndims[0] += 1 * _get_array_shape(elem, dims, ndims) */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 73, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":72 * if elemlen == -2: * elemlen = len(elem) * if elemlen > _MAXINT32: # <<<<<<<<<<<<<< * raise ValueError('too many elements in array value') * ndims[0] += 1 */ } /* "asyncpg/protocol/codecs/array.pyx":74 * if elemlen > _MAXINT32: * raise ValueError('too many elements in array value') * ndims[0] += 1 # <<<<<<<<<<<<<< * _get_array_shape(elem, dims, ndims) * else: */ __pyx_t_10 = 0; (__pyx_v_ndims[__pyx_t_10]) = ((__pyx_v_ndims[__pyx_t_10]) + 1); /* "asyncpg/protocol/codecs/array.pyx":75 * raise ValueError('too many elements in array value') * ndims[0] += 1 * _get_array_shape(elem, dims, ndims) # <<<<<<<<<<<<<< * else: * if len(elem) != elemlen: */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__get_array_shape(__pyx_v_elem, __pyx_v_dims, __pyx_v_ndims); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/array.pyx":70 * for elem in obj: * if _is_sub_array_iterable(elem): * if elemlen == -2: # <<<<<<<<<<<<<< * elemlen = len(elem) * if elemlen > _MAXINT32: */ goto __pyx_L8; } /* "asyncpg/protocol/codecs/array.pyx":77 * _get_array_shape(elem, dims, ndims) * else: * if len(elem) != elemlen: # <<<<<<<<<<<<<< * raise ValueError('non-homogeneous array') * else: */ /*else*/ { __pyx_t_9 = PyObject_Length(__pyx_v_elem); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(4, 77, __pyx_L1_error) __pyx_t_2 = (__pyx_t_9 != __pyx_v_elemlen); if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/codecs/array.pyx":78 * else: * if len(elem) != elemlen: * raise ValueError('non-homogeneous array') # <<<<<<<<<<<<<< * else: * if elemlen >= 0: */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 78, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":77 * _get_array_shape(elem, dims, ndims) * else: * if len(elem) != elemlen: # <<<<<<<<<<<<<< * raise ValueError('non-homogeneous array') * else: */ } } __pyx_L8:; /* "asyncpg/protocol/codecs/array.pyx":69 * * for elem in obj: * if _is_sub_array_iterable(elem): # <<<<<<<<<<<<<< * if elemlen == -2: * elemlen = len(elem) */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/array.pyx":80 * raise ValueError('non-homogeneous array') * else: * if elemlen >= 0: # <<<<<<<<<<<<<< * raise ValueError('non-homogeneous array') * else: */ /*else*/ { __pyx_t_2 = (__pyx_v_elemlen >= 0); if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/codecs/array.pyx":81 * else: * if elemlen >= 0: * raise ValueError('non-homogeneous array') # <<<<<<<<<<<<<< * else: * elemlen = -1 */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 81, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":80 * raise ValueError('non-homogeneous array') * else: * if elemlen >= 0: # <<<<<<<<<<<<<< * raise ValueError('non-homogeneous array') * else: */ } /* "asyncpg/protocol/codecs/array.pyx":83 * raise ValueError('non-homogeneous array') * else: * elemlen = -1 # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_v_elemlen = -1L; } } __pyx_L7:; /* "asyncpg/protocol/codecs/array.pyx":68 * dims[ndims[0] - 1] = mylen * * for elem in obj: # <<<<<<<<<<<<<< * if _is_sub_array_iterable(elem): * if elemlen == -2: */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":52 * * * cdef _get_array_shape(object obj, int32_t *dims, int32_t *ndims): # <<<<<<<<<<<<<< * cdef: * ssize_t mylen = len(obj) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.protocol.protocol._get_array_shape", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_elem); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":86 * * * cdef _write_array_data(ConnectionSettings settings, object obj, int32_t ndims, # <<<<<<<<<<<<<< * int32_t dim, WriteBuffer elem_data, * encode_func_ex encoder, const void *encoder_arg): */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__write_array_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, PyObject *__pyx_v_obj, int32_t __pyx_v_ndims, int32_t __pyx_v_dim, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_elem_data, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex __pyx_v_encoder, void const *__pyx_v_encoder_arg) { PyObject *__pyx_v_item = NULL; PyObject *__pyx_v_e = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; unsigned int __pyx_t_16; int __pyx_t_17; char const *__pyx_t_18; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_write_array_data", 1); /* "asyncpg/protocol/codecs/array.pyx":89 * int32_t dim, WriteBuffer elem_data, * encode_func_ex encoder, const void *encoder_arg): * if dim < ndims - 1: # <<<<<<<<<<<<<< * for item in obj: * _write_array_data(settings, item, ndims, dim + 1, elem_data, */ __pyx_t_1 = (__pyx_v_dim < (__pyx_v_ndims - 1)); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":90 * encode_func_ex encoder, const void *encoder_arg): * if dim < ndims - 1: * for item in obj: # <<<<<<<<<<<<<< * _write_array_data(settings, item, ndims, dim + 1, elem_data, * encoder, encoder_arg) */ if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) { __pyx_t_2 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 90, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 90, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(4, 90, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 90, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(4, 90, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(4, 90, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":91 * if dim < ndims - 1: * for item in obj: * _write_array_data(settings, item, ndims, dim + 1, elem_data, # <<<<<<<<<<<<<< * encoder, encoder_arg) * else: */ __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol__write_array_data(__pyx_v_settings, __pyx_v_item, __pyx_v_ndims, (__pyx_v_dim + 1), __pyx_v_elem_data, __pyx_v_encoder, __pyx_v_encoder_arg); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":90 * encode_func_ex encoder, const void *encoder_arg): * if dim < ndims - 1: * for item in obj: # <<<<<<<<<<<<<< * _write_array_data(settings, item, ndims, dim + 1, elem_data, * encoder, encoder_arg) */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/array.pyx":89 * int32_t dim, WriteBuffer elem_data, * encode_func_ex encoder, const void *encoder_arg): * if dim < ndims - 1: # <<<<<<<<<<<<<< * for item in obj: * _write_array_data(settings, item, ndims, dim + 1, elem_data, */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/array.pyx":94 * encoder, encoder_arg) * else: * for item in obj: # <<<<<<<<<<<<<< * if item is None: * elem_data.write_int32(-1) */ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) { __pyx_t_2 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 94, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 94, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(4, 94, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 94, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(4, 94, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(4, 94, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":95 * else: * for item in obj: * if item is None: # <<<<<<<<<<<<<< * elem_data.write_int32(-1) * else: */ __pyx_t_1 = (__pyx_v_item == Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":96 * for item in obj: * if item is None: * elem_data.write_int32(-1) # <<<<<<<<<<<<<< * else: * try: */ __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_elem_data->__pyx_vtab)->write_int32(__pyx_v_elem_data, -1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":95 * else: * for item in obj: * if item is None: # <<<<<<<<<<<<<< * elem_data.write_int32(-1) * else: */ goto __pyx_L9; } /* "asyncpg/protocol/codecs/array.pyx":98 * elem_data.write_int32(-1) * else: * try: # <<<<<<<<<<<<<< * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: */ /*else*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "asyncpg/protocol/codecs/array.pyx":99 * else: * try: * encoder(settings, elem_data, item, encoder_arg) # <<<<<<<<<<<<<< * except TypeError as e: * raise ValueError( */ __pyx_t_5 = __pyx_v_encoder(__pyx_v_settings, __pyx_v_elem_data, __pyx_v_item, __pyx_v_encoder_arg); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 99, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":98 * elem_data.write_int32(-1) * else: * try: # <<<<<<<<<<<<<< * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L17_try_end; __pyx_L10_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":100 * try: * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: # <<<<<<<<<<<<<< * raise ValueError( * 'invalid array element: {}'.format(e.args[0])) from None */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_9) { __Pyx_AddTraceback("asyncpg.protocol.protocol._write_array_data", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_10, &__pyx_t_11) < 0) __PYX_ERR(4, 100, __pyx_L12_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_10); __pyx_v_e = __pyx_t_10; /*try:*/ { /* "asyncpg/protocol/codecs/array.pyx":102 * except TypeError as e: * raise ValueError( * 'invalid array element: {}'.format(e.args[0])) from None # <<<<<<<<<<<<<< * * */ __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_array_element, __pyx_n_s_format); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 102, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_args); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 102, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_14, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 102, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; __pyx_t_16 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_16 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_15}; __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 102, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } /* "asyncpg/protocol/codecs/array.pyx":101 * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: * raise ValueError( # <<<<<<<<<<<<<< * 'invalid array element: {}'.format(e.args[0])) from None * */ __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 101, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "asyncpg/protocol/codecs/array.pyx":102 * except TypeError as e: * raise ValueError( * 'invalid array element: {}'.format(e.args[0])) from None # <<<<<<<<<<<<<< * * */ __Pyx_Raise(__pyx_t_13, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __PYX_ERR(4, 101, __pyx_L23_error) } /* "asyncpg/protocol/codecs/array.pyx":100 * try: * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: # <<<<<<<<<<<<<< * raise ValueError( * 'invalid array element: {}'.format(e.args[0])) from None */ /*finally:*/ { __pyx_L23_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __pyx_t_9 = __pyx_lineno; __pyx_t_17 = __pyx_clineno; __pyx_t_18 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24); } __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ErrRestore(__pyx_t_19, __pyx_t_20, __pyx_t_21); __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_17; __pyx_filename = __pyx_t_18; goto __pyx_L12_except_error; } } } goto __pyx_L12_except_error; /* "asyncpg/protocol/codecs/array.pyx":98 * elem_data.write_int32(-1) * else: * try: # <<<<<<<<<<<<<< * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: */ __pyx_L12_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L17_try_end:; } } __pyx_L9:; /* "asyncpg/protocol/codecs/array.pyx":94 * encoder, encoder_arg) * else: * for item in obj: # <<<<<<<<<<<<<< * if item is None: * elem_data.write_int32(-1) */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L3:; /* "asyncpg/protocol/codecs/array.pyx":86 * * * cdef _write_array_data(ConnectionSettings settings, object obj, int32_t ndims, # <<<<<<<<<<<<<< * int32_t dim, WriteBuffer elem_data, * encode_func_ex encoder, const void *encoder_arg): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("asyncpg.protocol.protocol._write_array_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_item); __Pyx_XDECREF(__pyx_v_e); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":105 * * * cdef inline array_encode(ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj, uint32_t elem_oid, * encode_func_ex encoder, const void *encoder_arg): */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_array_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj, uint32_t __pyx_v_elem_oid, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex __pyx_v_encoder, void const *__pyx_v_encoder_arg) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_elem_data = 0; int32_t __pyx_v_dims[6]; int32_t __pyx_v_ndims; int32_t __pyx_v_i; PyObject *__pyx_v_item = NULL; PyObject *__pyx_v_e = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int32_t __pyx_t_8; Py_ssize_t __pyx_t_9; PyObject *(*__pyx_t_10)(PyObject *); PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; int __pyx_t_20; char const *__pyx_t_21; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; PyObject *__pyx_t_25 = NULL; PyObject *__pyx_t_26 = NULL; PyObject *__pyx_t_27 = NULL; int32_t __pyx_t_28; int32_t __pyx_t_29; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("array_encode", 1); /* "asyncpg/protocol/codecs/array.pyx":111 * WriteBuffer elem_data * int32_t dims[ARRAY_MAXDIM] * int32_t ndims = 1 # <<<<<<<<<<<<<< * int32_t i * */ __pyx_v_ndims = 1; /* "asyncpg/protocol/codecs/array.pyx":114 * int32_t i * * if not _is_array_iterable(obj): # <<<<<<<<<<<<<< * raise TypeError( * 'a sized iterable container expected (got type {!r})'.format( */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol__is_array_iterable(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (unlikely(__pyx_t_3)) { /* "asyncpg/protocol/codecs/array.pyx":116 * if not _is_array_iterable(obj): * raise TypeError( * 'a sized iterable container expected (got type {!r})'.format( # <<<<<<<<<<<<<< * type(obj).__name__)) * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_a_sized_iterable_container_expec, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/codecs/array.pyx":117 * raise TypeError( * 'a sized iterable container expected (got type {!r})'.format( * type(obj).__name__)) # <<<<<<<<<<<<<< * * _get_array_shape(obj, dims, &ndims) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/protocol/codecs/array.pyx":115 * * if not _is_array_iterable(obj): * raise TypeError( # <<<<<<<<<<<<<< * 'a sized iterable container expected (got type {!r})'.format( * type(obj).__name__)) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(4, 115, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":114 * int32_t i * * if not _is_array_iterable(obj): # <<<<<<<<<<<<<< * raise TypeError( * 'a sized iterable container expected (got type {!r})'.format( */ } /* "asyncpg/protocol/codecs/array.pyx":119 * type(obj).__name__)) * * _get_array_shape(obj, dims, &ndims) # <<<<<<<<<<<<<< * * elem_data = WriteBuffer.new() */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol__get_array_shape(__pyx_v_obj, __pyx_v_dims, (&__pyx_v_ndims)); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":121 * _get_array_shape(obj, dims, &ndims) * * elem_data = WriteBuffer.new() # <<<<<<<<<<<<<< * * if ndims > 1: */ __pyx_t_4 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_elem_data = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":123 * elem_data = WriteBuffer.new() * * if ndims > 1: # <<<<<<<<<<<<<< * _write_array_data(settings, obj, ndims, 0, elem_data, * encoder, encoder_arg) */ __pyx_t_3 = (__pyx_v_ndims > 1); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/array.pyx":124 * * if ndims > 1: * _write_array_data(settings, obj, ndims, 0, elem_data, # <<<<<<<<<<<<<< * encoder, encoder_arg) * else: */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol__write_array_data(__pyx_v_settings, __pyx_v_obj, __pyx_v_ndims, 0, __pyx_v_elem_data, __pyx_v_encoder, __pyx_v_encoder_arg); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":123 * elem_data = WriteBuffer.new() * * if ndims > 1: # <<<<<<<<<<<<<< * _write_array_data(settings, obj, ndims, 0, elem_data, * encoder, encoder_arg) */ goto __pyx_L4; } /* "asyncpg/protocol/codecs/array.pyx":127 * encoder, encoder_arg) * else: * for i, item in enumerate(obj): # <<<<<<<<<<<<<< * if item is None: * elem_data.write_int32(-1) */ /*else*/ { __pyx_t_8 = 0; if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) { __pyx_t_4 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 127, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_10)) { if (likely(PyList_CheckExact(__pyx_t_4))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 127, __pyx_L1_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(4, 127, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 127, __pyx_L1_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(4, 127, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_10(__pyx_t_4); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(4, 127, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1); __pyx_t_1 = 0; __pyx_v_i = __pyx_t_8; __pyx_t_8 = (__pyx_t_8 + 1); /* "asyncpg/protocol/codecs/array.pyx":128 * else: * for i, item in enumerate(obj): * if item is None: # <<<<<<<<<<<<<< * elem_data.write_int32(-1) * else: */ __pyx_t_3 = (__pyx_v_item == Py_None); if (__pyx_t_3) { /* "asyncpg/protocol/codecs/array.pyx":129 * for i, item in enumerate(obj): * if item is None: * elem_data.write_int32(-1) # <<<<<<<<<<<<<< * else: * try: */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_elem_data->__pyx_vtab)->write_int32(__pyx_v_elem_data, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":128 * else: * for i, item in enumerate(obj): * if item is None: # <<<<<<<<<<<<<< * elem_data.write_int32(-1) * else: */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/array.pyx":131 * elem_data.write_int32(-1) * else: * try: # <<<<<<<<<<<<<< * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: */ /*else*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { /* "asyncpg/protocol/codecs/array.pyx":132 * else: * try: * encoder(settings, elem_data, item, encoder_arg) # <<<<<<<<<<<<<< * except TypeError as e: * raise ValueError( */ __pyx_t_1 = __pyx_v_encoder(__pyx_v_settings, __pyx_v_elem_data, __pyx_v_item, __pyx_v_encoder_arg); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 132, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":131 * elem_data.write_int32(-1) * else: * try: # <<<<<<<<<<<<<< * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: */ } __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L15_try_end; __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/array.pyx":133 * try: * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: # <<<<<<<<<<<<<< * raise ValueError( * 'invalid array element at index {}: {}'.format( */ __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_14) { __Pyx_AddTraceback("asyncpg.protocol.protocol.array_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(4, 133, __pyx_L10_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_v_e = __pyx_t_5; /*try:*/ { /* "asyncpg/protocol/codecs/array.pyx":135 * except TypeError as e: * raise ValueError( * 'invalid array element at index {}: {}'.format( # <<<<<<<<<<<<<< * i, e.args[0])) from None * */ __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_array_element_at_index, __pyx_n_s_format); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 135, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_16); /* "asyncpg/protocol/codecs/array.pyx":136 * raise ValueError( * 'invalid array element at index {}: {}'.format( * i, e.args[0])) from None # <<<<<<<<<<<<<< * * buf.write_int32(12 + 8 * ndims + elem_data.len()) */ __pyx_t_17 = __Pyx_PyInt_From_int32_t(__pyx_v_i); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 136, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_args); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 136, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_19 = __Pyx_GetItemInt(__pyx_t_18, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 136, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_18)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_18, __pyx_t_17, __pyx_t_19}; __pyx_t_15 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 135, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } /* "asyncpg/protocol/codecs/array.pyx":134 * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: * raise ValueError( # <<<<<<<<<<<<<< * 'invalid array element at index {}: {}'.format( * i, e.args[0])) from None */ __pyx_t_16 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 134, __pyx_L21_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "asyncpg/protocol/codecs/array.pyx":136 * raise ValueError( * 'invalid array element at index {}: {}'.format( * i, e.args[0])) from None # <<<<<<<<<<<<<< * * buf.write_int32(12 + 8 * ndims + elem_data.len()) */ __Pyx_Raise(__pyx_t_16, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __PYX_ERR(4, 134, __pyx_L21_error) } /* "asyncpg/protocol/codecs/array.pyx":133 * try: * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: # <<<<<<<<<<<<<< * raise ValueError( * 'invalid array element at index {}: {}'.format( */ /*finally:*/ { __pyx_L21_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_26); __Pyx_XGOTREF(__pyx_t_27); __pyx_t_14 = __pyx_lineno; __pyx_t_20 = __pyx_clineno; __pyx_t_21 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_XGIVEREF(__pyx_t_27); __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_26, __pyx_t_27); } __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ErrRestore(__pyx_t_22, __pyx_t_23, __pyx_t_24); __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_21; goto __pyx_L10_except_error; } } } goto __pyx_L10_except_error; /* "asyncpg/protocol/codecs/array.pyx":131 * elem_data.write_int32(-1) * else: * try: # <<<<<<<<<<<<<< * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: */ __pyx_L10_except_error:; __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L1_error; __pyx_L15_try_end:; } } __pyx_L7:; /* "asyncpg/protocol/codecs/array.pyx":127 * encoder, encoder_arg) * else: * for i, item in enumerate(obj): # <<<<<<<<<<<<<< * if item is None: * elem_data.write_int32(-1) */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L4:; /* "asyncpg/protocol/codecs/array.pyx":138 * i, e.args[0])) from None * * buf.write_int32(12 + 8 * ndims + elem_data.len()) # <<<<<<<<<<<<<< * # Number of dimensions * buf.write_int32(ndims) */ __pyx_t_4 = __Pyx_PyInt_From_long((12 + (8 * __pyx_v_ndims))); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_elem_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_t_5); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":140 * buf.write_int32(12 + 8 * ndims + elem_data.len()) * # Number of dimensions * buf.write_int32(ndims) # <<<<<<<<<<<<<< * # flags * buf.write_int32(0) */ __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_v_ndims); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":142 * buf.write_int32(ndims) * # flags * buf.write_int32(0) # <<<<<<<<<<<<<< * # element type * buf.write_int32(elem_oid) */ __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":144 * buf.write_int32(0) * # element type * buf.write_int32(elem_oid) # <<<<<<<<<<<<<< * # upper / lower bounds * for i in range(ndims): */ __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, ((int32_t)__pyx_v_elem_oid)); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":146 * buf.write_int32(elem_oid) * # upper / lower bounds * for i in range(ndims): # <<<<<<<<<<<<<< * buf.write_int32(dims[i]) * buf.write_int32(1) */ __pyx_t_8 = __pyx_v_ndims; __pyx_t_28 = __pyx_t_8; for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) { __pyx_v_i = __pyx_t_29; /* "asyncpg/protocol/codecs/array.pyx":147 * # upper / lower bounds * for i in range(ndims): * buf.write_int32(dims[i]) # <<<<<<<<<<<<<< * buf.write_int32(1) * # element data */ __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, (__pyx_v_dims[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":148 * for i in range(ndims): * buf.write_int32(dims[i]) * buf.write_int32(1) # <<<<<<<<<<<<<< * # element data * buf.write_buffer(elem_data) */ __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* "asyncpg/protocol/codecs/array.pyx":150 * buf.write_int32(1) * # element data * buf.write_buffer(elem_data) # <<<<<<<<<<<<<< * * */ __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, __pyx_v_elem_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":105 * * * cdef inline array_encode(ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj, uint32_t elem_oid, * encode_func_ex encoder, const void *encoder_arg): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_XDECREF(__pyx_t_18); __Pyx_XDECREF(__pyx_t_19); __Pyx_AddTraceback("asyncpg.protocol.protocol.array_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_elem_data); __Pyx_XDECREF(__pyx_v_item); __Pyx_XDECREF(__pyx_v_e); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":153 * * * cdef _write_textarray_data(ConnectionSettings settings, object obj, # <<<<<<<<<<<<<< * int32_t ndims, int32_t dim, WriteBuffer array_data, * encode_func_ex encoder, const void *encoder_arg, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__write_textarray_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, PyObject *__pyx_v_obj, int32_t __pyx_v_ndims, int32_t __pyx_v_dim, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_array_data, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex __pyx_v_encoder, void const *__pyx_v_encoder_arg, Py_UCS4 __pyx_v_typdelim) { Py_ssize_t __pyx_v_i; int8_t __pyx_v_delim; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_elem_data = 0; Py_buffer __pyx_v_pybuf; char const *__pyx_v_elem_str; char __pyx_v_ch; Py_ssize_t __pyx_v_elem_len; Py_ssize_t __pyx_v_quoted_elem_len; int __pyx_v_need_quoting; PyObject *__pyx_v_item = NULL; PyObject *__pyx_v_e = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; unsigned int __pyx_t_16; int __pyx_t_17; char const *__pyx_t_18; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; Py_ssize_t __pyx_t_25; Py_ssize_t __pyx_t_26; Py_ssize_t __pyx_t_27; int __pyx_t_28; char const *__pyx_t_29; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_write_textarray_data", 1); /* "asyncpg/protocol/codecs/array.pyx":158 * Py_UCS4 typdelim): * cdef: * ssize_t i = 0 # <<<<<<<<<<<<<< * int8_t delim = typdelim * WriteBuffer elem_data */ __pyx_v_i = 0; /* "asyncpg/protocol/codecs/array.pyx":159 * cdef: * ssize_t i = 0 * int8_t delim = typdelim # <<<<<<<<<<<<<< * WriteBuffer elem_data * Py_buffer pybuf */ __pyx_v_delim = ((int8_t)__pyx_v_typdelim); /* "asyncpg/protocol/codecs/array.pyx":168 * bint need_quoting * * array_data.write_byte(b'{') # <<<<<<<<<<<<<< * * if dim < ndims - 1: */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, '{'); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":170 * array_data.write_byte(b'{') * * if dim < ndims - 1: # <<<<<<<<<<<<<< * for item in obj: * if i > 0: */ __pyx_t_2 = (__pyx_v_dim < (__pyx_v_ndims - 1)); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":171 * * if dim < ndims - 1: * for item in obj: # <<<<<<<<<<<<<< * if i > 0: * array_data.write_byte(delim) */ if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) { __pyx_t_1 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 171, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 171, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(4, 171, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 171, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(4, 171, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(4, 171, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":172 * if dim < ndims - 1: * for item in obj: * if i > 0: # <<<<<<<<<<<<<< * array_data.write_byte(delim) * array_data.write_byte(b' ') */ __pyx_t_2 = (__pyx_v_i > 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":173 * for item in obj: * if i > 0: * array_data.write_byte(delim) # <<<<<<<<<<<<<< * array_data.write_byte(b' ') * _write_textarray_data(settings, item, ndims, dim + 1, array_data, */ __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, __pyx_v_delim); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":174 * if i > 0: * array_data.write_byte(delim) * array_data.write_byte(b' ') # <<<<<<<<<<<<<< * _write_textarray_data(settings, item, ndims, dim + 1, array_data, * encoder, encoder_arg, typdelim) */ __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, ' '); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":172 * if dim < ndims - 1: * for item in obj: * if i > 0: # <<<<<<<<<<<<<< * array_data.write_byte(delim) * array_data.write_byte(b' ') */ } /* "asyncpg/protocol/codecs/array.pyx":175 * array_data.write_byte(delim) * array_data.write_byte(b' ') * _write_textarray_data(settings, item, ndims, dim + 1, array_data, # <<<<<<<<<<<<<< * encoder, encoder_arg, typdelim) * i += 1 */ __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol__write_textarray_data(__pyx_v_settings, __pyx_v_item, __pyx_v_ndims, (__pyx_v_dim + 1), __pyx_v_array_data, __pyx_v_encoder, __pyx_v_encoder_arg, __pyx_v_typdelim); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":177 * _write_textarray_data(settings, item, ndims, dim + 1, array_data, * encoder, encoder_arg, typdelim) * i += 1 # <<<<<<<<<<<<<< * else: * for item in obj: */ __pyx_v_i = (__pyx_v_i + 1); /* "asyncpg/protocol/codecs/array.pyx":171 * * if dim < ndims - 1: * for item in obj: # <<<<<<<<<<<<<< * if i > 0: * array_data.write_byte(delim) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":170 * array_data.write_byte(b'{') * * if dim < ndims - 1: # <<<<<<<<<<<<<< * for item in obj: * if i > 0: */ goto __pyx_L3; } /* "asyncpg/protocol/codecs/array.pyx":179 * i += 1 * else: * for item in obj: # <<<<<<<<<<<<<< * elem_data = WriteBuffer.new() * */ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) { __pyx_t_1 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 179, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 179, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(4, 179, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 179, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(4, 179, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(4, 179, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":180 * else: * for item in obj: * elem_data = WriteBuffer.new() # <<<<<<<<<<<<<< * * if i > 0: */ __pyx_t_5 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_elem_data, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_5)); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":182 * elem_data = WriteBuffer.new() * * if i > 0: # <<<<<<<<<<<<<< * array_data.write_byte(delim) * array_data.write_byte(b' ') */ __pyx_t_2 = (__pyx_v_i > 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":183 * * if i > 0: * array_data.write_byte(delim) # <<<<<<<<<<<<<< * array_data.write_byte(b' ') * */ __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, __pyx_v_delim); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":184 * if i > 0: * array_data.write_byte(delim) * array_data.write_byte(b' ') # <<<<<<<<<<<<<< * * if item is None: */ __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, ' '); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":182 * elem_data = WriteBuffer.new() * * if i > 0: # <<<<<<<<<<<<<< * array_data.write_byte(delim) * array_data.write_byte(b' ') */ } /* "asyncpg/protocol/codecs/array.pyx":186 * array_data.write_byte(b' ') * * if item is None: # <<<<<<<<<<<<<< * array_data.write_bytes(b'NULL') * i += 1 */ __pyx_t_2 = (__pyx_v_item == Py_None); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":187 * * if item is None: * array_data.write_bytes(b'NULL') # <<<<<<<<<<<<<< * i += 1 * continue */ __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_bytes(__pyx_v_array_data, __pyx_n_b_NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":188 * if item is None: * array_data.write_bytes(b'NULL') * i += 1 # <<<<<<<<<<<<<< * continue * else: */ __pyx_v_i = (__pyx_v_i + 1); /* "asyncpg/protocol/codecs/array.pyx":189 * array_data.write_bytes(b'NULL') * i += 1 * continue # <<<<<<<<<<<<<< * else: * try: */ goto __pyx_L8_continue; /* "asyncpg/protocol/codecs/array.pyx":186 * array_data.write_byte(b' ') * * if item is None: # <<<<<<<<<<<<<< * array_data.write_bytes(b'NULL') * i += 1 */ } /* "asyncpg/protocol/codecs/array.pyx":191 * continue * else: * try: # <<<<<<<<<<<<<< * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: */ /*else*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "asyncpg/protocol/codecs/array.pyx":192 * else: * try: * encoder(settings, elem_data, item, encoder_arg) # <<<<<<<<<<<<<< * except TypeError as e: * raise ValueError( */ __pyx_t_5 = __pyx_v_encoder(__pyx_v_settings, __pyx_v_elem_data, __pyx_v_item, __pyx_v_encoder_arg); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 192, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":191 * continue * else: * try: # <<<<<<<<<<<<<< * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L19_try_end; __pyx_L12_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":193 * try: * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: # <<<<<<<<<<<<<< * raise ValueError( * 'invalid array element: {}'.format( */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_9) { __Pyx_AddTraceback("asyncpg.protocol.protocol._write_textarray_data", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_10, &__pyx_t_11) < 0) __PYX_ERR(4, 193, __pyx_L14_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_10); __pyx_v_e = __pyx_t_10; /*try:*/ { /* "asyncpg/protocol/codecs/array.pyx":195 * except TypeError as e: * raise ValueError( * 'invalid array element: {}'.format( # <<<<<<<<<<<<<< * e.args[0])) from None * */ __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_array_element, __pyx_n_s_format); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 195, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_13); /* "asyncpg/protocol/codecs/array.pyx":196 * raise ValueError( * 'invalid array element: {}'.format( * e.args[0])) from None # <<<<<<<<<<<<<< * * # element string length (first four bytes are the encoded length.) */ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_args); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 196, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_14, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 196, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; __pyx_t_16 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_16 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_15}; __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 195, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } /* "asyncpg/protocol/codecs/array.pyx":194 * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: * raise ValueError( # <<<<<<<<<<<<<< * 'invalid array element: {}'.format( * e.args[0])) from None */ __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 194, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "asyncpg/protocol/codecs/array.pyx":196 * raise ValueError( * 'invalid array element: {}'.format( * e.args[0])) from None # <<<<<<<<<<<<<< * * # element string length (first four bytes are the encoded length.) */ __Pyx_Raise(__pyx_t_13, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __PYX_ERR(4, 194, __pyx_L25_error) } /* "asyncpg/protocol/codecs/array.pyx":193 * try: * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: # <<<<<<<<<<<<<< * raise ValueError( * 'invalid array element: {}'.format( */ /*finally:*/ { __pyx_L25_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __pyx_t_9 = __pyx_lineno; __pyx_t_17 = __pyx_clineno; __pyx_t_18 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24); } __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ErrRestore(__pyx_t_19, __pyx_t_20, __pyx_t_21); __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_17; __pyx_filename = __pyx_t_18; goto __pyx_L14_except_error; } } } goto __pyx_L14_except_error; /* "asyncpg/protocol/codecs/array.pyx":191 * continue * else: * try: # <<<<<<<<<<<<<< * encoder(settings, elem_data, item, encoder_arg) * except TypeError as e: */ __pyx_L14_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L19_try_end:; } } /* "asyncpg/protocol/codecs/array.pyx":199 * * # element string length (first four bytes are the encoded length.) * elem_len = elem_data.len() - 4 # <<<<<<<<<<<<<< * * if elem_len == 0: */ __pyx_t_11 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_elem_data); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = __Pyx_PyInt_SubtractObjC(__pyx_t_11, __pyx_int_4, 4, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_25 = PyInt_AsSsize_t(__pyx_t_10); if (unlikely((__pyx_t_25 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_elem_len = __pyx_t_25; /* "asyncpg/protocol/codecs/array.pyx":201 * elem_len = elem_data.len() - 4 * * if elem_len == 0: # <<<<<<<<<<<<<< * # Empty string * array_data.write_bytes(b'""') */ __pyx_t_2 = (__pyx_v_elem_len == 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":203 * if elem_len == 0: * # Empty string * array_data.write_bytes(b'""') # <<<<<<<<<<<<<< * else: * cpython.PyObject_GetBuffer( */ __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_bytes(__pyx_v_array_data, __pyx_kp_b__15); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/codecs/array.pyx":201 * elem_len = elem_data.len() - 4 * * if elem_len == 0: # <<<<<<<<<<<<<< * # Empty string * array_data.write_bytes(b'""') */ goto __pyx_L31; } /* "asyncpg/protocol/codecs/array.pyx":205 * array_data.write_bytes(b'""') * else: * cpython.PyObject_GetBuffer( # <<<<<<<<<<<<<< * elem_data, &pybuf, cpython.PyBUF_SIMPLE) * */ /*else*/ { /* "asyncpg/protocol/codecs/array.pyx":206 * else: * cpython.PyObject_GetBuffer( * elem_data, &pybuf, cpython.PyBUF_SIMPLE) # <<<<<<<<<<<<<< * * elem_str = (pybuf.buf) + 4 */ __pyx_t_17 = PyObject_GetBuffer(((PyObject *)__pyx_v_elem_data), (&__pyx_v_pybuf), PyBUF_SIMPLE); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(4, 205, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":208 * elem_data, &pybuf, cpython.PyBUF_SIMPLE) * * elem_str = (pybuf.buf) + 4 # <<<<<<<<<<<<<< * * try: */ __pyx_v_elem_str = (((char const *)__pyx_v_pybuf.buf) + 4); /* "asyncpg/protocol/codecs/array.pyx":210 * elem_str = (pybuf.buf) + 4 * * try: # <<<<<<<<<<<<<< * if not apg_strcasecmp_char(elem_str, b'NULL'): * array_data.write_byte(b'"') */ /*try:*/ { /* "asyncpg/protocol/codecs/array.pyx":211 * * try: * if not apg_strcasecmp_char(elem_str, b'NULL'): # <<<<<<<<<<<<<< * array_data.write_byte(b'"') * array_data.write_cstr(elem_str, 4) */ __pyx_t_17 = __pyx_f_7asyncpg_8protocol_8protocol_apg_strcasecmp_char(__pyx_v_elem_str, ((char const *)"NULL")); if (unlikely(__pyx_t_17 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(4, 211, __pyx_L35_error) __pyx_t_2 = (!(__pyx_t_17 != 0)); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":212 * try: * if not apg_strcasecmp_char(elem_str, b'NULL'): * array_data.write_byte(b'"') # <<<<<<<<<<<<<< * array_data.write_cstr(elem_str, 4) * array_data.write_byte(b'"') */ __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, '"'); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 212, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/codecs/array.pyx":213 * if not apg_strcasecmp_char(elem_str, b'NULL'): * array_data.write_byte(b'"') * array_data.write_cstr(elem_str, 4) # <<<<<<<<<<<<<< * array_data.write_byte(b'"') * else: */ __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_cstr(__pyx_v_array_data, __pyx_v_elem_str, 4); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 213, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/codecs/array.pyx":214 * array_data.write_byte(b'"') * array_data.write_cstr(elem_str, 4) * array_data.write_byte(b'"') # <<<<<<<<<<<<<< * else: * quoted_elem_len = elem_len */ __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, '"'); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 214, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/codecs/array.pyx":211 * * try: * if not apg_strcasecmp_char(elem_str, b'NULL'): # <<<<<<<<<<<<<< * array_data.write_byte(b'"') * array_data.write_cstr(elem_str, 4) */ goto __pyx_L37; } /* "asyncpg/protocol/codecs/array.pyx":216 * array_data.write_byte(b'"') * else: * quoted_elem_len = elem_len # <<<<<<<<<<<<<< * need_quoting = False * */ /*else*/ { __pyx_v_quoted_elem_len = __pyx_v_elem_len; /* "asyncpg/protocol/codecs/array.pyx":217 * else: * quoted_elem_len = elem_len * need_quoting = False # <<<<<<<<<<<<<< * * for i in range(elem_len): */ __pyx_v_need_quoting = 0; /* "asyncpg/protocol/codecs/array.pyx":219 * need_quoting = False * * for i in range(elem_len): # <<<<<<<<<<<<<< * ch = elem_str[i] * if ch == b'"' or ch == b'\\': */ __pyx_t_25 = __pyx_v_elem_len; __pyx_t_26 = __pyx_t_25; for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) { __pyx_v_i = __pyx_t_27; /* "asyncpg/protocol/codecs/array.pyx":220 * * for i in range(elem_len): * ch = elem_str[i] # <<<<<<<<<<<<<< * if ch == b'"' or ch == b'\\': * # Quotes and backslashes need escaping. */ __pyx_v_ch = (__pyx_v_elem_str[__pyx_v_i]); /* "asyncpg/protocol/codecs/array.pyx":221 * for i in range(elem_len): * ch = elem_str[i] * if ch == b'"' or ch == b'\\': # <<<<<<<<<<<<<< * # Quotes and backslashes need escaping. * quoted_elem_len += 1 */ switch (__pyx_v_ch) { case '"': case '\\': __pyx_t_2 = 1; break; default: __pyx_t_2 = 0; break; } if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":223 * if ch == b'"' or ch == b'\\': * # Quotes and backslashes need escaping. * quoted_elem_len += 1 # <<<<<<<<<<<<<< * need_quoting = True * elif (ch == b'{' or ch == b'}' or ch == delim or */ __pyx_v_quoted_elem_len = (__pyx_v_quoted_elem_len + 1); /* "asyncpg/protocol/codecs/array.pyx":224 * # Quotes and backslashes need escaping. * quoted_elem_len += 1 * need_quoting = True # <<<<<<<<<<<<<< * elif (ch == b'{' or ch == b'}' or ch == delim or * apg_ascii_isspace(ch)): */ __pyx_v_need_quoting = 1; /* "asyncpg/protocol/codecs/array.pyx":221 * for i in range(elem_len): * ch = elem_str[i] * if ch == b'"' or ch == b'\\': # <<<<<<<<<<<<<< * # Quotes and backslashes need escaping. * quoted_elem_len += 1 */ goto __pyx_L40; } /* "asyncpg/protocol/codecs/array.pyx":225 * quoted_elem_len += 1 * need_quoting = True * elif (ch == b'{' or ch == b'}' or ch == delim or # <<<<<<<<<<<<<< * apg_ascii_isspace(ch)): * need_quoting = True */ __pyx_t_28 = (__pyx_v_ch == '{'); if (!__pyx_t_28) { } else { __pyx_t_2 = __pyx_t_28; goto __pyx_L41_bool_binop_done; } __pyx_t_28 = (__pyx_v_ch == '}'); if (!__pyx_t_28) { } else { __pyx_t_2 = __pyx_t_28; goto __pyx_L41_bool_binop_done; } __pyx_t_28 = (__pyx_v_ch == __pyx_v_delim); if (!__pyx_t_28) { } else { __pyx_t_2 = __pyx_t_28; goto __pyx_L41_bool_binop_done; } /* "asyncpg/protocol/codecs/array.pyx":226 * need_quoting = True * elif (ch == b'{' or ch == b'}' or ch == delim or * apg_ascii_isspace(ch)): # <<<<<<<<<<<<<< * need_quoting = True * */ __pyx_t_28 = __pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace(((uint32_t)__pyx_v_ch)); if (unlikely(__pyx_t_28 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(4, 226, __pyx_L35_error) __pyx_t_2 = __pyx_t_28; __pyx_L41_bool_binop_done:; /* "asyncpg/protocol/codecs/array.pyx":225 * quoted_elem_len += 1 * need_quoting = True * elif (ch == b'{' or ch == b'}' or ch == delim or # <<<<<<<<<<<<<< * apg_ascii_isspace(ch)): * need_quoting = True */ if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":227 * elif (ch == b'{' or ch == b'}' or ch == delim or * apg_ascii_isspace(ch)): * need_quoting = True # <<<<<<<<<<<<<< * * if need_quoting: */ __pyx_v_need_quoting = 1; /* "asyncpg/protocol/codecs/array.pyx":225 * quoted_elem_len += 1 * need_quoting = True * elif (ch == b'{' or ch == b'}' or ch == delim or # <<<<<<<<<<<<<< * apg_ascii_isspace(ch)): * need_quoting = True */ } __pyx_L40:; } /* "asyncpg/protocol/codecs/array.pyx":229 * need_quoting = True * * if need_quoting: # <<<<<<<<<<<<<< * array_data.write_byte(b'"') * */ if (__pyx_v_need_quoting) { /* "asyncpg/protocol/codecs/array.pyx":230 * * if need_quoting: * array_data.write_byte(b'"') # <<<<<<<<<<<<<< * * if quoted_elem_len == elem_len: */ __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, '"'); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 230, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/codecs/array.pyx":232 * array_data.write_byte(b'"') * * if quoted_elem_len == elem_len: # <<<<<<<<<<<<<< * array_data.write_cstr(elem_str, elem_len) * else: */ __pyx_t_2 = (__pyx_v_quoted_elem_len == __pyx_v_elem_len); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":233 * * if quoted_elem_len == elem_len: * array_data.write_cstr(elem_str, elem_len) # <<<<<<<<<<<<<< * else: * # Escaping required. */ __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_cstr(__pyx_v_array_data, __pyx_v_elem_str, __pyx_v_elem_len); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 233, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/codecs/array.pyx":232 * array_data.write_byte(b'"') * * if quoted_elem_len == elem_len: # <<<<<<<<<<<<<< * array_data.write_cstr(elem_str, elem_len) * else: */ goto __pyx_L46; } /* "asyncpg/protocol/codecs/array.pyx":236 * else: * # Escaping required. * for i in range(elem_len): # <<<<<<<<<<<<<< * ch = elem_str[i] * if ch == b'"' or ch == b'\\': */ /*else*/ { __pyx_t_25 = __pyx_v_elem_len; __pyx_t_26 = __pyx_t_25; for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) { __pyx_v_i = __pyx_t_27; /* "asyncpg/protocol/codecs/array.pyx":237 * # Escaping required. * for i in range(elem_len): * ch = elem_str[i] # <<<<<<<<<<<<<< * if ch == b'"' or ch == b'\\': * array_data.write_byte(b'\\') */ __pyx_v_ch = (__pyx_v_elem_str[__pyx_v_i]); /* "asyncpg/protocol/codecs/array.pyx":238 * for i in range(elem_len): * ch = elem_str[i] * if ch == b'"' or ch == b'\\': # <<<<<<<<<<<<<< * array_data.write_byte(b'\\') * array_data.write_byte(ch) */ switch (__pyx_v_ch) { case '"': case '\\': /* "asyncpg/protocol/codecs/array.pyx":239 * ch = elem_str[i] * if ch == b'"' or ch == b'\\': * array_data.write_byte(b'\\') # <<<<<<<<<<<<<< * array_data.write_byte(ch) * */ __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, '\\'); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 239, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/codecs/array.pyx":238 * for i in range(elem_len): * ch = elem_str[i] * if ch == b'"' or ch == b'\\': # <<<<<<<<<<<<<< * array_data.write_byte(b'\\') * array_data.write_byte(ch) */ break; default: break; } /* "asyncpg/protocol/codecs/array.pyx":240 * if ch == b'"' or ch == b'\\': * array_data.write_byte(b'\\') * array_data.write_byte(ch) # <<<<<<<<<<<<<< * * array_data.write_byte(b'"') */ __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, __pyx_v_ch); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 240, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } } __pyx_L46:; /* "asyncpg/protocol/codecs/array.pyx":242 * array_data.write_byte(ch) * * array_data.write_byte(b'"') # <<<<<<<<<<<<<< * else: * array_data.write_cstr(elem_str, elem_len) */ __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, '"'); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 242, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/codecs/array.pyx":229 * need_quoting = True * * if need_quoting: # <<<<<<<<<<<<<< * array_data.write_byte(b'"') * */ goto __pyx_L45; } /* "asyncpg/protocol/codecs/array.pyx":244 * array_data.write_byte(b'"') * else: * array_data.write_cstr(elem_str, elem_len) # <<<<<<<<<<<<<< * finally: * cpython.PyBuffer_Release(&pybuf) */ /*else*/ { __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_cstr(__pyx_v_array_data, __pyx_v_elem_str, __pyx_v_elem_len); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 244, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __pyx_L45:; } __pyx_L37:; } /* "asyncpg/protocol/codecs/array.pyx":246 * array_data.write_cstr(elem_str, elem_len) * finally: * cpython.PyBuffer_Release(&pybuf) # <<<<<<<<<<<<<< * * i += 1 */ /*finally:*/ { /*normal exit:*/{ PyBuffer_Release((&__pyx_v_pybuf)); goto __pyx_L36; } __pyx_L35_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_22); __pyx_t_17 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_29 = __pyx_filename; { PyBuffer_Release((&__pyx_v_pybuf)); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_23, __pyx_t_22); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_7, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_lineno = __pyx_t_17; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_29; goto __pyx_L1_error; } __pyx_L36:; } } __pyx_L31:; /* "asyncpg/protocol/codecs/array.pyx":248 * cpython.PyBuffer_Release(&pybuf) * * i += 1 # <<<<<<<<<<<<<< * * array_data.write_byte(b'}') */ __pyx_v_i = (__pyx_v_i + 1); /* "asyncpg/protocol/codecs/array.pyx":179 * i += 1 * else: * for item in obj: # <<<<<<<<<<<<<< * elem_data = WriteBuffer.new() * */ __pyx_L8_continue:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "asyncpg/protocol/codecs/array.pyx":250 * i += 1 * * array_data.write_byte(b'}') # <<<<<<<<<<<<<< * * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, '}'); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":153 * * * cdef _write_textarray_data(ConnectionSettings settings, object obj, # <<<<<<<<<<<<<< * int32_t ndims, int32_t dim, WriteBuffer array_data, * encode_func_ex encoder, const void *encoder_arg, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("asyncpg.protocol.protocol._write_textarray_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_elem_data); __Pyx_XDECREF(__pyx_v_item); __Pyx_XDECREF(__pyx_v_e); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":253 * * * cdef inline textarray_encode(ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj, encode_func_ex encoder, * const void *encoder_arg, Py_UCS4 typdelim): */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_textarray_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex __pyx_v_encoder, void const *__pyx_v_encoder_arg, Py_UCS4 __pyx_v_typdelim) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_array_data = 0; int32_t __pyx_v_dims[6]; int32_t __pyx_v_ndims; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int32_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("textarray_encode", 1); /* "asyncpg/protocol/codecs/array.pyx":259 * WriteBuffer array_data * int32_t dims[ARRAY_MAXDIM] * int32_t ndims = 1 # <<<<<<<<<<<<<< * int32_t i * */ __pyx_v_ndims = 1; /* "asyncpg/protocol/codecs/array.pyx":262 * int32_t i * * if not _is_array_iterable(obj): # <<<<<<<<<<<<<< * raise TypeError( * 'a sized iterable container expected (got type {!r})'.format( */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol__is_array_iterable(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(4, 262, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (unlikely(__pyx_t_3)) { /* "asyncpg/protocol/codecs/array.pyx":264 * if not _is_array_iterable(obj): * raise TypeError( * 'a sized iterable container expected (got type {!r})'.format( # <<<<<<<<<<<<<< * type(obj).__name__)) * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_a_sized_iterable_container_expec, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/codecs/array.pyx":265 * raise TypeError( * 'a sized iterable container expected (got type {!r})'.format( * type(obj).__name__)) # <<<<<<<<<<<<<< * * _get_array_shape(obj, dims, &ndims) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/protocol/codecs/array.pyx":263 * * if not _is_array_iterable(obj): * raise TypeError( # <<<<<<<<<<<<<< * 'a sized iterable container expected (got type {!r})'.format( * type(obj).__name__)) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(4, 263, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":262 * int32_t i * * if not _is_array_iterable(obj): # <<<<<<<<<<<<<< * raise TypeError( * 'a sized iterable container expected (got type {!r})'.format( */ } /* "asyncpg/protocol/codecs/array.pyx":267 * type(obj).__name__)) * * _get_array_shape(obj, dims, &ndims) # <<<<<<<<<<<<<< * * array_data = WriteBuffer.new() */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol__get_array_shape(__pyx_v_obj, __pyx_v_dims, (&__pyx_v_ndims)); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":269 * _get_array_shape(obj, dims, &ndims) * * array_data = WriteBuffer.new() # <<<<<<<<<<<<<< * _write_textarray_data(settings, obj, ndims, 0, array_data, * encoder, encoder_arg, typdelim) */ __pyx_t_4 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_array_data = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":270 * * array_data = WriteBuffer.new() * _write_textarray_data(settings, obj, ndims, 0, array_data, # <<<<<<<<<<<<<< * encoder, encoder_arg, typdelim) * buf.write_int32(array_data.len()) */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol__write_textarray_data(__pyx_v_settings, __pyx_v_obj, __pyx_v_ndims, 0, __pyx_v_array_data, __pyx_v_encoder, __pyx_v_encoder_arg, __pyx_v_typdelim); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":272 * _write_textarray_data(settings, obj, ndims, 0, array_data, * encoder, encoder_arg, typdelim) * buf.write_int32(array_data.len()) # <<<<<<<<<<<<<< * buf.write_buffer(array_data) * */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_array_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_t_4); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":273 * encoder, encoder_arg, typdelim) * buf.write_int32(array_data.len()) * buf.write_buffer(array_data) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, __pyx_v_array_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":253 * * * cdef inline textarray_encode(ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj, encode_func_ex encoder, * const void *encoder_arg, Py_UCS4 typdelim): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.protocol.protocol.textarray_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_array_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":276 * * * cdef inline array_decode(ConnectionSettings settings, FRBuffer *buf, # <<<<<<<<<<<<<< * decode_func_ex decoder, const void *decoder_arg): * cdef: */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_array_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex __pyx_v_decoder, void const *__pyx_v_decoder_arg) { int32_t __pyx_v_ndims; CYTHON_UNUSED int32_t __pyx_v_flags; CYTHON_UNUSED uint32_t __pyx_v_elem_oid; PyObject *__pyx_v_result = 0; int __pyx_v_i; int32_t __pyx_v_elem_len; int32_t __pyx_v_elem_count; struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer __pyx_v_elem_buf; int32_t __pyx_v_dims[6]; PyObject *__pyx_v_elem = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; int32_t __pyx_t_10; int32_t __pyx_t_11; int __pyx_t_12; struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("array_decode", 1); /* "asyncpg/protocol/codecs/array.pyx":279 * decode_func_ex decoder, const void *decoder_arg): * cdef: * int32_t ndims = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * int32_t flags = hton.unpack_int32(frb_read(buf, 4)) * uint32_t elem_oid = hton.unpack_int32(frb_read(buf, 4)) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(4, 279, __pyx_L1_error) __pyx_v_ndims = unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/array.pyx":280 * cdef: * int32_t ndims = hton.unpack_int32(frb_read(buf, 4)) * int32_t flags = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * uint32_t elem_oid = hton.unpack_int32(frb_read(buf, 4)) * list result */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(4, 280, __pyx_L1_error) __pyx_v_flags = unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/array.pyx":281 * int32_t ndims = hton.unpack_int32(frb_read(buf, 4)) * int32_t flags = hton.unpack_int32(frb_read(buf, 4)) * uint32_t elem_oid = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * list result * int i */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(4, 281, __pyx_L1_error) __pyx_v_elem_oid = ((uint32_t)unpack_int32(__pyx_t_1)); /* "asyncpg/protocol/codecs/array.pyx":285 * int i * int32_t elem_len * int32_t elem_count = 1 # <<<<<<<<<<<<<< * FRBuffer elem_buf * int32_t dims[ARRAY_MAXDIM] */ __pyx_v_elem_count = 1; /* "asyncpg/protocol/codecs/array.pyx":290 * Codec elem_codec * * if ndims == 0: # <<<<<<<<<<<<<< * return [] * */ __pyx_t_2 = (__pyx_v_ndims == 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":291 * * if ndims == 0: * return [] # <<<<<<<<<<<<<< * * if ndims > ARRAY_MAXDIM: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/array.pyx":290 * Codec elem_codec * * if ndims == 0: # <<<<<<<<<<<<<< * return [] * */ } /* "asyncpg/protocol/codecs/array.pyx":293 * return [] * * if ndims > ARRAY_MAXDIM: # <<<<<<<<<<<<<< * raise exceptions.ProtocolError( * 'number of array dimensions ({}) exceed the maximum expected ({})'. */ __pyx_t_2 = (__pyx_v_ndims > 6); if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/codecs/array.pyx":294 * * if ndims > ARRAY_MAXDIM: * raise exceptions.ProtocolError( # <<<<<<<<<<<<<< * 'number of array dimensions ({}) exceed the maximum expected ({})'. * format(ndims, ARRAY_MAXDIM)) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ProtocolError); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":295 * if ndims > ARRAY_MAXDIM: * raise exceptions.ProtocolError( * 'number of array dimensions ({}) exceed the maximum expected ({})'. # <<<<<<<<<<<<<< * format(ndims, ARRAY_MAXDIM)) * elif ndims < 0: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_number_of_array_dimensions_excee, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "asyncpg/protocol/codecs/array.pyx":296 * raise exceptions.ProtocolError( * 'number of array dimensions ({}) exceed the maximum expected ({})'. * format(ndims, ARRAY_MAXDIM)) # <<<<<<<<<<<<<< * elif ndims < 0: * raise exceptions.ProtocolError( */ __pyx_t_7 = __Pyx_PyInt_From_int32_t(__pyx_v_ndims); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_7, __pyx_int_6}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 294, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":293 * return [] * * if ndims > ARRAY_MAXDIM: # <<<<<<<<<<<<<< * raise exceptions.ProtocolError( * 'number of array dimensions ({}) exceed the maximum expected ({})'. */ } /* "asyncpg/protocol/codecs/array.pyx":297 * 'number of array dimensions ({}) exceed the maximum expected ({})'. * format(ndims, ARRAY_MAXDIM)) * elif ndims < 0: # <<<<<<<<<<<<<< * raise exceptions.ProtocolError( * 'unexpected array dimensions value: {}'.format(ndims)) */ __pyx_t_2 = (__pyx_v_ndims < 0); if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/codecs/array.pyx":298 * format(ndims, ARRAY_MAXDIM)) * elif ndims < 0: * raise exceptions.ProtocolError( # <<<<<<<<<<<<<< * 'unexpected array dimensions value: {}'.format(ndims)) * */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ProtocolError); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":299 * elif ndims < 0: * raise exceptions.ProtocolError( * 'unexpected array dimensions value: {}'.format(ndims)) # <<<<<<<<<<<<<< * * for i in range(ndims): */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_array_dimensions_valu, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_int32_t(__pyx_v_ndims); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 298, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":297 * 'number of array dimensions ({}) exceed the maximum expected ({})'. * format(ndims, ARRAY_MAXDIM)) * elif ndims < 0: # <<<<<<<<<<<<<< * raise exceptions.ProtocolError( * 'unexpected array dimensions value: {}'.format(ndims)) */ } /* "asyncpg/protocol/codecs/array.pyx":301 * 'unexpected array dimensions value: {}'.format(ndims)) * * for i in range(ndims): # <<<<<<<<<<<<<< * dims[i] = hton.unpack_int32(frb_read(buf, 4)) * if dims[i] < 0: */ __pyx_t_10 = __pyx_v_ndims; __pyx_t_11 = __pyx_t_10; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; /* "asyncpg/protocol/codecs/array.pyx":302 * * for i in range(ndims): * dims[i] = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * if dims[i] < 0: * raise exceptions.ProtocolError( */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(4, 302, __pyx_L1_error) (__pyx_v_dims[__pyx_v_i]) = unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/array.pyx":303 * for i in range(ndims): * dims[i] = hton.unpack_int32(frb_read(buf, 4)) * if dims[i] < 0: # <<<<<<<<<<<<<< * raise exceptions.ProtocolError( * 'unexpected array dimension size: {}'.format(dims[i])) */ __pyx_t_2 = ((__pyx_v_dims[__pyx_v_i]) < 0); if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/codecs/array.pyx":304 * dims[i] = hton.unpack_int32(frb_read(buf, 4)) * if dims[i] < 0: * raise exceptions.ProtocolError( # <<<<<<<<<<<<<< * 'unexpected array dimension size: {}'.format(dims[i])) * # Ignore the lower bound information */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ProtocolError); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":305 * if dims[i] < 0: * raise exceptions.ProtocolError( * 'unexpected array dimension size: {}'.format(dims[i])) # <<<<<<<<<<<<<< * # Ignore the lower bound information * frb_read(buf, 4) */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_array_dimension_size, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_int32_t((__pyx_v_dims[__pyx_v_i])); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 304, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":303 * for i in range(ndims): * dims[i] = hton.unpack_int32(frb_read(buf, 4)) * if dims[i] < 0: # <<<<<<<<<<<<<< * raise exceptions.ProtocolError( * 'unexpected array dimension size: {}'.format(dims[i])) */ } /* "asyncpg/protocol/codecs/array.pyx":307 * 'unexpected array dimension size: {}'.format(dims[i])) * # Ignore the lower bound information * frb_read(buf, 4) # <<<<<<<<<<<<<< * * if ndims == 1: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(4, 307, __pyx_L1_error) } /* "asyncpg/protocol/codecs/array.pyx":309 * frb_read(buf, 4) * * if ndims == 1: # <<<<<<<<<<<<<< * # Fast path for flat arrays * elem_count = dims[0] */ __pyx_t_2 = (__pyx_v_ndims == 1); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":311 * if ndims == 1: * # Fast path for flat arrays * elem_count = dims[0] # <<<<<<<<<<<<<< * result = cpython.PyList_New(elem_count) * */ __pyx_v_elem_count = (__pyx_v_dims[0]); /* "asyncpg/protocol/codecs/array.pyx":312 * # Fast path for flat arrays * elem_count = dims[0] * result = cpython.PyList_New(elem_count) # <<<<<<<<<<<<<< * * for i in range(elem_count): */ __pyx_t_3 = PyList_New(__pyx_v_elem_count); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/array.pyx":314 * result = cpython.PyList_New(elem_count) * * for i in range(elem_count): # <<<<<<<<<<<<<< * elem_len = hton.unpack_int32(frb_read(buf, 4)) * if elem_len == -1: */ __pyx_t_10 = __pyx_v_elem_count; __pyx_t_11 = __pyx_t_10; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; /* "asyncpg/protocol/codecs/array.pyx":315 * * for i in range(elem_count): * elem_len = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * if elem_len == -1: * elem = None */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(4, 315, __pyx_L1_error) __pyx_v_elem_len = unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/array.pyx":316 * for i in range(elem_count): * elem_len = hton.unpack_int32(frb_read(buf, 4)) * if elem_len == -1: # <<<<<<<<<<<<<< * elem = None * else: */ __pyx_t_2 = (__pyx_v_elem_len == -1L); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":317 * elem_len = hton.unpack_int32(frb_read(buf, 4)) * if elem_len == -1: * elem = None # <<<<<<<<<<<<<< * else: * frb_slice_from(&elem_buf, buf, elem_len) */ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_elem, Py_None); /* "asyncpg/protocol/codecs/array.pyx":316 * for i in range(elem_count): * elem_len = hton.unpack_int32(frb_read(buf, 4)) * if elem_len == -1: # <<<<<<<<<<<<<< * elem = None * else: */ goto __pyx_L11; } /* "asyncpg/protocol/codecs/array.pyx":319 * elem = None * else: * frb_slice_from(&elem_buf, buf, elem_len) # <<<<<<<<<<<<<< * elem = decoder(settings, &elem_buf, decoder_arg) * */ /*else*/ { __pyx_t_13 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_slice_from((&__pyx_v_elem_buf), __pyx_v_buf, __pyx_v_elem_len); if (unlikely(__pyx_t_13 == ((struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)NULL) && PyErr_Occurred())) __PYX_ERR(4, 319, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":320 * else: * frb_slice_from(&elem_buf, buf, elem_len) * elem = decoder(settings, &elem_buf, decoder_arg) # <<<<<<<<<<<<<< * * cpython.Py_INCREF(elem) */ __pyx_t_3 = __pyx_v_decoder(__pyx_v_settings, (&__pyx_v_elem_buf), __pyx_v_decoder_arg); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_3); __pyx_t_3 = 0; } __pyx_L11:; /* "asyncpg/protocol/codecs/array.pyx":322 * elem = decoder(settings, &elem_buf, decoder_arg) * * cpython.Py_INCREF(elem) # <<<<<<<<<<<<<< * cpython.PyList_SET_ITEM(result, i, elem) * */ Py_INCREF(__pyx_v_elem); /* "asyncpg/protocol/codecs/array.pyx":323 * * cpython.Py_INCREF(elem) * cpython.PyList_SET_ITEM(result, i, elem) # <<<<<<<<<<<<<< * * else: */ PyList_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_elem); } /* "asyncpg/protocol/codecs/array.pyx":309 * frb_read(buf, 4) * * if ndims == 1: # <<<<<<<<<<<<<< * # Fast path for flat arrays * elem_count = dims[0] */ goto __pyx_L8; } /* "asyncpg/protocol/codecs/array.pyx":326 * * else: * result = _nested_array_decode(settings, buf, # <<<<<<<<<<<<<< * decoder, decoder_arg, ndims, dims, * &elem_buf) */ /*else*/ { /* "asyncpg/protocol/codecs/array.pyx":328 * result = _nested_array_decode(settings, buf, * decoder, decoder_arg, ndims, dims, * &elem_buf) # <<<<<<<<<<<<<< * * return result */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__nested_array_decode(__pyx_v_settings, __pyx_v_buf, __pyx_v_decoder, __pyx_v_decoder_arg, __pyx_v_ndims, __pyx_v_dims, (&__pyx_v_elem_buf)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/protocol/codecs/array.pyx":326 * * else: * result = _nested_array_decode(settings, buf, # <<<<<<<<<<<<<< * decoder, decoder_arg, ndims, dims, * &elem_buf) */ if (!(likely(PyList_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_3))) __PYX_ERR(4, 326, __pyx_L1_error) __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; } __pyx_L8:; /* "asyncpg/protocol/codecs/array.pyx":330 * &elem_buf) * * return result # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/protocol/codecs/array.pyx":276 * * * cdef inline array_decode(ConnectionSettings settings, FRBuffer *buf, # <<<<<<<<<<<<<< * decode_func_ex decoder, const void *decoder_arg): * cdef: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("asyncpg.protocol.protocol.array_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF(__pyx_v_elem); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":333 * * * cdef _nested_array_decode(ConnectionSettings settings, # <<<<<<<<<<<<<< * FRBuffer *buf, * decode_func_ex decoder, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__nested_array_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex __pyx_v_decoder, void const *__pyx_v_decoder_arg, int32_t __pyx_v_ndims, int32_t *__pyx_v_dims, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_elem_buf) { int32_t __pyx_v_elem_len; int64_t __pyx_v_i; int64_t __pyx_v_j; int64_t __pyx_v_array_len; PyObject *__pyx_v_elem = 0; PyObject *__pyx_v_stride = 0; void *__pyx_v_strides[6]; int32_t __pyx_v_indexes[6]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int32_t __pyx_t_1; int32_t __pyx_t_2; int64_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int64_t __pyx_t_9; int64_t __pyx_t_10; char const *__pyx_t_11; struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_t_12; int64_t __pyx_t_13; int64_t __pyx_t_14; int __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_nested_array_decode", 1); /* "asyncpg/protocol/codecs/array.pyx":343 * int32_t elem_len * int64_t i, j * int64_t array_len = 1 # <<<<<<<<<<<<<< * object elem, stride * # An array of pointers to lists for each current array level. */ __pyx_v_array_len = 1; /* "asyncpg/protocol/codecs/array.pyx":350 * int32_t indexes[ARRAY_MAXDIM] * * for i in range(ndims): # <<<<<<<<<<<<<< * array_len *= dims[i] * indexes[i] = 0 */ __pyx_t_1 = __pyx_v_ndims; __pyx_t_2 = __pyx_t_1; for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; /* "asyncpg/protocol/codecs/array.pyx":351 * * for i in range(ndims): * array_len *= dims[i] # <<<<<<<<<<<<<< * indexes[i] = 0 * strides[i] = NULL */ __pyx_v_array_len = (__pyx_v_array_len * (__pyx_v_dims[__pyx_v_i])); /* "asyncpg/protocol/codecs/array.pyx":352 * for i in range(ndims): * array_len *= dims[i] * indexes[i] = 0 # <<<<<<<<<<<<<< * strides[i] = NULL * */ (__pyx_v_indexes[__pyx_v_i]) = 0; /* "asyncpg/protocol/codecs/array.pyx":353 * array_len *= dims[i] * indexes[i] = 0 * strides[i] = NULL # <<<<<<<<<<<<<< * * if array_len == 0: */ (__pyx_v_strides[__pyx_v_i]) = NULL; } /* "asyncpg/protocol/codecs/array.pyx":355 * strides[i] = NULL * * if array_len == 0: # <<<<<<<<<<<<<< * # A multidimensional array with a zero-sized dimension? * return [] */ __pyx_t_4 = (__pyx_v_array_len == 0); if (__pyx_t_4) { /* "asyncpg/protocol/codecs/array.pyx":357 * if array_len == 0: * # A multidimensional array with a zero-sized dimension? * return [] # <<<<<<<<<<<<<< * * elif array_len < 0: */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/array.pyx":355 * strides[i] = NULL * * if array_len == 0: # <<<<<<<<<<<<<< * # A multidimensional array with a zero-sized dimension? * return [] */ } /* "asyncpg/protocol/codecs/array.pyx":359 * return [] * * elif array_len < 0: # <<<<<<<<<<<<<< * # Array length overflow * raise exceptions.ProtocolError('array length overflow') */ __pyx_t_4 = (__pyx_v_array_len < 0); if (unlikely(__pyx_t_4)) { /* "asyncpg/protocol/codecs/array.pyx":361 * elif array_len < 0: * # Array length overflow * raise exceptions.ProtocolError('array length overflow') # <<<<<<<<<<<<<< * * for i in range(array_len): */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ProtocolError); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_kp_u_array_length_overflow}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(4, 361, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":359 * return [] * * elif array_len < 0: # <<<<<<<<<<<<<< * # Array length overflow * raise exceptions.ProtocolError('array length overflow') */ } /* "asyncpg/protocol/codecs/array.pyx":363 * raise exceptions.ProtocolError('array length overflow') * * for i in range(array_len): # <<<<<<<<<<<<<< * # Decode the element. * elem_len = hton.unpack_int32(frb_read(buf, 4)) */ __pyx_t_3 = __pyx_v_array_len; __pyx_t_9 = __pyx_t_3; for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; /* "asyncpg/protocol/codecs/array.pyx":365 * for i in range(array_len): * # Decode the element. * elem_len = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * if elem_len == -1: * elem = None */ __pyx_t_11 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_11 == ((char const *)NULL))) __PYX_ERR(4, 365, __pyx_L1_error) __pyx_v_elem_len = unpack_int32(__pyx_t_11); /* "asyncpg/protocol/codecs/array.pyx":366 * # Decode the element. * elem_len = hton.unpack_int32(frb_read(buf, 4)) * if elem_len == -1: # <<<<<<<<<<<<<< * elem = None * else: */ __pyx_t_4 = (__pyx_v_elem_len == -1L); if (__pyx_t_4) { /* "asyncpg/protocol/codecs/array.pyx":367 * elem_len = hton.unpack_int32(frb_read(buf, 4)) * if elem_len == -1: * elem = None # <<<<<<<<<<<<<< * else: * elem = decoder(settings, */ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_elem, Py_None); /* "asyncpg/protocol/codecs/array.pyx":366 * # Decode the element. * elem_len = hton.unpack_int32(frb_read(buf, 4)) * if elem_len == -1: # <<<<<<<<<<<<<< * elem = None * else: */ goto __pyx_L8; } /* "asyncpg/protocol/codecs/array.pyx":369 * elem = None * else: * elem = decoder(settings, # <<<<<<<<<<<<<< * frb_slice_from(elem_buf, buf, elem_len), * decoder_arg) */ /*else*/ { /* "asyncpg/protocol/codecs/array.pyx":370 * else: * elem = decoder(settings, * frb_slice_from(elem_buf, buf, elem_len), # <<<<<<<<<<<<<< * decoder_arg) * */ __pyx_t_12 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_slice_from(__pyx_v_elem_buf, __pyx_v_buf, __pyx_v_elem_len); if (unlikely(__pyx_t_12 == ((struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)NULL) && PyErr_Occurred())) __PYX_ERR(4, 370, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":369 * elem = None * else: * elem = decoder(settings, # <<<<<<<<<<<<<< * frb_slice_from(elem_buf, buf, elem_len), * decoder_arg) */ __pyx_t_5 = __pyx_v_decoder(__pyx_v_settings, __pyx_t_12, __pyx_v_decoder_arg); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_5); __pyx_t_5 = 0; } __pyx_L8:; /* "asyncpg/protocol/codecs/array.pyx":375 * # Take an explicit reference for PyList_SET_ITEM in the below * # loop expects this. * cpython.Py_INCREF(elem) # <<<<<<<<<<<<<< * * # Iterate over array dimentions and put the element in */ Py_INCREF(__pyx_v_elem); /* "asyncpg/protocol/codecs/array.pyx":379 * # Iterate over array dimentions and put the element in * # the correctly nested sublist. * for j in reversed(range(ndims)): # <<<<<<<<<<<<<< * if indexes[j] == 0: * # Allocate the list for this array level. */ for (__pyx_t_13 = __pyx_v_ndims-1; __pyx_t_13 >= 0; __pyx_t_13-=1) { __pyx_v_j = __pyx_t_13; /* "asyncpg/protocol/codecs/array.pyx":380 * # the correctly nested sublist. * for j in reversed(range(ndims)): * if indexes[j] == 0: # <<<<<<<<<<<<<< * # Allocate the list for this array level. * stride = cpython.PyList_New(dims[j]) */ __pyx_t_4 = ((__pyx_v_indexes[__pyx_v_j]) == 0); if (__pyx_t_4) { /* "asyncpg/protocol/codecs/array.pyx":382 * if indexes[j] == 0: * # Allocate the list for this array level. * stride = cpython.PyList_New(dims[j]) # <<<<<<<<<<<<<< * * strides[j] = stride */ __pyx_t_5 = PyList_New((__pyx_v_dims[__pyx_v_j])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":384 * stride = cpython.PyList_New(dims[j]) * * strides[j] = stride # <<<<<<<<<<<<<< * # Take an explicit reference for PyList_SET_ITEM below * # expects this. */ (__pyx_v_strides[__pyx_v_j]) = ((void *)__pyx_v_stride); /* "asyncpg/protocol/codecs/array.pyx":387 * # Take an explicit reference for PyList_SET_ITEM below * # expects this. * cpython.Py_INCREF(stride) # <<<<<<<<<<<<<< * * stride = strides[j] */ Py_INCREF(__pyx_v_stride); /* "asyncpg/protocol/codecs/array.pyx":380 * # the correctly nested sublist. * for j in reversed(range(ndims)): * if indexes[j] == 0: # <<<<<<<<<<<<<< * # Allocate the list for this array level. * stride = cpython.PyList_New(dims[j]) */ } /* "asyncpg/protocol/codecs/array.pyx":389 * cpython.Py_INCREF(stride) * * stride = strides[j] # <<<<<<<<<<<<<< * cpython.PyList_SET_ITEM(stride, indexes[j], elem) * indexes[j] += 1 */ __pyx_t_5 = ((PyObject *)((PyObject *)(__pyx_v_strides[__pyx_v_j]))); __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":390 * * stride = strides[j] * cpython.PyList_SET_ITEM(stride, indexes[j], elem) # <<<<<<<<<<<<<< * indexes[j] += 1 * */ PyList_SET_ITEM(__pyx_v_stride, (__pyx_v_indexes[__pyx_v_j]), __pyx_v_elem); /* "asyncpg/protocol/codecs/array.pyx":391 * stride = strides[j] * cpython.PyList_SET_ITEM(stride, indexes[j], elem) * indexes[j] += 1 # <<<<<<<<<<<<<< * * if indexes[j] == dims[j] and j != 0: */ __pyx_t_14 = __pyx_v_j; (__pyx_v_indexes[__pyx_t_14]) = ((__pyx_v_indexes[__pyx_t_14]) + 1); /* "asyncpg/protocol/codecs/array.pyx":393 * indexes[j] += 1 * * if indexes[j] == dims[j] and j != 0: # <<<<<<<<<<<<<< * # This array level is full, continue the * # ascent in the dimensions so that this level */ __pyx_t_15 = ((__pyx_v_indexes[__pyx_v_j]) == (__pyx_v_dims[__pyx_v_j])); if (__pyx_t_15) { } else { __pyx_t_4 = __pyx_t_15; goto __pyx_L13_bool_binop_done; } __pyx_t_15 = (__pyx_v_j != 0); __pyx_t_4 = __pyx_t_15; __pyx_L13_bool_binop_done:; if (__pyx_t_4) { /* "asyncpg/protocol/codecs/array.pyx":397 * # ascent in the dimensions so that this level * # sublist will be appened to the parent list. * elem = stride # <<<<<<<<<<<<<< * # Reset the index, this will cause the * # new list to be allocated on the next */ __Pyx_INCREF(__pyx_v_stride); __Pyx_DECREF_SET(__pyx_v_elem, __pyx_v_stride); /* "asyncpg/protocol/codecs/array.pyx":401 * # new list to be allocated on the next * # iteration on this array axis. * indexes[j] = 0 # <<<<<<<<<<<<<< * else: * break */ (__pyx_v_indexes[__pyx_v_j]) = 0; /* "asyncpg/protocol/codecs/array.pyx":393 * indexes[j] += 1 * * if indexes[j] == dims[j] and j != 0: # <<<<<<<<<<<<<< * # This array level is full, continue the * # ascent in the dimensions so that this level */ goto __pyx_L12; } /* "asyncpg/protocol/codecs/array.pyx":403 * indexes[j] = 0 * else: * break # <<<<<<<<<<<<<< * * stride = strides[0] */ /*else*/ { goto __pyx_L10_break; } __pyx_L12:; } __pyx_L10_break:; } /* "asyncpg/protocol/codecs/array.pyx":405 * break * * stride = strides[0] # <<<<<<<<<<<<<< * # Since each element in strides has a refcount of 1, * # returning strides[0] will increment it to 2, so */ __pyx_t_5 = ((PyObject *)((PyObject *)(__pyx_v_strides[0]))); __Pyx_INCREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/codecs/array.pyx":409 * # returning strides[0] will increment it to 2, so * # balance that. * cpython.Py_DECREF(stride) # <<<<<<<<<<<<<< * return stride * */ Py_DECREF(__pyx_v_stride); /* "asyncpg/protocol/codecs/array.pyx":410 * # balance that. * cpython.Py_DECREF(stride) * return stride # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_stride); __pyx_r = __pyx_v_stride; goto __pyx_L0; /* "asyncpg/protocol/codecs/array.pyx":333 * * * cdef _nested_array_decode(ConnectionSettings settings, # <<<<<<<<<<<<<< * FRBuffer *buf, * decode_func_ex decoder, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("asyncpg.protocol.protocol._nested_array_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_elem); __Pyx_XDECREF(__pyx_v_stride); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":413 * * * cdef textarray_decode(ConnectionSettings settings, FRBuffer *buf, # <<<<<<<<<<<<<< * decode_func_ex decoder, const void *decoder_arg, * Py_UCS4 typdelim): */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_textarray_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex __pyx_v_decoder, void const *__pyx_v_decoder_arg, Py_UCS4 __pyx_v_typdelim) { Py_UCS4 *__pyx_v_array_text; PyObject *__pyx_v_s = 0; PyObject *__pyx_v_e = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_UCS4 *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; unsigned int __pyx_t_15; int __pyx_t_16; char const *__pyx_t_17; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; char const *__pyx_t_24; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("textarray_decode", 1); /* "asyncpg/protocol/codecs/array.pyx":422 * # Make a copy of array data since we will be mutating it for * # the purposes of element decoding. * s = pgproto.text_decode(settings, buf) # <<<<<<<<<<<<<< * array_text = cpythonx.PyUnicode_AsUCS4Copy(s) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_text_decode(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings), __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(4, 422, __pyx_L1_error) __pyx_v_s = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":423 * # the purposes of element decoding. * s = pgproto.text_decode(settings, buf) * array_text = cpythonx.PyUnicode_AsUCS4Copy(s) # <<<<<<<<<<<<<< * * try: */ __pyx_t_2 = PyUnicode_AsUCS4Copy(__pyx_v_s); if (unlikely(__pyx_t_2 == ((Py_UCS4 *)NULL))) __PYX_ERR(4, 423, __pyx_L1_error) __pyx_v_array_text = __pyx_t_2; /* "asyncpg/protocol/codecs/array.pyx":425 * array_text = cpythonx.PyUnicode_AsUCS4Copy(s) * * try: # <<<<<<<<<<<<<< * return _textarray_decode( * settings, array_text, decoder, decoder_arg, typdelim) */ /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { /* "asyncpg/protocol/codecs/array.pyx":426 * * try: * return _textarray_decode( # <<<<<<<<<<<<<< * settings, array_text, decoder, decoder_arg, typdelim) * except ValueError as e: */ __Pyx_XDECREF(__pyx_r); /* "asyncpg/protocol/codecs/array.pyx":427 * try: * return _textarray_decode( * settings, array_text, decoder, decoder_arg, typdelim) # <<<<<<<<<<<<<< * except ValueError as e: * raise exceptions.ProtocolError( */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol__textarray_decode(__pyx_v_settings, __pyx_v_array_text, __pyx_v_decoder, __pyx_v_decoder_arg, __pyx_v_typdelim); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 426, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L10_try_return; /* "asyncpg/protocol/codecs/array.pyx":425 * array_text = cpythonx.PyUnicode_AsUCS4Copy(s) * * try: # <<<<<<<<<<<<<< * return _textarray_decode( * settings, array_text, decoder, decoder_arg, typdelim) */ } __pyx_L6_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":428 * return _textarray_decode( * settings, array_text, decoder, decoder_arg, typdelim) * except ValueError as e: # <<<<<<<<<<<<<< * raise exceptions.ProtocolError( * 'malformed array literal {!r}: {}'.format(s, e.args[0])) */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_6) { __Pyx_AddTraceback("asyncpg.protocol.protocol.textarray_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(4, 428, __pyx_L8_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_v_e = __pyx_t_7; /*try:*/ { /* "asyncpg/protocol/codecs/array.pyx":429 * settings, array_text, decoder, decoder_arg, typdelim) * except ValueError as e: * raise exceptions.ProtocolError( # <<<<<<<<<<<<<< * 'malformed array literal {!r}: {}'.format(s, e.args[0])) * finally: */ __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 429, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_ProtocolError); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 429, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/codecs/array.pyx":430 * except ValueError as e: * raise exceptions.ProtocolError( * 'malformed array literal {!r}: {}'.format(s, e.args[0])) # <<<<<<<<<<<<<< * finally: * cpython.PyMem_Free(array_text) */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_malformed_array_literal_r, __pyx_n_s_format); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 430, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_args); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 430, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_13, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 430, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = NULL; __pyx_t_15 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_15 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_13, __pyx_v_s, __pyx_t_14}; __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_15, 2+__pyx_t_15); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 430, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __pyx_t_12 = NULL; __pyx_t_15 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_15 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_10}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 429, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(4, 429, __pyx_L17_error) } /* "asyncpg/protocol/codecs/array.pyx":428 * return _textarray_decode( * settings, array_text, decoder, decoder_arg, typdelim) * except ValueError as e: # <<<<<<<<<<<<<< * raise exceptions.ProtocolError( * 'malformed array literal {!r}: {}'.format(s, e.args[0])) */ /*finally:*/ { __pyx_L17_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __pyx_t_6 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23); } __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ErrRestore(__pyx_t_18, __pyx_t_19, __pyx_t_20); __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17; goto __pyx_L8_except_error; } } } goto __pyx_L8_except_error; /* "asyncpg/protocol/codecs/array.pyx":425 * array_text = cpythonx.PyUnicode_AsUCS4Copy(s) * * try: # <<<<<<<<<<<<<< * return _textarray_decode( * settings, array_text, decoder, decoder_arg, typdelim) */ __pyx_L8_except_error:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L4_error; __pyx_L10_try_return:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L3_return; } } /* "asyncpg/protocol/codecs/array.pyx":432 * 'malformed array literal {!r}: {}'.format(s, e.args[0])) * finally: * cpython.PyMem_Free(array_text) # <<<<<<<<<<<<<< * * */ /*finally:*/ { __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_21); __pyx_t_16 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_24 = __pyx_filename; { PyMem_Free(__pyx_v_array_text); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_22, __pyx_t_21); } __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ErrRestore(__pyx_t_5, __pyx_t_4, __pyx_t_3); __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_lineno = __pyx_t_16; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_24; goto __pyx_L1_error; } __pyx_L3_return: { __pyx_t_21 = __pyx_r; __pyx_r = 0; PyMem_Free(__pyx_v_array_text); __pyx_r = __pyx_t_21; __pyx_t_21 = 0; goto __pyx_L0; } } /* "asyncpg/protocol/codecs/array.pyx":413 * * * cdef textarray_decode(ConnectionSettings settings, FRBuffer *buf, # <<<<<<<<<<<<<< * decode_func_ex decoder, const void *decoder_arg, * Py_UCS4 typdelim): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("asyncpg.protocol.protocol.textarray_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_s); __Pyx_XDECREF(__pyx_v_e); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":435 * * * cdef _textarray_decode(ConnectionSettings settings, # <<<<<<<<<<<<<< * Py_UCS4 *array_text, * decode_func_ex decoder, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__textarray_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, Py_UCS4 *__pyx_v_array_text, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex __pyx_v_decoder, void const *__pyx_v_decoder_arg, Py_UCS4 __pyx_v_typdelim) { PyObject *__pyx_v_result = 0; PyObject *__pyx_v_new_stride = 0; Py_UCS4 *__pyx_v_ptr; int32_t __pyx_v_ndims; int32_t __pyx_v_ubound; int32_t __pyx_v_lbound; int32_t __pyx_v_dims[6]; int32_t __pyx_v_inferred_dims[6]; int32_t __pyx_v_inferred_ndims; void *__pyx_v_strides[6]; int32_t __pyx_v_indexes[6]; int32_t __pyx_v_nest_level; int32_t __pyx_v_item_level; int __pyx_v_end_of_array; int __pyx_v_end_of_item; int __pyx_v_has_quoting; int __pyx_v_strip_spaces; int __pyx_v_in_quotes; Py_UCS4 *__pyx_v_item_start; Py_UCS4 *__pyx_v_item_ptr; Py_UCS4 *__pyx_v_item_end; int __pyx_v_i; PyObject *__pyx_v_item = 0; PyObject *__pyx_v_item_text = 0; struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer __pyx_v_item_buf; char *__pyx_v_pg_item_str; Py_ssize_t __pyx_v_pg_item_len; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; Py_UCS4 *__pyx_t_7; int32_t __pyx_t_8; int32_t __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11; int __pyx_t_12; long __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_textarray_decode", 1); /* "asyncpg/protocol/codecs/array.pyx":446 * list new_stride * Py_UCS4 *ptr * int32_t ndims = 0 # <<<<<<<<<<<<<< * int32_t ubound = 0 * int32_t lbound = 0 */ __pyx_v_ndims = 0; /* "asyncpg/protocol/codecs/array.pyx":447 * Py_UCS4 *ptr * int32_t ndims = 0 * int32_t ubound = 0 # <<<<<<<<<<<<<< * int32_t lbound = 0 * int32_t dims[ARRAY_MAXDIM] */ __pyx_v_ubound = 0; /* "asyncpg/protocol/codecs/array.pyx":448 * int32_t ndims = 0 * int32_t ubound = 0 * int32_t lbound = 0 # <<<<<<<<<<<<<< * int32_t dims[ARRAY_MAXDIM] * int32_t inferred_dims[ARRAY_MAXDIM] */ __pyx_v_lbound = 0; /* "asyncpg/protocol/codecs/array.pyx":451 * int32_t dims[ARRAY_MAXDIM] * int32_t inferred_dims[ARRAY_MAXDIM] * int32_t inferred_ndims = 0 # <<<<<<<<<<<<<< * void *strides[ARRAY_MAXDIM] * int32_t indexes[ARRAY_MAXDIM] */ __pyx_v_inferred_ndims = 0; /* "asyncpg/protocol/codecs/array.pyx":454 * void *strides[ARRAY_MAXDIM] * int32_t indexes[ARRAY_MAXDIM] * int32_t nest_level = 0 # <<<<<<<<<<<<<< * int32_t item_level = 0 * bint end_of_array = False */ __pyx_v_nest_level = 0; /* "asyncpg/protocol/codecs/array.pyx":455 * int32_t indexes[ARRAY_MAXDIM] * int32_t nest_level = 0 * int32_t item_level = 0 # <<<<<<<<<<<<<< * bint end_of_array = False * */ __pyx_v_item_level = 0; /* "asyncpg/protocol/codecs/array.pyx":456 * int32_t nest_level = 0 * int32_t item_level = 0 * bint end_of_array = False # <<<<<<<<<<<<<< * * bint end_of_item = False */ __pyx_v_end_of_array = 0; /* "asyncpg/protocol/codecs/array.pyx":458 * bint end_of_array = False * * bint end_of_item = False # <<<<<<<<<<<<<< * bint has_quoting = False * bint strip_spaces = False */ __pyx_v_end_of_item = 0; /* "asyncpg/protocol/codecs/array.pyx":459 * * bint end_of_item = False * bint has_quoting = False # <<<<<<<<<<<<<< * bint strip_spaces = False * bint in_quotes = False */ __pyx_v_has_quoting = 0; /* "asyncpg/protocol/codecs/array.pyx":460 * bint end_of_item = False * bint has_quoting = False * bint strip_spaces = False # <<<<<<<<<<<<<< * bint in_quotes = False * Py_UCS4 *item_start */ __pyx_v_strip_spaces = 0; /* "asyncpg/protocol/codecs/array.pyx":461 * bint has_quoting = False * bint strip_spaces = False * bint in_quotes = False # <<<<<<<<<<<<<< * Py_UCS4 *item_start * Py_UCS4 *item_ptr */ __pyx_v_in_quotes = 0; /* "asyncpg/protocol/codecs/array.pyx":473 * ssize_t pg_item_len * * ptr = array_text # <<<<<<<<<<<<<< * * while True: */ __pyx_v_ptr = __pyx_v_array_text; /* "asyncpg/protocol/codecs/array.pyx":475 * ptr = array_text * * while True: # <<<<<<<<<<<<<< * while apg_ascii_isspace(ptr[0]): * ptr += 1 */ while (1) { /* "asyncpg/protocol/codecs/array.pyx":476 * * while True: * while apg_ascii_isspace(ptr[0]): # <<<<<<<<<<<<<< * ptr += 1 * */ while (1) { __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace((__pyx_v_ptr[0])); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(4, 476, __pyx_L1_error) if (!__pyx_t_1) break; /* "asyncpg/protocol/codecs/array.pyx":477 * while True: * while apg_ascii_isspace(ptr[0]): * ptr += 1 # <<<<<<<<<<<<<< * * if ptr[0] != '[': */ __pyx_v_ptr = (__pyx_v_ptr + 1); } /* "asyncpg/protocol/codecs/array.pyx":479 * ptr += 1 * * if ptr[0] != '[': # <<<<<<<<<<<<<< * # Finished parsing dimensions spec. * break */ __pyx_t_1 = ((__pyx_v_ptr[0]) != 91); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":481 * if ptr[0] != '[': * # Finished parsing dimensions spec. * break # <<<<<<<<<<<<<< * * ptr += 1 # '[' */ goto __pyx_L4_break; /* "asyncpg/protocol/codecs/array.pyx":479 * ptr += 1 * * if ptr[0] != '[': # <<<<<<<<<<<<<< * # Finished parsing dimensions spec. * break */ } /* "asyncpg/protocol/codecs/array.pyx":483 * break * * ptr += 1 # '[' # <<<<<<<<<<<<<< * * if ndims > ARRAY_MAXDIM: */ __pyx_v_ptr = (__pyx_v_ptr + 1); /* "asyncpg/protocol/codecs/array.pyx":485 * ptr += 1 # '[' * * if ndims > ARRAY_MAXDIM: # <<<<<<<<<<<<<< * raise ValueError( * 'number of array dimensions ({}) exceed the ' */ __pyx_t_1 = (__pyx_v_ndims > 6); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/codecs/array.pyx":488 * raise ValueError( * 'number of array dimensions ({}) exceed the ' * 'maximum expected ({})'.format(ndims, ARRAY_MAXDIM)) # <<<<<<<<<<<<<< * * ptr = apg_parse_int32(ptr, &ubound) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_number_of_array_dimensions_excee, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_ndims); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_4, __pyx_int_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "asyncpg/protocol/codecs/array.pyx":486 * * if ndims > ARRAY_MAXDIM: * raise ValueError( # <<<<<<<<<<<<<< * 'number of array dimensions ({}) exceed the ' * 'maximum expected ({})'.format(ndims, ARRAY_MAXDIM)) */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 486, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":485 * ptr += 1 # '[' * * if ndims > ARRAY_MAXDIM: # <<<<<<<<<<<<<< * raise ValueError( * 'number of array dimensions ({}) exceed the ' */ } /* "asyncpg/protocol/codecs/array.pyx":490 * 'maximum expected ({})'.format(ndims, ARRAY_MAXDIM)) * * ptr = apg_parse_int32(ptr, &ubound) # <<<<<<<<<<<<<< * if ptr == NULL: * raise ValueError('missing array dimension value') */ __pyx_t_7 = __pyx_f_7asyncpg_8protocol_8protocol_apg_parse_int32(__pyx_v_ptr, (&__pyx_v_ubound)); if (unlikely(__pyx_t_7 == ((Py_UCS4 *)NULL) && PyErr_Occurred())) __PYX_ERR(4, 490, __pyx_L1_error) __pyx_v_ptr = __pyx_t_7; /* "asyncpg/protocol/codecs/array.pyx":491 * * ptr = apg_parse_int32(ptr, &ubound) * if ptr == NULL: # <<<<<<<<<<<<<< * raise ValueError('missing array dimension value') * */ __pyx_t_1 = (__pyx_v_ptr == NULL); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/codecs/array.pyx":492 * ptr = apg_parse_int32(ptr, &ubound) * if ptr == NULL: * raise ValueError('missing array dimension value') # <<<<<<<<<<<<<< * * if ptr[0] == ':': */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 492, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":491 * * ptr = apg_parse_int32(ptr, &ubound) * if ptr == NULL: # <<<<<<<<<<<<<< * raise ValueError('missing array dimension value') * */ } /* "asyncpg/protocol/codecs/array.pyx":494 * raise ValueError('missing array dimension value') * * if ptr[0] == ':': # <<<<<<<<<<<<<< * ptr += 1 * lbound = ubound */ __pyx_t_1 = ((__pyx_v_ptr[0]) == 58); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":495 * * if ptr[0] == ':': * ptr += 1 # <<<<<<<<<<<<<< * lbound = ubound * */ __pyx_v_ptr = (__pyx_v_ptr + 1); /* "asyncpg/protocol/codecs/array.pyx":496 * if ptr[0] == ':': * ptr += 1 * lbound = ubound # <<<<<<<<<<<<<< * * # [lower:upper] spec. We disregard the lbound for decoding. */ __pyx_v_lbound = __pyx_v_ubound; /* "asyncpg/protocol/codecs/array.pyx":499 * * # [lower:upper] spec. We disregard the lbound for decoding. * ptr = apg_parse_int32(ptr, &ubound) # <<<<<<<<<<<<<< * if ptr == NULL: * raise ValueError('missing array dimension value') */ __pyx_t_7 = __pyx_f_7asyncpg_8protocol_8protocol_apg_parse_int32(__pyx_v_ptr, (&__pyx_v_ubound)); if (unlikely(__pyx_t_7 == ((Py_UCS4 *)NULL) && PyErr_Occurred())) __PYX_ERR(4, 499, __pyx_L1_error) __pyx_v_ptr = __pyx_t_7; /* "asyncpg/protocol/codecs/array.pyx":500 * # [lower:upper] spec. We disregard the lbound for decoding. * ptr = apg_parse_int32(ptr, &ubound) * if ptr == NULL: # <<<<<<<<<<<<<< * raise ValueError('missing array dimension value') * else: */ __pyx_t_1 = (__pyx_v_ptr == NULL); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/codecs/array.pyx":501 * ptr = apg_parse_int32(ptr, &ubound) * if ptr == NULL: * raise ValueError('missing array dimension value') # <<<<<<<<<<<<<< * else: * lbound = 1 */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 501, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":500 * # [lower:upper] spec. We disregard the lbound for decoding. * ptr = apg_parse_int32(ptr, &ubound) * if ptr == NULL: # <<<<<<<<<<<<<< * raise ValueError('missing array dimension value') * else: */ } /* "asyncpg/protocol/codecs/array.pyx":494 * raise ValueError('missing array dimension value') * * if ptr[0] == ':': # <<<<<<<<<<<<<< * ptr += 1 * lbound = ubound */ goto __pyx_L10; } /* "asyncpg/protocol/codecs/array.pyx":503 * raise ValueError('missing array dimension value') * else: * lbound = 1 # <<<<<<<<<<<<<< * * if ptr[0] != ']': */ /*else*/ { __pyx_v_lbound = 1; } __pyx_L10:; /* "asyncpg/protocol/codecs/array.pyx":505 * lbound = 1 * * if ptr[0] != ']': # <<<<<<<<<<<<<< * raise ValueError('missing \']\' after array dimensions') * */ __pyx_t_1 = ((__pyx_v_ptr[0]) != 93); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/codecs/array.pyx":506 * * if ptr[0] != ']': * raise ValueError('missing \']\' after array dimensions') # <<<<<<<<<<<<<< * * ptr += 1 # ']' */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 506, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":505 * lbound = 1 * * if ptr[0] != ']': # <<<<<<<<<<<<<< * raise ValueError('missing \']\' after array dimensions') * */ } /* "asyncpg/protocol/codecs/array.pyx":508 * raise ValueError('missing \']\' after array dimensions') * * ptr += 1 # ']' # <<<<<<<<<<<<<< * * dims[ndims] = ubound - lbound + 1 */ __pyx_v_ptr = (__pyx_v_ptr + 1); /* "asyncpg/protocol/codecs/array.pyx":510 * ptr += 1 # ']' * * dims[ndims] = ubound - lbound + 1 # <<<<<<<<<<<<<< * ndims += 1 * */ (__pyx_v_dims[__pyx_v_ndims]) = ((__pyx_v_ubound - __pyx_v_lbound) + 1); /* "asyncpg/protocol/codecs/array.pyx":511 * * dims[ndims] = ubound - lbound + 1 * ndims += 1 # <<<<<<<<<<<<<< * * if ndims != 0: */ __pyx_v_ndims = (__pyx_v_ndims + 1); } __pyx_L4_break:; /* "asyncpg/protocol/codecs/array.pyx":513 * ndims += 1 * * if ndims != 0: # <<<<<<<<<<<<<< * # If dimensions were given, the '=' token is expected. * if ptr[0] != '=': */ __pyx_t_1 = (__pyx_v_ndims != 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":515 * if ndims != 0: * # If dimensions were given, the '=' token is expected. * if ptr[0] != '=': # <<<<<<<<<<<<<< * raise ValueError('missing \'=\' after array dimensions') * */ __pyx_t_1 = ((__pyx_v_ptr[0]) != 61); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/codecs/array.pyx":516 * # If dimensions were given, the '=' token is expected. * if ptr[0] != '=': * raise ValueError('missing \'=\' after array dimensions') # <<<<<<<<<<<<<< * * ptr += 1 # '=' */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 516, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":515 * if ndims != 0: * # If dimensions were given, the '=' token is expected. * if ptr[0] != '=': # <<<<<<<<<<<<<< * raise ValueError('missing \'=\' after array dimensions') * */ } /* "asyncpg/protocol/codecs/array.pyx":518 * raise ValueError('missing \'=\' after array dimensions') * * ptr += 1 # '=' # <<<<<<<<<<<<<< * * # Skip any whitespace after the '=', whitespace */ __pyx_v_ptr = (__pyx_v_ptr + 1); /* "asyncpg/protocol/codecs/array.pyx":522 * # Skip any whitespace after the '=', whitespace * # before was consumed in the above loop. * while apg_ascii_isspace(ptr[0]): # <<<<<<<<<<<<<< * ptr += 1 * */ while (1) { __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace((__pyx_v_ptr[0])); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(4, 522, __pyx_L1_error) if (!__pyx_t_1) break; /* "asyncpg/protocol/codecs/array.pyx":523 * # before was consumed in the above loop. * while apg_ascii_isspace(ptr[0]): * ptr += 1 # <<<<<<<<<<<<<< * * # Infer the dimensions from the brace structure in the */ __pyx_v_ptr = (__pyx_v_ptr + 1); } /* "asyncpg/protocol/codecs/array.pyx":528 * # array literal body, and check that it matches the explicit * # spec. This also validates that the array literal is sane. * _infer_array_dims(ptr, typdelim, inferred_dims, &inferred_ndims) # <<<<<<<<<<<<<< * * if inferred_ndims != ndims: */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__infer_array_dims(__pyx_v_ptr, __pyx_v_typdelim, __pyx_v_inferred_dims, (&__pyx_v_inferred_ndims)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/array.pyx":530 * _infer_array_dims(ptr, typdelim, inferred_dims, &inferred_ndims) * * if inferred_ndims != ndims: # <<<<<<<<<<<<<< * raise ValueError( * 'specified array dimensions do not match array content') */ __pyx_t_1 = (__pyx_v_inferred_ndims != __pyx_v_ndims); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/codecs/array.pyx":531 * * if inferred_ndims != ndims: * raise ValueError( # <<<<<<<<<<<<<< * 'specified array dimensions do not match array content') * */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 531, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":530 * _infer_array_dims(ptr, typdelim, inferred_dims, &inferred_ndims) * * if inferred_ndims != ndims: # <<<<<<<<<<<<<< * raise ValueError( * 'specified array dimensions do not match array content') */ } /* "asyncpg/protocol/codecs/array.pyx":534 * 'specified array dimensions do not match array content') * * for i in range(ndims): # <<<<<<<<<<<<<< * if inferred_dims[i] != dims[i]: * raise ValueError( */ __pyx_t_8 = __pyx_v_ndims; __pyx_t_9 = __pyx_t_8; for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; /* "asyncpg/protocol/codecs/array.pyx":535 * * for i in range(ndims): * if inferred_dims[i] != dims[i]: # <<<<<<<<<<<<<< * raise ValueError( * 'specified array dimensions do not match array content') */ __pyx_t_1 = ((__pyx_v_inferred_dims[__pyx_v_i]) != (__pyx_v_dims[__pyx_v_i])); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/codecs/array.pyx":536 * for i in range(ndims): * if inferred_dims[i] != dims[i]: * raise ValueError( # <<<<<<<<<<<<<< * 'specified array dimensions do not match array content') * else: */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 536, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":535 * * for i in range(ndims): * if inferred_dims[i] != dims[i]: # <<<<<<<<<<<<<< * raise ValueError( * 'specified array dimensions do not match array content') */ } } /* "asyncpg/protocol/codecs/array.pyx":513 * ndims += 1 * * if ndims != 0: # <<<<<<<<<<<<<< * # If dimensions were given, the '=' token is expected. * if ptr[0] != '=': */ goto __pyx_L13; } /* "asyncpg/protocol/codecs/array.pyx":541 * # Infer the dimensions from the brace structure in the array literal * # body. This also validates that the array literal is sane. * _infer_array_dims(ptr, typdelim, dims, &ndims) # <<<<<<<<<<<<<< * * while not end_of_array: */ /*else*/ { __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__infer_array_dims(__pyx_v_ptr, __pyx_v_typdelim, __pyx_v_dims, (&__pyx_v_ndims)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L13:; /* "asyncpg/protocol/codecs/array.pyx":543 * _infer_array_dims(ptr, typdelim, dims, &ndims) * * while not end_of_array: # <<<<<<<<<<<<<< * # We iterate over the literal character by character * # and modify the string in-place removing the array-specific */ while (1) { __pyx_t_1 = (!__pyx_v_end_of_array); if (!__pyx_t_1) break; /* "asyncpg/protocol/codecs/array.pyx":547 * # and modify the string in-place removing the array-specific * # quoting and determining the boundaries of each element. * end_of_item = has_quoting = in_quotes = False # <<<<<<<<<<<<<< * strip_spaces = True * */ __pyx_v_end_of_item = 0; __pyx_v_has_quoting = 0; __pyx_v_in_quotes = 0; /* "asyncpg/protocol/codecs/array.pyx":548 * # quoting and determining the boundaries of each element. * end_of_item = has_quoting = in_quotes = False * strip_spaces = True # <<<<<<<<<<<<<< * * # Pointers to array element start, end, and the current pointer */ __pyx_v_strip_spaces = 1; /* "asyncpg/protocol/codecs/array.pyx":553 * # tracking the position where characters are written when * # escaping is folded. * item_start = item_end = item_ptr = ptr # <<<<<<<<<<<<<< * item_level = 0 * */ __pyx_v_item_start = __pyx_v_ptr; __pyx_v_item_end = __pyx_v_ptr; __pyx_v_item_ptr = __pyx_v_ptr; /* "asyncpg/protocol/codecs/array.pyx":554 * # escaping is folded. * item_start = item_end = item_ptr = ptr * item_level = 0 # <<<<<<<<<<<<<< * * while not end_of_item: */ __pyx_v_item_level = 0; /* "asyncpg/protocol/codecs/array.pyx":556 * item_level = 0 * * while not end_of_item: # <<<<<<<<<<<<<< * if ptr[0] == '"': * in_quotes = not in_quotes */ while (1) { __pyx_t_1 = (!__pyx_v_end_of_item); if (!__pyx_t_1) break; /* "asyncpg/protocol/codecs/array.pyx":557 * * while not end_of_item: * if ptr[0] == '"': # <<<<<<<<<<<<<< * in_quotes = not in_quotes * if in_quotes: */ __pyx_t_1 = ((__pyx_v_ptr[0]) == 34); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":558 * while not end_of_item: * if ptr[0] == '"': * in_quotes = not in_quotes # <<<<<<<<<<<<<< * if in_quotes: * strip_spaces = False */ __pyx_v_in_quotes = (!__pyx_v_in_quotes); /* "asyncpg/protocol/codecs/array.pyx":559 * if ptr[0] == '"': * in_quotes = not in_quotes * if in_quotes: # <<<<<<<<<<<<<< * strip_spaces = False * else: */ if (__pyx_v_in_quotes) { /* "asyncpg/protocol/codecs/array.pyx":560 * in_quotes = not in_quotes * if in_quotes: * strip_spaces = False # <<<<<<<<<<<<<< * else: * item_end = item_ptr */ __pyx_v_strip_spaces = 0; /* "asyncpg/protocol/codecs/array.pyx":559 * if ptr[0] == '"': * in_quotes = not in_quotes * if in_quotes: # <<<<<<<<<<<<<< * strip_spaces = False * else: */ goto __pyx_L26; } /* "asyncpg/protocol/codecs/array.pyx":562 * strip_spaces = False * else: * item_end = item_ptr # <<<<<<<<<<<<<< * has_quoting = True * */ /*else*/ { __pyx_v_item_end = __pyx_v_item_ptr; } __pyx_L26:; /* "asyncpg/protocol/codecs/array.pyx":563 * else: * item_end = item_ptr * has_quoting = True # <<<<<<<<<<<<<< * * elif ptr[0] == '\\': */ __pyx_v_has_quoting = 1; /* "asyncpg/protocol/codecs/array.pyx":557 * * while not end_of_item: * if ptr[0] == '"': # <<<<<<<<<<<<<< * in_quotes = not in_quotes * if in_quotes: */ goto __pyx_L25; } /* "asyncpg/protocol/codecs/array.pyx":565 * has_quoting = True * * elif ptr[0] == '\\': # <<<<<<<<<<<<<< * # Quoted character, collapse the backslash. * ptr += 1 */ __pyx_t_1 = ((__pyx_v_ptr[0]) == 92); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":567 * elif ptr[0] == '\\': * # Quoted character, collapse the backslash. * ptr += 1 # <<<<<<<<<<<<<< * has_quoting = True * item_ptr[0] = ptr[0] */ __pyx_v_ptr = (__pyx_v_ptr + 1); /* "asyncpg/protocol/codecs/array.pyx":568 * # Quoted character, collapse the backslash. * ptr += 1 * has_quoting = True # <<<<<<<<<<<<<< * item_ptr[0] = ptr[0] * item_ptr += 1 */ __pyx_v_has_quoting = 1; /* "asyncpg/protocol/codecs/array.pyx":569 * ptr += 1 * has_quoting = True * item_ptr[0] = ptr[0] # <<<<<<<<<<<<<< * item_ptr += 1 * strip_spaces = False */ (__pyx_v_item_ptr[0]) = (__pyx_v_ptr[0]); /* "asyncpg/protocol/codecs/array.pyx":570 * has_quoting = True * item_ptr[0] = ptr[0] * item_ptr += 1 # <<<<<<<<<<<<<< * strip_spaces = False * item_end = item_ptr */ __pyx_v_item_ptr = (__pyx_v_item_ptr + 1); /* "asyncpg/protocol/codecs/array.pyx":571 * item_ptr[0] = ptr[0] * item_ptr += 1 * strip_spaces = False # <<<<<<<<<<<<<< * item_end = item_ptr * */ __pyx_v_strip_spaces = 0; /* "asyncpg/protocol/codecs/array.pyx":572 * item_ptr += 1 * strip_spaces = False * item_end = item_ptr # <<<<<<<<<<<<<< * * elif in_quotes: */ __pyx_v_item_end = __pyx_v_item_ptr; /* "asyncpg/protocol/codecs/array.pyx":565 * has_quoting = True * * elif ptr[0] == '\\': # <<<<<<<<<<<<<< * # Quoted character, collapse the backslash. * ptr += 1 */ goto __pyx_L25; } /* "asyncpg/protocol/codecs/array.pyx":574 * item_end = item_ptr * * elif in_quotes: # <<<<<<<<<<<<<< * # Consume the string until we see the closing quote. * item_ptr[0] = ptr[0] */ if (__pyx_v_in_quotes) { /* "asyncpg/protocol/codecs/array.pyx":576 * elif in_quotes: * # Consume the string until we see the closing quote. * item_ptr[0] = ptr[0] # <<<<<<<<<<<<<< * item_ptr += 1 * */ (__pyx_v_item_ptr[0]) = (__pyx_v_ptr[0]); /* "asyncpg/protocol/codecs/array.pyx":577 * # Consume the string until we see the closing quote. * item_ptr[0] = ptr[0] * item_ptr += 1 # <<<<<<<<<<<<<< * * elif ptr[0] == '{': */ __pyx_v_item_ptr = (__pyx_v_item_ptr + 1); /* "asyncpg/protocol/codecs/array.pyx":574 * item_end = item_ptr * * elif in_quotes: # <<<<<<<<<<<<<< * # Consume the string until we see the closing quote. * item_ptr[0] = ptr[0] */ goto __pyx_L25; } /* "asyncpg/protocol/codecs/array.pyx":579 * item_ptr += 1 * * elif ptr[0] == '{': # <<<<<<<<<<<<<< * # Nesting level increase. * nest_level += 1 */ __pyx_t_1 = ((__pyx_v_ptr[0]) == 0x7B); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":581 * elif ptr[0] == '{': * # Nesting level increase. * nest_level += 1 # <<<<<<<<<<<<<< * * indexes[nest_level - 1] = 0 */ __pyx_v_nest_level = (__pyx_v_nest_level + 1); /* "asyncpg/protocol/codecs/array.pyx":583 * nest_level += 1 * * indexes[nest_level - 1] = 0 # <<<<<<<<<<<<<< * new_stride = cpython.PyList_New(dims[nest_level - 1]) * strides[nest_level - 1] = \ */ (__pyx_v_indexes[(__pyx_v_nest_level - 1)]) = 0; /* "asyncpg/protocol/codecs/array.pyx":584 * * indexes[nest_level - 1] = 0 * new_stride = cpython.PyList_New(dims[nest_level - 1]) # <<<<<<<<<<<<<< * strides[nest_level - 1] = \ * (new_stride) */ __pyx_t_3 = PyList_New((__pyx_v_dims[(__pyx_v_nest_level - 1)])); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_new_stride, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/array.pyx":585 * indexes[nest_level - 1] = 0 * new_stride = cpython.PyList_New(dims[nest_level - 1]) * strides[nest_level - 1] = \ # <<<<<<<<<<<<<< * (new_stride) * */ (__pyx_v_strides[(__pyx_v_nest_level - 1)]) = ((void *)__pyx_v_new_stride); /* "asyncpg/protocol/codecs/array.pyx":588 * (new_stride) * * if nest_level > 1: # <<<<<<<<<<<<<< * cpython.Py_INCREF(new_stride) * cpython.PyList_SET_ITEM( */ __pyx_t_1 = (__pyx_v_nest_level > 1); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":589 * * if nest_level > 1: * cpython.Py_INCREF(new_stride) # <<<<<<<<<<<<<< * cpython.PyList_SET_ITEM( * strides[nest_level - 2], */ Py_INCREF(__pyx_v_new_stride); /* "asyncpg/protocol/codecs/array.pyx":591 * cpython.Py_INCREF(new_stride) * cpython.PyList_SET_ITEM( * strides[nest_level - 2], # <<<<<<<<<<<<<< * indexes[nest_level - 2], * new_stride) */ __pyx_t_11 = ((PyObject *)(__pyx_v_strides[(__pyx_v_nest_level - 2)])); /* "asyncpg/protocol/codecs/array.pyx":590 * if nest_level > 1: * cpython.Py_INCREF(new_stride) * cpython.PyList_SET_ITEM( # <<<<<<<<<<<<<< * strides[nest_level - 2], * indexes[nest_level - 2], */ PyList_SET_ITEM(((PyObject *)__pyx_t_11), (__pyx_v_indexes[(__pyx_v_nest_level - 2)]), __pyx_v_new_stride); /* "asyncpg/protocol/codecs/array.pyx":588 * (new_stride) * * if nest_level > 1: # <<<<<<<<<<<<<< * cpython.Py_INCREF(new_stride) * cpython.PyList_SET_ITEM( */ goto __pyx_L27; } /* "asyncpg/protocol/codecs/array.pyx":595 * new_stride) * else: * result = new_stride # <<<<<<<<<<<<<< * * elif ptr[0] == '}': */ /*else*/ { __Pyx_INCREF(__pyx_v_new_stride); __Pyx_XDECREF_SET(__pyx_v_result, __pyx_v_new_stride); } __pyx_L27:; /* "asyncpg/protocol/codecs/array.pyx":579 * item_ptr += 1 * * elif ptr[0] == '{': # <<<<<<<<<<<<<< * # Nesting level increase. * nest_level += 1 */ goto __pyx_L25; } /* "asyncpg/protocol/codecs/array.pyx":597 * result = new_stride * * elif ptr[0] == '}': # <<<<<<<<<<<<<< * if item_level == 0: * # Make sure we keep track of which nesting */ __pyx_t_1 = ((__pyx_v_ptr[0]) == 0x7D); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":598 * * elif ptr[0] == '}': * if item_level == 0: # <<<<<<<<<<<<<< * # Make sure we keep track of which nesting * # level the item belongs to, as the loop */ __pyx_t_1 = (__pyx_v_item_level == 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":603 * # will continue to consume closing braces * # until the delimiter or the end of input. * item_level = nest_level # <<<<<<<<<<<<<< * * nest_level -= 1 */ __pyx_v_item_level = __pyx_v_nest_level; /* "asyncpg/protocol/codecs/array.pyx":598 * * elif ptr[0] == '}': * if item_level == 0: # <<<<<<<<<<<<<< * # Make sure we keep track of which nesting * # level the item belongs to, as the loop */ } /* "asyncpg/protocol/codecs/array.pyx":605 * item_level = nest_level * * nest_level -= 1 # <<<<<<<<<<<<<< * * if nest_level == 0: */ __pyx_v_nest_level = (__pyx_v_nest_level - 1); /* "asyncpg/protocol/codecs/array.pyx":607 * nest_level -= 1 * * if nest_level == 0: # <<<<<<<<<<<<<< * end_of_array = end_of_item = True * */ __pyx_t_1 = (__pyx_v_nest_level == 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":608 * * if nest_level == 0: * end_of_array = end_of_item = True # <<<<<<<<<<<<<< * * elif ptr[0] == typdelim: */ __pyx_v_end_of_array = 1; __pyx_v_end_of_item = 1; /* "asyncpg/protocol/codecs/array.pyx":607 * nest_level -= 1 * * if nest_level == 0: # <<<<<<<<<<<<<< * end_of_array = end_of_item = True * */ } /* "asyncpg/protocol/codecs/array.pyx":597 * result = new_stride * * elif ptr[0] == '}': # <<<<<<<<<<<<<< * if item_level == 0: * # Make sure we keep track of which nesting */ goto __pyx_L25; } /* "asyncpg/protocol/codecs/array.pyx":610 * end_of_array = end_of_item = True * * elif ptr[0] == typdelim: # <<<<<<<<<<<<<< * # Array element delimiter, * end_of_item = True */ __pyx_t_1 = ((__pyx_v_ptr[0]) == __pyx_v_typdelim); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":612 * elif ptr[0] == typdelim: * # Array element delimiter, * end_of_item = True # <<<<<<<<<<<<<< * if item_level == 0: * item_level = nest_level */ __pyx_v_end_of_item = 1; /* "asyncpg/protocol/codecs/array.pyx":613 * # Array element delimiter, * end_of_item = True * if item_level == 0: # <<<<<<<<<<<<<< * item_level = nest_level * */ __pyx_t_1 = (__pyx_v_item_level == 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":614 * end_of_item = True * if item_level == 0: * item_level = nest_level # <<<<<<<<<<<<<< * * elif apg_ascii_isspace(ptr[0]): */ __pyx_v_item_level = __pyx_v_nest_level; /* "asyncpg/protocol/codecs/array.pyx":613 * # Array element delimiter, * end_of_item = True * if item_level == 0: # <<<<<<<<<<<<<< * item_level = nest_level * */ } /* "asyncpg/protocol/codecs/array.pyx":610 * end_of_array = end_of_item = True * * elif ptr[0] == typdelim: # <<<<<<<<<<<<<< * # Array element delimiter, * end_of_item = True */ goto __pyx_L25; } /* "asyncpg/protocol/codecs/array.pyx":616 * item_level = nest_level * * elif apg_ascii_isspace(ptr[0]): # <<<<<<<<<<<<<< * if not strip_spaces: * item_ptr[0] = ptr[0] */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace((__pyx_v_ptr[0])); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(4, 616, __pyx_L1_error) if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":617 * * elif apg_ascii_isspace(ptr[0]): * if not strip_spaces: # <<<<<<<<<<<<<< * item_ptr[0] = ptr[0] * item_ptr += 1 */ __pyx_t_1 = (!__pyx_v_strip_spaces); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":618 * elif apg_ascii_isspace(ptr[0]): * if not strip_spaces: * item_ptr[0] = ptr[0] # <<<<<<<<<<<<<< * item_ptr += 1 * # Ignore the leading literal whitespace. */ (__pyx_v_item_ptr[0]) = (__pyx_v_ptr[0]); /* "asyncpg/protocol/codecs/array.pyx":619 * if not strip_spaces: * item_ptr[0] = ptr[0] * item_ptr += 1 # <<<<<<<<<<<<<< * # Ignore the leading literal whitespace. * */ __pyx_v_item_ptr = (__pyx_v_item_ptr + 1); /* "asyncpg/protocol/codecs/array.pyx":617 * * elif apg_ascii_isspace(ptr[0]): * if not strip_spaces: # <<<<<<<<<<<<<< * item_ptr[0] = ptr[0] * item_ptr += 1 */ } /* "asyncpg/protocol/codecs/array.pyx":616 * item_level = nest_level * * elif apg_ascii_isspace(ptr[0]): # <<<<<<<<<<<<<< * if not strip_spaces: * item_ptr[0] = ptr[0] */ goto __pyx_L25; } /* "asyncpg/protocol/codecs/array.pyx":623 * * else: * item_ptr[0] = ptr[0] # <<<<<<<<<<<<<< * item_ptr += 1 * strip_spaces = False */ /*else*/ { (__pyx_v_item_ptr[0]) = (__pyx_v_ptr[0]); /* "asyncpg/protocol/codecs/array.pyx":624 * else: * item_ptr[0] = ptr[0] * item_ptr += 1 # <<<<<<<<<<<<<< * strip_spaces = False * item_end = item_ptr */ __pyx_v_item_ptr = (__pyx_v_item_ptr + 1); /* "asyncpg/protocol/codecs/array.pyx":625 * item_ptr[0] = ptr[0] * item_ptr += 1 * strip_spaces = False # <<<<<<<<<<<<<< * item_end = item_ptr * */ __pyx_v_strip_spaces = 0; /* "asyncpg/protocol/codecs/array.pyx":626 * item_ptr += 1 * strip_spaces = False * item_end = item_ptr # <<<<<<<<<<<<<< * * ptr += 1 */ __pyx_v_item_end = __pyx_v_item_ptr; } __pyx_L25:; /* "asyncpg/protocol/codecs/array.pyx":628 * item_end = item_ptr * * ptr += 1 # <<<<<<<<<<<<<< * * # end while not end_of_item */ __pyx_v_ptr = (__pyx_v_ptr + 1); } /* "asyncpg/protocol/codecs/array.pyx":632 * # end while not end_of_item * * if item_end == item_start: # <<<<<<<<<<<<<< * # Empty array * continue */ __pyx_t_1 = (__pyx_v_item_end == __pyx_v_item_start); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":634 * if item_end == item_start: * # Empty array * continue # <<<<<<<<<<<<<< * * item_end[0] = '\0' */ goto __pyx_L21_continue; /* "asyncpg/protocol/codecs/array.pyx":632 * # end while not end_of_item * * if item_end == item_start: # <<<<<<<<<<<<<< * # Empty array * continue */ } /* "asyncpg/protocol/codecs/array.pyx":636 * continue * * item_end[0] = '\0' # <<<<<<<<<<<<<< * * if not has_quoting and apg_strcasecmp(item_start, APG_NULL) == 0: */ (__pyx_v_item_end[0]) = 0; /* "asyncpg/protocol/codecs/array.pyx":638 * item_end[0] = '\0' * * if not has_quoting and apg_strcasecmp(item_start, APG_NULL) == 0: # <<<<<<<<<<<<<< * # NULL element. * item = None */ __pyx_t_12 = (!__pyx_v_has_quoting); if (__pyx_t_12) { } else { __pyx_t_1 = __pyx_t_12; goto __pyx_L34_bool_binop_done; } __pyx_t_10 = __pyx_f_7asyncpg_8protocol_8protocol_apg_strcasecmp(__pyx_v_item_start, __pyx_v_7asyncpg_8protocol_8protocol_APG_NULL); if (unlikely(__pyx_t_10 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(4, 638, __pyx_L1_error) __pyx_t_12 = (__pyx_t_10 == 0); __pyx_t_1 = __pyx_t_12; __pyx_L34_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":640 * if not has_quoting and apg_strcasecmp(item_start, APG_NULL) == 0: * # NULL element. * item = None # <<<<<<<<<<<<<< * else: * # XXX: find a way to avoid the redundant encode/decode */ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_item, Py_None); /* "asyncpg/protocol/codecs/array.pyx":638 * item_end[0] = '\0' * * if not has_quoting and apg_strcasecmp(item_start, APG_NULL) == 0: # <<<<<<<<<<<<<< * # NULL element. * item = None */ goto __pyx_L33; } /* "asyncpg/protocol/codecs/array.pyx":644 * # XXX: find a way to avoid the redundant encode/decode * # cycle here. * item_text = cpythonx.PyUnicode_FromKindAndData( # <<<<<<<<<<<<<< * cpythonx.PyUnicode_4BYTE_KIND, * item_start, */ /*else*/ { /* "asyncpg/protocol/codecs/array.pyx":647 * cpythonx.PyUnicode_4BYTE_KIND, * item_start, * item_end - item_start) # <<<<<<<<<<<<<< * * # Prepare the element buffer and call the text decoder */ __pyx_t_3 = PyUnicode_FromKindAndData(PyUnicode_4BYTE_KIND, ((void *)__pyx_v_item_start), (__pyx_v_item_end - __pyx_v_item_start)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/protocol/codecs/array.pyx":644 * # XXX: find a way to avoid the redundant encode/decode * # cycle here. * item_text = cpythonx.PyUnicode_FromKindAndData( # <<<<<<<<<<<<<< * cpythonx.PyUnicode_4BYTE_KIND, * item_start, */ if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_3))) __PYX_ERR(4, 644, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_item_text, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/array.pyx":651 * # Prepare the element buffer and call the text decoder * # for the element type. * pgproto.as_pg_string_and_size( # <<<<<<<<<<<<<< * settings, item_text, &pg_item_str, &pg_item_len) * frb_init(&item_buf, pg_item_str, pg_item_len) */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_as_pg_string_and_size(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings), __pyx_v_item_text, (&__pyx_v_pg_item_str), (&__pyx_v_pg_item_len)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/array.pyx":653 * pgproto.as_pg_string_and_size( * settings, item_text, &pg_item_str, &pg_item_len) * frb_init(&item_buf, pg_item_str, pg_item_len) # <<<<<<<<<<<<<< * item = decoder(settings, &item_buf, decoder_arg) * */ __pyx_f_7asyncpg_7pgproto_7pgproto_frb_init((&__pyx_v_item_buf), __pyx_v_pg_item_str, __pyx_v_pg_item_len); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 653, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":654 * settings, item_text, &pg_item_str, &pg_item_len) * frb_init(&item_buf, pg_item_str, pg_item_len) * item = decoder(settings, &item_buf, decoder_arg) # <<<<<<<<<<<<<< * * # Place the decoded element in the array. */ __pyx_t_3 = __pyx_v_decoder(__pyx_v_settings, (&__pyx_v_item_buf), __pyx_v_decoder_arg); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3); __pyx_t_3 = 0; } __pyx_L33:; /* "asyncpg/protocol/codecs/array.pyx":657 * * # Place the decoded element in the array. * cpython.Py_INCREF(item) # <<<<<<<<<<<<<< * cpython.PyList_SET_ITEM( * strides[item_level - 1], */ Py_INCREF(__pyx_v_item); /* "asyncpg/protocol/codecs/array.pyx":659 * cpython.Py_INCREF(item) * cpython.PyList_SET_ITEM( * strides[item_level - 1], # <<<<<<<<<<<<<< * indexes[item_level - 1], * item) */ __pyx_t_11 = ((PyObject *)(__pyx_v_strides[(__pyx_v_item_level - 1)])); /* "asyncpg/protocol/codecs/array.pyx":658 * # Place the decoded element in the array. * cpython.Py_INCREF(item) * cpython.PyList_SET_ITEM( # <<<<<<<<<<<<<< * strides[item_level - 1], * indexes[item_level - 1], */ PyList_SET_ITEM(((PyObject *)__pyx_t_11), (__pyx_v_indexes[(__pyx_v_item_level - 1)]), __pyx_v_item); /* "asyncpg/protocol/codecs/array.pyx":663 * item) * * if nest_level > 0: # <<<<<<<<<<<<<< * indexes[nest_level - 1] += 1 * */ __pyx_t_1 = (__pyx_v_nest_level > 0); if (__pyx_t_1) { /* "asyncpg/protocol/codecs/array.pyx":664 * * if nest_level > 0: * indexes[nest_level - 1] += 1 # <<<<<<<<<<<<<< * * return result */ __pyx_t_13 = (__pyx_v_nest_level - 1); (__pyx_v_indexes[__pyx_t_13]) = ((__pyx_v_indexes[__pyx_t_13]) + 1); /* "asyncpg/protocol/codecs/array.pyx":663 * item) * * if nest_level > 0: # <<<<<<<<<<<<<< * indexes[nest_level - 1] += 1 * */ } __pyx_L21_continue:; } /* "asyncpg/protocol/codecs/array.pyx":666 * indexes[nest_level - 1] += 1 * * return result # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); __PYX_ERR(4, 666, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/protocol/codecs/array.pyx":435 * * * cdef _textarray_decode(ConnectionSettings settings, # <<<<<<<<<<<<<< * Py_UCS4 *array_text, * decode_func_ex decoder, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol._textarray_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF(__pyx_v_new_stride); __Pyx_XDECREF(__pyx_v_item); __Pyx_XDECREF(__pyx_v_item_text); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":678 * * * cdef _UnexpectedCharacter(const Py_UCS4 *array_text, const Py_UCS4 *ptr): # <<<<<<<<<<<<<< * return ValueError('unexpected character {!r} at position {}'.format( * cpython.PyUnicode_FromOrdinal(ptr[0]), ptr - array_text + 1)) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__UnexpectedCharacter(Py_UCS4 const *__pyx_v_array_text, Py_UCS4 const *__pyx_v_ptr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_UnexpectedCharacter", 1); /* "asyncpg/protocol/codecs/array.pyx":679 * * cdef _UnexpectedCharacter(const Py_UCS4 *array_text, const Py_UCS4 *ptr): * return ValueError('unexpected character {!r} at position {}'.format( # <<<<<<<<<<<<<< * cpython.PyUnicode_FromOrdinal(ptr[0]), ptr - array_text + 1)) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_character_r_at_positi, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/codecs/array.pyx":680 * cdef _UnexpectedCharacter(const Py_UCS4 *array_text, const Py_UCS4 *ptr): * return ValueError('unexpected character {!r} at position {}'.format( * cpython.PyUnicode_FromOrdinal(ptr[0]), ptr - array_text + 1)) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = PyUnicode_FromOrdinal(((int)(__pyx_v_ptr[0]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_ptrdiff_t(((__pyx_v_ptr - __pyx_v_array_text) + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "asyncpg/protocol/codecs/array.pyx":679 * * cdef _UnexpectedCharacter(const Py_UCS4 *array_text, const Py_UCS4 *ptr): * return ValueError('unexpected character {!r} at position {}'.format( # <<<<<<<<<<<<<< * cpython.PyUnicode_FromOrdinal(ptr[0]), ptr - array_text + 1)) * */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/array.pyx":678 * * * cdef _UnexpectedCharacter(const Py_UCS4 *array_text, const Py_UCS4 *ptr): # <<<<<<<<<<<<<< * return ValueError('unexpected character {!r} at position {}'.format( * cpython.PyUnicode_FromOrdinal(ptr[0]), ptr - array_text + 1)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol._UnexpectedCharacter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":683 * * * cdef _infer_array_dims(const Py_UCS4 *array_text, # <<<<<<<<<<<<<< * Py_UCS4 typdelim, * int32_t *dims, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__infer_array_dims(Py_UCS4 const *__pyx_v_array_text, Py_UCS4 __pyx_v_typdelim, int32_t *__pyx_v_dims, int32_t *__pyx_v_ndims) { Py_UCS4 const *__pyx_v_ptr; int __pyx_v_i; int __pyx_v_nest_level; int __pyx_v_end_of_array; int __pyx_v_end_of_item; int __pyx_v_in_quotes; int __pyx_v_array_is_empty; int __pyx_v_stride_len[6]; int __pyx_v_prev_stride_len[6]; enum __pyx_t_7asyncpg_8protocol_8protocol__ArrayParseState __pyx_v_parse_state; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; long __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_infer_array_dims", 1); /* "asyncpg/protocol/codecs/array.pyx":688 * int32_t *ndims): * cdef: * const Py_UCS4 *ptr = array_text # <<<<<<<<<<<<<< * int i * int nest_level = 0 */ __pyx_v_ptr = __pyx_v_array_text; /* "asyncpg/protocol/codecs/array.pyx":690 * const Py_UCS4 *ptr = array_text * int i * int nest_level = 0 # <<<<<<<<<<<<<< * bint end_of_array = False * bint end_of_item = False */ __pyx_v_nest_level = 0; /* "asyncpg/protocol/codecs/array.pyx":691 * int i * int nest_level = 0 * bint end_of_array = False # <<<<<<<<<<<<<< * bint end_of_item = False * bint in_quotes = False */ __pyx_v_end_of_array = 0; /* "asyncpg/protocol/codecs/array.pyx":692 * int nest_level = 0 * bint end_of_array = False * bint end_of_item = False # <<<<<<<<<<<<<< * bint in_quotes = False * bint array_is_empty = True */ __pyx_v_end_of_item = 0; /* "asyncpg/protocol/codecs/array.pyx":693 * bint end_of_array = False * bint end_of_item = False * bint in_quotes = False # <<<<<<<<<<<<<< * bint array_is_empty = True * int stride_len[ARRAY_MAXDIM] */ __pyx_v_in_quotes = 0; /* "asyncpg/protocol/codecs/array.pyx":694 * bint end_of_item = False * bint in_quotes = False * bint array_is_empty = True # <<<<<<<<<<<<<< * int stride_len[ARRAY_MAXDIM] * int prev_stride_len[ARRAY_MAXDIM] */ __pyx_v_array_is_empty = 1; /* "asyncpg/protocol/codecs/array.pyx":697 * int stride_len[ARRAY_MAXDIM] * int prev_stride_len[ARRAY_MAXDIM] * _ArrayParseState parse_state = APS_START # <<<<<<<<<<<<<< * * for i in range(ARRAY_MAXDIM): */ __pyx_v_parse_state = __pyx_e_7asyncpg_8protocol_8protocol_APS_START; /* "asyncpg/protocol/codecs/array.pyx":699 * _ArrayParseState parse_state = APS_START * * for i in range(ARRAY_MAXDIM): # <<<<<<<<<<<<<< * dims[i] = prev_stride_len[i] = 0 * stride_len[i] = 1 */ for (__pyx_t_1 = 0; __pyx_t_1 < 6; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; /* "asyncpg/protocol/codecs/array.pyx":700 * * for i in range(ARRAY_MAXDIM): * dims[i] = prev_stride_len[i] = 0 # <<<<<<<<<<<<<< * stride_len[i] = 1 * */ (__pyx_v_dims[__pyx_v_i]) = 0; (__pyx_v_prev_stride_len[__pyx_v_i]) = 0; /* "asyncpg/protocol/codecs/array.pyx":701 * for i in range(ARRAY_MAXDIM): * dims[i] = prev_stride_len[i] = 0 * stride_len[i] = 1 # <<<<<<<<<<<<<< * * while not end_of_array: */ (__pyx_v_stride_len[__pyx_v_i]) = 1; } /* "asyncpg/protocol/codecs/array.pyx":703 * stride_len[i] = 1 * * while not end_of_array: # <<<<<<<<<<<<<< * end_of_item = False * */ while (1) { __pyx_t_2 = (!__pyx_v_end_of_array); if (!__pyx_t_2) break; /* "asyncpg/protocol/codecs/array.pyx":704 * * while not end_of_array: * end_of_item = False # <<<<<<<<<<<<<< * * while not end_of_item: */ __pyx_v_end_of_item = 0; /* "asyncpg/protocol/codecs/array.pyx":706 * end_of_item = False * * while not end_of_item: # <<<<<<<<<<<<<< * if ptr[0] == '\0': * raise ValueError('unexpected end of string') */ while (1) { __pyx_t_2 = (!__pyx_v_end_of_item); if (!__pyx_t_2) break; /* "asyncpg/protocol/codecs/array.pyx":707 * * while not end_of_item: * if ptr[0] == '\0': # <<<<<<<<<<<<<< * raise ValueError('unexpected end of string') * */ __pyx_t_2 = ((__pyx_v_ptr[0]) == 0); if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/codecs/array.pyx":708 * while not end_of_item: * if ptr[0] == '\0': * raise ValueError('unexpected end of string') # <<<<<<<<<<<<<< * * elif ptr[0] == '"': */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 708, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":707 * * while not end_of_item: * if ptr[0] == '\0': # <<<<<<<<<<<<<< * raise ValueError('unexpected end of string') * */ } /* "asyncpg/protocol/codecs/array.pyx":710 * raise ValueError('unexpected end of string') * * elif ptr[0] == '"': # <<<<<<<<<<<<<< * if (parse_state not in (APS_STRIDE_STARTED, * APS_ELEM_DELIMITED) and */ __pyx_t_2 = ((__pyx_v_ptr[0]) == 34); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":711 * * elif ptr[0] == '"': * if (parse_state not in (APS_STRIDE_STARTED, # <<<<<<<<<<<<<< * APS_ELEM_DELIMITED) and * not (parse_state == APS_ELEM_STARTED and in_quotes)): */ switch (__pyx_v_parse_state) { case __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_STARTED: case __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_DELIMITED: /* "asyncpg/protocol/codecs/array.pyx":712 * elif ptr[0] == '"': * if (parse_state not in (APS_STRIDE_STARTED, * APS_ELEM_DELIMITED) and # <<<<<<<<<<<<<< * not (parse_state == APS_ELEM_STARTED and in_quotes)): * raise _UnexpectedCharacter(array_text, ptr) */ __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/array.pyx":711 * * elif ptr[0] == '"': * if (parse_state not in (APS_STRIDE_STARTED, # <<<<<<<<<<<<<< * APS_ELEM_DELIMITED) and * not (parse_state == APS_ELEM_STARTED and in_quotes)): */ break; default: __pyx_t_4 = 1; break; } __pyx_t_5 = __pyx_t_4; if (__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L11_bool_binop_done; } /* "asyncpg/protocol/codecs/array.pyx":713 * if (parse_state not in (APS_STRIDE_STARTED, * APS_ELEM_DELIMITED) and * not (parse_state == APS_ELEM_STARTED and in_quotes)): # <<<<<<<<<<<<<< * raise _UnexpectedCharacter(array_text, ptr) * */ __pyx_t_4 = (__pyx_v_parse_state == __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_STARTED); if (__pyx_t_4) { } else { __pyx_t_5 = __pyx_t_4; goto __pyx_L13_bool_binop_done; } __pyx_t_5 = __pyx_v_in_quotes; __pyx_L13_bool_binop_done:; __pyx_t_4 = (!__pyx_t_5); __pyx_t_2 = __pyx_t_4; __pyx_L11_bool_binop_done:; /* "asyncpg/protocol/codecs/array.pyx":711 * * elif ptr[0] == '"': * if (parse_state not in (APS_STRIDE_STARTED, # <<<<<<<<<<<<<< * APS_ELEM_DELIMITED) and * not (parse_state == APS_ELEM_STARTED and in_quotes)): */ if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/codecs/array.pyx":714 * APS_ELEM_DELIMITED) and * not (parse_state == APS_ELEM_STARTED and in_quotes)): * raise _UnexpectedCharacter(array_text, ptr) # <<<<<<<<<<<<<< * * in_quotes = not in_quotes */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__UnexpectedCharacter(__pyx_v_array_text, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 714, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":711 * * elif ptr[0] == '"': * if (parse_state not in (APS_STRIDE_STARTED, # <<<<<<<<<<<<<< * APS_ELEM_DELIMITED) and * not (parse_state == APS_ELEM_STARTED and in_quotes)): */ } /* "asyncpg/protocol/codecs/array.pyx":716 * raise _UnexpectedCharacter(array_text, ptr) * * in_quotes = not in_quotes # <<<<<<<<<<<<<< * if in_quotes: * parse_state = APS_ELEM_STARTED */ __pyx_v_in_quotes = (!__pyx_v_in_quotes); /* "asyncpg/protocol/codecs/array.pyx":717 * * in_quotes = not in_quotes * if in_quotes: # <<<<<<<<<<<<<< * parse_state = APS_ELEM_STARTED * array_is_empty = False */ if (__pyx_v_in_quotes) { /* "asyncpg/protocol/codecs/array.pyx":718 * in_quotes = not in_quotes * if in_quotes: * parse_state = APS_ELEM_STARTED # <<<<<<<<<<<<<< * array_is_empty = False * */ __pyx_v_parse_state = __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_STARTED; /* "asyncpg/protocol/codecs/array.pyx":719 * if in_quotes: * parse_state = APS_ELEM_STARTED * array_is_empty = False # <<<<<<<<<<<<<< * * elif ptr[0] == '\\': */ __pyx_v_array_is_empty = 0; /* "asyncpg/protocol/codecs/array.pyx":717 * * in_quotes = not in_quotes * if in_quotes: # <<<<<<<<<<<<<< * parse_state = APS_ELEM_STARTED * array_is_empty = False */ } /* "asyncpg/protocol/codecs/array.pyx":710 * raise ValueError('unexpected end of string') * * elif ptr[0] == '"': # <<<<<<<<<<<<<< * if (parse_state not in (APS_STRIDE_STARTED, * APS_ELEM_DELIMITED) and */ goto __pyx_L9; } /* "asyncpg/protocol/codecs/array.pyx":721 * array_is_empty = False * * elif ptr[0] == '\\': # <<<<<<<<<<<<<< * if parse_state not in (APS_STRIDE_STARTED, * APS_ELEM_STARTED, */ __pyx_t_2 = ((__pyx_v_ptr[0]) == 92); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":722 * * elif ptr[0] == '\\': * if parse_state not in (APS_STRIDE_STARTED, # <<<<<<<<<<<<<< * APS_ELEM_STARTED, * APS_ELEM_DELIMITED): */ switch (__pyx_v_parse_state) { case __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_STARTED: case __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_STARTED: /* "asyncpg/protocol/codecs/array.pyx":723 * elif ptr[0] == '\\': * if parse_state not in (APS_STRIDE_STARTED, * APS_ELEM_STARTED, # <<<<<<<<<<<<<< * APS_ELEM_DELIMITED): * raise _UnexpectedCharacter(array_text, ptr) */ case __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_DELIMITED: /* "asyncpg/protocol/codecs/array.pyx":722 * * elif ptr[0] == '\\': * if parse_state not in (APS_STRIDE_STARTED, # <<<<<<<<<<<<<< * APS_ELEM_STARTED, * APS_ELEM_DELIMITED): */ __pyx_t_2 = 0; break; default: __pyx_t_2 = 1; break; } __pyx_t_4 = __pyx_t_2; if (unlikely(__pyx_t_4)) { /* "asyncpg/protocol/codecs/array.pyx":725 * APS_ELEM_STARTED, * APS_ELEM_DELIMITED): * raise _UnexpectedCharacter(array_text, ptr) # <<<<<<<<<<<<<< * * parse_state = APS_ELEM_STARTED */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__UnexpectedCharacter(__pyx_v_array_text, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 725, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":722 * * elif ptr[0] == '\\': * if parse_state not in (APS_STRIDE_STARTED, # <<<<<<<<<<<<<< * APS_ELEM_STARTED, * APS_ELEM_DELIMITED): */ } /* "asyncpg/protocol/codecs/array.pyx":727 * raise _UnexpectedCharacter(array_text, ptr) * * parse_state = APS_ELEM_STARTED # <<<<<<<<<<<<<< * array_is_empty = False * */ __pyx_v_parse_state = __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_STARTED; /* "asyncpg/protocol/codecs/array.pyx":728 * * parse_state = APS_ELEM_STARTED * array_is_empty = False # <<<<<<<<<<<<<< * * if ptr[1] != '\0': */ __pyx_v_array_is_empty = 0; /* "asyncpg/protocol/codecs/array.pyx":730 * array_is_empty = False * * if ptr[1] != '\0': # <<<<<<<<<<<<<< * ptr += 1 * else: */ __pyx_t_4 = ((__pyx_v_ptr[1]) != 0); if (likely(__pyx_t_4)) { /* "asyncpg/protocol/codecs/array.pyx":731 * * if ptr[1] != '\0': * ptr += 1 # <<<<<<<<<<<<<< * else: * raise ValueError('unexpected end of string') */ __pyx_v_ptr = (__pyx_v_ptr + 1); /* "asyncpg/protocol/codecs/array.pyx":730 * array_is_empty = False * * if ptr[1] != '\0': # <<<<<<<<<<<<<< * ptr += 1 * else: */ goto __pyx_L17; } /* "asyncpg/protocol/codecs/array.pyx":733 * ptr += 1 * else: * raise ValueError('unexpected end of string') # <<<<<<<<<<<<<< * * elif in_quotes: */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 733, __pyx_L1_error) } __pyx_L17:; /* "asyncpg/protocol/codecs/array.pyx":721 * array_is_empty = False * * elif ptr[0] == '\\': # <<<<<<<<<<<<<< * if parse_state not in (APS_STRIDE_STARTED, * APS_ELEM_STARTED, */ goto __pyx_L9; } /* "asyncpg/protocol/codecs/array.pyx":735 * raise ValueError('unexpected end of string') * * elif in_quotes: # <<<<<<<<<<<<<< * # Ignore everything inside the quotes. * pass */ if (__pyx_v_in_quotes) { goto __pyx_L9; } /* "asyncpg/protocol/codecs/array.pyx":739 * pass * * elif ptr[0] == '{': # <<<<<<<<<<<<<< * if parse_state not in (APS_START, * APS_STRIDE_STARTED, */ __pyx_t_4 = ((__pyx_v_ptr[0]) == 0x7B); if (__pyx_t_4) { /* "asyncpg/protocol/codecs/array.pyx":740 * * elif ptr[0] == '{': * if parse_state not in (APS_START, # <<<<<<<<<<<<<< * APS_STRIDE_STARTED, * APS_STRIDE_DELIMITED): */ switch (__pyx_v_parse_state) { case __pyx_e_7asyncpg_8protocol_8protocol_APS_START: case __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_STARTED: /* "asyncpg/protocol/codecs/array.pyx":741 * elif ptr[0] == '{': * if parse_state not in (APS_START, * APS_STRIDE_STARTED, # <<<<<<<<<<<<<< * APS_STRIDE_DELIMITED): * raise _UnexpectedCharacter(array_text, ptr) */ case __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_DELIMITED: /* "asyncpg/protocol/codecs/array.pyx":740 * * elif ptr[0] == '{': * if parse_state not in (APS_START, # <<<<<<<<<<<<<< * APS_STRIDE_STARTED, * APS_STRIDE_DELIMITED): */ __pyx_t_4 = 0; break; default: __pyx_t_4 = 1; break; } __pyx_t_2 = __pyx_t_4; if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/codecs/array.pyx":743 * APS_STRIDE_STARTED, * APS_STRIDE_DELIMITED): * raise _UnexpectedCharacter(array_text, ptr) # <<<<<<<<<<<<<< * * parse_state = APS_STRIDE_STARTED */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__UnexpectedCharacter(__pyx_v_array_text, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 743, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":740 * * elif ptr[0] == '{': * if parse_state not in (APS_START, # <<<<<<<<<<<<<< * APS_STRIDE_STARTED, * APS_STRIDE_DELIMITED): */ } /* "asyncpg/protocol/codecs/array.pyx":745 * raise _UnexpectedCharacter(array_text, ptr) * * parse_state = APS_STRIDE_STARTED # <<<<<<<<<<<<<< * if nest_level >= ARRAY_MAXDIM: * raise ValueError( */ __pyx_v_parse_state = __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_STARTED; /* "asyncpg/protocol/codecs/array.pyx":746 * * parse_state = APS_STRIDE_STARTED * if nest_level >= ARRAY_MAXDIM: # <<<<<<<<<<<<<< * raise ValueError( * 'number of array dimensions ({}) exceed the ' */ __pyx_t_2 = (__pyx_v_nest_level >= 6); if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/codecs/array.pyx":749 * raise ValueError( * 'number of array dimensions ({}) exceed the ' * 'maximum expected ({})'.format( # <<<<<<<<<<<<<< * nest_level, ARRAY_MAXDIM)) * */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_number_of_array_dimensions_excee, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "asyncpg/protocol/codecs/array.pyx":750 * 'number of array dimensions ({}) exceed the ' * 'maximum expected ({})'.format( * nest_level, ARRAY_MAXDIM)) # <<<<<<<<<<<<<< * * dims[nest_level] = 0 */ __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_nest_level); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_7, __pyx_int_6}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } /* "asyncpg/protocol/codecs/array.pyx":747 * parse_state = APS_STRIDE_STARTED * if nest_level >= ARRAY_MAXDIM: * raise ValueError( # <<<<<<<<<<<<<< * 'number of array dimensions ({}) exceed the ' * 'maximum expected ({})'.format( */ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(4, 747, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":746 * * parse_state = APS_STRIDE_STARTED * if nest_level >= ARRAY_MAXDIM: # <<<<<<<<<<<<<< * raise ValueError( * 'number of array dimensions ({}) exceed the ' */ } /* "asyncpg/protocol/codecs/array.pyx":752 * nest_level, ARRAY_MAXDIM)) * * dims[nest_level] = 0 # <<<<<<<<<<<<<< * nest_level += 1 * if ndims[0] < nest_level: */ (__pyx_v_dims[__pyx_v_nest_level]) = 0; /* "asyncpg/protocol/codecs/array.pyx":753 * * dims[nest_level] = 0 * nest_level += 1 # <<<<<<<<<<<<<< * if ndims[0] < nest_level: * ndims[0] = nest_level */ __pyx_v_nest_level = (__pyx_v_nest_level + 1); /* "asyncpg/protocol/codecs/array.pyx":754 * dims[nest_level] = 0 * nest_level += 1 * if ndims[0] < nest_level: # <<<<<<<<<<<<<< * ndims[0] = nest_level * */ __pyx_t_2 = ((__pyx_v_ndims[0]) < __pyx_v_nest_level); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":755 * nest_level += 1 * if ndims[0] < nest_level: * ndims[0] = nest_level # <<<<<<<<<<<<<< * * elif ptr[0] == '}': */ (__pyx_v_ndims[0]) = __pyx_v_nest_level; /* "asyncpg/protocol/codecs/array.pyx":754 * dims[nest_level] = 0 * nest_level += 1 * if ndims[0] < nest_level: # <<<<<<<<<<<<<< * ndims[0] = nest_level * */ } /* "asyncpg/protocol/codecs/array.pyx":739 * pass * * elif ptr[0] == '{': # <<<<<<<<<<<<<< * if parse_state not in (APS_START, * APS_STRIDE_STARTED, */ goto __pyx_L9; } /* "asyncpg/protocol/codecs/array.pyx":757 * ndims[0] = nest_level * * elif ptr[0] == '}': # <<<<<<<<<<<<<< * if (parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE) and * not (nest_level == 1 and */ __pyx_t_2 = ((__pyx_v_ptr[0]) == 0x7D); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":758 * * elif ptr[0] == '}': * if (parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE) and # <<<<<<<<<<<<<< * not (nest_level == 1 and * parse_state == APS_STRIDE_STARTED)): */ switch (__pyx_v_parse_state) { case __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_STARTED: case __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_DONE: __pyx_t_4 = 0; break; default: __pyx_t_4 = 1; break; } __pyx_t_5 = __pyx_t_4; if (__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L22_bool_binop_done; } /* "asyncpg/protocol/codecs/array.pyx":759 * elif ptr[0] == '}': * if (parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE) and * not (nest_level == 1 and # <<<<<<<<<<<<<< * parse_state == APS_STRIDE_STARTED)): * raise _UnexpectedCharacter(array_text, ptr) */ __pyx_t_4 = (__pyx_v_nest_level == 1); if (__pyx_t_4) { } else { __pyx_t_5 = __pyx_t_4; goto __pyx_L24_bool_binop_done; } /* "asyncpg/protocol/codecs/array.pyx":760 * if (parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE) and * not (nest_level == 1 and * parse_state == APS_STRIDE_STARTED)): # <<<<<<<<<<<<<< * raise _UnexpectedCharacter(array_text, ptr) * */ __pyx_t_4 = (__pyx_v_parse_state == __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_STARTED); __pyx_t_5 = __pyx_t_4; __pyx_L24_bool_binop_done:; /* "asyncpg/protocol/codecs/array.pyx":759 * elif ptr[0] == '}': * if (parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE) and * not (nest_level == 1 and # <<<<<<<<<<<<<< * parse_state == APS_STRIDE_STARTED)): * raise _UnexpectedCharacter(array_text, ptr) */ __pyx_t_4 = (!__pyx_t_5); __pyx_t_2 = __pyx_t_4; __pyx_L22_bool_binop_done:; /* "asyncpg/protocol/codecs/array.pyx":758 * * elif ptr[0] == '}': * if (parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE) and # <<<<<<<<<<<<<< * not (nest_level == 1 and * parse_state == APS_STRIDE_STARTED)): */ if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/codecs/array.pyx":761 * not (nest_level == 1 and * parse_state == APS_STRIDE_STARTED)): * raise _UnexpectedCharacter(array_text, ptr) # <<<<<<<<<<<<<< * * parse_state = APS_STRIDE_DONE */ __pyx_t_6 = __pyx_f_7asyncpg_8protocol_8protocol__UnexpectedCharacter(__pyx_v_array_text, __pyx_v_ptr); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(4, 761, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":758 * * elif ptr[0] == '}': * if (parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE) and # <<<<<<<<<<<<<< * not (nest_level == 1 and * parse_state == APS_STRIDE_STARTED)): */ } /* "asyncpg/protocol/codecs/array.pyx":763 * raise _UnexpectedCharacter(array_text, ptr) * * parse_state = APS_STRIDE_DONE # <<<<<<<<<<<<<< * * if nest_level == 0: */ __pyx_v_parse_state = __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_DONE; /* "asyncpg/protocol/codecs/array.pyx":765 * parse_state = APS_STRIDE_DONE * * if nest_level == 0: # <<<<<<<<<<<<<< * raise _UnexpectedCharacter(array_text, ptr) * */ __pyx_t_2 = (__pyx_v_nest_level == 0); if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/codecs/array.pyx":766 * * if nest_level == 0: * raise _UnexpectedCharacter(array_text, ptr) # <<<<<<<<<<<<<< * * nest_level -= 1 */ __pyx_t_6 = __pyx_f_7asyncpg_8protocol_8protocol__UnexpectedCharacter(__pyx_v_array_text, __pyx_v_ptr); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(4, 766, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":765 * parse_state = APS_STRIDE_DONE * * if nest_level == 0: # <<<<<<<<<<<<<< * raise _UnexpectedCharacter(array_text, ptr) * */ } /* "asyncpg/protocol/codecs/array.pyx":768 * raise _UnexpectedCharacter(array_text, ptr) * * nest_level -= 1 # <<<<<<<<<<<<<< * * if (prev_stride_len[nest_level] != 0 and */ __pyx_v_nest_level = (__pyx_v_nest_level - 1); /* "asyncpg/protocol/codecs/array.pyx":770 * nest_level -= 1 * * if (prev_stride_len[nest_level] != 0 and # <<<<<<<<<<<<<< * stride_len[nest_level] != prev_stride_len[nest_level]): * raise ValueError( */ __pyx_t_4 = ((__pyx_v_prev_stride_len[__pyx_v_nest_level]) != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L28_bool_binop_done; } /* "asyncpg/protocol/codecs/array.pyx":771 * * if (prev_stride_len[nest_level] != 0 and * stride_len[nest_level] != prev_stride_len[nest_level]): # <<<<<<<<<<<<<< * raise ValueError( * 'inconsistent sub-array dimensions' */ __pyx_t_4 = ((__pyx_v_stride_len[__pyx_v_nest_level]) != (__pyx_v_prev_stride_len[__pyx_v_nest_level])); __pyx_t_2 = __pyx_t_4; __pyx_L28_bool_binop_done:; /* "asyncpg/protocol/codecs/array.pyx":770 * nest_level -= 1 * * if (prev_stride_len[nest_level] != 0 and # <<<<<<<<<<<<<< * stride_len[nest_level] != prev_stride_len[nest_level]): * raise ValueError( */ if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/codecs/array.pyx":774 * raise ValueError( * 'inconsistent sub-array dimensions' * ' at position {}'.format( # <<<<<<<<<<<<<< * ptr - array_text + 1)) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_inconsistent_sub_array_dimension, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/protocol/codecs/array.pyx":775 * 'inconsistent sub-array dimensions' * ' at position {}'.format( * ptr - array_text + 1)) # <<<<<<<<<<<<<< * * prev_stride_len[nest_level] = stride_len[nest_level] */ __pyx_t_7 = __Pyx_PyInt_From_ptrdiff_t(((__pyx_v_ptr - __pyx_v_array_text) + 1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "asyncpg/protocol/codecs/array.pyx":772 * if (prev_stride_len[nest_level] != 0 and * stride_len[nest_level] != prev_stride_len[nest_level]): * raise ValueError( # <<<<<<<<<<<<<< * 'inconsistent sub-array dimensions' * ' at position {}'.format( */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 772, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":770 * nest_level -= 1 * * if (prev_stride_len[nest_level] != 0 and # <<<<<<<<<<<<<< * stride_len[nest_level] != prev_stride_len[nest_level]): * raise ValueError( */ } /* "asyncpg/protocol/codecs/array.pyx":777 * ptr - array_text + 1)) * * prev_stride_len[nest_level] = stride_len[nest_level] # <<<<<<<<<<<<<< * stride_len[nest_level] = 1 * if nest_level == 0: */ (__pyx_v_prev_stride_len[__pyx_v_nest_level]) = (__pyx_v_stride_len[__pyx_v_nest_level]); /* "asyncpg/protocol/codecs/array.pyx":778 * * prev_stride_len[nest_level] = stride_len[nest_level] * stride_len[nest_level] = 1 # <<<<<<<<<<<<<< * if nest_level == 0: * end_of_array = end_of_item = True */ (__pyx_v_stride_len[__pyx_v_nest_level]) = 1; /* "asyncpg/protocol/codecs/array.pyx":779 * prev_stride_len[nest_level] = stride_len[nest_level] * stride_len[nest_level] = 1 * if nest_level == 0: # <<<<<<<<<<<<<< * end_of_array = end_of_item = True * else: */ __pyx_t_2 = (__pyx_v_nest_level == 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":780 * stride_len[nest_level] = 1 * if nest_level == 0: * end_of_array = end_of_item = True # <<<<<<<<<<<<<< * else: * dims[nest_level - 1] += 1 */ __pyx_v_end_of_array = 1; __pyx_v_end_of_item = 1; /* "asyncpg/protocol/codecs/array.pyx":779 * prev_stride_len[nest_level] = stride_len[nest_level] * stride_len[nest_level] = 1 * if nest_level == 0: # <<<<<<<<<<<<<< * end_of_array = end_of_item = True * else: */ goto __pyx_L30; } /* "asyncpg/protocol/codecs/array.pyx":782 * end_of_array = end_of_item = True * else: * dims[nest_level - 1] += 1 # <<<<<<<<<<<<<< * * elif ptr[0] == typdelim: */ /*else*/ { __pyx_t_10 = (__pyx_v_nest_level - 1); (__pyx_v_dims[__pyx_t_10]) = ((__pyx_v_dims[__pyx_t_10]) + 1); } __pyx_L30:; /* "asyncpg/protocol/codecs/array.pyx":757 * ndims[0] = nest_level * * elif ptr[0] == '}': # <<<<<<<<<<<<<< * if (parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE) and * not (nest_level == 1 and */ goto __pyx_L9; } /* "asyncpg/protocol/codecs/array.pyx":784 * dims[nest_level - 1] += 1 * * elif ptr[0] == typdelim: # <<<<<<<<<<<<<< * if parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE): * raise _UnexpectedCharacter(array_text, ptr) */ __pyx_t_2 = ((__pyx_v_ptr[0]) == __pyx_v_typdelim); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":785 * * elif ptr[0] == typdelim: * if parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE): # <<<<<<<<<<<<<< * raise _UnexpectedCharacter(array_text, ptr) * */ switch (__pyx_v_parse_state) { case __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_STARTED: case __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_DONE: __pyx_t_2 = 0; break; default: __pyx_t_2 = 1; break; } __pyx_t_4 = __pyx_t_2; if (unlikely(__pyx_t_4)) { /* "asyncpg/protocol/codecs/array.pyx":786 * elif ptr[0] == typdelim: * if parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE): * raise _UnexpectedCharacter(array_text, ptr) # <<<<<<<<<<<<<< * * if parse_state == APS_STRIDE_DONE: */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__UnexpectedCharacter(__pyx_v_array_text, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 786, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":785 * * elif ptr[0] == typdelim: * if parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE): # <<<<<<<<<<<<<< * raise _UnexpectedCharacter(array_text, ptr) * */ } /* "asyncpg/protocol/codecs/array.pyx":788 * raise _UnexpectedCharacter(array_text, ptr) * * if parse_state == APS_STRIDE_DONE: # <<<<<<<<<<<<<< * parse_state = APS_STRIDE_DELIMITED * else: */ __pyx_t_4 = (__pyx_v_parse_state == __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_DONE); if (__pyx_t_4) { /* "asyncpg/protocol/codecs/array.pyx":789 * * if parse_state == APS_STRIDE_DONE: * parse_state = APS_STRIDE_DELIMITED # <<<<<<<<<<<<<< * else: * parse_state = APS_ELEM_DELIMITED */ __pyx_v_parse_state = __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_DELIMITED; /* "asyncpg/protocol/codecs/array.pyx":788 * raise _UnexpectedCharacter(array_text, ptr) * * if parse_state == APS_STRIDE_DONE: # <<<<<<<<<<<<<< * parse_state = APS_STRIDE_DELIMITED * else: */ goto __pyx_L32; } /* "asyncpg/protocol/codecs/array.pyx":791 * parse_state = APS_STRIDE_DELIMITED * else: * parse_state = APS_ELEM_DELIMITED # <<<<<<<<<<<<<< * end_of_item = True * stride_len[nest_level - 1] += 1 */ /*else*/ { __pyx_v_parse_state = __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_DELIMITED; } __pyx_L32:; /* "asyncpg/protocol/codecs/array.pyx":792 * else: * parse_state = APS_ELEM_DELIMITED * end_of_item = True # <<<<<<<<<<<<<< * stride_len[nest_level - 1] += 1 * */ __pyx_v_end_of_item = 1; /* "asyncpg/protocol/codecs/array.pyx":793 * parse_state = APS_ELEM_DELIMITED * end_of_item = True * stride_len[nest_level - 1] += 1 # <<<<<<<<<<<<<< * * elif not apg_ascii_isspace(ptr[0]): */ __pyx_t_10 = (__pyx_v_nest_level - 1); (__pyx_v_stride_len[__pyx_t_10]) = ((__pyx_v_stride_len[__pyx_t_10]) + 1); /* "asyncpg/protocol/codecs/array.pyx":784 * dims[nest_level - 1] += 1 * * elif ptr[0] == typdelim: # <<<<<<<<<<<<<< * if parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE): * raise _UnexpectedCharacter(array_text, ptr) */ goto __pyx_L9; } /* "asyncpg/protocol/codecs/array.pyx":795 * stride_len[nest_level - 1] += 1 * * elif not apg_ascii_isspace(ptr[0]): # <<<<<<<<<<<<<< * if parse_state not in (APS_STRIDE_STARTED, * APS_ELEM_STARTED, */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace((__pyx_v_ptr[0])); if (unlikely(__pyx_t_4 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(4, 795, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_4); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/array.pyx":796 * * elif not apg_ascii_isspace(ptr[0]): * if parse_state not in (APS_STRIDE_STARTED, # <<<<<<<<<<<<<< * APS_ELEM_STARTED, * APS_ELEM_DELIMITED): */ switch (__pyx_v_parse_state) { case __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_STARTED: case __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_STARTED: /* "asyncpg/protocol/codecs/array.pyx":797 * elif not apg_ascii_isspace(ptr[0]): * if parse_state not in (APS_STRIDE_STARTED, * APS_ELEM_STARTED, # <<<<<<<<<<<<<< * APS_ELEM_DELIMITED): * raise _UnexpectedCharacter(array_text, ptr) */ case __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_DELIMITED: /* "asyncpg/protocol/codecs/array.pyx":796 * * elif not apg_ascii_isspace(ptr[0]): * if parse_state not in (APS_STRIDE_STARTED, # <<<<<<<<<<<<<< * APS_ELEM_STARTED, * APS_ELEM_DELIMITED): */ __pyx_t_2 = 0; break; default: __pyx_t_2 = 1; break; } __pyx_t_4 = __pyx_t_2; if (unlikely(__pyx_t_4)) { /* "asyncpg/protocol/codecs/array.pyx":799 * APS_ELEM_STARTED, * APS_ELEM_DELIMITED): * raise _UnexpectedCharacter(array_text, ptr) # <<<<<<<<<<<<<< * * parse_state = APS_ELEM_STARTED */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__UnexpectedCharacter(__pyx_v_array_text, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 799, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":796 * * elif not apg_ascii_isspace(ptr[0]): * if parse_state not in (APS_STRIDE_STARTED, # <<<<<<<<<<<<<< * APS_ELEM_STARTED, * APS_ELEM_DELIMITED): */ } /* "asyncpg/protocol/codecs/array.pyx":801 * raise _UnexpectedCharacter(array_text, ptr) * * parse_state = APS_ELEM_STARTED # <<<<<<<<<<<<<< * array_is_empty = False * */ __pyx_v_parse_state = __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_STARTED; /* "asyncpg/protocol/codecs/array.pyx":802 * * parse_state = APS_ELEM_STARTED * array_is_empty = False # <<<<<<<<<<<<<< * * if not end_of_item: */ __pyx_v_array_is_empty = 0; /* "asyncpg/protocol/codecs/array.pyx":795 * stride_len[nest_level - 1] += 1 * * elif not apg_ascii_isspace(ptr[0]): # <<<<<<<<<<<<<< * if parse_state not in (APS_STRIDE_STARTED, * APS_ELEM_STARTED, */ } __pyx_L9:; /* "asyncpg/protocol/codecs/array.pyx":804 * array_is_empty = False * * if not end_of_item: # <<<<<<<<<<<<<< * ptr += 1 * */ __pyx_t_4 = (!__pyx_v_end_of_item); if (__pyx_t_4) { /* "asyncpg/protocol/codecs/array.pyx":805 * * if not end_of_item: * ptr += 1 # <<<<<<<<<<<<<< * * if not array_is_empty: */ __pyx_v_ptr = (__pyx_v_ptr + 1); /* "asyncpg/protocol/codecs/array.pyx":804 * array_is_empty = False * * if not end_of_item: # <<<<<<<<<<<<<< * ptr += 1 * */ } } /* "asyncpg/protocol/codecs/array.pyx":807 * ptr += 1 * * if not array_is_empty: # <<<<<<<<<<<<<< * dims[ndims[0] - 1] += 1 * */ __pyx_t_4 = (!__pyx_v_array_is_empty); if (__pyx_t_4) { /* "asyncpg/protocol/codecs/array.pyx":808 * * if not array_is_empty: * dims[ndims[0] - 1] += 1 # <<<<<<<<<<<<<< * * ptr += 1 */ __pyx_t_10 = ((__pyx_v_ndims[0]) - 1); (__pyx_v_dims[__pyx_t_10]) = ((__pyx_v_dims[__pyx_t_10]) + 1); /* "asyncpg/protocol/codecs/array.pyx":807 * ptr += 1 * * if not array_is_empty: # <<<<<<<<<<<<<< * dims[ndims[0] - 1] += 1 * */ } /* "asyncpg/protocol/codecs/array.pyx":810 * dims[ndims[0] - 1] += 1 * * ptr += 1 # <<<<<<<<<<<<<< * * # only whitespace is allowed after the closing brace */ __pyx_v_ptr = (__pyx_v_ptr + 1); } /* "asyncpg/protocol/codecs/array.pyx":813 * * # only whitespace is allowed after the closing brace * while ptr[0] != '\0': # <<<<<<<<<<<<<< * if not apg_ascii_isspace(ptr[0]): * raise _UnexpectedCharacter(array_text, ptr) */ while (1) { __pyx_t_4 = ((__pyx_v_ptr[0]) != 0); if (!__pyx_t_4) break; /* "asyncpg/protocol/codecs/array.pyx":814 * # only whitespace is allowed after the closing brace * while ptr[0] != '\0': * if not apg_ascii_isspace(ptr[0]): # <<<<<<<<<<<<<< * raise _UnexpectedCharacter(array_text, ptr) * */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace((__pyx_v_ptr[0])); if (unlikely(__pyx_t_4 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(4, 814, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_4); if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/codecs/array.pyx":815 * while ptr[0] != '\0': * if not apg_ascii_isspace(ptr[0]): * raise _UnexpectedCharacter(array_text, ptr) # <<<<<<<<<<<<<< * * ptr += 1 */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__UnexpectedCharacter(__pyx_v_array_text, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(4, 815, __pyx_L1_error) /* "asyncpg/protocol/codecs/array.pyx":814 * # only whitespace is allowed after the closing brace * while ptr[0] != '\0': * if not apg_ascii_isspace(ptr[0]): # <<<<<<<<<<<<<< * raise _UnexpectedCharacter(array_text, ptr) * */ } /* "asyncpg/protocol/codecs/array.pyx":817 * raise _UnexpectedCharacter(array_text, ptr) * * ptr += 1 # <<<<<<<<<<<<<< * * if array_is_empty: */ __pyx_v_ptr = (__pyx_v_ptr + 1); } /* "asyncpg/protocol/codecs/array.pyx":819 * ptr += 1 * * if array_is_empty: # <<<<<<<<<<<<<< * ndims[0] = 0 * */ if (__pyx_v_array_is_empty) { /* "asyncpg/protocol/codecs/array.pyx":820 * * if array_is_empty: * ndims[0] = 0 # <<<<<<<<<<<<<< * * */ (__pyx_v_ndims[0]) = 0; /* "asyncpg/protocol/codecs/array.pyx":819 * ptr += 1 * * if array_is_empty: # <<<<<<<<<<<<<< * ndims[0] = 0 * */ } /* "asyncpg/protocol/codecs/array.pyx":683 * * * cdef _infer_array_dims(const Py_UCS4 *array_text, # <<<<<<<<<<<<<< * Py_UCS4 typdelim, * int32_t *dims, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("asyncpg.protocol.protocol._infer_array_dims", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":823 * * * cdef uint4_encode_ex(ConnectionSettings settings, WriteBuffer buf, object obj, # <<<<<<<<<<<<<< * const void *arg): * return pgproto.uint4_encode(settings, buf, obj) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_uint4_encode_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj, CYTHON_UNUSED void const *__pyx_v_arg) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("uint4_encode_ex", 1); /* "asyncpg/protocol/codecs/array.pyx":825 * cdef uint4_encode_ex(ConnectionSettings settings, WriteBuffer buf, object obj, * const void *arg): * return pgproto.uint4_encode(settings, buf, obj) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_uint4_encode(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings), __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/array.pyx":823 * * * cdef uint4_encode_ex(ConnectionSettings settings, WriteBuffer buf, object obj, # <<<<<<<<<<<<<< * const void *arg): * return pgproto.uint4_encode(settings, buf, obj) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.uint4_encode_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":828 * * * cdef uint4_decode_ex(ConnectionSettings settings, FRBuffer *buf, # <<<<<<<<<<<<<< * const void *arg): * return pgproto.uint4_decode(settings, buf) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_uint4_decode_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf, CYTHON_UNUSED void const *__pyx_v_arg) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("uint4_decode_ex", 1); /* "asyncpg/protocol/codecs/array.pyx":830 * cdef uint4_decode_ex(ConnectionSettings settings, FRBuffer *buf, * const void *arg): * return pgproto.uint4_decode(settings, buf) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_uint4_decode(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings), __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/array.pyx":828 * * * cdef uint4_decode_ex(ConnectionSettings settings, FRBuffer *buf, # <<<<<<<<<<<<<< * const void *arg): * return pgproto.uint4_decode(settings, buf) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.uint4_decode_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":833 * * * cdef arrayoid_encode(ConnectionSettings settings, WriteBuffer buf, items): # <<<<<<<<<<<<<< * array_encode(settings, buf, items, OIDOID, * &uint4_encode_ex, NULL) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_arrayoid_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_items) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arrayoid_encode", 1); /* "asyncpg/protocol/codecs/array.pyx":834 * * cdef arrayoid_encode(ConnectionSettings settings, WriteBuffer buf, items): * array_encode(settings, buf, items, OIDOID, # <<<<<<<<<<<<<< * &uint4_encode_ex, NULL) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_array_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_items, 26, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex)(&__pyx_f_7asyncpg_8protocol_8protocol_uint4_encode_ex)), NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":833 * * * cdef arrayoid_encode(ConnectionSettings settings, WriteBuffer buf, items): # <<<<<<<<<<<<<< * array_encode(settings, buf, items, OIDOID, * &uint4_encode_ex, NULL) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.arrayoid_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":838 * * * cdef arrayoid_decode(ConnectionSettings settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return array_decode(settings, buf, &uint4_decode_ex, NULL) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_arrayoid_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arrayoid_decode", 1); /* "asyncpg/protocol/codecs/array.pyx":839 * * cdef arrayoid_decode(ConnectionSettings settings, FRBuffer *buf): * return array_decode(settings, buf, &uint4_decode_ex, NULL) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_array_decode(__pyx_v_settings, __pyx_v_buf, ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex)(&__pyx_f_7asyncpg_8protocol_8protocol_uint4_decode_ex)), NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/array.pyx":838 * * * cdef arrayoid_decode(ConnectionSettings settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return array_decode(settings, buf, &uint4_decode_ex, NULL) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.arrayoid_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":842 * * * cdef text_encode_ex(ConnectionSettings settings, WriteBuffer buf, object obj, # <<<<<<<<<<<<<< * const void *arg): * return pgproto.text_encode(settings, buf, obj) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_text_encode_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj, CYTHON_UNUSED void const *__pyx_v_arg) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("text_encode_ex", 1); /* "asyncpg/protocol/codecs/array.pyx":844 * cdef text_encode_ex(ConnectionSettings settings, WriteBuffer buf, object obj, * const void *arg): * return pgproto.text_encode(settings, buf, obj) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_text_encode(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings), __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/array.pyx":842 * * * cdef text_encode_ex(ConnectionSettings settings, WriteBuffer buf, object obj, # <<<<<<<<<<<<<< * const void *arg): * return pgproto.text_encode(settings, buf, obj) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.text_encode_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":847 * * * cdef text_decode_ex(ConnectionSettings settings, FRBuffer *buf, # <<<<<<<<<<<<<< * const void *arg): * return pgproto.text_decode(settings, buf) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_text_decode_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf, CYTHON_UNUSED void const *__pyx_v_arg) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("text_decode_ex", 1); /* "asyncpg/protocol/codecs/array.pyx":849 * cdef text_decode_ex(ConnectionSettings settings, FRBuffer *buf, * const void *arg): * return pgproto.text_decode(settings, buf) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_text_decode(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings), __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/array.pyx":847 * * * cdef text_decode_ex(ConnectionSettings settings, FRBuffer *buf, # <<<<<<<<<<<<<< * const void *arg): * return pgproto.text_decode(settings, buf) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.text_decode_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":852 * * * cdef arraytext_encode(ConnectionSettings settings, WriteBuffer buf, items): # <<<<<<<<<<<<<< * array_encode(settings, buf, items, TEXTOID, * &text_encode_ex, NULL) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_arraytext_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_items) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arraytext_encode", 1); /* "asyncpg/protocol/codecs/array.pyx":853 * * cdef arraytext_encode(ConnectionSettings settings, WriteBuffer buf, items): * array_encode(settings, buf, items, TEXTOID, # <<<<<<<<<<<<<< * &text_encode_ex, NULL) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_array_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_items, 25, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex)(&__pyx_f_7asyncpg_8protocol_8protocol_text_encode_ex)), NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":852 * * * cdef arraytext_encode(ConnectionSettings settings, WriteBuffer buf, items): # <<<<<<<<<<<<<< * array_encode(settings, buf, items, TEXTOID, * &text_encode_ex, NULL) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.arraytext_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":857 * * * cdef arraytext_decode(ConnectionSettings settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return array_decode(settings, buf, &text_decode_ex, NULL) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_arraytext_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arraytext_decode", 1); /* "asyncpg/protocol/codecs/array.pyx":858 * * cdef arraytext_decode(ConnectionSettings settings, FRBuffer *buf): * return array_decode(settings, buf, &text_decode_ex, NULL) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_array_decode(__pyx_v_settings, __pyx_v_buf, ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex)(&__pyx_f_7asyncpg_8protocol_8protocol_text_decode_ex)), NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/array.pyx":857 * * * cdef arraytext_decode(ConnectionSettings settings, FRBuffer *buf): # <<<<<<<<<<<<<< * return array_decode(settings, buf, &text_decode_ex, NULL) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.arraytext_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/array.pyx":861 * * * cdef init_array_codecs(): # <<<<<<<<<<<<<< * # oid[] and text[] are registered as core codecs * # to make type introspection query work */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_array_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init_array_codecs", 1); /* "asyncpg/protocol/codecs/array.pyx":865 * # to make type introspection query work * # * register_core_codec(_OIDOID, # <<<<<<<<<<<<<< * &arrayoid_encode, * &arrayoid_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x404, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_arrayoid_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_arrayoid_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":870 * PG_FORMAT_BINARY) * * register_core_codec(_TEXTOID, # <<<<<<<<<<<<<< * &arraytext_encode, * &arraytext_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x3F1, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_arraytext_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_arraytext_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/array.pyx":861 * * * cdef init_array_codecs(): # <<<<<<<<<<<<<< * # oid[] and text[] are registered as core codecs * # to make type introspection query work */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.init_array_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/range.pyx":26 * * * cdef inline bint _range_has_lbound(uint8_t flags): # <<<<<<<<<<<<<< * return not (flags & (RANGE_EMPTY | RANGE_LB_INF)) * */ static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol__range_has_lbound(uint8_t __pyx_v_flags) { int __pyx_r; /* "asyncpg/protocol/codecs/range.pyx":27 * * cdef inline bint _range_has_lbound(uint8_t flags): * return not (flags & (RANGE_EMPTY | RANGE_LB_INF)) # <<<<<<<<<<<<<< * * */ __pyx_r = (!((__pyx_v_flags & 0x9) != 0)); goto __pyx_L0; /* "asyncpg/protocol/codecs/range.pyx":26 * * * cdef inline bint _range_has_lbound(uint8_t flags): # <<<<<<<<<<<<<< * return not (flags & (RANGE_EMPTY | RANGE_LB_INF)) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "asyncpg/protocol/codecs/range.pyx":30 * * * cdef inline bint _range_has_ubound(uint8_t flags): # <<<<<<<<<<<<<< * return not (flags & (RANGE_EMPTY | RANGE_UB_INF)) * */ static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol__range_has_ubound(uint8_t __pyx_v_flags) { int __pyx_r; /* "asyncpg/protocol/codecs/range.pyx":31 * * cdef inline bint _range_has_ubound(uint8_t flags): * return not (flags & (RANGE_EMPTY | RANGE_UB_INF)) # <<<<<<<<<<<<<< * * */ __pyx_r = (!((__pyx_v_flags & 0x11) != 0)); goto __pyx_L0; /* "asyncpg/protocol/codecs/range.pyx":30 * * * cdef inline bint _range_has_ubound(uint8_t flags): # <<<<<<<<<<<<<< * return not (flags & (RANGE_EMPTY | RANGE_UB_INF)) * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "asyncpg/protocol/codecs/range.pyx":34 * * * cdef inline _RangeArgumentType _range_type(object obj): # <<<<<<<<<<<<<< * if cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj): * return _RANGE_ARGUMENT_TUPLE */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol__RangeArgumentType __pyx_f_7asyncpg_8protocol_8protocol__range_type(PyObject *__pyx_v_obj) { enum __pyx_t_7asyncpg_8protocol_8protocol__RangeArgumentType __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_range_type", 1); /* "asyncpg/protocol/codecs/range.pyx":35 * * cdef inline _RangeArgumentType _range_type(object obj): * if cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj): # <<<<<<<<<<<<<< * return _RANGE_ARGUMENT_TUPLE * elif isinstance(obj, apg_types.Range): */ __pyx_t_2 = PyTuple_Check(__pyx_v_obj); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = PyList_Check(__pyx_v_obj); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/protocol/codecs/range.pyx":36 * cdef inline _RangeArgumentType _range_type(object obj): * if cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj): * return _RANGE_ARGUMENT_TUPLE # <<<<<<<<<<<<<< * elif isinstance(obj, apg_types.Range): * return _RANGE_ARGUMENT_RANGE */ __pyx_r = __pyx_e_7asyncpg_8protocol_8protocol__RANGE_ARGUMENT_TUPLE; goto __pyx_L0; /* "asyncpg/protocol/codecs/range.pyx":35 * * cdef inline _RangeArgumentType _range_type(object obj): * if cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj): # <<<<<<<<<<<<<< * return _RANGE_ARGUMENT_TUPLE * elif isinstance(obj, apg_types.Range): */ } /* "asyncpg/protocol/codecs/range.pyx":37 * if cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj): * return _RANGE_ARGUMENT_TUPLE * elif isinstance(obj, apg_types.Range): # <<<<<<<<<<<<<< * return _RANGE_ARGUMENT_RANGE * else: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_apg_types); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Range); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_4); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(14, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "asyncpg/protocol/codecs/range.pyx":38 * return _RANGE_ARGUMENT_TUPLE * elif isinstance(obj, apg_types.Range): * return _RANGE_ARGUMENT_RANGE # <<<<<<<<<<<<<< * else: * return _RANGE_ARGUMENT_INVALID */ __pyx_r = __pyx_e_7asyncpg_8protocol_8protocol__RANGE_ARGUMENT_RANGE; goto __pyx_L0; /* "asyncpg/protocol/codecs/range.pyx":37 * if cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj): * return _RANGE_ARGUMENT_TUPLE * elif isinstance(obj, apg_types.Range): # <<<<<<<<<<<<<< * return _RANGE_ARGUMENT_RANGE * else: */ } /* "asyncpg/protocol/codecs/range.pyx":40 * return _RANGE_ARGUMENT_RANGE * else: * return _RANGE_ARGUMENT_INVALID # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_r = __pyx_e_7asyncpg_8protocol_8protocol__RANGE_ARGUMENT_INVALID; goto __pyx_L0; } /* "asyncpg/protocol/codecs/range.pyx":34 * * * cdef inline _RangeArgumentType _range_type(object obj): # <<<<<<<<<<<<<< * if cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj): * return _RANGE_ARGUMENT_TUPLE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol._range_type", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = (enum __pyx_t_7asyncpg_8protocol_8protocol__RangeArgumentType) 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/range.pyx":43 * * * cdef range_encode(ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj, uint32_t elem_oid, * encode_func_ex encoder, const void *encoder_arg): */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_range_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj, CYTHON_UNUSED uint32_t __pyx_v_elem_oid, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex __pyx_v_encoder, void const *__pyx_v_encoder_arg) { Py_ssize_t __pyx_v_obj_len; uint8_t __pyx_v_flags; PyObject *__pyx_v_lower = 0; PyObject *__pyx_v_upper = 0; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_bounds_data = 0; enum __pyx_t_7asyncpg_8protocol_8protocol__RangeArgumentType __pyx_v_arg_type; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; enum __pyx_t_7asyncpg_8protocol_8protocol__RangeArgumentType __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; Py_ssize_t __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int32_t __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("range_encode", 1); /* "asyncpg/protocol/codecs/range.pyx":48 * cdef: * ssize_t obj_len * uint8_t flags = 0 # <<<<<<<<<<<<<< * object lower = None * object upper = None */ __pyx_v_flags = 0; /* "asyncpg/protocol/codecs/range.pyx":49 * ssize_t obj_len * uint8_t flags = 0 * object lower = None # <<<<<<<<<<<<<< * object upper = None * WriteBuffer bounds_data = WriteBuffer.new() */ __Pyx_INCREF(Py_None); __pyx_v_lower = Py_None; /* "asyncpg/protocol/codecs/range.pyx":50 * uint8_t flags = 0 * object lower = None * object upper = None # <<<<<<<<<<<<<< * WriteBuffer bounds_data = WriteBuffer.new() * _RangeArgumentType arg_type = _range_type(obj) */ __Pyx_INCREF(Py_None); __pyx_v_upper = Py_None; /* "asyncpg/protocol/codecs/range.pyx":51 * object lower = None * object upper = None * WriteBuffer bounds_data = WriteBuffer.new() # <<<<<<<<<<<<<< * _RangeArgumentType arg_type = _range_type(obj) * */ __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bounds_data = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/range.pyx":52 * object upper = None * WriteBuffer bounds_data = WriteBuffer.new() * _RangeArgumentType arg_type = _range_type(obj) # <<<<<<<<<<<<<< * * if arg_type == _RANGE_ARGUMENT_INVALID: */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__range_type(__pyx_v_obj); if (unlikely(PyErr_Occurred())) __PYX_ERR(14, 52, __pyx_L1_error) __pyx_v_arg_type = __pyx_t_2; /* "asyncpg/protocol/codecs/range.pyx":54 * _RangeArgumentType arg_type = _range_type(obj) * * if arg_type == _RANGE_ARGUMENT_INVALID: # <<<<<<<<<<<<<< * raise TypeError( * 'list, tuple or Range object expected (got type {})'.format( */ switch (__pyx_v_arg_type) { case __pyx_e_7asyncpg_8protocol_8protocol__RANGE_ARGUMENT_INVALID: /* "asyncpg/protocol/codecs/range.pyx":56 * if arg_type == _RANGE_ARGUMENT_INVALID: * raise TypeError( * 'list, tuple or Range object expected (got type {})'.format( # <<<<<<<<<<<<<< * type(obj))) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_list_tuple_or_Range_object_expec, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/protocol/codecs/range.pyx":57 * raise TypeError( * 'list, tuple or Range object expected (got type {})'.format( * type(obj))) # <<<<<<<<<<<<<< * * elif arg_type == _RANGE_ARGUMENT_TUPLE: */ __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)Py_TYPE(__pyx_v_obj))}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "asyncpg/protocol/codecs/range.pyx":55 * * if arg_type == _RANGE_ARGUMENT_INVALID: * raise TypeError( # <<<<<<<<<<<<<< * 'list, tuple or Range object expected (got type {})'.format( * type(obj))) */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(14, 55, __pyx_L1_error) /* "asyncpg/protocol/codecs/range.pyx":54 * _RangeArgumentType arg_type = _range_type(obj) * * if arg_type == _RANGE_ARGUMENT_INVALID: # <<<<<<<<<<<<<< * raise TypeError( * 'list, tuple or Range object expected (got type {})'.format( */ break; case __pyx_e_7asyncpg_8protocol_8protocol__RANGE_ARGUMENT_TUPLE: /* "asyncpg/protocol/codecs/range.pyx":60 * * elif arg_type == _RANGE_ARGUMENT_TUPLE: * obj_len = len(obj) # <<<<<<<<<<<<<< * if obj_len == 2: * lower = obj[0] */ __pyx_t_6 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(14, 60, __pyx_L1_error) __pyx_v_obj_len = __pyx_t_6; /* "asyncpg/protocol/codecs/range.pyx":61 * elif arg_type == _RANGE_ARGUMENT_TUPLE: * obj_len = len(obj) * if obj_len == 2: # <<<<<<<<<<<<<< * lower = obj[0] * upper = obj[1] */ switch (__pyx_v_obj_len) { case 2: /* "asyncpg/protocol/codecs/range.pyx":62 * obj_len = len(obj) * if obj_len == 2: * lower = obj[0] # <<<<<<<<<<<<<< * upper = obj[1] * */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_lower, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/range.pyx":63 * if obj_len == 2: * lower = obj[0] * upper = obj[1] # <<<<<<<<<<<<<< * * if lower is None: */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_obj, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_upper, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/range.pyx":65 * upper = obj[1] * * if lower is None: # <<<<<<<<<<<<<< * flags |= RANGE_LB_INF * */ __pyx_t_7 = (__pyx_v_lower == Py_None); if (__pyx_t_7) { /* "asyncpg/protocol/codecs/range.pyx":66 * * if lower is None: * flags |= RANGE_LB_INF # <<<<<<<<<<<<<< * * if upper is None: */ __pyx_v_flags = (__pyx_v_flags | 8); /* "asyncpg/protocol/codecs/range.pyx":65 * upper = obj[1] * * if lower is None: # <<<<<<<<<<<<<< * flags |= RANGE_LB_INF * */ } /* "asyncpg/protocol/codecs/range.pyx":68 * flags |= RANGE_LB_INF * * if upper is None: # <<<<<<<<<<<<<< * flags |= RANGE_UB_INF * */ __pyx_t_7 = (__pyx_v_upper == Py_None); if (__pyx_t_7) { /* "asyncpg/protocol/codecs/range.pyx":69 * * if upper is None: * flags |= RANGE_UB_INF # <<<<<<<<<<<<<< * * flags |= RANGE_LB_INC | RANGE_UB_INC */ __pyx_v_flags = (__pyx_v_flags | 16); /* "asyncpg/protocol/codecs/range.pyx":68 * flags |= RANGE_LB_INF * * if upper is None: # <<<<<<<<<<<<<< * flags |= RANGE_UB_INF * */ } /* "asyncpg/protocol/codecs/range.pyx":71 * flags |= RANGE_UB_INF * * flags |= RANGE_LB_INC | RANGE_UB_INC # <<<<<<<<<<<<<< * * elif obj_len == 1: */ __pyx_v_flags = (__pyx_v_flags | 0x6); /* "asyncpg/protocol/codecs/range.pyx":61 * elif arg_type == _RANGE_ARGUMENT_TUPLE: * obj_len = len(obj) * if obj_len == 2: # <<<<<<<<<<<<<< * lower = obj[0] * upper = obj[1] */ break; case 1: /* "asyncpg/protocol/codecs/range.pyx":74 * * elif obj_len == 1: * lower = obj[0] # <<<<<<<<<<<<<< * flags |= RANGE_LB_INC | RANGE_UB_INF * */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_lower, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/range.pyx":75 * elif obj_len == 1: * lower = obj[0] * flags |= RANGE_LB_INC | RANGE_UB_INF # <<<<<<<<<<<<<< * * elif obj_len == 0: */ __pyx_v_flags = (__pyx_v_flags | 0x12); /* "asyncpg/protocol/codecs/range.pyx":73 * flags |= RANGE_LB_INC | RANGE_UB_INC * * elif obj_len == 1: # <<<<<<<<<<<<<< * lower = obj[0] * flags |= RANGE_LB_INC | RANGE_UB_INF */ break; case 0: /* "asyncpg/protocol/codecs/range.pyx":78 * * elif obj_len == 0: * flags |= RANGE_EMPTY # <<<<<<<<<<<<<< * * else: */ __pyx_v_flags = (__pyx_v_flags | 1); /* "asyncpg/protocol/codecs/range.pyx":77 * flags |= RANGE_LB_INC | RANGE_UB_INF * * elif obj_len == 0: # <<<<<<<<<<<<<< * flags |= RANGE_EMPTY * */ break; default: /* "asyncpg/protocol/codecs/range.pyx":82 * else: * raise ValueError( * 'expected 0, 1 or 2 elements in range (got {})'.format( # <<<<<<<<<<<<<< * obj_len)) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_expected_0_1_or_2_elements_in_ra, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "asyncpg/protocol/codecs/range.pyx":83 * raise ValueError( * 'expected 0, 1 or 2 elements in range (got {})'.format( * obj_len)) # <<<<<<<<<<<<<< * * else: */ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_obj_len); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_4}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "asyncpg/protocol/codecs/range.pyx":81 * * else: * raise ValueError( # <<<<<<<<<<<<<< * 'expected 0, 1 or 2 elements in range (got {})'.format( * obj_len)) */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(14, 81, __pyx_L1_error) break; } /* "asyncpg/protocol/codecs/range.pyx":59 * type(obj))) * * elif arg_type == _RANGE_ARGUMENT_TUPLE: # <<<<<<<<<<<<<< * obj_len = len(obj) * if obj_len == 2: */ break; default: /* "asyncpg/protocol/codecs/range.pyx":86 * * else: * if obj.isempty: # <<<<<<<<<<<<<< * flags |= RANGE_EMPTY * else: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_isempty); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(14, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { /* "asyncpg/protocol/codecs/range.pyx":87 * else: * if obj.isempty: * flags |= RANGE_EMPTY # <<<<<<<<<<<<<< * else: * lower = obj.lower */ __pyx_v_flags = (__pyx_v_flags | 1); /* "asyncpg/protocol/codecs/range.pyx":86 * * else: * if obj.isempty: # <<<<<<<<<<<<<< * flags |= RANGE_EMPTY * else: */ goto __pyx_L5; } /* "asyncpg/protocol/codecs/range.pyx":89 * flags |= RANGE_EMPTY * else: * lower = obj.lower # <<<<<<<<<<<<<< * upper = obj.upper * */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_lower); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_lower, __pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/range.pyx":90 * else: * lower = obj.lower * upper = obj.upper # <<<<<<<<<<<<<< * * if obj.lower_inc: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_upper); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_upper, __pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/range.pyx":92 * upper = obj.upper * * if obj.lower_inc: # <<<<<<<<<<<<<< * flags |= RANGE_LB_INC * elif lower is None: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_lower_inc); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(14, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { /* "asyncpg/protocol/codecs/range.pyx":93 * * if obj.lower_inc: * flags |= RANGE_LB_INC # <<<<<<<<<<<<<< * elif lower is None: * flags |= RANGE_LB_INF */ __pyx_v_flags = (__pyx_v_flags | 2); /* "asyncpg/protocol/codecs/range.pyx":92 * upper = obj.upper * * if obj.lower_inc: # <<<<<<<<<<<<<< * flags |= RANGE_LB_INC * elif lower is None: */ goto __pyx_L6; } /* "asyncpg/protocol/codecs/range.pyx":94 * if obj.lower_inc: * flags |= RANGE_LB_INC * elif lower is None: # <<<<<<<<<<<<<< * flags |= RANGE_LB_INF * */ __pyx_t_7 = (__pyx_v_lower == Py_None); if (__pyx_t_7) { /* "asyncpg/protocol/codecs/range.pyx":95 * flags |= RANGE_LB_INC * elif lower is None: * flags |= RANGE_LB_INF # <<<<<<<<<<<<<< * * if obj.upper_inc: */ __pyx_v_flags = (__pyx_v_flags | 8); /* "asyncpg/protocol/codecs/range.pyx":94 * if obj.lower_inc: * flags |= RANGE_LB_INC * elif lower is None: # <<<<<<<<<<<<<< * flags |= RANGE_LB_INF * */ } __pyx_L6:; /* "asyncpg/protocol/codecs/range.pyx":97 * flags |= RANGE_LB_INF * * if obj.upper_inc: # <<<<<<<<<<<<<< * flags |= RANGE_UB_INC * elif upper is None: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_upper_inc); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(14, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { /* "asyncpg/protocol/codecs/range.pyx":98 * * if obj.upper_inc: * flags |= RANGE_UB_INC # <<<<<<<<<<<<<< * elif upper is None: * flags |= RANGE_UB_INF */ __pyx_v_flags = (__pyx_v_flags | 4); /* "asyncpg/protocol/codecs/range.pyx":97 * flags |= RANGE_LB_INF * * if obj.upper_inc: # <<<<<<<<<<<<<< * flags |= RANGE_UB_INC * elif upper is None: */ goto __pyx_L7; } /* "asyncpg/protocol/codecs/range.pyx":99 * if obj.upper_inc: * flags |= RANGE_UB_INC * elif upper is None: # <<<<<<<<<<<<<< * flags |= RANGE_UB_INF * */ __pyx_t_7 = (__pyx_v_upper == Py_None); if (__pyx_t_7) { /* "asyncpg/protocol/codecs/range.pyx":100 * flags |= RANGE_UB_INC * elif upper is None: * flags |= RANGE_UB_INF # <<<<<<<<<<<<<< * * if _range_has_lbound(flags): */ __pyx_v_flags = (__pyx_v_flags | 16); /* "asyncpg/protocol/codecs/range.pyx":99 * if obj.upper_inc: * flags |= RANGE_UB_INC * elif upper is None: # <<<<<<<<<<<<<< * flags |= RANGE_UB_INF * */ } __pyx_L7:; } __pyx_L5:; break; } /* "asyncpg/protocol/codecs/range.pyx":102 * flags |= RANGE_UB_INF * * if _range_has_lbound(flags): # <<<<<<<<<<<<<< * encoder(settings, bounds_data, lower, encoder_arg) * */ __pyx_t_7 = __pyx_f_7asyncpg_8protocol_8protocol__range_has_lbound(__pyx_v_flags); if (unlikely(__pyx_t_7 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(14, 102, __pyx_L1_error) if (__pyx_t_7) { /* "asyncpg/protocol/codecs/range.pyx":103 * * if _range_has_lbound(flags): * encoder(settings, bounds_data, lower, encoder_arg) # <<<<<<<<<<<<<< * * if _range_has_ubound(flags): */ __pyx_t_1 = __pyx_v_encoder(__pyx_v_settings, __pyx_v_bounds_data, __pyx_v_lower, __pyx_v_encoder_arg); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/range.pyx":102 * flags |= RANGE_UB_INF * * if _range_has_lbound(flags): # <<<<<<<<<<<<<< * encoder(settings, bounds_data, lower, encoder_arg) * */ } /* "asyncpg/protocol/codecs/range.pyx":105 * encoder(settings, bounds_data, lower, encoder_arg) * * if _range_has_ubound(flags): # <<<<<<<<<<<<<< * encoder(settings, bounds_data, upper, encoder_arg) * */ __pyx_t_7 = __pyx_f_7asyncpg_8protocol_8protocol__range_has_ubound(__pyx_v_flags); if (unlikely(__pyx_t_7 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(14, 105, __pyx_L1_error) if (__pyx_t_7) { /* "asyncpg/protocol/codecs/range.pyx":106 * * if _range_has_ubound(flags): * encoder(settings, bounds_data, upper, encoder_arg) # <<<<<<<<<<<<<< * * buf.write_int32(1 + bounds_data.len()) */ __pyx_t_1 = __pyx_v_encoder(__pyx_v_settings, __pyx_v_bounds_data, __pyx_v_upper, __pyx_v_encoder_arg); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/range.pyx":105 * encoder(settings, bounds_data, lower, encoder_arg) * * if _range_has_ubound(flags): # <<<<<<<<<<<<<< * encoder(settings, bounds_data, upper, encoder_arg) * */ } /* "asyncpg/protocol/codecs/range.pyx":108 * encoder(settings, bounds_data, upper, encoder_arg) * * buf.write_int32(1 + bounds_data.len()) # <<<<<<<<<<<<<< * buf.write_byte(flags) * buf.write_buffer(bounds_data) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_bounds_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __Pyx_PyInt_As_int32_t(__pyx_t_3); if (unlikely((__pyx_t_9 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(14, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/range.pyx":109 * * buf.write_int32(1 + bounds_data.len()) * buf.write_byte(flags) # <<<<<<<<<<<<<< * buf.write_buffer(bounds_data) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_byte(__pyx_v_buf, ((int8_t)__pyx_v_flags)); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/range.pyx":110 * buf.write_int32(1 + bounds_data.len()) * buf.write_byte(flags) * buf.write_buffer(bounds_data) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, __pyx_v_bounds_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/range.pyx":43 * * * cdef range_encode(ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj, uint32_t elem_oid, * encode_func_ex encoder, const void *encoder_arg): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("asyncpg.protocol.protocol.range_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_lower); __Pyx_XDECREF(__pyx_v_upper); __Pyx_XDECREF((PyObject *)__pyx_v_bounds_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/range.pyx":113 * * * cdef range_decode(ConnectionSettings settings, FRBuffer *buf, # <<<<<<<<<<<<<< * decode_func_ex decoder, const void *decoder_arg): * cdef: */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_range_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex __pyx_v_decoder, void const *__pyx_v_decoder_arg) { uint8_t __pyx_v_flags; int32_t __pyx_v_bound_len; PyObject *__pyx_v_lower = 0; PyObject *__pyx_v_upper = 0; struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer __pyx_v_bound_buf; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; int __pyx_t_2; struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("range_decode", 1); /* "asyncpg/protocol/codecs/range.pyx":116 * decode_func_ex decoder, const void *decoder_arg): * cdef: * uint8_t flags = frb_read(buf, 1)[0] # <<<<<<<<<<<<<< * int32_t bound_len * object lower = None */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 1); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 116, __pyx_L1_error) __pyx_v_flags = ((uint8_t)(__pyx_t_1[0])); /* "asyncpg/protocol/codecs/range.pyx":118 * uint8_t flags = frb_read(buf, 1)[0] * int32_t bound_len * object lower = None # <<<<<<<<<<<<<< * object upper = None * FRBuffer bound_buf */ __Pyx_INCREF(Py_None); __pyx_v_lower = Py_None; /* "asyncpg/protocol/codecs/range.pyx":119 * int32_t bound_len * object lower = None * object upper = None # <<<<<<<<<<<<<< * FRBuffer bound_buf * */ __Pyx_INCREF(Py_None); __pyx_v_upper = Py_None; /* "asyncpg/protocol/codecs/range.pyx":122 * FRBuffer bound_buf * * if _range_has_lbound(flags): # <<<<<<<<<<<<<< * bound_len = hton.unpack_int32(frb_read(buf, 4)) * if bound_len == -1: */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__range_has_lbound(__pyx_v_flags); if (unlikely(__pyx_t_2 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(14, 122, __pyx_L1_error) if (__pyx_t_2) { /* "asyncpg/protocol/codecs/range.pyx":123 * * if _range_has_lbound(flags): * bound_len = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * if bound_len == -1: * lower = None */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 123, __pyx_L1_error) __pyx_v_bound_len = unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/range.pyx":124 * if _range_has_lbound(flags): * bound_len = hton.unpack_int32(frb_read(buf, 4)) * if bound_len == -1: # <<<<<<<<<<<<<< * lower = None * else: */ __pyx_t_2 = (__pyx_v_bound_len == -1L); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/range.pyx":125 * bound_len = hton.unpack_int32(frb_read(buf, 4)) * if bound_len == -1: * lower = None # <<<<<<<<<<<<<< * else: * frb_slice_from(&bound_buf, buf, bound_len) */ __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_lower, Py_None); /* "asyncpg/protocol/codecs/range.pyx":124 * if _range_has_lbound(flags): * bound_len = hton.unpack_int32(frb_read(buf, 4)) * if bound_len == -1: # <<<<<<<<<<<<<< * lower = None * else: */ goto __pyx_L4; } /* "asyncpg/protocol/codecs/range.pyx":127 * lower = None * else: * frb_slice_from(&bound_buf, buf, bound_len) # <<<<<<<<<<<<<< * lower = decoder(settings, &bound_buf, decoder_arg) * */ /*else*/ { __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_slice_from((&__pyx_v_bound_buf), __pyx_v_buf, __pyx_v_bound_len); if (unlikely(__pyx_t_3 == ((struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)NULL) && PyErr_Occurred())) __PYX_ERR(14, 127, __pyx_L1_error) /* "asyncpg/protocol/codecs/range.pyx":128 * else: * frb_slice_from(&bound_buf, buf, bound_len) * lower = decoder(settings, &bound_buf, decoder_arg) # <<<<<<<<<<<<<< * * if _range_has_ubound(flags): */ __pyx_t_4 = __pyx_v_decoder(__pyx_v_settings, (&__pyx_v_bound_buf), __pyx_v_decoder_arg); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_lower, __pyx_t_4); __pyx_t_4 = 0; } __pyx_L4:; /* "asyncpg/protocol/codecs/range.pyx":122 * FRBuffer bound_buf * * if _range_has_lbound(flags): # <<<<<<<<<<<<<< * bound_len = hton.unpack_int32(frb_read(buf, 4)) * if bound_len == -1: */ } /* "asyncpg/protocol/codecs/range.pyx":130 * lower = decoder(settings, &bound_buf, decoder_arg) * * if _range_has_ubound(flags): # <<<<<<<<<<<<<< * bound_len = hton.unpack_int32(frb_read(buf, 4)) * if bound_len == -1: */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__range_has_ubound(__pyx_v_flags); if (unlikely(__pyx_t_2 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(14, 130, __pyx_L1_error) if (__pyx_t_2) { /* "asyncpg/protocol/codecs/range.pyx":131 * * if _range_has_ubound(flags): * bound_len = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * if bound_len == -1: * upper = None */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 131, __pyx_L1_error) __pyx_v_bound_len = unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/range.pyx":132 * if _range_has_ubound(flags): * bound_len = hton.unpack_int32(frb_read(buf, 4)) * if bound_len == -1: # <<<<<<<<<<<<<< * upper = None * else: */ __pyx_t_2 = (__pyx_v_bound_len == -1L); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/range.pyx":133 * bound_len = hton.unpack_int32(frb_read(buf, 4)) * if bound_len == -1: * upper = None # <<<<<<<<<<<<<< * else: * frb_slice_from(&bound_buf, buf, bound_len) */ __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_upper, Py_None); /* "asyncpg/protocol/codecs/range.pyx":132 * if _range_has_ubound(flags): * bound_len = hton.unpack_int32(frb_read(buf, 4)) * if bound_len == -1: # <<<<<<<<<<<<<< * upper = None * else: */ goto __pyx_L6; } /* "asyncpg/protocol/codecs/range.pyx":135 * upper = None * else: * frb_slice_from(&bound_buf, buf, bound_len) # <<<<<<<<<<<<<< * upper = decoder(settings, &bound_buf, decoder_arg) * */ /*else*/ { __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_slice_from((&__pyx_v_bound_buf), __pyx_v_buf, __pyx_v_bound_len); if (unlikely(__pyx_t_3 == ((struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)NULL) && PyErr_Occurred())) __PYX_ERR(14, 135, __pyx_L1_error) /* "asyncpg/protocol/codecs/range.pyx":136 * else: * frb_slice_from(&bound_buf, buf, bound_len) * upper = decoder(settings, &bound_buf, decoder_arg) # <<<<<<<<<<<<<< * * return apg_types.Range(lower=lower, upper=upper, */ __pyx_t_4 = __pyx_v_decoder(__pyx_v_settings, (&__pyx_v_bound_buf), __pyx_v_decoder_arg); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_upper, __pyx_t_4); __pyx_t_4 = 0; } __pyx_L6:; /* "asyncpg/protocol/codecs/range.pyx":130 * lower = decoder(settings, &bound_buf, decoder_arg) * * if _range_has_ubound(flags): # <<<<<<<<<<<<<< * bound_len = hton.unpack_int32(frb_read(buf, 4)) * if bound_len == -1: */ } /* "asyncpg/protocol/codecs/range.pyx":138 * upper = decoder(settings, &bound_buf, decoder_arg) * * return apg_types.Range(lower=lower, upper=upper, # <<<<<<<<<<<<<< * lower_inc=(flags & RANGE_LB_INC) != 0, * upper_inc=(flags & RANGE_UB_INC) != 0, */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_apg_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Range); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_lower, __pyx_v_lower) < 0) __PYX_ERR(14, 138, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_upper, __pyx_v_upper) < 0) __PYX_ERR(14, 138, __pyx_L1_error) /* "asyncpg/protocol/codecs/range.pyx":139 * * return apg_types.Range(lower=lower, upper=upper, * lower_inc=(flags & RANGE_LB_INC) != 0, # <<<<<<<<<<<<<< * upper_inc=(flags & RANGE_UB_INC) != 0, * empty=(flags & RANGE_EMPTY) != 0) */ __pyx_t_6 = __Pyx_PyBool_FromLong(((__pyx_v_flags & 2) != 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_lower_inc, __pyx_t_6) < 0) __PYX_ERR(14, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/range.pyx":140 * return apg_types.Range(lower=lower, upper=upper, * lower_inc=(flags & RANGE_LB_INC) != 0, * upper_inc=(flags & RANGE_UB_INC) != 0, # <<<<<<<<<<<<<< * empty=(flags & RANGE_EMPTY) != 0) * */ __pyx_t_6 = __Pyx_PyBool_FromLong(((__pyx_v_flags & 4) != 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_upper_inc, __pyx_t_6) < 0) __PYX_ERR(14, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/range.pyx":141 * lower_inc=(flags & RANGE_LB_INC) != 0, * upper_inc=(flags & RANGE_UB_INC) != 0, * empty=(flags & RANGE_EMPTY) != 0) # <<<<<<<<<<<<<< * * */ __pyx_t_6 = __Pyx_PyBool_FromLong(((__pyx_v_flags & 1) != 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_empty, __pyx_t_6) < 0) __PYX_ERR(14, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/codecs/range.pyx":138 * upper = decoder(settings, &bound_buf, decoder_arg) * * return apg_types.Range(lower=lower, upper=upper, # <<<<<<<<<<<<<< * lower_inc=(flags & RANGE_LB_INC) != 0, * upper_inc=(flags & RANGE_UB_INC) != 0, */ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/range.pyx":113 * * * cdef range_decode(ConnectionSettings settings, FRBuffer *buf, # <<<<<<<<<<<<<< * decode_func_ex decoder, const void *decoder_arg): * cdef: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.protocol.protocol.range_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_lower); __Pyx_XDECREF(__pyx_v_upper); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/range.pyx":144 * * * cdef multirange_encode(ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj, uint32_t elem_oid, * encode_func_ex encoder, const void *encoder_arg): */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_multirange_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj, uint32_t __pyx_v_elem_oid, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex __pyx_v_encoder, void const *__pyx_v_encoder_arg) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_elem_data = 0; Py_ssize_t __pyx_v_elem_data_len; Py_ssize_t __pyx_v_elem_count; PyObject *__pyx_v_elem = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); Py_ssize_t __pyx_t_10; Py_UCS4 __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("multirange_encode", 1); /* "asyncpg/protocol/codecs/range.pyx":152 * ssize_t elem_count * * if not isinstance(obj, SequenceABC): # <<<<<<<<<<<<<< * raise TypeError( * 'expected a sequence (got type {!r})'.format(type(obj).__name__) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SequenceABC); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(14, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (unlikely(__pyx_t_3)) { /* "asyncpg/protocol/codecs/range.pyx":154 * if not isinstance(obj, SequenceABC): * raise TypeError( * 'expected a sequence (got type {!r})'.format(type(obj).__name__) # <<<<<<<<<<<<<< * ) * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_expected_a_sequence_got_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/protocol/codecs/range.pyx":153 * * if not isinstance(obj, SequenceABC): * raise TypeError( # <<<<<<<<<<<<<< * 'expected a sequence (got type {!r})'.format(type(obj).__name__) * ) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(14, 153, __pyx_L1_error) /* "asyncpg/protocol/codecs/range.pyx":152 * ssize_t elem_count * * if not isinstance(obj, SequenceABC): # <<<<<<<<<<<<<< * raise TypeError( * 'expected a sequence (got type {!r})'.format(type(obj).__name__) */ } /* "asyncpg/protocol/codecs/range.pyx":157 * ) * * elem_data = WriteBuffer.new() # <<<<<<<<<<<<<< * * for elem in obj: */ __pyx_t_4 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_elem_data = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/range.pyx":159 * elem_data = WriteBuffer.new() * * for elem in obj: # <<<<<<<<<<<<<< * range_encode(settings, elem_data, elem, elem_oid, encoder, encoder_arg) * */ if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) { __pyx_t_4 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(14, 159, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_4))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(14, 159, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(14, 159, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(14, 159, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(14, 159, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(14, 159, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/range.pyx":160 * * for elem in obj: * range_encode(settings, elem_data, elem, elem_oid, encoder, encoder_arg) # <<<<<<<<<<<<<< * * elem_count = len(obj) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_range_encode(__pyx_v_settings, __pyx_v_elem_data, __pyx_v_elem, __pyx_v_elem_oid, __pyx_v_encoder, __pyx_v_encoder_arg); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/range.pyx":159 * elem_data = WriteBuffer.new() * * for elem in obj: # <<<<<<<<<<<<<< * range_encode(settings, elem_data, elem, elem_oid, encoder, encoder_arg) * */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/range.pyx":162 * range_encode(settings, elem_data, elem, elem_oid, encoder, encoder_arg) * * elem_count = len(obj) # <<<<<<<<<<<<<< * if elem_count > INT32_MAX: * raise OverflowError(f'too many elements in multirange value') */ __pyx_t_8 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(14, 162, __pyx_L1_error) __pyx_v_elem_count = __pyx_t_8; /* "asyncpg/protocol/codecs/range.pyx":163 * * elem_count = len(obj) * if elem_count > INT32_MAX: # <<<<<<<<<<<<<< * raise OverflowError(f'too many elements in multirange value') * */ __pyx_t_3 = (__pyx_v_elem_count > INT32_MAX); if (unlikely(__pyx_t_3)) { /* "asyncpg/protocol/codecs/range.pyx":164 * elem_count = len(obj) * if elem_count > INT32_MAX: * raise OverflowError(f'too many elements in multirange value') # <<<<<<<<<<<<<< * * elem_data_len = elem_data.len() */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_OverflowError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(14, 164, __pyx_L1_error) /* "asyncpg/protocol/codecs/range.pyx":163 * * elem_count = len(obj) * if elem_count > INT32_MAX: # <<<<<<<<<<<<<< * raise OverflowError(f'too many elements in multirange value') * */ } /* "asyncpg/protocol/codecs/range.pyx":166 * raise OverflowError(f'too many elements in multirange value') * * elem_data_len = elem_data.len() # <<<<<<<<<<<<<< * if elem_data_len > INT32_MAX - 4: * raise OverflowError( */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_elem_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = PyInt_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(14, 166, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_elem_data_len = __pyx_t_10; /* "asyncpg/protocol/codecs/range.pyx":167 * * elem_data_len = elem_data.len() * if elem_data_len > INT32_MAX - 4: # <<<<<<<<<<<<<< * raise OverflowError( * f'size of encoded multirange datum exceeds the maximum allowed' */ __pyx_t_3 = (__pyx_v_elem_data_len > (INT32_MAX - 4)); if (unlikely(__pyx_t_3)) { /* "asyncpg/protocol/codecs/range.pyx":169 * if elem_data_len > INT32_MAX - 4: * raise OverflowError( * f'size of encoded multirange datum exceeds the maximum allowed' # <<<<<<<<<<<<<< * f' {INT32_MAX - 4} bytes') * */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = 0; __pyx_t_11 = 127; __Pyx_INCREF(__pyx_kp_u_size_of_encoded_multirange_datum); __pyx_t_8 += 61; __Pyx_GIVEREF(__pyx_kp_u_size_of_encoded_multirange_datum); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_size_of_encoded_multirange_datum); /* "asyncpg/protocol/codecs/range.pyx":170 * raise OverflowError( * f'size of encoded multirange datum exceeds the maximum allowed' * f' {INT32_MAX - 4} bytes') # <<<<<<<<<<<<<< * * # Datum length */ __pyx_t_1 = __Pyx_PyUnicode_From_long((INT32_MAX - 4), 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __pyx_t_1 = 0; __Pyx_INCREF(__pyx_kp_u_bytes); __pyx_t_8 += 6; __Pyx_GIVEREF(__pyx_kp_u_bytes); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_bytes); /* "asyncpg/protocol/codecs/range.pyx":169 * if elem_data_len > INT32_MAX - 4: * raise OverflowError( * f'size of encoded multirange datum exceeds the maximum allowed' # <<<<<<<<<<<<<< * f' {INT32_MAX - 4} bytes') * */ __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_8, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/range.pyx":168 * elem_data_len = elem_data.len() * if elem_data_len > INT32_MAX - 4: * raise OverflowError( # <<<<<<<<<<<<<< * f'size of encoded multirange datum exceeds the maximum allowed' * f' {INT32_MAX - 4} bytes') */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_OverflowError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(14, 168, __pyx_L1_error) /* "asyncpg/protocol/codecs/range.pyx":167 * * elem_data_len = elem_data.len() * if elem_data_len > INT32_MAX - 4: # <<<<<<<<<<<<<< * raise OverflowError( * f'size of encoded multirange datum exceeds the maximum allowed' */ } /* "asyncpg/protocol/codecs/range.pyx":173 * * # Datum length * buf.write_int32(4 + elem_data_len) # <<<<<<<<<<<<<< * # Number of elements in multirange * buf.write_int32(elem_count) */ __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, (4 + ((int32_t)__pyx_v_elem_data_len))); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/range.pyx":175 * buf.write_int32(4 + elem_data_len) * # Number of elements in multirange * buf.write_int32(elem_count) # <<<<<<<<<<<<<< * buf.write_buffer(elem_data) * */ __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, ((int32_t)__pyx_v_elem_count)); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/range.pyx":176 * # Number of elements in multirange * buf.write_int32(elem_count) * buf.write_buffer(elem_data) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, __pyx_v_elem_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/range.pyx":144 * * * cdef multirange_encode(ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * object obj, uint32_t elem_oid, * encode_func_ex encoder, const void *encoder_arg): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.protocol.protocol.multirange_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_elem_data); __Pyx_XDECREF(__pyx_v_elem); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/range.pyx":179 * * * cdef multirange_decode(ConnectionSettings settings, FRBuffer *buf, # <<<<<<<<<<<<<< * decode_func_ex decoder, const void *decoder_arg): * cdef: */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_multirange_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex __pyx_v_decoder, void const *__pyx_v_decoder_arg) { int32_t __pyx_v_nelems; struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer __pyx_v_elem_buf; int32_t __pyx_v_elem_len; int __pyx_v_i; PyObject *__pyx_v_result = 0; PyObject *__pyx_v_elem = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; int32_t __pyx_t_10; int32_t __pyx_t_11; int __pyx_t_12; struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("multirange_decode", 1); /* "asyncpg/protocol/codecs/range.pyx":182 * decode_func_ex decoder, const void *decoder_arg): * cdef: * int32_t nelems = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * FRBuffer elem_buf * int32_t elem_len */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 182, __pyx_L1_error) __pyx_v_nelems = unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/range.pyx":188 * list result * * if nelems == 0: # <<<<<<<<<<<<<< * return [] * */ __pyx_t_2 = (__pyx_v_nelems == 0); if (__pyx_t_2) { /* "asyncpg/protocol/codecs/range.pyx":189 * * if nelems == 0: * return [] # <<<<<<<<<<<<<< * * if nelems < 0: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/protocol/codecs/range.pyx":188 * list result * * if nelems == 0: # <<<<<<<<<<<<<< * return [] * */ } /* "asyncpg/protocol/codecs/range.pyx":191 * return [] * * if nelems < 0: # <<<<<<<<<<<<<< * raise exceptions.ProtocolError( * 'unexpected multirange size value: {}'.format(nelems)) */ __pyx_t_2 = (__pyx_v_nelems < 0); if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/codecs/range.pyx":192 * * if nelems < 0: * raise exceptions.ProtocolError( # <<<<<<<<<<<<<< * 'unexpected multirange size value: {}'.format(nelems)) * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ProtocolError); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/codecs/range.pyx":193 * if nelems < 0: * raise exceptions.ProtocolError( * 'unexpected multirange size value: {}'.format(nelems)) # <<<<<<<<<<<<<< * * result = cpython.PyList_New(nelems) */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_multirange_size_value, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_int32_t(__pyx_v_nelems); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(14, 192, __pyx_L1_error) /* "asyncpg/protocol/codecs/range.pyx":191 * return [] * * if nelems < 0: # <<<<<<<<<<<<<< * raise exceptions.ProtocolError( * 'unexpected multirange size value: {}'.format(nelems)) */ } /* "asyncpg/protocol/codecs/range.pyx":195 * 'unexpected multirange size value: {}'.format(nelems)) * * result = cpython.PyList_New(nelems) # <<<<<<<<<<<<<< * for i in range(nelems): * elem_len = hton.unpack_int32(frb_read(buf, 4)) */ __pyx_t_3 = PyList_New(__pyx_v_nelems); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/range.pyx":196 * * result = cpython.PyList_New(nelems) * for i in range(nelems): # <<<<<<<<<<<<<< * elem_len = hton.unpack_int32(frb_read(buf, 4)) * if elem_len == -1: */ __pyx_t_10 = __pyx_v_nelems; __pyx_t_11 = __pyx_t_10; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; /* "asyncpg/protocol/codecs/range.pyx":197 * result = cpython.PyList_New(nelems) * for i in range(nelems): * elem_len = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * if elem_len == -1: * raise exceptions.ProtocolError( */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(14, 197, __pyx_L1_error) __pyx_v_elem_len = unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/range.pyx":198 * for i in range(nelems): * elem_len = hton.unpack_int32(frb_read(buf, 4)) * if elem_len == -1: # <<<<<<<<<<<<<< * raise exceptions.ProtocolError( * 'unexpected NULL element in multirange value') */ __pyx_t_2 = (__pyx_v_elem_len == -1L); if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/codecs/range.pyx":199 * elem_len = hton.unpack_int32(frb_read(buf, 4)) * if elem_len == -1: * raise exceptions.ProtocolError( # <<<<<<<<<<<<<< * 'unexpected NULL element in multirange value') * else: */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ProtocolError); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_unexpected_NULL_element_in_multi}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(14, 199, __pyx_L1_error) /* "asyncpg/protocol/codecs/range.pyx":198 * for i in range(nelems): * elem_len = hton.unpack_int32(frb_read(buf, 4)) * if elem_len == -1: # <<<<<<<<<<<<<< * raise exceptions.ProtocolError( * 'unexpected NULL element in multirange value') */ } /* "asyncpg/protocol/codecs/range.pyx":202 * 'unexpected NULL element in multirange value') * else: * frb_slice_from(&elem_buf, buf, elem_len) # <<<<<<<<<<<<<< * elem = range_decode(settings, &elem_buf, decoder, decoder_arg) * cpython.Py_INCREF(elem) */ /*else*/ { __pyx_t_13 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_slice_from((&__pyx_v_elem_buf), __pyx_v_buf, __pyx_v_elem_len); if (unlikely(__pyx_t_13 == ((struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)NULL) && PyErr_Occurred())) __PYX_ERR(14, 202, __pyx_L1_error) } /* "asyncpg/protocol/codecs/range.pyx":203 * else: * frb_slice_from(&elem_buf, buf, elem_len) * elem = range_decode(settings, &elem_buf, decoder, decoder_arg) # <<<<<<<<<<<<<< * cpython.Py_INCREF(elem) * cpython.PyList_SET_ITEM(result, i, elem) */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_range_decode(__pyx_v_settings, (&__pyx_v_elem_buf), __pyx_v_decoder, __pyx_v_decoder_arg); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/range.pyx":204 * frb_slice_from(&elem_buf, buf, elem_len) * elem = range_decode(settings, &elem_buf, decoder, decoder_arg) * cpython.Py_INCREF(elem) # <<<<<<<<<<<<<< * cpython.PyList_SET_ITEM(result, i, elem) * */ Py_INCREF(__pyx_v_elem); /* "asyncpg/protocol/codecs/range.pyx":205 * elem = range_decode(settings, &elem_buf, decoder, decoder_arg) * cpython.Py_INCREF(elem) * cpython.PyList_SET_ITEM(result, i, elem) # <<<<<<<<<<<<<< * * return result */ PyList_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_elem); } /* "asyncpg/protocol/codecs/range.pyx":207 * cpython.PyList_SET_ITEM(result, i, elem) * * return result # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/protocol/codecs/range.pyx":179 * * * cdef multirange_decode(ConnectionSettings settings, FRBuffer *buf, # <<<<<<<<<<<<<< * decode_func_ex decoder, const void *decoder_arg): * cdef: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("asyncpg.protocol.protocol.multirange_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF(__pyx_v_elem); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/record.pyx":11 * * * cdef inline record_encode_frame(ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * WriteBuffer elem_data, int32_t elem_count): * buf.write_int32(4 + elem_data.len()) */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_record_encode_frame(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_elem_data, int32_t __pyx_v_elem_count) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int32_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("record_encode_frame", 1); /* "asyncpg/protocol/codecs/record.pyx":13 * cdef inline record_encode_frame(ConnectionSettings settings, WriteBuffer buf, * WriteBuffer elem_data, int32_t elem_count): * buf.write_int32(4 + elem_data.len()) # <<<<<<<<<<<<<< * # attribute count * buf.write_int32(elem_count) */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_elem_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_AddCObj(__pyx_int_4, __pyx_t_1, 4, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(15, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/record.pyx":15 * buf.write_int32(4 + elem_data.len()) * # attribute count * buf.write_int32(elem_count) # <<<<<<<<<<<<<< * # encoded attribute data * buf.write_buffer(elem_data) */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_v_elem_count); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/record.pyx":17 * buf.write_int32(elem_count) * # encoded attribute data * buf.write_buffer(elem_data) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, __pyx_v_elem_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/record.pyx":11 * * * cdef inline record_encode_frame(ConnectionSettings settings, WriteBuffer buf, # <<<<<<<<<<<<<< * WriteBuffer elem_data, int32_t elem_count): * buf.write_int32(4 + elem_data.len()) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.record_encode_frame", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/record.pyx":20 * * * cdef anonymous_record_decode(ConnectionSettings settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * tuple result */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_anonymous_record_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) { PyObject *__pyx_v_result = 0; Py_ssize_t __pyx_v_elem_count; Py_ssize_t __pyx_v_i; int32_t __pyx_v_elem_len; uint32_t __pyx_v_elem_typ; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_elem_codec = 0; struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer __pyx_v_elem_buf; PyObject *__pyx_v_elem = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; Py_ssize_t __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; unsigned int __pyx_t_15; struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("anonymous_record_decode", 1); /* "asyncpg/protocol/codecs/record.pyx":30 * FRBuffer elem_buf * * elem_count = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * result = cpython.PyTuple_New(elem_count) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(15, 30, __pyx_L1_error) __pyx_v_elem_count = ((Py_ssize_t)((uint32_t)unpack_int32(__pyx_t_1))); /* "asyncpg/protocol/codecs/record.pyx":31 * * elem_count = hton.unpack_int32(frb_read(buf, 4)) * result = cpython.PyTuple_New(elem_count) # <<<<<<<<<<<<<< * * for i in range(elem_count): */ __pyx_t_2 = PyTuple_New(__pyx_v_elem_count); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_result = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/record.pyx":33 * result = cpython.PyTuple_New(elem_count) * * for i in range(elem_count): # <<<<<<<<<<<<<< * elem_typ = hton.unpack_int32(frb_read(buf, 4)) * elem_len = hton.unpack_int32(frb_read(buf, 4)) */ __pyx_t_3 = __pyx_v_elem_count; __pyx_t_4 = __pyx_t_3; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; /* "asyncpg/protocol/codecs/record.pyx":34 * * for i in range(elem_count): * elem_typ = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * elem_len = hton.unpack_int32(frb_read(buf, 4)) * */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(15, 34, __pyx_L1_error) __pyx_v_elem_typ = ((uint32_t)unpack_int32(__pyx_t_1)); /* "asyncpg/protocol/codecs/record.pyx":35 * for i in range(elem_count): * elem_typ = hton.unpack_int32(frb_read(buf, 4)) * elem_len = hton.unpack_int32(frb_read(buf, 4)) # <<<<<<<<<<<<<< * * if elem_len == -1: */ __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(15, 35, __pyx_L1_error) __pyx_v_elem_len = unpack_int32(__pyx_t_1); /* "asyncpg/protocol/codecs/record.pyx":37 * elem_len = hton.unpack_int32(frb_read(buf, 4)) * * if elem_len == -1: # <<<<<<<<<<<<<< * elem = None * else: */ __pyx_t_6 = (__pyx_v_elem_len == -1L); if (__pyx_t_6) { /* "asyncpg/protocol/codecs/record.pyx":38 * * if elem_len == -1: * elem = None # <<<<<<<<<<<<<< * else: * elem_codec = settings.get_data_codec(elem_typ) */ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_elem, Py_None); /* "asyncpg/protocol/codecs/record.pyx":37 * elem_len = hton.unpack_int32(frb_read(buf, 4)) * * if elem_len == -1: # <<<<<<<<<<<<<< * elem = None * else: */ goto __pyx_L5; } /* "asyncpg/protocol/codecs/record.pyx":40 * elem = None * else: * elem_codec = settings.get_data_codec(elem_typ) # <<<<<<<<<<<<<< * if elem_codec is None or not elem_codec.has_decoder(): * raise exceptions.InternalClientError( */ /*else*/ { __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec(__pyx_v_settings, __pyx_v_elem_typ, 0, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2)); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/record.pyx":41 * else: * elem_codec = settings.get_data_codec(elem_typ) * if elem_codec is None or not elem_codec.has_decoder(): # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * 'no decoder for composite type element in ' */ __pyx_t_7 = (((PyObject *)__pyx_v_elem_codec) == Py_None); if (!__pyx_t_7) { } else { __pyx_t_6 = __pyx_t_7; goto __pyx_L7_bool_binop_done; } __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder(__pyx_v_elem_codec); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(15, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = (!__pyx_t_7); __pyx_t_6 = __pyx_t_8; __pyx_L7_bool_binop_done:; if (unlikely(__pyx_t_6)) { /* "asyncpg/protocol/codecs/record.pyx":42 * elem_codec = settings.get_data_codec(elem_typ) * if elem_codec is None or not elem_codec.has_decoder(): * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * 'no decoder for composite type element in ' * 'position {} of type OID {}'.format(i, elem_typ)) */ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_10)) __PYX_ERR(15, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/codecs/record.pyx":44 * raise exceptions.InternalClientError( * 'no decoder for composite type element in ' * 'position {} of type OID {}'.format(i, elem_typ)) # <<<<<<<<<<<<<< * elem = elem_codec.decode(settings, * frb_slice_from(&elem_buf, buf, elem_len)) */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_no_decoder_for_composite_type_el, __pyx_n_s_format); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_12)) __PYX_ERR(15, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyInt_From_uint32_t(__pyx_v_elem_typ); if (unlikely(!__pyx_t_13)) __PYX_ERR(15, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; __pyx_t_15 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_15 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_12, __pyx_t_13}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_15, 2+__pyx_t_15); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __pyx_t_11 = NULL; __pyx_t_15 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_15 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_9}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(15, 42, __pyx_L1_error) /* "asyncpg/protocol/codecs/record.pyx":41 * else: * elem_codec = settings.get_data_codec(elem_typ) * if elem_codec is None or not elem_codec.has_decoder(): # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * 'no decoder for composite type element in ' */ } /* "asyncpg/protocol/codecs/record.pyx":46 * 'position {} of type OID {}'.format(i, elem_typ)) * elem = elem_codec.decode(settings, * frb_slice_from(&elem_buf, buf, elem_len)) # <<<<<<<<<<<<<< * * cpython.Py_INCREF(elem) */ __pyx_t_16 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_slice_from((&__pyx_v_elem_buf), __pyx_v_buf, __pyx_v_elem_len); if (unlikely(__pyx_t_16 == ((struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)NULL) && PyErr_Occurred())) __PYX_ERR(15, 46, __pyx_L1_error) /* "asyncpg/protocol/codecs/record.pyx":45 * 'no decoder for composite type element in ' * 'position {} of type OID {}'.format(i, elem_typ)) * elem = elem_codec.decode(settings, # <<<<<<<<<<<<<< * frb_slice_from(&elem_buf, buf, elem_len)) * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode(__pyx_v_elem_codec, __pyx_v_settings, __pyx_t_16); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_2); __pyx_t_2 = 0; } __pyx_L5:; /* "asyncpg/protocol/codecs/record.pyx":48 * frb_slice_from(&elem_buf, buf, elem_len)) * * cpython.Py_INCREF(elem) # <<<<<<<<<<<<<< * cpython.PyTuple_SET_ITEM(result, i, elem) * */ Py_INCREF(__pyx_v_elem); /* "asyncpg/protocol/codecs/record.pyx":49 * * cpython.Py_INCREF(elem) * cpython.PyTuple_SET_ITEM(result, i, elem) # <<<<<<<<<<<<<< * * return result */ PyTuple_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_elem); } /* "asyncpg/protocol/codecs/record.pyx":51 * cpython.PyTuple_SET_ITEM(result, i, elem) * * return result # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/protocol/codecs/record.pyx":20 * * * cdef anonymous_record_decode(ConnectionSettings settings, FRBuffer *buf): # <<<<<<<<<<<<<< * cdef: * tuple result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("asyncpg.protocol.protocol.anonymous_record_decode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF((PyObject *)__pyx_v_elem_codec); __Pyx_XDECREF(__pyx_v_elem); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/record.pyx":54 * * * cdef anonymous_record_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * raise exceptions.UnsupportedClientFeatureError( * 'input of anonymous composite types is not supported', */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_anonymous_record_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, CYTHON_UNUSED PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("anonymous_record_encode", 1); /* "asyncpg/protocol/codecs/record.pyx":55 * * cdef anonymous_record_encode(ConnectionSettings settings, WriteBuffer buf, obj): * raise exceptions.UnsupportedClientFeatureError( # <<<<<<<<<<<<<< * 'input of anonymous composite types is not supported', * hint=( */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_UnsupportedClientFeatureError); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/record.pyx":57 * raise exceptions.UnsupportedClientFeatureError( * 'input of anonymous composite types is not supported', * hint=( # <<<<<<<<<<<<<< * 'Consider declaring an explicit composite type and ' * 'using it to cast the argument.' */ __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hint, __pyx_kp_u_Consider_declaring_an_explicit_c) < 0) __PYX_ERR(15, 57, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_detail, __pyx_kp_u_PostgreSQL_does_not_implement_an) < 0) __PYX_ERR(15, 57, __pyx_L1_error) /* "asyncpg/protocol/codecs/record.pyx":55 * * cdef anonymous_record_encode(ConnectionSettings settings, WriteBuffer buf, obj): * raise exceptions.UnsupportedClientFeatureError( # <<<<<<<<<<<<<< * 'input of anonymous composite types is not supported', * hint=( */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__22, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(15, 55, __pyx_L1_error) /* "asyncpg/protocol/codecs/record.pyx":54 * * * cdef anonymous_record_encode(ConnectionSettings settings, WriteBuffer buf, obj): # <<<<<<<<<<<<<< * raise exceptions.UnsupportedClientFeatureError( * 'input of anonymous composite types is not supported', */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.anonymous_record_encode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/codecs/record.pyx":65 * * * cdef init_record_codecs(): # <<<<<<<<<<<<<< * register_core_codec(RECORDOID, * anonymous_record_encode, */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_record_codecs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init_record_codecs", 1); /* "asyncpg/protocol/codecs/record.pyx":66 * * cdef init_record_codecs(): * register_core_codec(RECORDOID, # <<<<<<<<<<<<<< * anonymous_record_encode, * anonymous_record_decode, */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x8C9, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_8protocol_8protocol_anonymous_record_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_8protocol_8protocol_anonymous_record_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/codecs/record.pyx":65 * * * cdef init_record_codecs(): # <<<<<<<<<<<<<< * register_core_codec(RECORDOID, * anonymous_record_encode, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.init_record_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/scram.pyx":93 * ) * * def __cinit__(self, bytes authentication_method): # <<<<<<<<<<<<<< * self.authentication_method = authentication_method * self.authorization_message = None */ /* Python wrapper */ static int __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_authentication_method = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_authentication_method,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_authentication_method)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 93, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(5, 93, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_authentication_method = ((PyObject*)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(5, 93, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_authentication_method), (&PyBytes_Type), 1, "authentication_method", 1))) __PYX_ERR(5, 93, __pyx_L1_error) __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication___cinit__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self), __pyx_v_authentication_method); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_authentication_method) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 1); /* "asyncpg/protocol/scram.pyx":94 * * def __cinit__(self, bytes authentication_method): * self.authentication_method = authentication_method # <<<<<<<<<<<<<< * self.authorization_message = None * # channel binding is turned off for the time being */ __Pyx_INCREF(__pyx_v_authentication_method); __Pyx_GIVEREF(__pyx_v_authentication_method); __Pyx_GOTREF(__pyx_v_self->authentication_method); __Pyx_DECREF(__pyx_v_self->authentication_method); __pyx_v_self->authentication_method = __pyx_v_authentication_method; /* "asyncpg/protocol/scram.pyx":95 * def __cinit__(self, bytes authentication_method): * self.authentication_method = authentication_method * self.authorization_message = None # <<<<<<<<<<<<<< * # channel binding is turned off for the time being * self.client_channel_binding = b"n,," */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->authorization_message); __Pyx_DECREF(__pyx_v_self->authorization_message); __pyx_v_self->authorization_message = ((PyObject*)Py_None); /* "asyncpg/protocol/scram.pyx":97 * self.authorization_message = None * # channel binding is turned off for the time being * self.client_channel_binding = b"n,," # <<<<<<<<<<<<<< * self.client_first_message_bare = None * self.client_nonce = None */ __Pyx_INCREF(__pyx_kp_b_n); __Pyx_GIVEREF(__pyx_kp_b_n); __Pyx_GOTREF(__pyx_v_self->client_channel_binding); __Pyx_DECREF(__pyx_v_self->client_channel_binding); __pyx_v_self->client_channel_binding = __pyx_kp_b_n; /* "asyncpg/protocol/scram.pyx":98 * # channel binding is turned off for the time being * self.client_channel_binding = b"n,," * self.client_first_message_bare = None # <<<<<<<<<<<<<< * self.client_nonce = None * self.client_proof = None */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->client_first_message_bare); __Pyx_DECREF(__pyx_v_self->client_first_message_bare); __pyx_v_self->client_first_message_bare = ((PyObject*)Py_None); /* "asyncpg/protocol/scram.pyx":99 * self.client_channel_binding = b"n,," * self.client_first_message_bare = None * self.client_nonce = None # <<<<<<<<<<<<<< * self.client_proof = None * self.password_salt = None */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->client_nonce); __Pyx_DECREF(__pyx_v_self->client_nonce); __pyx_v_self->client_nonce = ((PyObject*)Py_None); /* "asyncpg/protocol/scram.pyx":100 * self.client_first_message_bare = None * self.client_nonce = None * self.client_proof = None # <<<<<<<<<<<<<< * self.password_salt = None * # self.password_iterations = None */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->client_proof); __Pyx_DECREF(__pyx_v_self->client_proof); __pyx_v_self->client_proof = ((PyObject*)Py_None); /* "asyncpg/protocol/scram.pyx":101 * self.client_nonce = None * self.client_proof = None * self.password_salt = None # <<<<<<<<<<<<<< * # self.password_iterations = None * self.server_first_message = None */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->password_salt); __Pyx_DECREF(__pyx_v_self->password_salt); __pyx_v_self->password_salt = ((PyObject*)Py_None); /* "asyncpg/protocol/scram.pyx":103 * self.password_salt = None * # self.password_iterations = None * self.server_first_message = None # <<<<<<<<<<<<<< * self.server_key = None * self.server_nonce = None */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->server_first_message); __Pyx_DECREF(__pyx_v_self->server_first_message); __pyx_v_self->server_first_message = ((PyObject*)Py_None); /* "asyncpg/protocol/scram.pyx":104 * # self.password_iterations = None * self.server_first_message = None * self.server_key = None # <<<<<<<<<<<<<< * self.server_nonce = None * */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->server_key); __Pyx_DECREF(__pyx_v_self->server_key); __pyx_v_self->server_key = Py_None; /* "asyncpg/protocol/scram.pyx":105 * self.server_first_message = None * self.server_key = None * self.server_nonce = None # <<<<<<<<<<<<<< * * cdef create_client_first_message(self, str username): */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->server_nonce); __Pyx_DECREF(__pyx_v_self->server_nonce); __pyx_v_self->server_nonce = ((PyObject*)Py_None); /* "asyncpg/protocol/scram.pyx":93 * ) * * def __cinit__(self, bytes authentication_method): # <<<<<<<<<<<<<< * self.authentication_method = authentication_method * self.authorization_message = None */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/scram.pyx":107 * self.server_nonce = None * * cdef create_client_first_message(self, str username): # <<<<<<<<<<<<<< * """Create the initial client message for SCRAM authentication""" * cdef: */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_create_client_first_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_username) { PyObject *__pyx_v_msg = 0; PyObject *__pyx_v_client_first_message = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_client_first_message", 1); /* "asyncpg/protocol/scram.pyx":114 * * self.client_nonce = \ * self._generate_client_nonce(self.DEFAULT_CLIENT_NONCE_BYTES) # <<<<<<<<<<<<<< * # set the client first message bare here, as it's used in a later step * self.client_first_message_bare = b"n=" + username.encode("utf-8") + \ */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_DEFAULT_CLIENT_NONCE_BYTES); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_client_nonce(__pyx_v_self, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(5, 114, __pyx_L1_error) /* "asyncpg/protocol/scram.pyx":113 * bytes client_first_message * * self.client_nonce = \ # <<<<<<<<<<<<<< * self._generate_client_nonce(self.DEFAULT_CLIENT_NONCE_BYTES) * # set the client first message bare here, as it's used in a later step */ __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->client_nonce); __Pyx_DECREF(__pyx_v_self->client_nonce); __pyx_v_self->client_nonce = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/scram.pyx":116 * self._generate_client_nonce(self.DEFAULT_CLIENT_NONCE_BYTES) * # set the client first message bare here, as it's used in a later step * self.client_first_message_bare = b"n=" + username.encode("utf-8") + \ # <<<<<<<<<<<<<< * b",r=" + self.client_nonce * # put together the full message here */ if (unlikely(__pyx_v_username == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); __PYX_ERR(5, 116, __pyx_L1_error) } __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_Add(__pyx_kp_b_n_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_kp_b_r_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/scram.pyx":117 * # set the client first message bare here, as it's used in a later step * self.client_first_message_bare = b"n=" + username.encode("utf-8") + \ * b",r=" + self.client_nonce # <<<<<<<<<<<<<< * # put together the full message here * msg = bytes() */ __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_v_self->client_nonce); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(5, 117, __pyx_L1_error) /* "asyncpg/protocol/scram.pyx":116 * self._generate_client_nonce(self.DEFAULT_CLIENT_NONCE_BYTES) * # set the client first message bare here, as it's used in a later step * self.client_first_message_bare = b"n=" + username.encode("utf-8") + \ # <<<<<<<<<<<<<< * b",r=" + self.client_nonce * # put together the full message here */ __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->client_first_message_bare); __Pyx_DECREF(__pyx_v_self->client_first_message_bare); __pyx_v_self->client_first_message_bare = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/scram.pyx":119 * b",r=" + self.client_nonce * # put together the full message here * msg = bytes() # <<<<<<<<<<<<<< * msg += self.authentication_method + b"\0" * client_first_message = self.client_channel_binding + \ */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)(&PyBytes_Type))); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_msg = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/scram.pyx":120 * # put together the full message here * msg = bytes() * msg += self.authentication_method + b"\0" # <<<<<<<<<<<<<< * client_first_message = self.client_channel_binding + \ * self.client_first_message_bare */ __pyx_t_3 = PyNumber_Add(__pyx_v_self->authentication_method, __pyx_kp_b__23); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "asyncpg/protocol/scram.pyx":121 * msg = bytes() * msg += self.authentication_method + b"\0" * client_first_message = self.client_channel_binding + \ # <<<<<<<<<<<<<< * self.client_first_message_bare * msg += (len(client_first_message)).to_bytes(4, byteorder='big') + \ */ __pyx_t_1 = PyNumber_Add(__pyx_v_self->client_channel_binding, __pyx_v_self->client_first_message_bare); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_client_first_message = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/scram.pyx":123 * client_first_message = self.client_channel_binding + \ * self.client_first_message_bare * msg += (len(client_first_message)).to_bytes(4, byteorder='big') + \ # <<<<<<<<<<<<<< * client_first_message * return msg */ __pyx_t_4 = __Pyx_PyBytes_GET_SIZE(__pyx_v_client_first_message); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(5, 123, __pyx_L1_error) __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_byteorder, __pyx_n_u_big) < 0) __PYX_ERR(5, 123, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__24, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/scram.pyx":124 * self.client_first_message_bare * msg += (len(client_first_message)).to_bytes(4, byteorder='big') + \ * client_first_message # <<<<<<<<<<<<<< * return msg * */ __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_v_client_first_message); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/scram.pyx":123 * client_first_message = self.client_channel_binding + \ * self.client_first_message_bare * msg += (len(client_first_message)).to_bytes(4, byteorder='big') + \ # <<<<<<<<<<<<<< * client_first_message * return msg */ __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_5))) __PYX_ERR(5, 123, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; /* "asyncpg/protocol/scram.pyx":125 * msg += (len(client_first_message)).to_bytes(4, byteorder='big') + \ * client_first_message * return msg # <<<<<<<<<<<<<< * * cdef create_client_final_message(self, str password): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_msg); __pyx_r = __pyx_v_msg; goto __pyx_L0; /* "asyncpg/protocol/scram.pyx":107 * self.server_nonce = None * * cdef create_client_first_message(self, str username): # <<<<<<<<<<<<<< * """Create the initial client message for SCRAM authentication""" * cdef: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.create_client_first_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_msg); __Pyx_XDECREF(__pyx_v_client_first_message); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/scram.pyx":127 * return msg * * cdef create_client_final_message(self, str password): # <<<<<<<<<<<<<< * """Create the final client message as part of SCRAM authentication""" * cdef: */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_create_client_final_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_password) { PyObject *__pyx_v_msg = 0; PyObject *__pyx_8genexpr2__pyx_v_val = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_t_6; unsigned int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_client_final_message", 0); __Pyx_INCREF(__pyx_v_password); /* "asyncpg/protocol/scram.pyx":132 * bytes msg * * if any([getattr(self, val) is None for val in # <<<<<<<<<<<<<< * self.REQUIREMENTS_CLIENT_FINAL_MESSAGE]): * raise Exception( */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 132, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); /* "asyncpg/protocol/scram.pyx":133 * * if any([getattr(self, val) is None for val in * self.REQUIREMENTS_CLIENT_FINAL_MESSAGE]): # <<<<<<<<<<<<<< * raise Exception( * "you need values from server to generate a client proof") */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_REQUIREMENTS_CLIENT_FINAL_MESSAG); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 133, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 133, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 133, __pyx_L6_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 133, __pyx_L6_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(5, 133, __pyx_L6_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 133, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 133, __pyx_L6_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(5, 133, __pyx_L6_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 133, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(5, 133, __pyx_L6_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_val, __pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/scram.pyx":132 * bytes msg * * if any([getattr(self, val) is None for val in # <<<<<<<<<<<<<< * self.REQUIREMENTS_CLIENT_FINAL_MESSAGE]): * raise Exception( */ __pyx_t_2 = __Pyx_GetAttr(((PyObject *)__pyx_v_self), __pyx_8genexpr2__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 132, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = (__pyx_t_2 == Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 132, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(5, 132, __pyx_L6_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_val); __pyx_8genexpr2__pyx_v_val = 0; goto __pyx_L10_exit_scope; __pyx_L6_error:; __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_val); __pyx_8genexpr2__pyx_v_val = 0; goto __pyx_L1_error; __pyx_L10_exit_scope:; } /* exit inner scope */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_any, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(5, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_6)) { /* "asyncpg/protocol/scram.pyx":134 * if any([getattr(self, val) is None for val in * self.REQUIREMENTS_CLIENT_FINAL_MESSAGE]): * raise Exception( # <<<<<<<<<<<<<< * "you need values from server to generate a client proof") * */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(5, 134, __pyx_L1_error) /* "asyncpg/protocol/scram.pyx":132 * bytes msg * * if any([getattr(self, val) is None for val in # <<<<<<<<<<<<<< * self.REQUIREMENTS_CLIENT_FINAL_MESSAGE]): * raise Exception( */ } /* "asyncpg/protocol/scram.pyx":138 * * # normalize the password using the SASLprep algorithm in RFC 4013 * password = self._normalize_password(password) # <<<<<<<<<<<<<< * * # generate the client proof */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__normalize_password(__pyx_v_self, __pyx_v_password); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_3))) __PYX_ERR(5, 138, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_password, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "asyncpg/protocol/scram.pyx":141 * * # generate the client proof * self.client_proof = self._generate_client_proof(password=password) # <<<<<<<<<<<<<< * msg = bytes() * msg += b"c=" + base64.b64encode(self.client_channel_binding) + \ */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_client_proof(__pyx_v_self, __pyx_v_password); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(5, 141, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->client_proof); __Pyx_DECREF(__pyx_v_self->client_proof); __pyx_v_self->client_proof = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/scram.pyx":142 * # generate the client proof * self.client_proof = self._generate_client_proof(password=password) * msg = bytes() # <<<<<<<<<<<<<< * msg += b"c=" + base64.b64encode(self.client_channel_binding) + \ * b",r=" + self.server_nonce + \ */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)(&PyBytes_Type))); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_msg = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/scram.pyx":143 * self.client_proof = self._generate_client_proof(password=password) * msg = bytes() * msg += b"c=" + base64.b64encode(self.client_channel_binding) + \ # <<<<<<<<<<<<<< * b",r=" + self.server_nonce + \ * b",p=" + base64.b64encode(self.client_proof) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_base64); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_b64encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_self->client_channel_binding}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = PyNumber_Add(__pyx_kp_b_c_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_b_r_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/scram.pyx":144 * msg = bytes() * msg += b"c=" + base64.b64encode(self.client_channel_binding) + \ * b",r=" + self.server_nonce + \ # <<<<<<<<<<<<<< * b",p=" + base64.b64encode(self.client_proof) * return msg */ __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_self->server_nonce); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_b_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/scram.pyx":145 * msg += b"c=" + base64.b64encode(self.client_channel_binding) + \ * b",r=" + self.server_nonce + \ * b",p=" + base64.b64encode(self.client_proof) # <<<<<<<<<<<<<< * return msg * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_base64); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_b64encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_self->client_proof}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_8 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/scram.pyx":143 * self.client_proof = self._generate_client_proof(password=password) * msg = bytes() * msg += b"c=" + base64.b64encode(self.client_channel_binding) + \ # <<<<<<<<<<<<<< * b",r=" + self.server_nonce + \ * b",p=" + base64.b64encode(self.client_proof) */ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_2))) __PYX_ERR(5, 143, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; /* "asyncpg/protocol/scram.pyx":146 * b",r=" + self.server_nonce + \ * b",p=" + base64.b64encode(self.client_proof) * return msg # <<<<<<<<<<<<<< * * cdef parse_server_first_message(self, bytes server_response): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_msg); __pyx_r = __pyx_v_msg; goto __pyx_L0; /* "asyncpg/protocol/scram.pyx":127 * return msg * * cdef create_client_final_message(self, str password): # <<<<<<<<<<<<<< * """Create the final client message as part of SCRAM authentication""" * cdef: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.create_client_final_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_msg); __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_val); __Pyx_XDECREF(__pyx_v_password); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/scram.pyx":148 * return msg * * cdef parse_server_first_message(self, bytes server_response): # <<<<<<<<<<<<<< * """Parse the response from the first message from the server""" * self.server_first_message = server_response */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_parse_server_first_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_server_response) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("parse_server_first_message", 1); /* "asyncpg/protocol/scram.pyx":150 * cdef parse_server_first_message(self, bytes server_response): * """Parse the response from the first message from the server""" * self.server_first_message = server_response # <<<<<<<<<<<<<< * try: * self.server_nonce = re.search(b'r=([^,]+),', */ __Pyx_INCREF(__pyx_v_server_response); __Pyx_GIVEREF(__pyx_v_server_response); __Pyx_GOTREF(__pyx_v_self->server_first_message); __Pyx_DECREF(__pyx_v_self->server_first_message); __pyx_v_self->server_first_message = __pyx_v_server_response; /* "asyncpg/protocol/scram.pyx":151 * """Parse the response from the first message from the server""" * self.server_first_message = server_response * try: # <<<<<<<<<<<<<< * self.server_nonce = re.search(b'r=([^,]+),', * self.server_first_message).group(1) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "asyncpg/protocol/scram.pyx":152 * self.server_first_message = server_response * try: * self.server_nonce = re.search(b'r=([^,]+),', # <<<<<<<<<<<<<< * self.server_first_message).group(1) * except IndexError: */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 152, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_search); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 152, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/scram.pyx":153 * try: * self.server_nonce = re.search(b'r=([^,]+),', * self.server_first_message).group(1) # <<<<<<<<<<<<<< * except IndexError: * raise Exception("could not get nonce") */ __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_kp_b_r_3, __pyx_v_self->server_first_message}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 152, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_group); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 153, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_int_1}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 153, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(5, 153, __pyx_L3_error) /* "asyncpg/protocol/scram.pyx":152 * self.server_first_message = server_response * try: * self.server_nonce = re.search(b'r=([^,]+),', # <<<<<<<<<<<<<< * self.server_first_message).group(1) * except IndexError: */ __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->server_nonce); __Pyx_DECREF(__pyx_v_self->server_nonce); __pyx_v_self->server_nonce = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/scram.pyx":151 * """Parse the response from the first message from the server""" * self.server_first_message = server_response * try: # <<<<<<<<<<<<<< * self.server_nonce = re.search(b'r=([^,]+),', * self.server_first_message).group(1) */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/scram.pyx":154 * self.server_nonce = re.search(b'r=([^,]+),', * self.server_first_message).group(1) * except IndexError: # <<<<<<<<<<<<<< * raise Exception("could not get nonce") * if not self.server_nonce.startswith(self.client_nonce): */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError); if (__pyx_t_9) { __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.parse_server_first_message", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_5) < 0) __PYX_ERR(5, 154, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); /* "asyncpg/protocol/scram.pyx":155 * self.server_first_message).group(1) * except IndexError: * raise Exception("could not get nonce") # <<<<<<<<<<<<<< * if not self.server_nonce.startswith(self.client_nonce): * raise Exception("invalid nonce") */ __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 155, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(5, 155, __pyx_L5_except_error) } goto __pyx_L5_except_error; /* "asyncpg/protocol/scram.pyx":151 * """Parse the response from the first message from the server""" * self.server_first_message = server_response * try: # <<<<<<<<<<<<<< * self.server_nonce = re.search(b'r=([^,]+),', * self.server_first_message).group(1) */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L8_try_end:; } /* "asyncpg/protocol/scram.pyx":156 * except IndexError: * raise Exception("could not get nonce") * if not self.server_nonce.startswith(self.client_nonce): # <<<<<<<<<<<<<< * raise Exception("invalid nonce") * try: */ if (unlikely(__pyx_v_self->server_nonce == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "startswith"); __PYX_ERR(5, 156, __pyx_L1_error) } __pyx_t_10 = __Pyx_PyBytes_Tailmatch(__pyx_v_self->server_nonce, __pyx_v_self->client_nonce, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(5, 156, __pyx_L1_error) __pyx_t_11 = (!__pyx_t_10); if (unlikely(__pyx_t_11)) { /* "asyncpg/protocol/scram.pyx":157 * raise Exception("could not get nonce") * if not self.server_nonce.startswith(self.client_nonce): * raise Exception("invalid nonce") # <<<<<<<<<<<<<< * try: * self.password_salt = re.search(b',s=([^,]+),', */ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(5, 157, __pyx_L1_error) /* "asyncpg/protocol/scram.pyx":156 * except IndexError: * raise Exception("could not get nonce") * if not self.server_nonce.startswith(self.client_nonce): # <<<<<<<<<<<<<< * raise Exception("invalid nonce") * try: */ } /* "asyncpg/protocol/scram.pyx":158 * if not self.server_nonce.startswith(self.client_nonce): * raise Exception("invalid nonce") * try: # <<<<<<<<<<<<<< * self.password_salt = re.search(b',s=([^,]+),', * self.server_first_message).group(1) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_1); /*try:*/ { /* "asyncpg/protocol/scram.pyx":159 * raise Exception("invalid nonce") * try: * self.password_salt = re.search(b',s=([^,]+),', # <<<<<<<<<<<<<< * self.server_first_message).group(1) * except IndexError: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_re); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 159, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_search); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 159, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/scram.pyx":160 * try: * self.password_salt = re.search(b',s=([^,]+),', * self.server_first_message).group(1) # <<<<<<<<<<<<<< * except IndexError: * raise Exception("could not get salt") */ __pyx_t_4 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_kp_b_s, __pyx_v_self->server_first_message}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 159, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_group); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 160, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_int_1}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 160, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_5))) __PYX_ERR(5, 160, __pyx_L12_error) /* "asyncpg/protocol/scram.pyx":159 * raise Exception("invalid nonce") * try: * self.password_salt = re.search(b',s=([^,]+),', # <<<<<<<<<<<<<< * self.server_first_message).group(1) * except IndexError: */ __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->password_salt); __Pyx_DECREF(__pyx_v_self->password_salt); __pyx_v_self->password_salt = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/scram.pyx":158 * if not self.server_nonce.startswith(self.client_nonce): * raise Exception("invalid nonce") * try: # <<<<<<<<<<<<<< * self.password_salt = re.search(b',s=([^,]+),', * self.server_first_message).group(1) */ } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L17_try_end; __pyx_L12_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/scram.pyx":161 * self.password_salt = re.search(b',s=([^,]+),', * self.server_first_message).group(1) * except IndexError: # <<<<<<<<<<<<<< * raise Exception("could not get salt") * try: */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError); if (__pyx_t_9) { __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.parse_server_first_message", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(5, 161, __pyx_L14_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); /* "asyncpg/protocol/scram.pyx":162 * self.server_first_message).group(1) * except IndexError: * raise Exception("could not get salt") # <<<<<<<<<<<<<< * try: * self.password_iterations = int(re.search(b',i=(\d+),?', */ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 162, __pyx_L14_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(5, 162, __pyx_L14_except_error) } goto __pyx_L14_except_error; /* "asyncpg/protocol/scram.pyx":158 * if not self.server_nonce.startswith(self.client_nonce): * raise Exception("invalid nonce") * try: # <<<<<<<<<<<<<< * self.password_salt = re.search(b',s=([^,]+),', * self.server_first_message).group(1) */ __pyx_L14_except_error:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1); goto __pyx_L1_error; __pyx_L17_try_end:; } /* "asyncpg/protocol/scram.pyx":163 * except IndexError: * raise Exception("could not get salt") * try: # <<<<<<<<<<<<<< * self.password_iterations = int(re.search(b',i=(\d+),?', * self.server_first_message).group(1)) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "asyncpg/protocol/scram.pyx":164 * raise Exception("could not get salt") * try: * self.password_iterations = int(re.search(b',i=(\d+),?', # <<<<<<<<<<<<<< * self.server_first_message).group(1)) * except (IndexError, TypeError, ValueError): */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 164, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_search); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 164, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/scram.pyx":165 * try: * self.password_iterations = int(re.search(b',i=(\d+),?', * self.server_first_message).group(1)) # <<<<<<<<<<<<<< * except (IndexError, TypeError, ValueError): * raise Exception("could not get iterations") */ __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_kp_b_i_d, __pyx_v_self->server_first_message}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 164, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_group); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 165, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_int_1}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 165, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/protocol/scram.pyx":164 * raise Exception("could not get salt") * try: * self.password_iterations = int(re.search(b',i=(\d+),?', # <<<<<<<<<<<<<< * self.server_first_message).group(1)) * except (IndexError, TypeError, ValueError): */ __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 164, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 164, __pyx_L20_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_self->password_iterations = __pyx_t_9; /* "asyncpg/protocol/scram.pyx":163 * except IndexError: * raise Exception("could not get salt") * try: # <<<<<<<<<<<<<< * self.password_iterations = int(re.search(b',i=(\d+),?', * self.server_first_message).group(1)) */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L25_try_end; __pyx_L20_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/scram.pyx":166 * self.password_iterations = int(re.search(b',i=(\d+),?', * self.server_first_message).group(1)) * except (IndexError, TypeError, ValueError): # <<<<<<<<<<<<<< * raise Exception("could not get iterations") * */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_9) { __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.parse_server_first_message", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(5, 166, __pyx_L22_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_6); /* "asyncpg/protocol/scram.pyx":167 * self.server_first_message).group(1)) * except (IndexError, TypeError, ValueError): * raise Exception("could not get iterations") # <<<<<<<<<<<<<< * * cdef verify_server_final_message(self, bytes server_final_message): */ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 167, __pyx_L22_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(5, 167, __pyx_L22_except_error) } goto __pyx_L22_except_error; /* "asyncpg/protocol/scram.pyx":163 * except IndexError: * raise Exception("could not get salt") * try: # <<<<<<<<<<<<<< * self.password_iterations = int(re.search(b',i=(\d+),?', * self.server_first_message).group(1)) */ __pyx_L22_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L25_try_end:; } /* "asyncpg/protocol/scram.pyx":148 * return msg * * cdef parse_server_first_message(self, bytes server_response): # <<<<<<<<<<<<<< * """Parse the response from the first message from the server""" * self.server_first_message = server_response */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.parse_server_first_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/scram.pyx":169 * raise Exception("could not get iterations") * * cdef verify_server_final_message(self, bytes server_final_message): # <<<<<<<<<<<<<< * """Verify the final message from the server""" * cdef: */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_verify_server_final_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_server_final_message) { PyObject *__pyx_v_server_signature = 0; PyObject *__pyx_v_verify_server_signature = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("verify_server_final_message", 1); /* "asyncpg/protocol/scram.pyx":174 * bytes server_signature * * try: # <<<<<<<<<<<<<< * server_signature = re.search(b'v=([^,]+)', * server_final_message).group(1) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "asyncpg/protocol/scram.pyx":175 * * try: * server_signature = re.search(b'v=([^,]+)', # <<<<<<<<<<<<<< * server_final_message).group(1) * except IndexError: */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 175, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_search); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 175, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/scram.pyx":176 * try: * server_signature = re.search(b'v=([^,]+)', * server_final_message).group(1) # <<<<<<<<<<<<<< * except IndexError: * raise Exception("could not get server signature") */ __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_kp_b_v, __pyx_v_server_final_message}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 175, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_group); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 176, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_int_1}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 176, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(5, 176, __pyx_L3_error) __pyx_v_server_signature = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/scram.pyx":174 * bytes server_signature * * try: # <<<<<<<<<<<<<< * server_signature = re.search(b'v=([^,]+)', * server_final_message).group(1) */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/scram.pyx":177 * server_signature = re.search(b'v=([^,]+)', * server_final_message).group(1) * except IndexError: # <<<<<<<<<<<<<< * raise Exception("could not get server signature") * */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError); if (__pyx_t_9) { __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.verify_server_final_message", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_5) < 0) __PYX_ERR(5, 177, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); /* "asyncpg/protocol/scram.pyx":178 * server_final_message).group(1) * except IndexError: * raise Exception("could not get server signature") # <<<<<<<<<<<<<< * * verify_server_signature = hmac.new(self.server_key.digest(), */ __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 178, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(5, 178, __pyx_L5_except_error) } goto __pyx_L5_except_error; /* "asyncpg/protocol/scram.pyx":174 * bytes server_signature * * try: # <<<<<<<<<<<<<< * server_signature = re.search(b'v=([^,]+)', * server_final_message).group(1) */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L8_try_end:; } /* "asyncpg/protocol/scram.pyx":180 * raise Exception("could not get server signature") * * verify_server_signature = hmac.new(self.server_key.digest(), # <<<<<<<<<<<<<< * self.authorization_message, self.DIGEST) * # validate the server signature against the verifier */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_hmac); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_new); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->server_key, __pyx_n_s_digest); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_10 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } /* "asyncpg/protocol/scram.pyx":181 * * verify_server_signature = hmac.new(self.server_key.digest(), * self.authorization_message, self.DIGEST) # <<<<<<<<<<<<<< * # validate the server signature against the verifier * return server_signature == base64.b64encode( */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_DIGEST); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_10 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_10, __pyx_t_7, __pyx_v_self->authorization_message, __pyx_t_6}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_verify_server_signature = __pyx_t_5; __pyx_t_5 = 0; /* "asyncpg/protocol/scram.pyx":183 * self.authorization_message, self.DIGEST) * # validate the server signature against the verifier * return server_signature == base64.b64encode( # <<<<<<<<<<<<<< * verify_server_signature.digest()) * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_base64); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_b64encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/scram.pyx":184 * # validate the server signature against the verifier * return server_signature == base64.b64encode( * verify_server_signature.digest()) # <<<<<<<<<<<<<< * * cdef _bytes_xor(self, bytes a, bytes b): */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_verify_server_signature, __pyx_n_s_digest); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_10 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = PyObject_RichCompare(__pyx_v_server_signature, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "asyncpg/protocol/scram.pyx":169 * raise Exception("could not get iterations") * * cdef verify_server_final_message(self, bytes server_final_message): # <<<<<<<<<<<<<< * """Verify the final message from the server""" * cdef: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.verify_server_final_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_server_signature); __Pyx_XDECREF(__pyx_v_verify_server_signature); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10_bytes_xor_2generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/scram.pyx":188 * cdef _bytes_xor(self, bytes a, bytes b): * """XOR two bytestrings together""" * return bytes(a_i ^ b_i for a_i, b_i in zip(a, b)) # <<<<<<<<<<<<<< * * cdef _generate_client_nonce(self, int num_bytes): */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10_bytes_xor_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(5, 188, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10_bytes_xor_2generator12, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_SCRAMAuthentication__bytes_xor_l, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(5, 188, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication._bytes_xor.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10_bytes_xor_2generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L8_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(5, 188, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(5, 188, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 188, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 188, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(5, 188, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 188, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(5, 188, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(5, 188, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(5, 188, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(5, 188, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(5, 188, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_a_i); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_a_i, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_b_i); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_b_i, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = PyNumber_Xor(__pyx_cur_scope->__pyx_v_a_i, __pyx_cur_scope->__pyx_v_b_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L8_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; if (unlikely(!__pyx_sent_value)) __PYX_ERR(5, 188, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/scram.pyx":186 * verify_server_signature.digest()) * * cdef _bytes_xor(self, bytes a, bytes b): # <<<<<<<<<<<<<< * """XOR two bytestrings together""" * return bytes(a_i ^ b_i for a_i, b_i in zip(a, b)) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__bytes_xor(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b) { PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10_bytes_xor_2generator12 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_bytes_xor", 1); /* "asyncpg/protocol/scram.pyx":188 * cdef _bytes_xor(self, bytes a, bytes b): * """XOR two bytestrings together""" * return bytes(a_i ^ b_i for a_i, b_i in zip(a, b)) # <<<<<<<<<<<<<< * * cdef _generate_client_nonce(self, int num_bytes): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_a); __Pyx_GIVEREF(__pyx_v_a); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_a)) __PYX_ERR(5, 188, __pyx_L1_error); __Pyx_INCREF(__pyx_v_b); __Pyx_GIVEREF(__pyx_v_b); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_b)) __PYX_ERR(5, 188, __pyx_L1_error); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10_bytes_xor_genexpr(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/scram.pyx":186 * verify_server_signature.digest()) * * cdef _bytes_xor(self, bytes a, bytes b): # <<<<<<<<<<<<<< * """XOR two bytestrings together""" * return bytes(a_i ^ b_i for a_i, b_i in zip(a, b)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication._bytes_xor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10_bytes_xor_2generator12); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/scram.pyx":190 * return bytes(a_i ^ b_i for a_i, b_i in zip(a, b)) * * cdef _generate_client_nonce(self, int num_bytes): # <<<<<<<<<<<<<< * cdef: * bytes token */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_client_nonce(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, int __pyx_v_num_bytes) { PyObject *__pyx_v_token = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_generate_client_nonce", 1); /* "asyncpg/protocol/scram.pyx":194 * bytes token * * token = secrets.token_bytes(num_bytes) # <<<<<<<<<<<<<< * * return base64.b64encode(token) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_secrets); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_token_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_num_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(5, 194, __pyx_L1_error) __pyx_v_token = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/scram.pyx":196 * token = secrets.token_bytes(num_bytes) * * return base64.b64encode(token) # <<<<<<<<<<<<<< * * cdef _generate_client_proof(self, str password): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_base64); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_b64encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_token}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/scram.pyx":190 * return bytes(a_i ^ b_i for a_i, b_i in zip(a, b)) * * cdef _generate_client_nonce(self, int num_bytes): # <<<<<<<<<<<<<< * cdef: * bytes token */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication._generate_client_nonce", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_token); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/scram.pyx":198 * return base64.b64encode(token) * * cdef _generate_client_proof(self, str password): # <<<<<<<<<<<<<< * """need to ensure a server response exists, i.e. """ * cdef: */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_client_proof(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_password) { PyObject *__pyx_v_salted_password = 0; PyObject *__pyx_v_client_key = NULL; PyObject *__pyx_v_stored_key = NULL; PyObject *__pyx_v_client_signature = NULL; PyObject *__pyx_8genexpr4__pyx_v_val = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_t_6; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_generate_client_proof", 1); /* "asyncpg/protocol/scram.pyx":203 * bytes salted_password * * if any([getattr(self, val) is None for val in # <<<<<<<<<<<<<< * self.REQUIREMENTS_CLIENT_PROOF]): * raise Exception( */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 203, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); /* "asyncpg/protocol/scram.pyx":204 * * if any([getattr(self, val) is None for val in * self.REQUIREMENTS_CLIENT_PROOF]): # <<<<<<<<<<<<<< * raise Exception( * "you need values from server to generate a client proof") */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_REQUIREMENTS_CLIENT_PROOF); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 204, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 204, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 204, __pyx_L6_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 204, __pyx_L6_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(5, 204, __pyx_L6_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 204, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 204, __pyx_L6_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(5, 204, __pyx_L6_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 204, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(5, 204, __pyx_L6_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_val, __pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/scram.pyx":203 * bytes salted_password * * if any([getattr(self, val) is None for val in # <<<<<<<<<<<<<< * self.REQUIREMENTS_CLIENT_PROOF]): * raise Exception( */ __pyx_t_2 = __Pyx_GetAttr(((PyObject *)__pyx_v_self), __pyx_8genexpr4__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 203, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = (__pyx_t_2 == Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 203, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(5, 203, __pyx_L6_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_val); __pyx_8genexpr4__pyx_v_val = 0; goto __pyx_L10_exit_scope; __pyx_L6_error:; __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_val); __pyx_8genexpr4__pyx_v_val = 0; goto __pyx_L1_error; __pyx_L10_exit_scope:; } /* exit inner scope */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_any, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(5, 203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_6)) { /* "asyncpg/protocol/scram.pyx":205 * if any([getattr(self, val) is None for val in * self.REQUIREMENTS_CLIENT_PROOF]): * raise Exception( # <<<<<<<<<<<<<< * "you need values from server to generate a client proof") * # generate a salt password */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(5, 205, __pyx_L1_error) /* "asyncpg/protocol/scram.pyx":203 * bytes salted_password * * if any([getattr(self, val) is None for val in # <<<<<<<<<<<<<< * self.REQUIREMENTS_CLIENT_PROOF]): * raise Exception( */ } /* "asyncpg/protocol/scram.pyx":209 * # generate a salt password * salted_password = self._generate_salted_password(password, * self.password_salt, self.password_iterations) # <<<<<<<<<<<<<< * # client key is derived from the salted password * client_key = hmac.new(salted_password, b"Client Key", self.DIGEST) */ __pyx_t_3 = __pyx_v_self->password_salt; __Pyx_INCREF(__pyx_t_3); /* "asyncpg/protocol/scram.pyx":208 * "you need values from server to generate a client proof") * # generate a salt password * salted_password = self._generate_salted_password(password, # <<<<<<<<<<<<<< * self.password_salt, self.password_iterations) * # client key is derived from the salted password */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_salted_password(__pyx_v_self, __pyx_v_password, ((PyObject*)__pyx_t_3), __pyx_v_self->password_iterations); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(5, 208, __pyx_L1_error) __pyx_v_salted_password = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/scram.pyx":211 * self.password_salt, self.password_iterations) * # client key is derived from the salted password * client_key = hmac.new(salted_password, b"Client Key", self.DIGEST) # <<<<<<<<<<<<<< * # this allows us to compute the stored key that is residing on the server * stored_key = self.DIGEST(client_key.digest()) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_hmac); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_DIGEST); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_salted_password, __pyx_kp_b_Client_Key, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_client_key = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/scram.pyx":213 * client_key = hmac.new(salted_password, b"Client Key", self.DIGEST) * # this allows us to compute the stored key that is residing on the server * stored_key = self.DIGEST(client_key.digest()) # <<<<<<<<<<<<<< * # as well as compute the server key * self.server_key = hmac.new(salted_password, b"Server Key", self.DIGEST) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_DIGEST); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_client_key, __pyx_n_s_digest); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_stored_key = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/scram.pyx":215 * stored_key = self.DIGEST(client_key.digest()) * # as well as compute the server key * self.server_key = hmac.new(salted_password, b"Server Key", self.DIGEST) # <<<<<<<<<<<<<< * # build the authorization message that will be used in the * # client signature */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_hmac); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_DIGEST); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_salted_password, __pyx_kp_b_Server_Key, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->server_key); __Pyx_DECREF(__pyx_v_self->server_key); __pyx_v_self->server_key = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/scram.pyx":220 * # the "c=" portion is for the channel binding, but this is not * # presently implemented * self.authorization_message = self.client_first_message_bare + b"," + \ # <<<<<<<<<<<<<< * self.server_first_message + b",c=" + \ * base64.b64encode(self.client_channel_binding) + \ */ __pyx_t_1 = PyNumber_Add(__pyx_v_self->client_first_message_bare, __pyx_kp_b__31); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "asyncpg/protocol/scram.pyx":221 * # presently implemented * self.authorization_message = self.client_first_message_bare + b"," + \ * self.server_first_message + b",c=" + \ # <<<<<<<<<<<<<< * base64.b64encode(self.client_channel_binding) + \ * b",r=" + self.server_nonce */ __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_v_self->server_first_message); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_kp_b_c_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/scram.pyx":222 * self.authorization_message = self.client_first_message_bare + b"," + \ * self.server_first_message + b",c=" + \ * base64.b64encode(self.client_channel_binding) + \ # <<<<<<<<<<<<<< * b",r=" + self.server_nonce * # sign! */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_base64); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_b64encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->client_channel_binding}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } /* "asyncpg/protocol/scram.pyx":221 * # presently implemented * self.authorization_message = self.client_first_message_bare + b"," + \ * self.server_first_message + b",c=" + \ # <<<<<<<<<<<<<< * base64.b64encode(self.client_channel_binding) + \ * b",r=" + self.server_nonce */ __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/scram.pyx":222 * self.authorization_message = self.client_first_message_bare + b"," + \ * self.server_first_message + b",c=" + \ * base64.b64encode(self.client_channel_binding) + \ # <<<<<<<<<<<<<< * b",r=" + self.server_nonce * # sign! */ __pyx_t_3 = PyNumber_Add(__pyx_t_7, __pyx_kp_b_r_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/scram.pyx":223 * self.server_first_message + b",c=" + \ * base64.b64encode(self.client_channel_binding) + \ * b",r=" + self.server_nonce # <<<<<<<<<<<<<< * # sign! * client_signature = hmac.new(stored_key.digest(), */ __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_v_self->server_nonce); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(5, 223, __pyx_L1_error) /* "asyncpg/protocol/scram.pyx":220 * # the "c=" portion is for the channel binding, but this is not * # presently implemented * self.authorization_message = self.client_first_message_bare + b"," + \ # <<<<<<<<<<<<<< * self.server_first_message + b",c=" + \ * base64.b64encode(self.client_channel_binding) + \ */ __Pyx_GIVEREF(__pyx_t_7); __Pyx_GOTREF(__pyx_v_self->authorization_message); __Pyx_DECREF(__pyx_v_self->authorization_message); __pyx_v_self->authorization_message = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/scram.pyx":225 * b",r=" + self.server_nonce * # sign! * client_signature = hmac.new(stored_key.digest(), # <<<<<<<<<<<<<< * self.authorization_message, self.DIGEST) * # and the proof */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_hmac); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_stored_key, __pyx_n_s_digest); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "asyncpg/protocol/scram.pyx":226 * # sign! * client_signature = hmac.new(stored_key.digest(), * self.authorization_message, self.DIGEST) # <<<<<<<<<<<<<< * # and the proof * return self._bytes_xor(client_key.digest(), client_signature.digest()) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_DIGEST); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_t_3, __pyx_v_self->authorization_message, __pyx_t_2}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_client_signature = __pyx_t_7; __pyx_t_7 = 0; /* "asyncpg/protocol/scram.pyx":228 * self.authorization_message, self.DIGEST) * # and the proof * return self._bytes_xor(client_key.digest(), client_signature.digest()) # <<<<<<<<<<<<<< * * cdef _generate_salted_password(self, str password, bytes salt, int iterations): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_client_key, __pyx_n_s_digest); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_7))) __PYX_ERR(5, 228, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_client_signature, __pyx_n_s_digest); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(5, 228, __pyx_L1_error) __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__bytes_xor(__pyx_v_self, ((PyObject*)__pyx_t_7), ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/scram.pyx":198 * return base64.b64encode(token) * * cdef _generate_client_proof(self, str password): # <<<<<<<<<<<<<< * """need to ensure a server response exists, i.e. """ * cdef: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication._generate_client_proof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_salted_password); __Pyx_XDECREF(__pyx_v_client_key); __Pyx_XDECREF(__pyx_v_stored_key); __Pyx_XDECREF(__pyx_v_client_signature); __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/scram.pyx":230 * return self._bytes_xor(client_key.digest(), client_signature.digest()) * * cdef _generate_salted_password(self, str password, bytes salt, int iterations): # <<<<<<<<<<<<<< * """This follows the "Hi" algorithm specified in RFC5802""" * cdef: */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_salted_password(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_password, PyObject *__pyx_v_salt, int __pyx_v_iterations) { PyObject *__pyx_v_p = 0; PyObject *__pyx_v_s = 0; PyObject *__pyx_v_u = 0; PyObject *__pyx_v_ui = NULL; CYTHON_UNUSED long __pyx_v_x; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; long __pyx_t_7; long __pyx_t_8; long __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_generate_salted_password", 1); /* "asyncpg/protocol/scram.pyx":239 * # convert the password to a binary string - UTF8 is safe for SASL * # (though there are SASLPrep rules) * p = password.encode("utf8") # <<<<<<<<<<<<<< * # the salt needs to be base64 decoded -- full binary must be used * s = base64.b64decode(salt) */ if (unlikely(__pyx_v_password == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); __PYX_ERR(5, 239, __pyx_L1_error) } __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_p = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/scram.pyx":241 * p = password.encode("utf8") * # the salt needs to be base64 decoded -- full binary must be used * s = base64.b64decode(salt) # <<<<<<<<<<<<<< * # the initial signature is the salt with a terminator of a 32-bit string * # ending in 1 */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_base64); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_b64decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_salt}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(5, 241, __pyx_L1_error) __pyx_v_s = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/scram.pyx":244 * # the initial signature is the salt with a terminator of a 32-bit string * # ending in 1 * ui = hmac.new(p, s + b'\x00\x00\x00\x01', self.DIGEST) # <<<<<<<<<<<<<< * # grab the initial digest * u = ui.digest() */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_hmac); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Add(__pyx_v_s, __pyx_kp_b__32); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_DIGEST); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_v_p, __pyx_t_3, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_ui = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/scram.pyx":246 * ui = hmac.new(p, s + b'\x00\x00\x00\x01', self.DIGEST) * # grab the initial digest * u = ui.digest() # <<<<<<<<<<<<<< * # for X number of iterations, recompute the HMAC signature against the * # password and the latest iteration of the hash, and XOR it with the */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ui, __pyx_n_s_digest); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(5, 246, __pyx_L1_error) __pyx_v_u = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/scram.pyx":250 * # password and the latest iteration of the hash, and XOR it with the * # previous version * for x in range(iterations - 1): # <<<<<<<<<<<<<< * ui = hmac.new(p, ui.digest(), hashlib.sha256) * # this is a fancy way of XORing two byte strings together */ __pyx_t_7 = (__pyx_v_iterations - 1); __pyx_t_8 = __pyx_t_7; for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_v_x = __pyx_t_9; /* "asyncpg/protocol/scram.pyx":251 * # previous version * for x in range(iterations - 1): * ui = hmac.new(p, ui.digest(), hashlib.sha256) # <<<<<<<<<<<<<< * # this is a fancy way of XORing two byte strings together * u = self._bytes_xor(u, ui.digest()) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_hmac); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_new); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_ui, __pyx_n_s_digest); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_hashlib); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sha256); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_p, __pyx_t_2, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF_SET(__pyx_v_ui, __pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/scram.pyx":253 * ui = hmac.new(p, ui.digest(), hashlib.sha256) * # this is a fancy way of XORing two byte strings together * u = self._bytes_xor(u, ui.digest()) # <<<<<<<<<<<<<< * return u * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_ui, __pyx_n_s_digest); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(5, 253, __pyx_L1_error) __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__bytes_xor(__pyx_v_self, __pyx_v_u, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_5))) __PYX_ERR(5, 253, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_u, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; } /* "asyncpg/protocol/scram.pyx":254 * # this is a fancy way of XORing two byte strings together * u = self._bytes_xor(u, ui.digest()) * return u # <<<<<<<<<<<<<< * * cdef _normalize_password(self, str original_password): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_u); __pyx_r = __pyx_v_u; goto __pyx_L0; /* "asyncpg/protocol/scram.pyx":230 * return self._bytes_xor(client_key.digest(), client_signature.digest()) * * cdef _generate_salted_password(self, str password, bytes salt, int iterations): # <<<<<<<<<<<<<< * """This follows the "Hi" algorithm specified in RFC5802""" * cdef: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication._generate_salted_password", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_p); __Pyx_XDECREF(__pyx_v_s); __Pyx_XDECREF(__pyx_v_u); __Pyx_XDECREF(__pyx_v_ui); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_2generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/scram.pyx":287 * # Table B.1 -- "Commonly mapped to nothing" * normalized_password = u"".join( * ' ' if stringprep.in_table_c12(c) else c # <<<<<<<<<<<<<< * for c in tuple(normalized_password) if not stringprep.in_table_b1(c) * ) */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(5, 287, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_2generator13, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_SCRAMAuthentication__normalize_p, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(5, 287, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication._normalize_password.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_2generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(5, 287, __pyx_L1_error) __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(5, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_r); /* "asyncpg/protocol/scram.pyx":288 * normalized_password = u"".join( * ' ' if stringprep.in_table_c12(c) else c * for c in tuple(normalized_password) if not stringprep.in_table_b1(c) # <<<<<<<<<<<<<< * ) * */ if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(5, 288, __pyx_L1_error) } __pyx_t_1 = PySequence_Tuple(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 288, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(5, 288, __pyx_L1_error) #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_stringprep); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_in_table_b1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_c}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(5, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = (!__pyx_t_7); if (__pyx_t_8) { /* "asyncpg/protocol/scram.pyx":287 * # Table B.1 -- "Commonly mapped to nothing" * normalized_password = u"".join( * ' ' if stringprep.in_table_c12(c) else c # <<<<<<<<<<<<<< * for c in tuple(normalized_password) if not stringprep.in_table_b1(c) * ) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_stringprep); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_in_table_c12); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_c}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(5, 287, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_8) { __Pyx_INCREF(__pyx_kp_u__33); __pyx_t_1 = __pyx_kp_u__33; } else { __Pyx_INCREF(__pyx_cur_scope->__pyx_v_c); __pyx_t_1 = __pyx_cur_scope->__pyx_v_c; } if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(5, 287, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/scram.pyx":288 * normalized_password = u"".join( * ' ' if stringprep.in_table_c12(c) else c * for c in tuple(normalized_password) if not stringprep.in_table_b1(c) # <<<<<<<<<<<<<< * ) * */ } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "asyncpg/protocol/scram.pyx":287 * # Table B.1 -- "Commonly mapped to nothing" * normalized_password = u"".join( * ' ' if stringprep.in_table_c12(c) else c # <<<<<<<<<<<<<< * for c in tuple(normalized_password) if not stringprep.in_table_b1(c) * ) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_5generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/scram.pyx":313 * for c in normalized_password_tuple: * if any( * in_prohibited_table(c) # <<<<<<<<<<<<<< * for in_prohibited_table in self.SASLPREP_PROHIBITED * ): */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_3genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(5, 313, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *) __pyx_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_5generator14, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_SCRAMAuthentication__normalize_p, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(5, 313, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication._normalize_password.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_5generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(5, 313, __pyx_L1_error) /* "asyncpg/protocol/scram.pyx":314 * if any( * in_prohibited_table(c) * for in_prohibited_table in self.SASLPREP_PROHIBITED # <<<<<<<<<<<<<< * ): * return original_password */ if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(5, 314, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 314, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 314, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(5, 314, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 314, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(5, 314, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(5, 314, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_in_prohibited_table); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_in_prohibited_table, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/scram.pyx":313 * for c in normalized_password_tuple: * if any( * in_prohibited_table(c) # <<<<<<<<<<<<<< * for in_prohibited_table in self.SASLPREP_PROHIBITED * ): */ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_c)) { __Pyx_RaiseClosureNameError("c"); __PYX_ERR(5, 313, __pyx_L1_error) } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_in_prohibited_table); __pyx_t_5 = __pyx_cur_scope->__pyx_v_in_prohibited_table; __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_c}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(5, 313, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_8) { /* "asyncpg/protocol/scram.pyx":312 * # category as PostgreSQL does the same * for c in normalized_password_tuple: * if any( # <<<<<<<<<<<<<< * in_prohibited_table(c) * for in_prohibited_table in self.SASLPREP_PROHIBITED */ __Pyx_XDECREF(__pyx_r); /* "asyncpg/protocol/scram.pyx":313 * for c in normalized_password_tuple: * if any( * in_prohibited_table(c) # <<<<<<<<<<<<<< * for in_prohibited_table in self.SASLPREP_PROHIBITED * ): */ __Pyx_INCREF(Py_True); __pyx_r = Py_True; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } /* "asyncpg/protocol/scram.pyx":314 * if any( * in_prohibited_table(c) * for in_prohibited_table in self.SASLPREP_PROHIBITED # <<<<<<<<<<<<<< * ): * return original_password */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*else*/ { /* "asyncpg/protocol/scram.pyx":312 * # category as PostgreSQL does the same * for c in normalized_password_tuple: * if any( # <<<<<<<<<<<<<< * in_prohibited_table(c) * for in_prohibited_table in self.SASLPREP_PROHIBITED */ __Pyx_XDECREF(__pyx_r); /* "asyncpg/protocol/scram.pyx":313 * for c in normalized_password_tuple: * if any( * in_prohibited_table(c) # <<<<<<<<<<<<<< * for in_prohibited_table in self.SASLPREP_PROHIBITED * ): */ __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_8generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/scram.pyx":327 * # character must be the first and last character of the string * # RandALCat characters are found in table D.1, whereas LCat are in D.2 * if any(stringprep.in_table_d1(c) for c in normalized_password_tuple): # <<<<<<<<<<<<<< * # if the first character or the last character are not in D.1, * # return the original password */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_6genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(5, 327, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_8generator15, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_SCRAMAuthentication__normalize_p, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(5, 327, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication._normalize_password.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_8generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(5, 327, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(5, 327, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 327, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(5, 327, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_stringprep); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_in_table_d1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_c}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(5, 327, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_7) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_11generator16(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/scram.pyx":336 * # if any characters are in D.2, use the original password * if any( * stringprep.in_table_d2(c) for c in normalized_password_tuple # <<<<<<<<<<<<<< * ): * return original_password */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_9genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(5, 336, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_11generator16, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_SCRAMAuthentication__normalize_p, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(5, 336, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication._normalize_password.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_11generator16(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(5, 336, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(5, 336, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 336, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(5, 336, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_stringprep); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_in_table_d2); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_c}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(5, 336, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_7) { /* "asyncpg/protocol/scram.pyx":335 * * # if any characters are in D.2, use the original password * if any( # <<<<<<<<<<<<<< * stringprep.in_table_d2(c) for c in normalized_password_tuple * ): */ __Pyx_XDECREF(__pyx_r); /* "asyncpg/protocol/scram.pyx":336 * # if any characters are in D.2, use the original password * if any( * stringprep.in_table_d2(c) for c in normalized_password_tuple # <<<<<<<<<<<<<< * ): * return original_password */ __Pyx_INCREF(Py_True); __pyx_r = Py_True; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*else*/ { /* "asyncpg/protocol/scram.pyx":335 * * # if any characters are in D.2, use the original password * if any( # <<<<<<<<<<<<<< * stringprep.in_table_d2(c) for c in normalized_password_tuple * ): */ __Pyx_XDECREF(__pyx_r); /* "asyncpg/protocol/scram.pyx":336 * # if any characters are in D.2, use the original password * if any( * stringprep.in_table_d2(c) for c in normalized_password_tuple # <<<<<<<<<<<<<< * ): * return original_password */ __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/scram.pyx":256 * return u * * cdef _normalize_password(self, str original_password): # <<<<<<<<<<<<<< * """Normalize the password using the SASLprep from RFC4013""" * cdef: */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__normalize_password(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_original_password) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *__pyx_cur_scope; PyObject *__pyx_v_normalized_password = 0; PyObject *__pyx_v_normalized_password_tuple = NULL; PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_2generator13 = 0; PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_5generator14 = 0; PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_8generator15 = 0; PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_11generator16 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; unsigned int __pyx_t_10; Py_ssize_t __pyx_t_11; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_normalize_password", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(5, 256, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } /* "asyncpg/protocol/scram.pyx":271 * # https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/common/saslprep.c * # using the `pg_saslprep` function * normalized_password = original_password # <<<<<<<<<<<<<< * # if the original password is an ASCII string or fails to encode as a * # UTF-8 string, then no further action is needed */ __Pyx_INCREF(__pyx_v_original_password); __pyx_v_normalized_password = __pyx_v_original_password; /* "asyncpg/protocol/scram.pyx":274 * # if the original password is an ASCII string or fails to encode as a * # UTF-8 string, then no further action is needed * try: # <<<<<<<<<<<<<< * original_password.encode("ascii") * except UnicodeEncodeError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "asyncpg/protocol/scram.pyx":275 * # UTF-8 string, then no further action is needed * try: * original_password.encode("ascii") # <<<<<<<<<<<<<< * except UnicodeEncodeError: * pass */ if (unlikely(__pyx_v_original_password == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); __PYX_ERR(5, 275, __pyx_L3_error) } __pyx_t_4 = PyUnicode_AsASCIIString(__pyx_v_original_password); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 275, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/scram.pyx":274 * # if the original password is an ASCII string or fails to encode as a * # UTF-8 string, then no further action is needed * try: # <<<<<<<<<<<<<< * original_password.encode("ascii") * except UnicodeEncodeError: */ } /* "asyncpg/protocol/scram.pyx":279 * pass * else: * return original_password # <<<<<<<<<<<<<< * * # Step 1 of SASLPrep: Map. Per the algorithm, we map non-ascii space */ /*else:*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_original_password); __pyx_r = __pyx_v_original_password; goto __pyx_L6_except_return; } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/scram.pyx":276 * try: * original_password.encode("ascii") * except UnicodeEncodeError: # <<<<<<<<<<<<<< * pass * else: */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeEncodeError); if (__pyx_t_5) { __Pyx_ErrRestore(0,0,0); goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; /* "asyncpg/protocol/scram.pyx":274 * # if the original password is an ASCII string or fails to encode as a * # UTF-8 string, then no further action is needed * try: # <<<<<<<<<<<<<< * original_password.encode("ascii") * except UnicodeEncodeError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); } /* "asyncpg/protocol/scram.pyx":287 * # Table B.1 -- "Commonly mapped to nothing" * normalized_password = u"".join( * ' ' if stringprep.in_table_c12(c) else c # <<<<<<<<<<<<<< * for c in tuple(normalized_password) if not stringprep.in_table_b1(c) * ) */ __pyx_t_4 = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_genexpr(NULL, __pyx_v_normalized_password); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/scram.pyx":286 * # Table C.1.2 -- non-ASCII spaces * # Table B.1 -- "Commonly mapped to nothing" * normalized_password = u"".join( # <<<<<<<<<<<<<< * ' ' if stringprep.in_table_c12(c) else c * for c in tuple(normalized_password) if not stringprep.in_table_b1(c) */ __pyx_t_6 = __Pyx_Generator_Next(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__34, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_normalized_password, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; /* "asyncpg/protocol/scram.pyx":293 * # If at this point the password is empty, PostgreSQL uses the original * # password * if not normalized_password: # <<<<<<<<<<<<<< * return original_password * */ __pyx_t_7 = (__pyx_v_normalized_password != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_normalized_password) != 0); __pyx_t_8 = (!__pyx_t_7); if (__pyx_t_8) { /* "asyncpg/protocol/scram.pyx":294 * # password * if not normalized_password: * return original_password # <<<<<<<<<<<<<< * * # Step 2 of SASLPrep: Normalize. Normalize the password using the */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_original_password); __pyx_r = __pyx_v_original_password; goto __pyx_L0; /* "asyncpg/protocol/scram.pyx":293 * # If at this point the password is empty, PostgreSQL uses the original * # password * if not normalized_password: # <<<<<<<<<<<<<< * return original_password * */ } /* "asyncpg/protocol/scram.pyx":298 * # Step 2 of SASLPrep: Normalize. Normalize the password using the * # Unicode normalization algorithm to NFKC form * normalized_password = unicodedata.normalize('NFKC', normalized_password) # <<<<<<<<<<<<<< * * # If the password is not empty, PostgreSQL uses the original password */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_unicodedata); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_normalize); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_n_u_NFKC, __pyx_v_normalized_password}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(5, 298, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_normalized_password, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; /* "asyncpg/protocol/scram.pyx":301 * * # If the password is not empty, PostgreSQL uses the original password * if not normalized_password: # <<<<<<<<<<<<<< * return original_password * */ __pyx_t_8 = (__pyx_v_normalized_password != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_normalized_password) != 0); __pyx_t_7 = (!__pyx_t_8); if (__pyx_t_7) { /* "asyncpg/protocol/scram.pyx":302 * # If the password is not empty, PostgreSQL uses the original password * if not normalized_password: * return original_password # <<<<<<<<<<<<<< * * normalized_password_tuple = tuple(normalized_password) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_original_password); __pyx_r = __pyx_v_original_password; goto __pyx_L0; /* "asyncpg/protocol/scram.pyx":301 * * # If the password is not empty, PostgreSQL uses the original password * if not normalized_password: # <<<<<<<<<<<<<< * return original_password * */ } /* "asyncpg/protocol/scram.pyx":304 * return original_password * * normalized_password_tuple = tuple(normalized_password) # <<<<<<<<<<<<<< * * # Step 3 of SASLPrep: Prohobited characters. If PostgreSQL detects any */ __pyx_t_4 = PySequence_Tuple(__pyx_v_normalized_password); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_normalized_password_tuple = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/scram.pyx":311 * # We also include "unassigned code points" in the prohibited character * # category as PostgreSQL does the same * for c in normalized_password_tuple: # <<<<<<<<<<<<<< * if any( * in_prohibited_table(c) */ __pyx_t_4 = __pyx_v_normalized_password_tuple; __Pyx_INCREF(__pyx_t_4); __pyx_t_11 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 311, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_9); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(5, 311, __pyx_L1_error) #else __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/scram.pyx":314 * if any( * in_prohibited_table(c) * for in_prohibited_table in self.SASLPREP_PROHIBITED # <<<<<<<<<<<<<< * ): * return original_password */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_SASLPREP_PROHIBITED); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); /* "asyncpg/protocol/scram.pyx":313 * for c in normalized_password_tuple: * if any( * in_prohibited_table(c) # <<<<<<<<<<<<<< * for in_prohibited_table in self.SASLPREP_PROHIBITED * ): */ __pyx_t_6 = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_3genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_Generator_Next(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(5, 313, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/scram.pyx":312 * # category as PostgreSQL does the same * for c in normalized_password_tuple: * if any( # <<<<<<<<<<<<<< * in_prohibited_table(c) * for in_prohibited_table in self.SASLPREP_PROHIBITED */ if (__pyx_t_7) { /* "asyncpg/protocol/scram.pyx":316 * for in_prohibited_table in self.SASLPREP_PROHIBITED * ): * return original_password # <<<<<<<<<<<<<< * * # Step 4 of SASLPrep: Bi-directional characters. PostgreSQL follows the */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_original_password); __pyx_r = __pyx_v_original_password; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/protocol/scram.pyx":312 * # category as PostgreSQL does the same * for c in normalized_password_tuple: * if any( # <<<<<<<<<<<<<< * in_prohibited_table(c) * for in_prohibited_table in self.SASLPREP_PROHIBITED */ } /* "asyncpg/protocol/scram.pyx":311 * # We also include "unassigned code points" in the prohibited character * # category as PostgreSQL does the same * for c in normalized_password_tuple: # <<<<<<<<<<<<<< * if any( * in_prohibited_table(c) */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/scram.pyx":327 * # character must be the first and last character of the string * # RandALCat characters are found in table D.1, whereas LCat are in D.2 * if any(stringprep.in_table_d1(c) for c in normalized_password_tuple): # <<<<<<<<<<<<<< * # if the first character or the last character are not in D.1, * # return the original password */ __pyx_t_4 = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_6genexpr(NULL, __pyx_v_normalized_password_tuple); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_Generator_Next(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(5, 327, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_7) { /* "asyncpg/protocol/scram.pyx":330 * # if the first character or the last character are not in D.1, * # return the original password * if not (stringprep.in_table_d1(normalized_password_tuple[0]) and # <<<<<<<<<<<<<< * stringprep.in_table_d1(normalized_password_tuple[-1])): * return original_password */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_stringprep); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_in_table_d1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_normalized_password_tuple, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_12 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_4}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(5, 330, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; goto __pyx_L17_bool_binop_done; } /* "asyncpg/protocol/scram.pyx":331 * # return the original password * if not (stringprep.in_table_d1(normalized_password_tuple[0]) and * stringprep.in_table_d1(normalized_password_tuple[-1])): # <<<<<<<<<<<<<< * return original_password * */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_stringprep); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_in_table_d1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_normalized_password_tuple, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_12 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_6}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(5, 331, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_7 = __pyx_t_8; __pyx_L17_bool_binop_done:; /* "asyncpg/protocol/scram.pyx":330 * # if the first character or the last character are not in D.1, * # return the original password * if not (stringprep.in_table_d1(normalized_password_tuple[0]) and # <<<<<<<<<<<<<< * stringprep.in_table_d1(normalized_password_tuple[-1])): * return original_password */ __pyx_t_8 = (!__pyx_t_7); if (__pyx_t_8) { /* "asyncpg/protocol/scram.pyx":332 * if not (stringprep.in_table_d1(normalized_password_tuple[0]) and * stringprep.in_table_d1(normalized_password_tuple[-1])): * return original_password # <<<<<<<<<<<<<< * * # if any characters are in D.2, use the original password */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_original_password); __pyx_r = __pyx_v_original_password; goto __pyx_L0; /* "asyncpg/protocol/scram.pyx":330 * # if the first character or the last character are not in D.1, * # return the original password * if not (stringprep.in_table_d1(normalized_password_tuple[0]) and # <<<<<<<<<<<<<< * stringprep.in_table_d1(normalized_password_tuple[-1])): * return original_password */ } /* "asyncpg/protocol/scram.pyx":336 * # if any characters are in D.2, use the original password * if any( * stringprep.in_table_d2(c) for c in normalized_password_tuple # <<<<<<<<<<<<<< * ): * return original_password */ __pyx_t_9 = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_9genexpr(NULL, __pyx_v_normalized_password_tuple); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_4 = __Pyx_Generator_Next(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(5, 336, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/scram.pyx":335 * * # if any characters are in D.2, use the original password * if any( # <<<<<<<<<<<<<< * stringprep.in_table_d2(c) for c in normalized_password_tuple * ): */ if (__pyx_t_8) { /* "asyncpg/protocol/scram.pyx":338 * stringprep.in_table_d2(c) for c in normalized_password_tuple * ): * return original_password # <<<<<<<<<<<<<< * * # return the normalized password */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_original_password); __pyx_r = __pyx_v_original_password; goto __pyx_L0; /* "asyncpg/protocol/scram.pyx":335 * * # if any characters are in D.2, use the original password * if any( # <<<<<<<<<<<<<< * stringprep.in_table_d2(c) for c in normalized_password_tuple * ): */ } /* "asyncpg/protocol/scram.pyx":327 * # character must be the first and last character of the string * # RandALCat characters are found in table D.1, whereas LCat are in D.2 * if any(stringprep.in_table_d1(c) for c in normalized_password_tuple): # <<<<<<<<<<<<<< * # if the first character or the last character are not in D.1, * # return the original password */ } /* "asyncpg/protocol/scram.pyx":341 * * # return the normalized password * return normalized_password # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_normalized_password); __pyx_r = __pyx_v_normalized_password; goto __pyx_L0; /* "asyncpg/protocol/scram.pyx":256 * return u * * cdef _normalize_password(self, str original_password): # <<<<<<<<<<<<<< * """Normalize the password using the SASLprep from RFC4013""" * cdef: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication._normalize_password", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_normalized_password); __Pyx_XDECREF(__pyx_v_normalized_password_tuple); __Pyx_XDECREF(__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_2generator13); __Pyx_XDECREF(__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_5generator14); __Pyx_XDECREF(__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_8generator15); __Pyx_XDECREF(__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_11generator16); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/scram.pxd":10 * cdef class SCRAMAuthentication: * cdef: * readonly bytes authentication_method # <<<<<<<<<<<<<< * readonly bytes authorization_message * readonly bytes client_channel_binding */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authentication_method_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authentication_method_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authentication_method___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authentication_method___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->authentication_method); __pyx_r = __pyx_v_self->authentication_method; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/scram.pxd":11 * cdef: * readonly bytes authentication_method * readonly bytes authorization_message # <<<<<<<<<<<<<< * readonly bytes client_channel_binding * readonly bytes client_first_message_bare */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authorization_message_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authorization_message_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authorization_message___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authorization_message___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->authorization_message); __pyx_r = __pyx_v_self->authorization_message; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/scram.pxd":12 * readonly bytes authentication_method * readonly bytes authorization_message * readonly bytes client_channel_binding # <<<<<<<<<<<<<< * readonly bytes client_first_message_bare * readonly bytes client_nonce */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_22client_channel_binding_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_22client_channel_binding_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_22client_channel_binding___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_22client_channel_binding___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->client_channel_binding); __pyx_r = __pyx_v_self->client_channel_binding; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/scram.pxd":13 * readonly bytes authorization_message * readonly bytes client_channel_binding * readonly bytes client_first_message_bare # <<<<<<<<<<<<<< * readonly bytes client_nonce * readonly bytes client_proof */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_25client_first_message_bare_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_25client_first_message_bare_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_25client_first_message_bare___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_25client_first_message_bare___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->client_first_message_bare); __pyx_r = __pyx_v_self->client_first_message_bare; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/scram.pxd":14 * readonly bytes client_channel_binding * readonly bytes client_first_message_bare * readonly bytes client_nonce # <<<<<<<<<<<<<< * readonly bytes client_proof * readonly bytes password_salt */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_nonce_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_nonce_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_nonce___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_nonce___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->client_nonce); __pyx_r = __pyx_v_self->client_nonce; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/scram.pxd":15 * readonly bytes client_first_message_bare * readonly bytes client_nonce * readonly bytes client_proof # <<<<<<<<<<<<<< * readonly bytes password_salt * readonly int password_iterations */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_proof_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_proof_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_proof___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_proof___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->client_proof); __pyx_r = __pyx_v_self->client_proof; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/scram.pxd":16 * readonly bytes client_nonce * readonly bytes client_proof * readonly bytes password_salt # <<<<<<<<<<<<<< * readonly int password_iterations * readonly bytes server_first_message */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_13password_salt_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_13password_salt_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_13password_salt___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_13password_salt___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->password_salt); __pyx_r = __pyx_v_self->password_salt; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/scram.pxd":17 * readonly bytes client_proof * readonly bytes password_salt * readonly int password_iterations # <<<<<<<<<<<<<< * readonly bytes server_first_message * # server_key is an instance of hmac.HAMC */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19password_iterations_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19password_iterations_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19password_iterations___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19password_iterations___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->password_iterations); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.password_iterations.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/scram.pxd":18 * readonly bytes password_salt * readonly int password_iterations * readonly bytes server_first_message # <<<<<<<<<<<<<< * # server_key is an instance of hmac.HAMC * readonly object server_key */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_20server_first_message_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_20server_first_message_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_20server_first_message___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_20server_first_message___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->server_first_message); __pyx_r = __pyx_v_self->server_first_message; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/scram.pxd":20 * readonly bytes server_first_message * # server_key is an instance of hmac.HAMC * readonly object server_key # <<<<<<<<<<<<<< * readonly bytes server_nonce * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10server_key_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10server_key_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10server_key___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10server_key___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->server_key); __pyx_r = __pyx_v_self->server_key; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/scram.pxd":21 * # server_key is an instance of hmac.HAMC * readonly object server_key * readonly bytes server_nonce # <<<<<<<<<<<<<< * * cdef create_client_first_message(self, str username) */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12server_nonce_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12server_nonce_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12server_nonce___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12server_nonce___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->server_nonce); __pyx_r = __pyx_v_self->server_nonce; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_3__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_3__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_2__reduce_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(2, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_5__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_5__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_4__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(2, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":26 * cdef class CoreProtocol: * * def __init__(self, addr, con_params): # <<<<<<<<<<<<<< * self.address = addr * # type of `con_params` is `_ConnectionParameters` */ /* Python wrapper */ static int __pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_addr = 0; PyObject *__pyx_v_con_params = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_addr,&__pyx_n_s_con_params,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addr)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 26, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_con_params)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 26, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(6, 26, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(6, 26, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); } __pyx_v_addr = values[0]; __pyx_v_con_params = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(6, 26, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol___init__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self), __pyx_v_addr, __pyx_v_con_params); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol___init__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_addr, PyObject *__pyx_v_con_params) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "asyncpg/protocol/coreproto.pyx":27 * * def __init__(self, addr, con_params): * self.address = addr # <<<<<<<<<<<<<< * # type of `con_params` is `_ConnectionParameters` * self.buffer = ReadBuffer() */ __Pyx_INCREF(__pyx_v_addr); __Pyx_GIVEREF(__pyx_v_addr); __Pyx_GOTREF(__pyx_v_self->address); __Pyx_DECREF(__pyx_v_self->address); __pyx_v_self->address = __pyx_v_addr; /* "asyncpg/protocol/coreproto.pyx":29 * self.address = addr * # type of `con_params` is `_ConnectionParameters` * self.buffer = ReadBuffer() # <<<<<<<<<<<<<< * self.user = con_params.user * self.password = con_params.password */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF((PyObject *)__pyx_v_self->buffer); __Pyx_DECREF((PyObject *)__pyx_v_self->buffer); __pyx_v_self->buffer = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":30 * # type of `con_params` is `_ConnectionParameters` * self.buffer = ReadBuffer() * self.user = con_params.user # <<<<<<<<<<<<<< * self.password = con_params.password * self.auth_msg = None */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_con_params, __pyx_n_s_user); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_user, __pyx_t_1) < 0) __PYX_ERR(6, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":31 * self.buffer = ReadBuffer() * self.user = con_params.user * self.password = con_params.password # <<<<<<<<<<<<<< * self.auth_msg = None * self.con_params = con_params */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_con_params, __pyx_n_s_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_password, __pyx_t_1) < 0) __PYX_ERR(6, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":32 * self.user = con_params.user * self.password = con_params.password * self.auth_msg = None # <<<<<<<<<<<<<< * self.con_params = con_params * self.con_status = CONNECTION_BAD */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_auth_msg, Py_None) < 0) __PYX_ERR(6, 32, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":33 * self.password = con_params.password * self.auth_msg = None * self.con_params = con_params # <<<<<<<<<<<<<< * self.con_status = CONNECTION_BAD * self.state = PROTOCOL_IDLE */ __Pyx_INCREF(__pyx_v_con_params); __Pyx_GIVEREF(__pyx_v_con_params); __Pyx_GOTREF(__pyx_v_self->con_params); __Pyx_DECREF(__pyx_v_self->con_params); __pyx_v_self->con_params = __pyx_v_con_params; /* "asyncpg/protocol/coreproto.pyx":34 * self.auth_msg = None * self.con_params = con_params * self.con_status = CONNECTION_BAD # <<<<<<<<<<<<<< * self.state = PROTOCOL_IDLE * self.xact_status = PQTRANS_IDLE */ __pyx_v_self->con_status = __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_BAD; /* "asyncpg/protocol/coreproto.pyx":35 * self.con_params = con_params * self.con_status = CONNECTION_BAD * self.state = PROTOCOL_IDLE # <<<<<<<<<<<<<< * self.xact_status = PQTRANS_IDLE * self.encoding = 'utf-8' */ __pyx_v_self->state = __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_IDLE; /* "asyncpg/protocol/coreproto.pyx":36 * self.con_status = CONNECTION_BAD * self.state = PROTOCOL_IDLE * self.xact_status = PQTRANS_IDLE # <<<<<<<<<<<<<< * self.encoding = 'utf-8' * # type of `scram` is `SCRAMAuthentcation` */ __pyx_v_self->xact_status = __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_IDLE; /* "asyncpg/protocol/coreproto.pyx":37 * self.state = PROTOCOL_IDLE * self.xact_status = PQTRANS_IDLE * self.encoding = 'utf-8' # <<<<<<<<<<<<<< * # type of `scram` is `SCRAMAuthentcation` * self.scram = None */ __Pyx_INCREF(__pyx_kp_u_utf_8); __Pyx_GIVEREF(__pyx_kp_u_utf_8); __Pyx_GOTREF(__pyx_v_self->encoding); __Pyx_DECREF(__pyx_v_self->encoding); __pyx_v_self->encoding = __pyx_kp_u_utf_8; /* "asyncpg/protocol/coreproto.pyx":39 * self.encoding = 'utf-8' * # type of `scram` is `SCRAMAuthentcation` * self.scram = None # <<<<<<<<<<<<<< * # type of `gss_ctx` is `gssapi.SecurityContext` or * # `sspilib.SecurityContext` */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF((PyObject *)__pyx_v_self->scram); __Pyx_DECREF((PyObject *)__pyx_v_self->scram); __pyx_v_self->scram = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)Py_None); /* "asyncpg/protocol/coreproto.pyx":42 * # type of `gss_ctx` is `gssapi.SecurityContext` or * # `sspilib.SecurityContext` * self.gss_ctx = None # <<<<<<<<<<<<<< * * self._reset_result() */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->gss_ctx); __Pyx_DECREF(__pyx_v_self->gss_ctx); __pyx_v_self->gss_ctx = Py_None; /* "asyncpg/protocol/coreproto.pyx":44 * self.gss_ctx = None * * self._reset_result() # <<<<<<<<<<<<<< * * cpdef is_in_transaction(self): */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_reset_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":26 * cdef class CoreProtocol: * * def __init__(self, addr, con_params): # <<<<<<<<<<<<<< * self.address = addr * # type of `con_params` is `_ConnectionParameters` */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":46 * self._reset_result() * * cpdef is_in_transaction(self): # <<<<<<<<<<<<<< * # PQTRANS_INTRANS = idle, within transaction block * # PQTRANS_INERROR = idle, within failed transaction */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_3is_in_transaction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol_is_in_transaction(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_in_transaction", 1); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_in_transaction); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_3is_in_transaction)) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "asyncpg/protocol/coreproto.pyx":49 * # PQTRANS_INTRANS = idle, within transaction block * # PQTRANS_INERROR = idle, within failed transaction * return self.xact_status in (PQTRANS_INTRANS, PQTRANS_INERROR) # <<<<<<<<<<<<<< * * cdef _read_server_messages(self): */ __Pyx_XDECREF(__pyx_r); switch (__pyx_v_self->xact_status) { case __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_INTRANS: case __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_INERROR: __pyx_t_6 = 1; break; default: __pyx_t_6 = 0; break; } __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/coreproto.pyx":46 * self._reset_result() * * cpdef is_in_transaction(self): # <<<<<<<<<<<<<< * # PQTRANS_INTRANS = idle, within transaction block * # PQTRANS_INERROR = idle, within failed transaction */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol.is_in_transaction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_3is_in_transaction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12CoreProtocol_3is_in_transaction = {"is_in_transaction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_3is_in_transaction, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_3is_in_transaction(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_in_transaction (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_in_transaction", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_in_transaction", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_2is_in_transaction(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_2is_in_transaction(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_in_transaction", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol_is_in_transaction(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol.is_in_transaction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":51 * return self.xact_status in (PQTRANS_INTRANS, PQTRANS_INERROR) * * cdef _read_server_messages(self): # <<<<<<<<<<<<<< * cdef: * char mtype */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__read_server_messages(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { char __pyx_v_mtype; enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState __pyx_v_state; __pyx_t_7asyncpg_7pgproto_7pgproto_take_message_method __pyx_v_take_message; __pyx_t_7asyncpg_7pgproto_7pgproto_get_message_type_method __pyx_v_get_message_type; PyObject *__pyx_v_ex = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int32_t __pyx_t_2; int __pyx_t_3; char __pyx_t_4; enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; unsigned int __pyx_t_11; Py_ssize_t __pyx_t_12; Py_UCS4 __pyx_t_13; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; int __pyx_t_16; int __pyx_t_17; char const *__pyx_t_18; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; char const *__pyx_t_25; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_read_server_messages", 1); /* "asyncpg/protocol/coreproto.pyx":56 * ProtocolState state * pgproto.take_message_method take_message = \ * self.buffer.take_message # <<<<<<<<<<<<<< * pgproto.get_message_type_method get_message_type= \ * self.buffer.get_message_type */ __pyx_v_take_message = ((__pyx_t_7asyncpg_7pgproto_7pgproto_take_message_method)((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->take_message); /* "asyncpg/protocol/coreproto.pyx":58 * self.buffer.take_message * pgproto.get_message_type_method get_message_type= \ * self.buffer.get_message_type # <<<<<<<<<<<<<< * * while take_message(self.buffer) == 1: */ __pyx_v_get_message_type = ((__pyx_t_7asyncpg_7pgproto_7pgproto_get_message_type_method)__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_type); /* "asyncpg/protocol/coreproto.pyx":60 * self.buffer.get_message_type * * while take_message(self.buffer) == 1: # <<<<<<<<<<<<<< * mtype = get_message_type(self.buffer) * state = self.state */ while (1) { __pyx_t_1 = ((PyObject *)__pyx_v_self->buffer); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_v_take_message(__pyx_t_1); if (unlikely(__pyx_t_2 == ((int32_t)-1))) __PYX_ERR(6, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 == 1); if (!__pyx_t_3) break; /* "asyncpg/protocol/coreproto.pyx":61 * * while take_message(self.buffer) == 1: * mtype = get_message_type(self.buffer) # <<<<<<<<<<<<<< * state = self.state * */ __pyx_t_1 = ((PyObject *)__pyx_v_self->buffer); __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = __pyx_v_get_message_type(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_mtype = __pyx_t_4; /* "asyncpg/protocol/coreproto.pyx":62 * while take_message(self.buffer) == 1: * mtype = get_message_type(self.buffer) * state = self.state # <<<<<<<<<<<<<< * * try: */ __pyx_t_5 = __pyx_v_self->state; __pyx_v_state = __pyx_t_5; /* "asyncpg/protocol/coreproto.pyx":64 * state = self.state * * try: # <<<<<<<<<<<<<< * if mtype == b'S': * # ParameterStatus */ /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "asyncpg/protocol/coreproto.pyx":65 * * try: * if mtype == b'S': # <<<<<<<<<<<<<< * # ParameterStatus * self._parse_msg_parameter_status() */ __pyx_t_3 = (__pyx_v_mtype == 'S'); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":67 * if mtype == b'S': * # ParameterStatus * self._parse_msg_parameter_status() # <<<<<<<<<<<<<< * * elif mtype == b'A': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_parameter_status(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 67, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":65 * * try: * if mtype == b'S': # <<<<<<<<<<<<<< * # ParameterStatus * self._parse_msg_parameter_status() */ goto __pyx_L18; } /* "asyncpg/protocol/coreproto.pyx":69 * self._parse_msg_parameter_status() * * elif mtype == b'A': # <<<<<<<<<<<<<< * # NotificationResponse * self._parse_msg_notification() */ __pyx_t_3 = (__pyx_v_mtype == 'A'); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":71 * elif mtype == b'A': * # NotificationResponse * self._parse_msg_notification() # <<<<<<<<<<<<<< * * elif mtype == b'N': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_notification(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 71, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":69 * self._parse_msg_parameter_status() * * elif mtype == b'A': # <<<<<<<<<<<<<< * # NotificationResponse * self._parse_msg_notification() */ goto __pyx_L18; } /* "asyncpg/protocol/coreproto.pyx":73 * self._parse_msg_notification() * * elif mtype == b'N': # <<<<<<<<<<<<<< * # 'N' - NoticeResponse * self._on_notice(self._parse_msg_error_response(False)) */ __pyx_t_3 = (__pyx_v_mtype == 'N'); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":75 * elif mtype == b'N': * # 'N' - NoticeResponse * self._on_notice(self._parse_msg_error_response(False)) # <<<<<<<<<<<<<< * * elif state == PROTOCOL_AUTH: */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_False); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 75, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_on_notice(__pyx_v_self, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 75, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":73 * self._parse_msg_notification() * * elif mtype == b'N': # <<<<<<<<<<<<<< * # 'N' - NoticeResponse * self._on_notice(self._parse_msg_error_response(False)) */ goto __pyx_L18; } /* "asyncpg/protocol/coreproto.pyx":77 * self._on_notice(self._parse_msg_error_response(False)) * * elif state == PROTOCOL_AUTH: # <<<<<<<<<<<<<< * self._process__auth(mtype) * */ __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_AUTH); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":78 * * elif state == PROTOCOL_AUTH: * self._process__auth(mtype) # <<<<<<<<<<<<<< * * elif state == PROTOCOL_PREPARE: */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__auth(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 78, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":77 * self._on_notice(self._parse_msg_error_response(False)) * * elif state == PROTOCOL_AUTH: # <<<<<<<<<<<<<< * self._process__auth(mtype) * */ goto __pyx_L18; } /* "asyncpg/protocol/coreproto.pyx":80 * self._process__auth(mtype) * * elif state == PROTOCOL_PREPARE: # <<<<<<<<<<<<<< * self._process__prepare(mtype) * */ __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_PREPARE); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":81 * * elif state == PROTOCOL_PREPARE: * self._process__prepare(mtype) # <<<<<<<<<<<<<< * * elif state == PROTOCOL_BIND_EXECUTE: */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__prepare(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 81, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":80 * self._process__auth(mtype) * * elif state == PROTOCOL_PREPARE: # <<<<<<<<<<<<<< * self._process__prepare(mtype) * */ goto __pyx_L18; } /* "asyncpg/protocol/coreproto.pyx":83 * self._process__prepare(mtype) * * elif state == PROTOCOL_BIND_EXECUTE: # <<<<<<<<<<<<<< * self._process__bind_execute(mtype) * */ __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND_EXECUTE); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":84 * * elif state == PROTOCOL_BIND_EXECUTE: * self._process__bind_execute(mtype) # <<<<<<<<<<<<<< * * elif state == PROTOCOL_BIND_EXECUTE_MANY: */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__bind_execute(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 84, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":83 * self._process__prepare(mtype) * * elif state == PROTOCOL_BIND_EXECUTE: # <<<<<<<<<<<<<< * self._process__bind_execute(mtype) * */ goto __pyx_L18; } /* "asyncpg/protocol/coreproto.pyx":86 * self._process__bind_execute(mtype) * * elif state == PROTOCOL_BIND_EXECUTE_MANY: # <<<<<<<<<<<<<< * self._process__bind_execute_many(mtype) * */ __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND_EXECUTE_MANY); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":87 * * elif state == PROTOCOL_BIND_EXECUTE_MANY: * self._process__bind_execute_many(mtype) # <<<<<<<<<<<<<< * * elif state == PROTOCOL_EXECUTE: */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__bind_execute_many(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 87, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":86 * self._process__bind_execute(mtype) * * elif state == PROTOCOL_BIND_EXECUTE_MANY: # <<<<<<<<<<<<<< * self._process__bind_execute_many(mtype) * */ goto __pyx_L18; } /* "asyncpg/protocol/coreproto.pyx":89 * self._process__bind_execute_many(mtype) * * elif state == PROTOCOL_EXECUTE: # <<<<<<<<<<<<<< * self._process__bind_execute(mtype) * */ __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_EXECUTE); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":90 * * elif state == PROTOCOL_EXECUTE: * self._process__bind_execute(mtype) # <<<<<<<<<<<<<< * * elif state == PROTOCOL_BIND: */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__bind_execute(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 90, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":89 * self._process__bind_execute_many(mtype) * * elif state == PROTOCOL_EXECUTE: # <<<<<<<<<<<<<< * self._process__bind_execute(mtype) * */ goto __pyx_L18; } /* "asyncpg/protocol/coreproto.pyx":92 * self._process__bind_execute(mtype) * * elif state == PROTOCOL_BIND: # <<<<<<<<<<<<<< * self._process__bind(mtype) * */ __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":93 * * elif state == PROTOCOL_BIND: * self._process__bind(mtype) # <<<<<<<<<<<<<< * * elif state == PROTOCOL_CLOSE_STMT_PORTAL: */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__bind(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 93, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":92 * self._process__bind_execute(mtype) * * elif state == PROTOCOL_BIND: # <<<<<<<<<<<<<< * self._process__bind(mtype) * */ goto __pyx_L18; } /* "asyncpg/protocol/coreproto.pyx":95 * self._process__bind(mtype) * * elif state == PROTOCOL_CLOSE_STMT_PORTAL: # <<<<<<<<<<<<<< * self._process__close_stmt_portal(mtype) * */ __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CLOSE_STMT_PORTAL); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":96 * * elif state == PROTOCOL_CLOSE_STMT_PORTAL: * self._process__close_stmt_portal(mtype) # <<<<<<<<<<<<<< * * elif state == PROTOCOL_SIMPLE_QUERY: */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__close_stmt_portal(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 96, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":95 * self._process__bind(mtype) * * elif state == PROTOCOL_CLOSE_STMT_PORTAL: # <<<<<<<<<<<<<< * self._process__close_stmt_portal(mtype) * */ goto __pyx_L18; } /* "asyncpg/protocol/coreproto.pyx":98 * self._process__close_stmt_portal(mtype) * * elif state == PROTOCOL_SIMPLE_QUERY: # <<<<<<<<<<<<<< * self._process__simple_query(mtype) * */ __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_SIMPLE_QUERY); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":99 * * elif state == PROTOCOL_SIMPLE_QUERY: * self._process__simple_query(mtype) # <<<<<<<<<<<<<< * * elif state == PROTOCOL_COPY_OUT: */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__simple_query(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 99, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":98 * self._process__close_stmt_portal(mtype) * * elif state == PROTOCOL_SIMPLE_QUERY: # <<<<<<<<<<<<<< * self._process__simple_query(mtype) * */ goto __pyx_L18; } /* "asyncpg/protocol/coreproto.pyx":101 * self._process__simple_query(mtype) * * elif state == PROTOCOL_COPY_OUT: # <<<<<<<<<<<<<< * self._process__copy_out(mtype) * */ __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":102 * * elif state == PROTOCOL_COPY_OUT: * self._process__copy_out(mtype) # <<<<<<<<<<<<<< * * elif (state == PROTOCOL_COPY_OUT_DATA or */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__copy_out(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 102, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":101 * self._process__simple_query(mtype) * * elif state == PROTOCOL_COPY_OUT: # <<<<<<<<<<<<<< * self._process__copy_out(mtype) * */ goto __pyx_L18; } /* "asyncpg/protocol/coreproto.pyx":104 * self._process__copy_out(mtype) * * elif (state == PROTOCOL_COPY_OUT_DATA or # <<<<<<<<<<<<<< * state == PROTOCOL_COPY_OUT_DONE): * self._process__copy_out_data(mtype) */ switch (__pyx_v_state) { case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DATA: case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DONE: /* "asyncpg/protocol/coreproto.pyx":105 * * elif (state == PROTOCOL_COPY_OUT_DATA or * state == PROTOCOL_COPY_OUT_DONE): # <<<<<<<<<<<<<< * self._process__copy_out_data(mtype) * */ __pyx_t_3 = 1; /* "asyncpg/protocol/coreproto.pyx":104 * self._process__copy_out(mtype) * * elif (state == PROTOCOL_COPY_OUT_DATA or # <<<<<<<<<<<<<< * state == PROTOCOL_COPY_OUT_DONE): * self._process__copy_out_data(mtype) */ break; default: __pyx_t_3 = 0; break; } if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":106 * elif (state == PROTOCOL_COPY_OUT_DATA or * state == PROTOCOL_COPY_OUT_DONE): * self._process__copy_out_data(mtype) # <<<<<<<<<<<<<< * * elif state == PROTOCOL_COPY_IN: */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__copy_out_data(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 106, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":104 * self._process__copy_out(mtype) * * elif (state == PROTOCOL_COPY_OUT_DATA or # <<<<<<<<<<<<<< * state == PROTOCOL_COPY_OUT_DONE): * self._process__copy_out_data(mtype) */ goto __pyx_L18; } /* "asyncpg/protocol/coreproto.pyx":108 * self._process__copy_out_data(mtype) * * elif state == PROTOCOL_COPY_IN: # <<<<<<<<<<<<<< * self._process__copy_in(mtype) * */ __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":109 * * elif state == PROTOCOL_COPY_IN: * self._process__copy_in(mtype) # <<<<<<<<<<<<<< * * elif state == PROTOCOL_COPY_IN_DATA: */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__copy_in(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 109, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":108 * self._process__copy_out_data(mtype) * * elif state == PROTOCOL_COPY_IN: # <<<<<<<<<<<<<< * self._process__copy_in(mtype) * */ goto __pyx_L18; } /* "asyncpg/protocol/coreproto.pyx":111 * self._process__copy_in(mtype) * * elif state == PROTOCOL_COPY_IN_DATA: # <<<<<<<<<<<<<< * self._process__copy_in_data(mtype) * */ __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN_DATA); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":112 * * elif state == PROTOCOL_COPY_IN_DATA: * self._process__copy_in_data(mtype) # <<<<<<<<<<<<<< * * elif state == PROTOCOL_CANCELLED: */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__copy_in_data(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 112, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":111 * self._process__copy_in(mtype) * * elif state == PROTOCOL_COPY_IN_DATA: # <<<<<<<<<<<<<< * self._process__copy_in_data(mtype) * */ goto __pyx_L18; } /* "asyncpg/protocol/coreproto.pyx":114 * self._process__copy_in_data(mtype) * * elif state == PROTOCOL_CANCELLED: # <<<<<<<<<<<<<< * # discard all messages until the sync message * if mtype == b'E': */ __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CANCELLED); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":116 * elif state == PROTOCOL_CANCELLED: * # discard all messages until the sync message * if mtype == b'E': # <<<<<<<<<<<<<< * self._parse_msg_error_response(True) * elif mtype == b'Z': */ switch (__pyx_v_mtype) { case 'E': /* "asyncpg/protocol/coreproto.pyx":117 * # discard all messages until the sync message * if mtype == b'E': * self._parse_msg_error_response(True) # <<<<<<<<<<<<<< * elif mtype == b'Z': * self._parse_msg_ready_for_query() */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 117, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":116 * elif state == PROTOCOL_CANCELLED: * # discard all messages until the sync message * if mtype == b'E': # <<<<<<<<<<<<<< * self._parse_msg_error_response(True) * elif mtype == b'Z': */ break; case 'Z': /* "asyncpg/protocol/coreproto.pyx":119 * self._parse_msg_error_response(True) * elif mtype == b'Z': * self._parse_msg_ready_for_query() # <<<<<<<<<<<<<< * self._push_result() * else: */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 119, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":120 * elif mtype == b'Z': * self._parse_msg_ready_for_query() * self._push_result() # <<<<<<<<<<<<<< * else: * self.buffer.discard_message() */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 120, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":118 * if mtype == b'E': * self._parse_msg_error_response(True) * elif mtype == b'Z': # <<<<<<<<<<<<<< * self._parse_msg_ready_for_query() * self._push_result() */ break; default: /* "asyncpg/protocol/coreproto.pyx":122 * self._push_result() * else: * self.buffer.discard_message() # <<<<<<<<<<<<<< * * elif state == PROTOCOL_ERROR_CONSUME: */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 122, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; break; } /* "asyncpg/protocol/coreproto.pyx":114 * self._process__copy_in_data(mtype) * * elif state == PROTOCOL_CANCELLED: # <<<<<<<<<<<<<< * # discard all messages until the sync message * if mtype == b'E': */ goto __pyx_L18; } /* "asyncpg/protocol/coreproto.pyx":124 * self.buffer.discard_message() * * elif state == PROTOCOL_ERROR_CONSUME: # <<<<<<<<<<<<<< * # Error in protocol (on asyncpg side); * # discard all messages until sync message */ __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_ERROR_CONSUME); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":128 * # discard all messages until sync message * * if mtype == b'Z': # <<<<<<<<<<<<<< * # Sync point, self to push the result * if self.result_type != RESULT_FAILED: */ __pyx_t_3 = (__pyx_v_mtype == 'Z'); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":130 * if mtype == b'Z': * # Sync point, self to push the result * if self.result_type != RESULT_FAILED: # <<<<<<<<<<<<<< * self.result_type = RESULT_FAILED * self.result = apg_exc.InternalClientError( */ __pyx_t_3 = (__pyx_v_self->result_type != __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":131 * # Sync point, self to push the result * if self.result_type != RESULT_FAILED: * self.result_type = RESULT_FAILED # <<<<<<<<<<<<<< * self.result = apg_exc.InternalClientError( * 'unknown error in protocol implementation') */ __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED; /* "asyncpg/protocol/coreproto.pyx":132 * if self.result_type != RESULT_FAILED: * self.result_type = RESULT_FAILED * self.result = apg_exc.InternalClientError( # <<<<<<<<<<<<<< * 'unknown error in protocol implementation') * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 132, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 132, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_u_unknown_error_in_protocol_implem}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 132, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_GIVEREF(__pyx_t_9); __Pyx_GOTREF(__pyx_v_self->result); __Pyx_DECREF(__pyx_v_self->result); __pyx_v_self->result = __pyx_t_9; __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":130 * if mtype == b'Z': * # Sync point, self to push the result * if self.result_type != RESULT_FAILED: # <<<<<<<<<<<<<< * self.result_type = RESULT_FAILED * self.result = apg_exc.InternalClientError( */ } /* "asyncpg/protocol/coreproto.pyx":135 * 'unknown error in protocol implementation') * * self._parse_msg_ready_for_query() # <<<<<<<<<<<<<< * self._push_result() * */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 135, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":136 * * self._parse_msg_ready_for_query() * self._push_result() # <<<<<<<<<<<<<< * * else: */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 136, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":128 * # discard all messages until sync message * * if mtype == b'Z': # <<<<<<<<<<<<<< * # Sync point, self to push the result * if self.result_type != RESULT_FAILED: */ goto __pyx_L19; } /* "asyncpg/protocol/coreproto.pyx":139 * * else: * self.buffer.discard_message() # <<<<<<<<<<<<<< * * elif state == PROTOCOL_TERMINATING: */ /*else*/ { __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 139, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_L19:; /* "asyncpg/protocol/coreproto.pyx":124 * self.buffer.discard_message() * * elif state == PROTOCOL_ERROR_CONSUME: # <<<<<<<<<<<<<< * # Error in protocol (on asyncpg side); * # discard all messages until sync message */ goto __pyx_L18; } /* "asyncpg/protocol/coreproto.pyx":141 * self.buffer.discard_message() * * elif state == PROTOCOL_TERMINATING: # <<<<<<<<<<<<<< * # The connection is being terminated. * # discard all messages until connection */ __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_TERMINATING); if (likely(__pyx_t_3)) { /* "asyncpg/protocol/coreproto.pyx":145 * # discard all messages until connection * # termination. * self.buffer.discard_message() # <<<<<<<<<<<<<< * * else: */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 145, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":141 * self.buffer.discard_message() * * elif state == PROTOCOL_TERMINATING: # <<<<<<<<<<<<<< * # The connection is being terminated. * # discard all messages until connection */ goto __pyx_L18; } /* "asyncpg/protocol/coreproto.pyx":148 * * else: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * f'cannot process message {chr(mtype)!r}: ' * f'protocol is in an unexpected state {state!r}.') */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 148, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 148, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/coreproto.pyx":149 * else: * raise apg_exc.InternalClientError( * f'cannot process message {chr(mtype)!r}: ' # <<<<<<<<<<<<<< * f'protocol is in an unexpected state {state!r}.') * */ __pyx_t_10 = PyTuple_New(5); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 149, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = 0; __pyx_t_13 = 127; __Pyx_INCREF(__pyx_kp_u_cannot_process_message); __pyx_t_12 += 23; __Pyx_GIVEREF(__pyx_kp_u_cannot_process_message); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_kp_u_cannot_process_message); __pyx_t_14 = __Pyx_PyInt_From_char(__pyx_v_mtype); if (unlikely(!__pyx_t_14)) __PYX_ERR(6, 149, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(6, 149, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_15), __pyx_empty_unicode); if (unlikely(!__pyx_t_14)) __PYX_ERR(6, 149, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_14) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_14) : __pyx_t_13; __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_14); __pyx_t_14 = 0; __Pyx_INCREF(__pyx_kp_u_protocol_is_in_an_unexpected_st); __pyx_t_12 += 37; __Pyx_GIVEREF(__pyx_kp_u_protocol_is_in_an_unexpected_st); PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_kp_u_protocol_is_in_an_unexpected_st); /* "asyncpg/protocol/coreproto.pyx":150 * raise apg_exc.InternalClientError( * f'cannot process message {chr(mtype)!r}: ' * f'protocol is in an unexpected state {state!r}.') # <<<<<<<<<<<<<< * * except Exception as ex: */ __pyx_t_14 = __Pyx_PyUnicode_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_state, 0, ' ', 'd'); if (unlikely(!__pyx_t_14)) __PYX_ERR(6, 150, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_14) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_14) : __pyx_t_13; __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_14); __pyx_t_14 = 0; __Pyx_INCREF(__pyx_kp_u__35); __pyx_t_12 += 1; __Pyx_GIVEREF(__pyx_kp_u__35); PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_kp_u__35); /* "asyncpg/protocol/coreproto.pyx":149 * else: * raise apg_exc.InternalClientError( * f'cannot process message {chr(mtype)!r}: ' # <<<<<<<<<<<<<< * f'protocol is in an unexpected state {state!r}.') * */ __pyx_t_14 = __Pyx_PyUnicode_Join(__pyx_t_10, 5, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(6, 149, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_14}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 148, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(6, 148, __pyx_L10_error) } __pyx_L18:; /* "asyncpg/protocol/coreproto.pyx":64 * state = self.state * * try: # <<<<<<<<<<<<<< * if mtype == b'S': * # ParameterStatus */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L17_try_end; __pyx_L10_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":152 * f'protocol is in an unexpected state {state!r}.') * * except Exception as ex: # <<<<<<<<<<<<<< * self.result_type = RESULT_FAILED * self.result = ex */ __pyx_t_16 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_16) { __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._read_server_messages", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_1, &__pyx_t_14) < 0) __PYX_ERR(6, 152, __pyx_L12_except_error) __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_t_1); __pyx_v_ex = __pyx_t_1; /*try:*/ { /* "asyncpg/protocol/coreproto.pyx":153 * * except Exception as ex: * self.result_type = RESULT_FAILED # <<<<<<<<<<<<<< * self.result = ex * */ __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED; /* "asyncpg/protocol/coreproto.pyx":154 * except Exception as ex: * self.result_type = RESULT_FAILED * self.result = ex # <<<<<<<<<<<<<< * * if mtype == b'Z': */ __Pyx_INCREF(__pyx_v_ex); __Pyx_GIVEREF(__pyx_v_ex); __Pyx_GOTREF(__pyx_v_self->result); __Pyx_DECREF(__pyx_v_self->result); __pyx_v_self->result = __pyx_v_ex; /* "asyncpg/protocol/coreproto.pyx":156 * self.result = ex * * if mtype == b'Z': # <<<<<<<<<<<<<< * self._push_result() * else: */ __pyx_t_3 = (__pyx_v_mtype == 'Z'); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":157 * * if mtype == b'Z': * self._push_result() # <<<<<<<<<<<<<< * else: * self.state = PROTOCOL_ERROR_CONSUME */ __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 157, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/coreproto.pyx":156 * self.result = ex * * if mtype == b'Z': # <<<<<<<<<<<<<< * self._push_result() * else: */ goto __pyx_L28; } /* "asyncpg/protocol/coreproto.pyx":159 * self._push_result() * else: * self.state = PROTOCOL_ERROR_CONSUME # <<<<<<<<<<<<<< * * finally: */ /*else*/ { __pyx_v_self->state = __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_ERROR_CONSUME; } __pyx_L28:; } /* "asyncpg/protocol/coreproto.pyx":152 * f'protocol is in an unexpected state {state!r}.') * * except Exception as ex: # <<<<<<<<<<<<<< * self.result_type = RESULT_FAILED * self.result = ex */ /*finally:*/ { /*normal exit:*/{ __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = 0; goto __pyx_L27; } __pyx_L26_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __pyx_t_16 = __pyx_lineno; __pyx_t_17 = __pyx_clineno; __pyx_t_18 = __pyx_filename; { __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24); } __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ErrRestore(__pyx_t_19, __pyx_t_20, __pyx_t_21); __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_lineno = __pyx_t_16; __pyx_clineno = __pyx_t_17; __pyx_filename = __pyx_t_18; goto __pyx_L12_except_error; } __pyx_L27:; } __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L11_exception_handled; } goto __pyx_L12_except_error; /* "asyncpg/protocol/coreproto.pyx":64 * state = self.state * * try: # <<<<<<<<<<<<<< * if mtype == b'S': * # ParameterStatus */ __pyx_L12_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L8_error; __pyx_L11_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L17_try_end:; } } /* "asyncpg/protocol/coreproto.pyx":162 * * finally: * self.buffer.finish_message() # <<<<<<<<<<<<<< * * cdef _process__auth(self, char mtype): */ /*finally:*/ { /*normal exit:*/{ __pyx_t_14 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_14)) __PYX_ERR(6, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L9; } __pyx_L8_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_22); __pyx_t_17 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_25 = __pyx_filename; { __pyx_t_14 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_14)) __PYX_ERR(6, 162, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_23, __pyx_t_22); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_7, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_lineno = __pyx_t_17; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_25; goto __pyx_L1_error; __pyx_L36_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_23, __pyx_t_22); } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; goto __pyx_L1_error; } __pyx_L9:; } } /* "asyncpg/protocol/coreproto.pyx":51 * return self.xact_status in (PQTRANS_INTRANS, PQTRANS_INERROR) * * cdef _read_server_messages(self): # <<<<<<<<<<<<<< * cdef: * char mtype */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._read_server_messages", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ex); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":164 * self.buffer.finish_message() * * cdef _process__auth(self, char mtype): # <<<<<<<<<<<<<< * if mtype == b'R': * # Authentication... */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__auth(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype) { PyObject *__pyx_v_ex = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; unsigned int __pyx_t_13; int __pyx_t_14; char const *__pyx_t_15; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_process__auth", 1); /* "asyncpg/protocol/coreproto.pyx":165 * * cdef _process__auth(self, char mtype): * if mtype == b'R': # <<<<<<<<<<<<<< * # Authentication... * try: */ switch (__pyx_v_mtype) { case 'R': /* "asyncpg/protocol/coreproto.pyx":167 * if mtype == b'R': * # Authentication... * try: # <<<<<<<<<<<<<< * self._parse_msg_authentication() * except Exception as ex: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "asyncpg/protocol/coreproto.pyx":168 * # Authentication... * try: * self._parse_msg_authentication() # <<<<<<<<<<<<<< * except Exception as ex: * # Exception in authentication parsing code */ __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_authentication(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 168, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":167 * if mtype == b'R': * # Authentication... * try: # <<<<<<<<<<<<<< * self._parse_msg_authentication() * except Exception as ex: */ } /* "asyncpg/protocol/coreproto.pyx":181 * self._push_result() * else: * if self.result_type != RESULT_OK: # <<<<<<<<<<<<<< * self.con_status = CONNECTION_BAD * self._push_result() */ /*else:*/ { __pyx_t_5 = (__pyx_v_self->result_type != __pyx_e_7asyncpg_8protocol_8protocol_RESULT_OK); if (__pyx_t_5) { /* "asyncpg/protocol/coreproto.pyx":182 * else: * if self.result_type != RESULT_OK: * self.con_status = CONNECTION_BAD # <<<<<<<<<<<<<< * self._push_result() * */ __pyx_v_self->con_status = __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_BAD; /* "asyncpg/protocol/coreproto.pyx":183 * if self.result_type != RESULT_OK: * self.con_status = CONNECTION_BAD * self._push_result() # <<<<<<<<<<<<<< * * elif self.auth_msg is not None: */ __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 183, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":181 * self._push_result() * else: * if self.result_type != RESULT_OK: # <<<<<<<<<<<<<< * self.con_status = CONNECTION_BAD * self._push_result() */ goto __pyx_L9; } /* "asyncpg/protocol/coreproto.pyx":185 * self._push_result() * * elif self.auth_msg is not None: # <<<<<<<<<<<<<< * # Server wants us to send auth data, so do that. * self._write(self.auth_msg) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_auth_msg); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 185, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = (__pyx_t_4 != Py_None); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { /* "asyncpg/protocol/coreproto.pyx":187 * elif self.auth_msg is not None: * # Server wants us to send auth data, so do that. * self._write(self.auth_msg) # <<<<<<<<<<<<<< * self.auth_msg = None * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_auth_msg); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 187, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 187, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/coreproto.pyx":188 * # Server wants us to send auth data, so do that. * self._write(self.auth_msg) * self.auth_msg = None # <<<<<<<<<<<<<< * * elif mtype == b'K': */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_auth_msg, Py_None) < 0) __PYX_ERR(6, 188, __pyx_L5_except_error) /* "asyncpg/protocol/coreproto.pyx":185 * self._push_result() * * elif self.auth_msg is not None: # <<<<<<<<<<<<<< * # Server wants us to send auth data, so do that. * self._write(self.auth_msg) */ } __pyx_L9:; } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":169 * try: * self._parse_msg_authentication() * except Exception as ex: # <<<<<<<<<<<<<< * # Exception in authentication parsing code * # is usually either malformed authentication data */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_7) { __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__auth", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_8) < 0) __PYX_ERR(6, 169, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_v_ex = __pyx_t_4; /*try:*/ { /* "asyncpg/protocol/coreproto.pyx":174 * # or missing support for cryptographic primitives * # in the hashlib module. * self.result_type = RESULT_FAILED # <<<<<<<<<<<<<< * self.result = apg_exc.InternalClientError( * f"unexpected error while performing authentication: {ex}") */ __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED; /* "asyncpg/protocol/coreproto.pyx":175 * # in the hashlib module. * self.result_type = RESULT_FAILED * self.result = apg_exc.InternalClientError( # <<<<<<<<<<<<<< * f"unexpected error while performing authentication: {ex}") * self.result.__cause__ = ex */ __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 175, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 175, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/coreproto.pyx":176 * self.result_type = RESULT_FAILED * self.result = apg_exc.InternalClientError( * f"unexpected error while performing authentication: {ex}") # <<<<<<<<<<<<<< * self.result.__cause__ = ex * self.con_status = CONNECTION_BAD */ __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_ex, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 176, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_kp_u_unexpected_error_while_performin, __pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 176, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; __pyx_t_13 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_11))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_13 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_12}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 175, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } /* "asyncpg/protocol/coreproto.pyx":175 * # in the hashlib module. * self.result_type = RESULT_FAILED * self.result = apg_exc.InternalClientError( # <<<<<<<<<<<<<< * f"unexpected error while performing authentication: {ex}") * self.result.__cause__ = ex */ __Pyx_GIVEREF(__pyx_t_9); __Pyx_GOTREF(__pyx_v_self->result); __Pyx_DECREF(__pyx_v_self->result); __pyx_v_self->result = __pyx_t_9; __pyx_t_9 = 0; /* "asyncpg/protocol/coreproto.pyx":177 * self.result = apg_exc.InternalClientError( * f"unexpected error while performing authentication: {ex}") * self.result.__cause__ = ex # <<<<<<<<<<<<<< * self.con_status = CONNECTION_BAD * self._push_result() */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->result, __pyx_n_s_cause, __pyx_v_ex) < 0) __PYX_ERR(6, 177, __pyx_L15_error) /* "asyncpg/protocol/coreproto.pyx":178 * f"unexpected error while performing authentication: {ex}") * self.result.__cause__ = ex * self.con_status = CONNECTION_BAD # <<<<<<<<<<<<<< * self._push_result() * else: */ __pyx_v_self->con_status = __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_BAD; /* "asyncpg/protocol/coreproto.pyx":179 * self.result.__cause__ = ex * self.con_status = CONNECTION_BAD * self._push_result() # <<<<<<<<<<<<<< * else: * if self.result_type != RESULT_OK: */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 179, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } /* "asyncpg/protocol/coreproto.pyx":169 * try: * self._parse_msg_authentication() * except Exception as ex: # <<<<<<<<<<<<<< * # Exception in authentication parsing code * # is usually either malformed authentication data */ /*finally:*/ { /*normal exit:*/{ __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = 0; goto __pyx_L16; } __pyx_L15_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __pyx_t_7 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename; { __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); } __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18); __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15; goto __pyx_L5_except_error; } __pyx_L16:; } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; /* "asyncpg/protocol/coreproto.pyx":167 * if mtype == b'R': * # Authentication... * try: # <<<<<<<<<<<<<< * self._parse_msg_authentication() * except Exception as ex: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L8_try_end:; } /* "asyncpg/protocol/coreproto.pyx":165 * * cdef _process__auth(self, char mtype): * if mtype == b'R': # <<<<<<<<<<<<<< * # Authentication... * try: */ break; case 'K': /* "asyncpg/protocol/coreproto.pyx":192 * elif mtype == b'K': * # BackendKeyData * self._parse_msg_backend_key_data() # <<<<<<<<<<<<<< * * elif mtype == b'E': */ __pyx_t_8 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_backend_key_data(__pyx_v_self); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":190 * self.auth_msg = None * * elif mtype == b'K': # <<<<<<<<<<<<<< * # BackendKeyData * self._parse_msg_backend_key_data() */ break; case 'E': /* "asyncpg/protocol/coreproto.pyx":196 * elif mtype == b'E': * # ErrorResponse * self.con_status = CONNECTION_BAD # <<<<<<<<<<<<<< * self._parse_msg_error_response(True) * self._push_result() */ __pyx_v_self->con_status = __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_BAD; /* "asyncpg/protocol/coreproto.pyx":197 * # ErrorResponse * self.con_status = CONNECTION_BAD * self._parse_msg_error_response(True) # <<<<<<<<<<<<<< * self._push_result() * */ __pyx_t_8 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":198 * self.con_status = CONNECTION_BAD * self._parse_msg_error_response(True) * self._push_result() # <<<<<<<<<<<<<< * * elif mtype == b'Z': */ __pyx_t_8 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":194 * self._parse_msg_backend_key_data() * * elif mtype == b'E': # <<<<<<<<<<<<<< * # ErrorResponse * self.con_status = CONNECTION_BAD */ break; case 'Z': /* "asyncpg/protocol/coreproto.pyx":202 * elif mtype == b'Z': * # ReadyForQuery * self._parse_msg_ready_for_query() # <<<<<<<<<<<<<< * self.con_status = CONNECTION_OK * self._push_result() */ __pyx_t_8 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":203 * # ReadyForQuery * self._parse_msg_ready_for_query() * self.con_status = CONNECTION_OK # <<<<<<<<<<<<<< * self._push_result() * */ __pyx_v_self->con_status = __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_OK; /* "asyncpg/protocol/coreproto.pyx":204 * self._parse_msg_ready_for_query() * self.con_status = CONNECTION_OK * self._push_result() # <<<<<<<<<<<<<< * * cdef _process__prepare(self, char mtype): */ __pyx_t_8 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":200 * self._push_result() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ break; default: break; } /* "asyncpg/protocol/coreproto.pyx":164 * self.buffer.finish_message() * * cdef _process__auth(self, char mtype): # <<<<<<<<<<<<<< * if mtype == b'R': * # Authentication... */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__auth", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ex); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":206 * self._push_result() * * cdef _process__prepare(self, char mtype): # <<<<<<<<<<<<<< * if mtype == b't': * # Parameters description */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__prepare(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_process__prepare", 1); /* "asyncpg/protocol/coreproto.pyx":207 * * cdef _process__prepare(self, char mtype): * if mtype == b't': # <<<<<<<<<<<<<< * # Parameters description * self.result_param_desc = self.buffer.consume_message() */ switch (__pyx_v_mtype) { case 't': /* "asyncpg/protocol/coreproto.pyx":209 * if mtype == b't': * # Parameters description * self.result_param_desc = self.buffer.consume_message() # <<<<<<<<<<<<<< * * elif mtype == b'1': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->consume_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->result_param_desc); __Pyx_DECREF(__pyx_v_self->result_param_desc); __pyx_v_self->result_param_desc = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":207 * * cdef _process__prepare(self, char mtype): * if mtype == b't': # <<<<<<<<<<<<<< * # Parameters description * self.result_param_desc = self.buffer.consume_message() */ break; case '1': /* "asyncpg/protocol/coreproto.pyx":213 * elif mtype == b'1': * # ParseComplete * self.buffer.discard_message() # <<<<<<<<<<<<<< * * elif mtype == b'T': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":211 * self.result_param_desc = self.buffer.consume_message() * * elif mtype == b'1': # <<<<<<<<<<<<<< * # ParseComplete * self.buffer.discard_message() */ break; case 'T': /* "asyncpg/protocol/coreproto.pyx":217 * elif mtype == b'T': * # Row description * self.result_row_desc = self.buffer.consume_message() # <<<<<<<<<<<<<< * self._push_result() * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->consume_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->result_row_desc); __Pyx_DECREF(__pyx_v_self->result_row_desc); __pyx_v_self->result_row_desc = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":218 * # Row description * self.result_row_desc = self.buffer.consume_message() * self._push_result() # <<<<<<<<<<<<<< * * elif mtype == b'E': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":215 * self.buffer.discard_message() * * elif mtype == b'T': # <<<<<<<<<<<<<< * # Row description * self.result_row_desc = self.buffer.consume_message() */ break; case 'E': /* "asyncpg/protocol/coreproto.pyx":222 * elif mtype == b'E': * # ErrorResponse * self._parse_msg_error_response(True) # <<<<<<<<<<<<<< * # we don't send a sync during the parse/describe sequence * # but send a FLUSH instead. If an error happens we need to */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":228 * # this effectively clears the error and we then wait until we get a * # ready for new query message * self._write(SYNC_MESSAGE) # <<<<<<<<<<<<<< * self.state = PROTOCOL_ERROR_CONSUME * */ __pyx_t_1 = __pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":229 * # ready for new query message * self._write(SYNC_MESSAGE) * self.state = PROTOCOL_ERROR_CONSUME # <<<<<<<<<<<<<< * * elif mtype == b'n': */ __pyx_v_self->state = __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_ERROR_CONSUME; /* "asyncpg/protocol/coreproto.pyx":220 * self._push_result() * * elif mtype == b'E': # <<<<<<<<<<<<<< * # ErrorResponse * self._parse_msg_error_response(True) */ break; case 'n': /* "asyncpg/protocol/coreproto.pyx":233 * elif mtype == b'n': * # NoData * self.buffer.discard_message() # <<<<<<<<<<<<<< * self._push_result() * */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":234 * # NoData * self.buffer.discard_message() * self._push_result() # <<<<<<<<<<<<<< * * cdef _process__bind_execute(self, char mtype): */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":231 * self.state = PROTOCOL_ERROR_CONSUME * * elif mtype == b'n': # <<<<<<<<<<<<<< * # NoData * self.buffer.discard_message() */ break; default: break; } /* "asyncpg/protocol/coreproto.pyx":206 * self._push_result() * * cdef _process__prepare(self, char mtype): # <<<<<<<<<<<<<< * if mtype == b't': * # Parameters description */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__prepare", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":236 * self._push_result() * * cdef _process__bind_execute(self, char mtype): # <<<<<<<<<<<<<< * if mtype == b'D': * # DataRow */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__bind_execute(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_process__bind_execute", 1); /* "asyncpg/protocol/coreproto.pyx":237 * * cdef _process__bind_execute(self, char mtype): * if mtype == b'D': # <<<<<<<<<<<<<< * # DataRow * self._parse_data_msgs() */ switch (__pyx_v_mtype) { case 'D': /* "asyncpg/protocol/coreproto.pyx":239 * if mtype == b'D': * # DataRow * self._parse_data_msgs() # <<<<<<<<<<<<<< * * elif mtype == b's': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_data_msgs(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":237 * * cdef _process__bind_execute(self, char mtype): * if mtype == b'D': # <<<<<<<<<<<<<< * # DataRow * self._parse_data_msgs() */ break; case 's': /* "asyncpg/protocol/coreproto.pyx":243 * elif mtype == b's': * # PortalSuspended * self.buffer.discard_message() # <<<<<<<<<<<<<< * * elif mtype == b'C': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":241 * self._parse_data_msgs() * * elif mtype == b's': # <<<<<<<<<<<<<< * # PortalSuspended * self.buffer.discard_message() */ break; case 'C': /* "asyncpg/protocol/coreproto.pyx":247 * elif mtype == b'C': * # CommandComplete * self.result_execute_completed = True # <<<<<<<<<<<<<< * self._parse_msg_command_complete() * */ __pyx_v_self->result_execute_completed = 1; /* "asyncpg/protocol/coreproto.pyx":248 * # CommandComplete * self.result_execute_completed = True * self._parse_msg_command_complete() # <<<<<<<<<<<<<< * * elif mtype == b'E': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_command_complete(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":245 * self.buffer.discard_message() * * elif mtype == b'C': # <<<<<<<<<<<<<< * # CommandComplete * self.result_execute_completed = True */ break; case 'E': /* "asyncpg/protocol/coreproto.pyx":252 * elif mtype == b'E': * # ErrorResponse * self._parse_msg_error_response(True) # <<<<<<<<<<<<<< * * elif mtype == b'1': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":250 * self._parse_msg_command_complete() * * elif mtype == b'E': # <<<<<<<<<<<<<< * # ErrorResponse * self._parse_msg_error_response(True) */ break; case '1': /* "asyncpg/protocol/coreproto.pyx":256 * elif mtype == b'1': * # ParseComplete, in case `_bind_execute()` is reparsing * self.buffer.discard_message() # <<<<<<<<<<<<<< * * elif mtype == b'2': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":254 * self._parse_msg_error_response(True) * * elif mtype == b'1': # <<<<<<<<<<<<<< * # ParseComplete, in case `_bind_execute()` is reparsing * self.buffer.discard_message() */ break; case '2': /* "asyncpg/protocol/coreproto.pyx":260 * elif mtype == b'2': * # BindComplete * self.buffer.discard_message() # <<<<<<<<<<<<<< * * elif mtype == b'Z': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":258 * self.buffer.discard_message() * * elif mtype == b'2': # <<<<<<<<<<<<<< * # BindComplete * self.buffer.discard_message() */ break; case 'Z': /* "asyncpg/protocol/coreproto.pyx":264 * elif mtype == b'Z': * # ReadyForQuery * self._parse_msg_ready_for_query() # <<<<<<<<<<<<<< * self._push_result() * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":265 * # ReadyForQuery * self._parse_msg_ready_for_query() * self._push_result() # <<<<<<<<<<<<<< * * elif mtype == b'I': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":262 * self.buffer.discard_message() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ break; case 'I': /* "asyncpg/protocol/coreproto.pyx":269 * elif mtype == b'I': * # EmptyQueryResponse * self.buffer.discard_message() # <<<<<<<<<<<<<< * * cdef _process__bind_execute_many(self, char mtype): */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":267 * self._push_result() * * elif mtype == b'I': # <<<<<<<<<<<<<< * # EmptyQueryResponse * self.buffer.discard_message() */ break; default: break; } /* "asyncpg/protocol/coreproto.pyx":236 * self._push_result() * * cdef _process__bind_execute(self, char mtype): # <<<<<<<<<<<<<< * if mtype == b'D': * # DataRow */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__bind_execute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":271 * self.buffer.discard_message() * * cdef _process__bind_execute_many(self, char mtype): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__bind_execute_many(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_process__bind_execute_many", 1); /* "asyncpg/protocol/coreproto.pyx":274 * cdef WriteBuffer buf * * if mtype == b'D': # <<<<<<<<<<<<<< * # DataRow * self._parse_data_msgs() */ __pyx_t_1 = (__pyx_v_mtype == 'D'); if (__pyx_t_1) { /* "asyncpg/protocol/coreproto.pyx":276 * if mtype == b'D': * # DataRow * self._parse_data_msgs() # <<<<<<<<<<<<<< * * elif mtype == b's': */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_data_msgs(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":274 * cdef WriteBuffer buf * * if mtype == b'D': # <<<<<<<<<<<<<< * # DataRow * self._parse_data_msgs() */ goto __pyx_L3; } /* "asyncpg/protocol/coreproto.pyx":278 * self._parse_data_msgs() * * elif mtype == b's': # <<<<<<<<<<<<<< * # PortalSuspended * self.buffer.discard_message() */ __pyx_t_1 = (__pyx_v_mtype == 's'); if (__pyx_t_1) { /* "asyncpg/protocol/coreproto.pyx":280 * elif mtype == b's': * # PortalSuspended * self.buffer.discard_message() # <<<<<<<<<<<<<< * * elif mtype == b'C': */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":278 * self._parse_data_msgs() * * elif mtype == b's': # <<<<<<<<<<<<<< * # PortalSuspended * self.buffer.discard_message() */ goto __pyx_L3; } /* "asyncpg/protocol/coreproto.pyx":282 * self.buffer.discard_message() * * elif mtype == b'C': # <<<<<<<<<<<<<< * # CommandComplete * self._parse_msg_command_complete() */ __pyx_t_1 = (__pyx_v_mtype == 'C'); if (__pyx_t_1) { /* "asyncpg/protocol/coreproto.pyx":284 * elif mtype == b'C': * # CommandComplete * self._parse_msg_command_complete() # <<<<<<<<<<<<<< * * elif mtype == b'E': */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_command_complete(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":282 * self.buffer.discard_message() * * elif mtype == b'C': # <<<<<<<<<<<<<< * # CommandComplete * self._parse_msg_command_complete() */ goto __pyx_L3; } /* "asyncpg/protocol/coreproto.pyx":286 * self._parse_msg_command_complete() * * elif mtype == b'E': # <<<<<<<<<<<<<< * # ErrorResponse * self._parse_msg_error_response(True) */ __pyx_t_1 = (__pyx_v_mtype == 'E'); if (__pyx_t_1) { /* "asyncpg/protocol/coreproto.pyx":288 * elif mtype == b'E': * # ErrorResponse * self._parse_msg_error_response(True) # <<<<<<<<<<<<<< * * elif mtype == b'1': */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":286 * self._parse_msg_command_complete() * * elif mtype == b'E': # <<<<<<<<<<<<<< * # ErrorResponse * self._parse_msg_error_response(True) */ goto __pyx_L3; } /* "asyncpg/protocol/coreproto.pyx":290 * self._parse_msg_error_response(True) * * elif mtype == b'1': # <<<<<<<<<<<<<< * # ParseComplete, in case `_bind_execute_many()` is reparsing * self.buffer.discard_message() */ __pyx_t_1 = (__pyx_v_mtype == '1'); if (__pyx_t_1) { /* "asyncpg/protocol/coreproto.pyx":292 * elif mtype == b'1': * # ParseComplete, in case `_bind_execute_many()` is reparsing * self.buffer.discard_message() # <<<<<<<<<<<<<< * * elif mtype == b'2': */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":290 * self._parse_msg_error_response(True) * * elif mtype == b'1': # <<<<<<<<<<<<<< * # ParseComplete, in case `_bind_execute_many()` is reparsing * self.buffer.discard_message() */ goto __pyx_L3; } /* "asyncpg/protocol/coreproto.pyx":294 * self.buffer.discard_message() * * elif mtype == b'2': # <<<<<<<<<<<<<< * # BindComplete * self.buffer.discard_message() */ __pyx_t_1 = (__pyx_v_mtype == '2'); if (__pyx_t_1) { /* "asyncpg/protocol/coreproto.pyx":296 * elif mtype == b'2': * # BindComplete * self.buffer.discard_message() # <<<<<<<<<<<<<< * * elif mtype == b'Z': */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":294 * self.buffer.discard_message() * * elif mtype == b'2': # <<<<<<<<<<<<<< * # BindComplete * self.buffer.discard_message() */ goto __pyx_L3; } /* "asyncpg/protocol/coreproto.pyx":298 * self.buffer.discard_message() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ __pyx_t_1 = (__pyx_v_mtype == 'Z'); if (__pyx_t_1) { /* "asyncpg/protocol/coreproto.pyx":300 * elif mtype == b'Z': * # ReadyForQuery * self._parse_msg_ready_for_query() # <<<<<<<<<<<<<< * self._push_result() * */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":301 * # ReadyForQuery * self._parse_msg_ready_for_query() * self._push_result() # <<<<<<<<<<<<<< * * elif mtype == b'I': */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":298 * self.buffer.discard_message() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ goto __pyx_L3; } /* "asyncpg/protocol/coreproto.pyx":303 * self._push_result() * * elif mtype == b'I': # <<<<<<<<<<<<<< * # EmptyQueryResponse * self.buffer.discard_message() */ __pyx_t_1 = (__pyx_v_mtype == 'I'); if (__pyx_t_1) { /* "asyncpg/protocol/coreproto.pyx":305 * elif mtype == b'I': * # EmptyQueryResponse * self.buffer.discard_message() # <<<<<<<<<<<<<< * * elif mtype == b'1': */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":303 * self._push_result() * * elif mtype == b'I': # <<<<<<<<<<<<<< * # EmptyQueryResponse * self.buffer.discard_message() */ goto __pyx_L3; } /* "asyncpg/protocol/coreproto.pyx":307 * self.buffer.discard_message() * * elif mtype == b'1': # <<<<<<<<<<<<<< * # ParseComplete * self.buffer.discard_message() */ __pyx_t_1 = (__pyx_v_mtype == '1'); if (__pyx_t_1) { /* "asyncpg/protocol/coreproto.pyx":309 * elif mtype == b'1': * # ParseComplete * self.buffer.discard_message() # <<<<<<<<<<<<<< * * cdef _process__bind(self, char mtype): */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":307 * self.buffer.discard_message() * * elif mtype == b'1': # <<<<<<<<<<<<<< * # ParseComplete * self.buffer.discard_message() */ } __pyx_L3:; /* "asyncpg/protocol/coreproto.pyx":271 * self.buffer.discard_message() * * cdef _process__bind_execute_many(self, char mtype): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":311 * self.buffer.discard_message() * * cdef _process__bind(self, char mtype): # <<<<<<<<<<<<<< * if mtype == b'E': * # ErrorResponse */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__bind(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_process__bind", 1); /* "asyncpg/protocol/coreproto.pyx":312 * * cdef _process__bind(self, char mtype): * if mtype == b'E': # <<<<<<<<<<<<<< * # ErrorResponse * self._parse_msg_error_response(True) */ switch (__pyx_v_mtype) { case 'E': /* "asyncpg/protocol/coreproto.pyx":314 * if mtype == b'E': * # ErrorResponse * self._parse_msg_error_response(True) # <<<<<<<<<<<<<< * * elif mtype == b'2': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":312 * * cdef _process__bind(self, char mtype): * if mtype == b'E': # <<<<<<<<<<<<<< * # ErrorResponse * self._parse_msg_error_response(True) */ break; case '2': /* "asyncpg/protocol/coreproto.pyx":318 * elif mtype == b'2': * # BindComplete * self.buffer.discard_message() # <<<<<<<<<<<<<< * * elif mtype == b'Z': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":316 * self._parse_msg_error_response(True) * * elif mtype == b'2': # <<<<<<<<<<<<<< * # BindComplete * self.buffer.discard_message() */ break; case 'Z': /* "asyncpg/protocol/coreproto.pyx":322 * elif mtype == b'Z': * # ReadyForQuery * self._parse_msg_ready_for_query() # <<<<<<<<<<<<<< * self._push_result() * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":323 * # ReadyForQuery * self._parse_msg_ready_for_query() * self._push_result() # <<<<<<<<<<<<<< * * cdef _process__close_stmt_portal(self, char mtype): */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":320 * self.buffer.discard_message() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ break; default: break; } /* "asyncpg/protocol/coreproto.pyx":311 * self.buffer.discard_message() * * cdef _process__bind(self, char mtype): # <<<<<<<<<<<<<< * if mtype == b'E': * # ErrorResponse */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__bind", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":325 * self._push_result() * * cdef _process__close_stmt_portal(self, char mtype): # <<<<<<<<<<<<<< * if mtype == b'E': * # ErrorResponse */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__close_stmt_portal(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_process__close_stmt_portal", 1); /* "asyncpg/protocol/coreproto.pyx":326 * * cdef _process__close_stmt_portal(self, char mtype): * if mtype == b'E': # <<<<<<<<<<<<<< * # ErrorResponse * self._parse_msg_error_response(True) */ switch (__pyx_v_mtype) { case 'E': /* "asyncpg/protocol/coreproto.pyx":328 * if mtype == b'E': * # ErrorResponse * self._parse_msg_error_response(True) # <<<<<<<<<<<<<< * * elif mtype == b'3': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":326 * * cdef _process__close_stmt_portal(self, char mtype): * if mtype == b'E': # <<<<<<<<<<<<<< * # ErrorResponse * self._parse_msg_error_response(True) */ break; case '3': /* "asyncpg/protocol/coreproto.pyx":332 * elif mtype == b'3': * # CloseComplete * self.buffer.discard_message() # <<<<<<<<<<<<<< * * elif mtype == b'Z': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":330 * self._parse_msg_error_response(True) * * elif mtype == b'3': # <<<<<<<<<<<<<< * # CloseComplete * self.buffer.discard_message() */ break; case 'Z': /* "asyncpg/protocol/coreproto.pyx":336 * elif mtype == b'Z': * # ReadyForQuery * self._parse_msg_ready_for_query() # <<<<<<<<<<<<<< * self._push_result() * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":337 * # ReadyForQuery * self._parse_msg_ready_for_query() * self._push_result() # <<<<<<<<<<<<<< * * cdef _process__simple_query(self, char mtype): */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":334 * self.buffer.discard_message() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ break; default: break; } /* "asyncpg/protocol/coreproto.pyx":325 * self._push_result() * * cdef _process__close_stmt_portal(self, char mtype): # <<<<<<<<<<<<<< * if mtype == b'E': * # ErrorResponse */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__close_stmt_portal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":339 * self._push_result() * * cdef _process__simple_query(self, char mtype): # <<<<<<<<<<<<<< * if mtype in {b'D', b'I', b'T'}: * # 'D' - DataRow */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__simple_query(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_process__simple_query", 1); /* "asyncpg/protocol/coreproto.pyx":340 * * cdef _process__simple_query(self, char mtype): * if mtype in {b'D', b'I', b'T'}: # <<<<<<<<<<<<<< * # 'D' - DataRow * # 'I' - EmptyQueryResponse */ switch (__pyx_v_mtype) { case 'D': case 'I': case 'T': /* "asyncpg/protocol/coreproto.pyx":344 * # 'I' - EmptyQueryResponse * # 'T' - RowDescription * self.buffer.discard_message() # <<<<<<<<<<<<<< * * elif mtype == b'E': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":340 * * cdef _process__simple_query(self, char mtype): * if mtype in {b'D', b'I', b'T'}: # <<<<<<<<<<<<<< * # 'D' - DataRow * # 'I' - EmptyQueryResponse */ break; case 'E': /* "asyncpg/protocol/coreproto.pyx":348 * elif mtype == b'E': * # ErrorResponse * self._parse_msg_error_response(True) # <<<<<<<<<<<<<< * * elif mtype == b'Z': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":346 * self.buffer.discard_message() * * elif mtype == b'E': # <<<<<<<<<<<<<< * # ErrorResponse * self._parse_msg_error_response(True) */ break; case 'Z': /* "asyncpg/protocol/coreproto.pyx":352 * elif mtype == b'Z': * # ReadyForQuery * self._parse_msg_ready_for_query() # <<<<<<<<<<<<<< * self._push_result() * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":353 * # ReadyForQuery * self._parse_msg_ready_for_query() * self._push_result() # <<<<<<<<<<<<<< * * elif mtype == b'C': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":350 * self._parse_msg_error_response(True) * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ break; case 'C': /* "asyncpg/protocol/coreproto.pyx":357 * elif mtype == b'C': * # CommandComplete * self._parse_msg_command_complete() # <<<<<<<<<<<<<< * * else: */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_command_complete(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":355 * self._push_result() * * elif mtype == b'C': # <<<<<<<<<<<<<< * # CommandComplete * self._parse_msg_command_complete() */ break; default: /* "asyncpg/protocol/coreproto.pyx":361 * else: * # We don't really care about COPY IN etc * self.buffer.discard_message() # <<<<<<<<<<<<<< * * cdef _process__copy_out(self, char mtype): */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; break; } /* "asyncpg/protocol/coreproto.pyx":339 * self._push_result() * * cdef _process__simple_query(self, char mtype): # <<<<<<<<<<<<<< * if mtype in {b'D', b'I', b'T'}: * # 'D' - DataRow */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__simple_query", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":363 * self.buffer.discard_message() * * cdef _process__copy_out(self, char mtype): # <<<<<<<<<<<<<< * if mtype == b'E': * self._parse_msg_error_response(True) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_out(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_process__copy_out", 1); /* "asyncpg/protocol/coreproto.pyx":364 * * cdef _process__copy_out(self, char mtype): * if mtype == b'E': # <<<<<<<<<<<<<< * self._parse_msg_error_response(True) * */ switch (__pyx_v_mtype) { case 'E': /* "asyncpg/protocol/coreproto.pyx":365 * cdef _process__copy_out(self, char mtype): * if mtype == b'E': * self._parse_msg_error_response(True) # <<<<<<<<<<<<<< * * elif mtype == b'H': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":364 * * cdef _process__copy_out(self, char mtype): * if mtype == b'E': # <<<<<<<<<<<<<< * self._parse_msg_error_response(True) * */ break; case 'H': /* "asyncpg/protocol/coreproto.pyx":369 * elif mtype == b'H': * # CopyOutResponse * self._set_state(PROTOCOL_COPY_OUT_DATA) # <<<<<<<<<<<<<< * self.buffer.discard_message() * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DATA); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":370 * # CopyOutResponse * self._set_state(PROTOCOL_COPY_OUT_DATA) * self.buffer.discard_message() # <<<<<<<<<<<<<< * * elif mtype == b'Z': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":367 * self._parse_msg_error_response(True) * * elif mtype == b'H': # <<<<<<<<<<<<<< * # CopyOutResponse * self._set_state(PROTOCOL_COPY_OUT_DATA) */ break; case 'Z': /* "asyncpg/protocol/coreproto.pyx":374 * elif mtype == b'Z': * # ReadyForQuery * self._parse_msg_ready_for_query() # <<<<<<<<<<<<<< * self._push_result() * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":375 * # ReadyForQuery * self._parse_msg_ready_for_query() * self._push_result() # <<<<<<<<<<<<<< * * cdef _process__copy_out_data(self, char mtype): */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":372 * self.buffer.discard_message() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ break; default: break; } /* "asyncpg/protocol/coreproto.pyx":363 * self.buffer.discard_message() * * cdef _process__copy_out(self, char mtype): # <<<<<<<<<<<<<< * if mtype == b'E': * self._parse_msg_error_response(True) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":377 * self._push_result() * * cdef _process__copy_out_data(self, char mtype): # <<<<<<<<<<<<<< * if mtype == b'E': * self._parse_msg_error_response(True) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_out_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_process__copy_out_data", 1); /* "asyncpg/protocol/coreproto.pyx":378 * * cdef _process__copy_out_data(self, char mtype): * if mtype == b'E': # <<<<<<<<<<<<<< * self._parse_msg_error_response(True) * */ switch (__pyx_v_mtype) { case 'E': /* "asyncpg/protocol/coreproto.pyx":379 * cdef _process__copy_out_data(self, char mtype): * if mtype == b'E': * self._parse_msg_error_response(True) # <<<<<<<<<<<<<< * * elif mtype == b'd': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":378 * * cdef _process__copy_out_data(self, char mtype): * if mtype == b'E': # <<<<<<<<<<<<<< * self._parse_msg_error_response(True) * */ break; case 'd': /* "asyncpg/protocol/coreproto.pyx":383 * elif mtype == b'd': * # CopyData * self._parse_copy_data_msgs() # <<<<<<<<<<<<<< * * elif mtype == b'c': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_copy_data_msgs(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":381 * self._parse_msg_error_response(True) * * elif mtype == b'd': # <<<<<<<<<<<<<< * # CopyData * self._parse_copy_data_msgs() */ break; case 'c': /* "asyncpg/protocol/coreproto.pyx":387 * elif mtype == b'c': * # CopyDone * self.buffer.discard_message() # <<<<<<<<<<<<<< * self._set_state(PROTOCOL_COPY_OUT_DONE) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":388 * # CopyDone * self.buffer.discard_message() * self._set_state(PROTOCOL_COPY_OUT_DONE) # <<<<<<<<<<<<<< * * elif mtype == b'C': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":385 * self._parse_copy_data_msgs() * * elif mtype == b'c': # <<<<<<<<<<<<<< * # CopyDone * self.buffer.discard_message() */ break; case 'C': /* "asyncpg/protocol/coreproto.pyx":392 * elif mtype == b'C': * # CommandComplete * self._parse_msg_command_complete() # <<<<<<<<<<<<<< * * elif mtype == b'Z': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_command_complete(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":390 * self._set_state(PROTOCOL_COPY_OUT_DONE) * * elif mtype == b'C': # <<<<<<<<<<<<<< * # CommandComplete * self._parse_msg_command_complete() */ break; case 'Z': /* "asyncpg/protocol/coreproto.pyx":396 * elif mtype == b'Z': * # ReadyForQuery * self._parse_msg_ready_for_query() # <<<<<<<<<<<<<< * self._push_result() * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":397 * # ReadyForQuery * self._parse_msg_ready_for_query() * self._push_result() # <<<<<<<<<<<<<< * * cdef _process__copy_in(self, char mtype): */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":394 * self._parse_msg_command_complete() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ break; default: break; } /* "asyncpg/protocol/coreproto.pyx":377 * self._push_result() * * cdef _process__copy_out_data(self, char mtype): # <<<<<<<<<<<<<< * if mtype == b'E': * self._parse_msg_error_response(True) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__copy_out_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":399 * self._push_result() * * cdef _process__copy_in(self, char mtype): # <<<<<<<<<<<<<< * if mtype == b'E': * self._parse_msg_error_response(True) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_in(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_process__copy_in", 1); /* "asyncpg/protocol/coreproto.pyx":400 * * cdef _process__copy_in(self, char mtype): * if mtype == b'E': # <<<<<<<<<<<<<< * self._parse_msg_error_response(True) * */ switch (__pyx_v_mtype) { case 'E': /* "asyncpg/protocol/coreproto.pyx":401 * cdef _process__copy_in(self, char mtype): * if mtype == b'E': * self._parse_msg_error_response(True) # <<<<<<<<<<<<<< * * elif mtype == b'G': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":400 * * cdef _process__copy_in(self, char mtype): * if mtype == b'E': # <<<<<<<<<<<<<< * self._parse_msg_error_response(True) * */ break; case 'G': /* "asyncpg/protocol/coreproto.pyx":405 * elif mtype == b'G': * # CopyInResponse * self._set_state(PROTOCOL_COPY_IN_DATA) # <<<<<<<<<<<<<< * self.buffer.discard_message() * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN_DATA); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":406 * # CopyInResponse * self._set_state(PROTOCOL_COPY_IN_DATA) * self.buffer.discard_message() # <<<<<<<<<<<<<< * * elif mtype == b'Z': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":403 * self._parse_msg_error_response(True) * * elif mtype == b'G': # <<<<<<<<<<<<<< * # CopyInResponse * self._set_state(PROTOCOL_COPY_IN_DATA) */ break; case 'Z': /* "asyncpg/protocol/coreproto.pyx":410 * elif mtype == b'Z': * # ReadyForQuery * self._parse_msg_ready_for_query() # <<<<<<<<<<<<<< * self._push_result() * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":411 * # ReadyForQuery * self._parse_msg_ready_for_query() * self._push_result() # <<<<<<<<<<<<<< * * cdef _process__copy_in_data(self, char mtype): */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":408 * self.buffer.discard_message() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ break; default: break; } /* "asyncpg/protocol/coreproto.pyx":399 * self._push_result() * * cdef _process__copy_in(self, char mtype): # <<<<<<<<<<<<<< * if mtype == b'E': * self._parse_msg_error_response(True) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":413 * self._push_result() * * cdef _process__copy_in_data(self, char mtype): # <<<<<<<<<<<<<< * if mtype == b'E': * self._parse_msg_error_response(True) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_in_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_process__copy_in_data", 1); /* "asyncpg/protocol/coreproto.pyx":414 * * cdef _process__copy_in_data(self, char mtype): * if mtype == b'E': # <<<<<<<<<<<<<< * self._parse_msg_error_response(True) * */ switch (__pyx_v_mtype) { case 'E': /* "asyncpg/protocol/coreproto.pyx":415 * cdef _process__copy_in_data(self, char mtype): * if mtype == b'E': * self._parse_msg_error_response(True) # <<<<<<<<<<<<<< * * elif mtype == b'C': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":414 * * cdef _process__copy_in_data(self, char mtype): * if mtype == b'E': # <<<<<<<<<<<<<< * self._parse_msg_error_response(True) * */ break; case 'C': /* "asyncpg/protocol/coreproto.pyx":419 * elif mtype == b'C': * # CommandComplete * self._parse_msg_command_complete() # <<<<<<<<<<<<<< * * elif mtype == b'Z': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_command_complete(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":417 * self._parse_msg_error_response(True) * * elif mtype == b'C': # <<<<<<<<<<<<<< * # CommandComplete * self._parse_msg_command_complete() */ break; case 'Z': /* "asyncpg/protocol/coreproto.pyx":423 * elif mtype == b'Z': * # ReadyForQuery * self._parse_msg_ready_for_query() # <<<<<<<<<<<<<< * self._push_result() * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":424 * # ReadyForQuery * self._parse_msg_ready_for_query() * self._push_result() # <<<<<<<<<<<<<< * * cdef _parse_msg_command_complete(self): */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":421 * self._parse_msg_command_complete() * * elif mtype == b'Z': # <<<<<<<<<<<<<< * # ReadyForQuery * self._parse_msg_ready_for_query() */ break; default: break; } /* "asyncpg/protocol/coreproto.pyx":413 * self._push_result() * * cdef _process__copy_in_data(self, char mtype): # <<<<<<<<<<<<<< * if mtype == b'E': * self._parse_msg_error_response(True) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__copy_in_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":426 * self._push_result() * * cdef _parse_msg_command_complete(self): # <<<<<<<<<<<<<< * cdef: * const char* cbuf */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_command_complete(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { char const *__pyx_v_cbuf; Py_ssize_t __pyx_v_cbuf_len; PyObject *__pyx_v_msg = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_msg_command_complete", 1); /* "asyncpg/protocol/coreproto.pyx":431 * ssize_t cbuf_len * * cbuf = self.buffer.try_consume_message(&cbuf_len) # <<<<<<<<<<<<<< * if cbuf != NULL and cbuf_len > 0: * msg = cpython.PyBytes_FromStringAndSize(cbuf, cbuf_len - 1) */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->try_consume_message(__pyx_v_self->buffer, (&__pyx_v_cbuf_len)); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 431, __pyx_L1_error) __pyx_v_cbuf = __pyx_t_1; /* "asyncpg/protocol/coreproto.pyx":432 * * cbuf = self.buffer.try_consume_message(&cbuf_len) * if cbuf != NULL and cbuf_len > 0: # <<<<<<<<<<<<<< * msg = cpython.PyBytes_FromStringAndSize(cbuf, cbuf_len - 1) * else: */ __pyx_t_3 = (__pyx_v_cbuf != NULL); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_cbuf_len > 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "asyncpg/protocol/coreproto.pyx":433 * cbuf = self.buffer.try_consume_message(&cbuf_len) * if cbuf != NULL and cbuf_len > 0: * msg = cpython.PyBytes_FromStringAndSize(cbuf, cbuf_len - 1) # <<<<<<<<<<<<<< * else: * msg = self.buffer.read_null_str() */ __pyx_t_4 = PyBytes_FromStringAndSize(__pyx_v_cbuf, (__pyx_v_cbuf_len - 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_msg = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":432 * * cbuf = self.buffer.try_consume_message(&cbuf_len) * if cbuf != NULL and cbuf_len > 0: # <<<<<<<<<<<<<< * msg = cpython.PyBytes_FromStringAndSize(cbuf, cbuf_len - 1) * else: */ goto __pyx_L3; } /* "asyncpg/protocol/coreproto.pyx":435 * msg = cpython.PyBytes_FromStringAndSize(cbuf, cbuf_len - 1) * else: * msg = self.buffer.read_null_str() # <<<<<<<<<<<<<< * self.result_status_msg = msg * */ /*else*/ { __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_null_str(__pyx_v_self->buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_msg = __pyx_t_4; __pyx_t_4 = 0; } __pyx_L3:; /* "asyncpg/protocol/coreproto.pyx":436 * else: * msg = self.buffer.read_null_str() * self.result_status_msg = msg # <<<<<<<<<<<<<< * * cdef _parse_copy_data_msgs(self): */ if (!(likely(PyBytes_CheckExact(__pyx_v_msg))||((__pyx_v_msg) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_v_msg))) __PYX_ERR(6, 436, __pyx_L1_error) __pyx_t_4 = __pyx_v_msg; __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->result_status_msg); __Pyx_DECREF(__pyx_v_self->result_status_msg); __pyx_v_self->result_status_msg = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":426 * self._push_result() * * cdef _parse_msg_command_complete(self): # <<<<<<<<<<<<<< * cdef: * const char* cbuf */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._parse_msg_command_complete", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_msg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":438 * self.result_status_msg = msg * * cdef _parse_copy_data_msgs(self): # <<<<<<<<<<<<<< * cdef: * ReadBuffer buf = self.buffer */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_copy_data_msgs(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int32_t __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_copy_data_msgs", 1); /* "asyncpg/protocol/coreproto.pyx":440 * cdef _parse_copy_data_msgs(self): * cdef: * ReadBuffer buf = self.buffer # <<<<<<<<<<<<<< * * self.result = buf.consume_messages(b'd') */ __pyx_t_1 = ((PyObject *)__pyx_v_self->buffer); __Pyx_INCREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":442 * ReadBuffer buf = self.buffer * * self.result = buf.consume_messages(b'd') # <<<<<<<<<<<<<< * * # By this point we have consumed all CopyData messages */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_buf->__pyx_vtab)->consume_messages(__pyx_v_buf, 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->result); __Pyx_DECREF(__pyx_v_self->result); __pyx_v_self->result = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":451 * # we must not push the result here and let the * # _process__copy_out_data subprotocol do the job. * if not buf.take_message(): # <<<<<<<<<<<<<< * self._on_result() * self.result = None */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_buf->__pyx_vtab)->take_message(__pyx_v_buf); if (unlikely(__pyx_t_2 == ((int32_t)-1))) __PYX_ERR(6, 451, __pyx_L1_error) __pyx_t_3 = (!(__pyx_t_2 != 0)); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":452 * # _process__copy_out_data subprotocol do the job. * if not buf.take_message(): * self._on_result() # <<<<<<<<<<<<<< * self.result = None * else: */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_on_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":453 * if not buf.take_message(): * self._on_result() * self.result = None # <<<<<<<<<<<<<< * else: * # If there is a message in the buffer, put it back to */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->result); __Pyx_DECREF(__pyx_v_self->result); __pyx_v_self->result = Py_None; /* "asyncpg/protocol/coreproto.pyx":451 * # we must not push the result here and let the * # _process__copy_out_data subprotocol do the job. * if not buf.take_message(): # <<<<<<<<<<<<<< * self._on_result() * self.result = None */ goto __pyx_L3; } /* "asyncpg/protocol/coreproto.pyx":457 * # If there is a message in the buffer, put it back to * # be processed by the next protocol iteration. * buf.put_message() # <<<<<<<<<<<<<< * * cdef _write_copy_data_msg(self, object data): */ /*else*/ { __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_buf->__pyx_vtab)->put_message(__pyx_v_buf); if (unlikely(__pyx_t_2 == ((int32_t)-1))) __PYX_ERR(6, 457, __pyx_L1_error) } __pyx_L3:; /* "asyncpg/protocol/coreproto.pyx":438 * self.result_status_msg = msg * * cdef _parse_copy_data_msgs(self): # <<<<<<<<<<<<<< * cdef: * ReadBuffer buf = self.buffer */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._parse_copy_data_msgs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":459 * buf.put_message() * * cdef _write_copy_data_msg(self, object data): # <<<<<<<<<<<<<< * cdef: * WriteBuffer buf */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_copy_data_msg(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_data) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_v_mview = 0; Py_buffer *__pyx_v_pybuf; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_write_copy_data_msg", 1); /* "asyncpg/protocol/coreproto.pyx":465 * Py_buffer *pybuf * * mview = cpythonx.PyMemoryView_GetContiguous( # <<<<<<<<<<<<<< * data, cpython.PyBUF_READ, b'C') * */ __pyx_t_1 = PyMemoryView_GetContiguous(__pyx_v_data, PyBUF_READ, 'C'); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mview = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":468 * data, cpython.PyBUF_READ, b'C') * * try: # <<<<<<<<<<<<<< * pybuf = cpythonx.PyMemoryView_GET_BUFFER(mview) * */ /*try:*/ { /* "asyncpg/protocol/coreproto.pyx":469 * * try: * pybuf = cpythonx.PyMemoryView_GET_BUFFER(mview) # <<<<<<<<<<<<<< * * buf = WriteBuffer.new_message(b'd') */ __pyx_v_pybuf = PyMemoryView_GET_BUFFER(__pyx_v_mview); /* "asyncpg/protocol/coreproto.pyx":471 * pybuf = cpythonx.PyMemoryView_GET_BUFFER(mview) * * buf = WriteBuffer.new_message(b'd') # <<<<<<<<<<<<<< * buf.write_cstr(pybuf.buf, pybuf.len) * buf.end_message() */ __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('d')); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 471, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":472 * * buf = WriteBuffer.new_message(b'd') * buf.write_cstr(pybuf.buf, pybuf.len) # <<<<<<<<<<<<<< * buf.end_message() * finally: */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_cstr(__pyx_v_buf, ((char const *)__pyx_v_pybuf->buf), __pyx_v_pybuf->len); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 472, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":473 * buf = WriteBuffer.new_message(b'd') * buf.write_cstr(pybuf.buf, pybuf.len) * buf.end_message() # <<<<<<<<<<<<<< * finally: * mview.release() */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 473, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "asyncpg/protocol/coreproto.pyx":475 * buf.end_message() * finally: * mview.release() # <<<<<<<<<<<<<< * * self._write(buf) */ /*finally:*/ { /*normal exit:*/{ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_mview, __pyx_n_s_release); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename; { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_mview, __pyx_n_s_release); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 475, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 475, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "asyncpg/protocol/coreproto.pyx":477 * mview.release() * * self._write(buf) # <<<<<<<<<<<<<< * * cdef _write_copy_done_msg(self): */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":459 * buf.put_message() * * cdef _write_copy_data_msg(self, object data): # <<<<<<<<<<<<<< * cdef: * WriteBuffer buf */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._write_copy_data_msg", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XDECREF(__pyx_v_mview); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":479 * self._write(buf) * * cdef _write_copy_done_msg(self): # <<<<<<<<<<<<<< * cdef: * WriteBuffer buf */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_copy_done_msg(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_write_copy_done_msg", 1); /* "asyncpg/protocol/coreproto.pyx":483 * WriteBuffer buf * * buf = WriteBuffer.new_message(b'c') # <<<<<<<<<<<<<< * buf.end_message() * self._write(buf) */ __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('c')); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":484 * * buf = WriteBuffer.new_message(b'c') * buf.end_message() # <<<<<<<<<<<<<< * self._write(buf) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":485 * buf = WriteBuffer.new_message(b'c') * buf.end_message() * self._write(buf) # <<<<<<<<<<<<<< * * cdef _write_copy_fail_msg(self, str cause): */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":479 * self._write(buf) * * cdef _write_copy_done_msg(self): # <<<<<<<<<<<<<< * cdef: * WriteBuffer buf */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._write_copy_done_msg", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":487 * self._write(buf) * * cdef _write_copy_fail_msg(self, str cause): # <<<<<<<<<<<<<< * cdef: * WriteBuffer buf */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_copy_fail_msg(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_cause) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_write_copy_fail_msg", 1); /* "asyncpg/protocol/coreproto.pyx":491 * WriteBuffer buf * * buf = WriteBuffer.new_message(b'f') # <<<<<<<<<<<<<< * buf.write_str(cause or '', self.encoding) * buf.end_message() */ __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('f')); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":492 * * buf = WriteBuffer.new_message(b'f') * buf.write_str(cause or '', self.encoding) # <<<<<<<<<<<<<< * buf.end_message() * self._write(buf) */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_cause); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(6, 492, __pyx_L1_error) if (!__pyx_t_2) { } else { __Pyx_INCREF(__pyx_v_cause); __pyx_t_1 = __pyx_v_cause; goto __pyx_L3_bool_binop_done; } __Pyx_INCREF(__pyx_kp_u__34); __pyx_t_1 = __pyx_kp_u__34; __pyx_L3_bool_binop_done:; __pyx_t_3 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, ((PyObject*)__pyx_t_1), ((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":493 * buf = WriteBuffer.new_message(b'f') * buf.write_str(cause or '', self.encoding) * buf.end_message() # <<<<<<<<<<<<<< * self._write(buf) * */ __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":494 * buf.write_str(cause or '', self.encoding) * buf.end_message() * self._write(buf) # <<<<<<<<<<<<<< * * cdef _parse_data_msgs(self): */ __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":487 * self._write(buf) * * cdef _write_copy_fail_msg(self, str cause): # <<<<<<<<<<<<<< * cdef: * WriteBuffer buf */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._write_copy_fail_msg", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":496 * self._write(buf) * * cdef _parse_data_msgs(self): # <<<<<<<<<<<<<< * cdef: * ReadBuffer buf = self.buffer */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_data_msgs(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_buf = 0; PyObject *__pyx_v_rows = 0; __pyx_t_7asyncpg_8protocol_8protocol_decode_row_method __pyx_v_decoder; __pyx_t_7asyncpg_7pgproto_7pgproto_try_consume_message_method __pyx_v_try_consume_message; __pyx_t_7asyncpg_7pgproto_7pgproto_take_message_type_method __pyx_v_take_message_type; char const *__pyx_v_cbuf; Py_ssize_t __pyx_v_cbuf_len; PyObject *__pyx_v_row = 0; PyObject *__pyx_v_mem = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int32_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; char const *__pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_data_msgs", 1); /* "asyncpg/protocol/coreproto.pyx":498 * cdef _parse_data_msgs(self): * cdef: * ReadBuffer buf = self.buffer # <<<<<<<<<<<<<< * list rows * */ __pyx_t_1 = ((PyObject *)__pyx_v_self->buffer); __Pyx_INCREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":501 * list rows * * decode_row_method decoder = self._decode_row # <<<<<<<<<<<<<< * pgproto.try_consume_message_method try_consume_message = \ * buf.try_consume_message */ __pyx_v_decoder = ((__pyx_t_7asyncpg_8protocol_8protocol_decode_row_method)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_decode_row); /* "asyncpg/protocol/coreproto.pyx":503 * decode_row_method decoder = self._decode_row * pgproto.try_consume_message_method try_consume_message = \ * buf.try_consume_message # <<<<<<<<<<<<<< * pgproto.take_message_type_method take_message_type = \ * buf.take_message_type */ __pyx_v_try_consume_message = ((__pyx_t_7asyncpg_7pgproto_7pgproto_try_consume_message_method)((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_buf->__pyx_vtab)->try_consume_message); /* "asyncpg/protocol/coreproto.pyx":505 * buf.try_consume_message * pgproto.take_message_type_method take_message_type = \ * buf.take_message_type # <<<<<<<<<<<<<< * * const char* cbuf */ __pyx_v_take_message_type = ((__pyx_t_7asyncpg_7pgproto_7pgproto_take_message_type_method)((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_buf->__pyx_vtab)->take_message_type); /* "asyncpg/protocol/coreproto.pyx":512 * bytes mem * * if PG_DEBUG: # <<<<<<<<<<<<<< * if buf.get_message_type() != b'D': * raise apg_exc.InternalClientError( */ __pyx_t_2 = (PG_DEBUG != 0); if (__pyx_t_2) { /* "asyncpg/protocol/coreproto.pyx":513 * * if PG_DEBUG: * if buf.get_message_type() != b'D': # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * '_parse_data_msgs: first message is not "D"') */ __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_v_buf); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 513, __pyx_L1_error) __pyx_t_2 = (__pyx_t_3 != 'D'); if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/coreproto.pyx":514 * if PG_DEBUG: * if buf.get_message_type() != b'D': * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * '_parse_data_msgs: first message is not "D"') * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_parse_data_msgs_first_message_i}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(6, 514, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":513 * * if PG_DEBUG: * if buf.get_message_type() != b'D': # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * '_parse_data_msgs: first message is not "D"') */ } /* "asyncpg/protocol/coreproto.pyx":512 * bytes mem * * if PG_DEBUG: # <<<<<<<<<<<<<< * if buf.get_message_type() != b'D': * raise apg_exc.InternalClientError( */ } /* "asyncpg/protocol/coreproto.pyx":517 * '_parse_data_msgs: first message is not "D"') * * if self._discard_data: # <<<<<<<<<<<<<< * while take_message_type(buf, b'D'): * buf.discard_message() */ if (__pyx_v_self->_discard_data) { /* "asyncpg/protocol/coreproto.pyx":518 * * if self._discard_data: * while take_message_type(buf, b'D'): # <<<<<<<<<<<<<< * buf.discard_message() * return */ while (1) { __pyx_t_7 = __pyx_v_take_message_type(((PyObject *)__pyx_v_buf), 'D'); if (unlikely(__pyx_t_7 == ((int32_t)-1))) __PYX_ERR(6, 518, __pyx_L1_error) __pyx_t_2 = (__pyx_t_7 != 0); if (!__pyx_t_2) break; /* "asyncpg/protocol/coreproto.pyx":519 * if self._discard_data: * while take_message_type(buf, b'D'): * buf.discard_message() # <<<<<<<<<<<<<< * return * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_buf->__pyx_vtab)->discard_message(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "asyncpg/protocol/coreproto.pyx":520 * while take_message_type(buf, b'D'): * buf.discard_message() * return # <<<<<<<<<<<<<< * * if PG_DEBUG: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/protocol/coreproto.pyx":517 * '_parse_data_msgs: first message is not "D"') * * if self._discard_data: # <<<<<<<<<<<<<< * while take_message_type(buf, b'D'): * buf.discard_message() */ } /* "asyncpg/protocol/coreproto.pyx":522 * return * * if PG_DEBUG: # <<<<<<<<<<<<<< * if type(self.result) is not list: * raise apg_exc.InternalClientError( */ __pyx_t_2 = (PG_DEBUG != 0); if (__pyx_t_2) { /* "asyncpg/protocol/coreproto.pyx":523 * * if PG_DEBUG: * if type(self.result) is not list: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * '_parse_data_msgs: result is not a list, but {!r}'. */ __pyx_t_2 = (((PyObject *)Py_TYPE(__pyx_v_self->result)) != ((PyObject *)(&PyList_Type))); if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/coreproto.pyx":524 * if PG_DEBUG: * if type(self.result) is not list: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * '_parse_data_msgs: result is not a list, but {!r}'. * format(self.result)) */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/coreproto.pyx":525 * if type(self.result) is not list: * raise apg_exc.InternalClientError( * '_parse_data_msgs: result is not a list, but {!r}'. # <<<<<<<<<<<<<< * format(self.result)) * */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_parse_data_msgs_result_is_not_a, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* "asyncpg/protocol/coreproto.pyx":526 * raise apg_exc.InternalClientError( * '_parse_data_msgs: result is not a list, but {!r}'. * format(self.result)) # <<<<<<<<<<<<<< * * rows = self.result */ __pyx_t_9 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_self->result}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_8 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(6, 524, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":523 * * if PG_DEBUG: * if type(self.result) is not list: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * '_parse_data_msgs: result is not a list, but {!r}'. */ } /* "asyncpg/protocol/coreproto.pyx":522 * return * * if PG_DEBUG: # <<<<<<<<<<<<<< * if type(self.result) is not list: * raise apg_exc.InternalClientError( */ } /* "asyncpg/protocol/coreproto.pyx":528 * format(self.result)) * * rows = self.result # <<<<<<<<<<<<<< * while take_message_type(buf, b'D'): * cbuf = try_consume_message(buf, &cbuf_len) */ if (!(likely(PyList_CheckExact(__pyx_v_self->result))||((__pyx_v_self->result) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_v_self->result))) __PYX_ERR(6, 528, __pyx_L1_error) __pyx_t_1 = __pyx_v_self->result; __Pyx_INCREF(__pyx_t_1); __pyx_v_rows = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":529 * * rows = self.result * while take_message_type(buf, b'D'): # <<<<<<<<<<<<<< * cbuf = try_consume_message(buf, &cbuf_len) * if cbuf != NULL: */ while (1) { __pyx_t_7 = __pyx_v_take_message_type(((PyObject *)__pyx_v_buf), 'D'); if (unlikely(__pyx_t_7 == ((int32_t)-1))) __PYX_ERR(6, 529, __pyx_L1_error) __pyx_t_2 = (__pyx_t_7 != 0); if (!__pyx_t_2) break; /* "asyncpg/protocol/coreproto.pyx":530 * rows = self.result * while take_message_type(buf, b'D'): * cbuf = try_consume_message(buf, &cbuf_len) # <<<<<<<<<<<<<< * if cbuf != NULL: * row = decoder(self, cbuf, cbuf_len) */ __pyx_t_10 = __pyx_v_try_consume_message(((PyObject *)__pyx_v_buf), (&__pyx_v_cbuf_len)); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 530, __pyx_L1_error) __pyx_v_cbuf = __pyx_t_10; /* "asyncpg/protocol/coreproto.pyx":531 * while take_message_type(buf, b'D'): * cbuf = try_consume_message(buf, &cbuf_len) * if cbuf != NULL: # <<<<<<<<<<<<<< * row = decoder(self, cbuf, cbuf_len) * else: */ __pyx_t_2 = (__pyx_v_cbuf != NULL); if (__pyx_t_2) { /* "asyncpg/protocol/coreproto.pyx":532 * cbuf = try_consume_message(buf, &cbuf_len) * if cbuf != NULL: * row = decoder(self, cbuf, cbuf_len) # <<<<<<<<<<<<<< * else: * mem = buf.consume_message() */ __pyx_t_1 = __pyx_v_decoder(((PyObject *)__pyx_v_self), __pyx_v_cbuf, __pyx_v_cbuf_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":531 * while take_message_type(buf, b'D'): * cbuf = try_consume_message(buf, &cbuf_len) * if cbuf != NULL: # <<<<<<<<<<<<<< * row = decoder(self, cbuf, cbuf_len) * else: */ goto __pyx_L12; } /* "asyncpg/protocol/coreproto.pyx":534 * row = decoder(self, cbuf, cbuf_len) * else: * mem = buf.consume_message() # <<<<<<<<<<<<<< * row = decoder( * self, */ /*else*/ { __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_buf->__pyx_vtab)->consume_message(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_mem, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":535 * else: * mem = buf.consume_message() * row = decoder( # <<<<<<<<<<<<<< * self, * cpython.PyBytes_AS_STRING(mem), */ __pyx_t_1 = __pyx_v_decoder(((PyObject *)__pyx_v_self), PyBytes_AS_STRING(__pyx_v_mem), PyBytes_GET_SIZE(__pyx_v_mem)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_1); __pyx_t_1 = 0; } __pyx_L12:; /* "asyncpg/protocol/coreproto.pyx":540 * cpython.PyBytes_GET_SIZE(mem)) * * cpython.PyList_Append(rows, row) # <<<<<<<<<<<<<< * * cdef _parse_msg_backend_key_data(self): */ __pyx_t_11 = PyList_Append(__pyx_v_rows, __pyx_v_row); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(6, 540, __pyx_L1_error) } /* "asyncpg/protocol/coreproto.pyx":496 * self._write(buf) * * cdef _parse_data_msgs(self): # <<<<<<<<<<<<<< * cdef: * ReadBuffer buf = self.buffer */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._parse_data_msgs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XDECREF(__pyx_v_rows); __Pyx_XDECREF(__pyx_v_row); __Pyx_XDECREF(__pyx_v_mem); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":542 * cpython.PyList_Append(rows, row) * * cdef _parse_msg_backend_key_data(self): # <<<<<<<<<<<<<< * self.backend_pid = self.buffer.read_int32() * self.backend_secret = self.buffer.read_int32() */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_backend_key_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int32_t __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_msg_backend_key_data", 1); /* "asyncpg/protocol/coreproto.pyx":543 * * cdef _parse_msg_backend_key_data(self): * self.backend_pid = self.buffer.read_int32() # <<<<<<<<<<<<<< * self.backend_secret = self.buffer.read_int32() * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_int32(__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 543, __pyx_L1_error) __pyx_v_self->backend_pid = __pyx_t_1; /* "asyncpg/protocol/coreproto.pyx":544 * cdef _parse_msg_backend_key_data(self): * self.backend_pid = self.buffer.read_int32() * self.backend_secret = self.buffer.read_int32() # <<<<<<<<<<<<<< * * cdef _parse_msg_parameter_status(self): */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_int32(__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 544, __pyx_L1_error) __pyx_v_self->backend_secret = __pyx_t_1; /* "asyncpg/protocol/coreproto.pyx":542 * cpython.PyList_Append(rows, row) * * cdef _parse_msg_backend_key_data(self): # <<<<<<<<<<<<<< * self.backend_pid = self.buffer.read_int32() * self.backend_secret = self.buffer.read_int32() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._parse_msg_backend_key_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":546 * self.backend_secret = self.buffer.read_int32() * * cdef _parse_msg_parameter_status(self): # <<<<<<<<<<<<<< * name = self.buffer.read_null_str() * name = name.decode(self.encoding) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_parameter_status(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_val = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_msg_parameter_status", 1); /* "asyncpg/protocol/coreproto.pyx":547 * * cdef _parse_msg_parameter_status(self): * name = self.buffer.read_null_str() # <<<<<<<<<<<<<< * name = name.decode(self.encoding) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_null_str(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":548 * cdef _parse_msg_parameter_status(self): * name = self.buffer.read_null_str() * name = name.decode(self.encoding) # <<<<<<<<<<<<<< * * val = self.buffer.read_null_str() */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self->encoding}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":550 * name = name.decode(self.encoding) * * val = self.buffer.read_null_str() # <<<<<<<<<<<<<< * val = val.decode(self.encoding) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_null_str(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_val = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":551 * * val = self.buffer.read_null_str() * val = val.decode(self.encoding) # <<<<<<<<<<<<<< * * self._set_server_parameter(name, val) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self->encoding}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":553 * val = val.decode(self.encoding) * * self._set_server_parameter(name, val) # <<<<<<<<<<<<<< * * cdef _parse_msg_notification(self): */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_server_parameter(__pyx_v_self, __pyx_v_name, __pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":546 * self.backend_secret = self.buffer.read_int32() * * cdef _parse_msg_parameter_status(self): # <<<<<<<<<<<<<< * name = self.buffer.read_null_str() * name = name.decode(self.encoding) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._parse_msg_parameter_status", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":555 * self._set_server_parameter(name, val) * * cdef _parse_msg_notification(self): # <<<<<<<<<<<<<< * pid = self.buffer.read_int32() * channel = self.buffer.read_null_str().decode(self.encoding) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_notification(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { int32_t __pyx_v_pid; PyObject *__pyx_v_channel = NULL; PyObject *__pyx_v_payload = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int32_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_msg_notification", 1); /* "asyncpg/protocol/coreproto.pyx":556 * * cdef _parse_msg_notification(self): * pid = self.buffer.read_int32() # <<<<<<<<<<<<<< * channel = self.buffer.read_null_str().decode(self.encoding) * payload = self.buffer.read_null_str().decode(self.encoding) */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_int32(__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 556, __pyx_L1_error) __pyx_v_pid = __pyx_t_1; /* "asyncpg/protocol/coreproto.pyx":557 * cdef _parse_msg_notification(self): * pid = self.buffer.read_int32() * channel = self.buffer.read_null_str().decode(self.encoding) # <<<<<<<<<<<<<< * payload = self.buffer.read_null_str().decode(self.encoding) * self._on_notification(pid, channel, payload) */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_null_str(__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self->encoding}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_channel = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":558 * pid = self.buffer.read_int32() * channel = self.buffer.read_null_str().decode(self.encoding) * payload = self.buffer.read_null_str().decode(self.encoding) # <<<<<<<<<<<<<< * self._on_notification(pid, channel, payload) * */ __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_null_str(__pyx_v_self->buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_self->encoding}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_payload = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":559 * channel = self.buffer.read_null_str().decode(self.encoding) * payload = self.buffer.read_null_str().decode(self.encoding) * self._on_notification(pid, channel, payload) # <<<<<<<<<<<<<< * * cdef _parse_msg_authentication(self): */ __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_pid); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_on_notification(__pyx_v_self, __pyx_t_2, __pyx_v_channel, __pyx_v_payload); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":555 * self._set_server_parameter(name, val) * * cdef _parse_msg_notification(self): # <<<<<<<<<<<<<< * pid = self.buffer.read_int32() * channel = self.buffer.read_null_str().decode(self.encoding) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._parse_msg_notification", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_channel); __Pyx_XDECREF(__pyx_v_payload); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":561 * self._on_notification(pid, channel, payload) * * cdef _parse_msg_authentication(self): # <<<<<<<<<<<<<< * cdef: * int32_t status */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_authentication(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { int32_t __pyx_v_status; PyObject *__pyx_v_md5_salt = 0; PyObject *__pyx_v_sasl_auth_methods = 0; PyObject *__pyx_v_unsupported_sasl_auth_methods = 0; PyObject *__pyx_v_auth_method = NULL; PyObject *__pyx_v_server_response = NULL; PyObject *__pyx_8genexpr9__pyx_v_m = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int32_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; Py_ssize_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; unsigned int __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_msg_authentication", 1); /* "asyncpg/protocol/coreproto.pyx":568 * list unsupported_sasl_auth_methods * * status = self.buffer.read_int32() # <<<<<<<<<<<<<< * * if status == AUTH_SUCCESSFUL: */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_int32(__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 568, __pyx_L1_error) __pyx_v_status = __pyx_t_1; /* "asyncpg/protocol/coreproto.pyx":570 * status = self.buffer.read_int32() * * if status == AUTH_SUCCESSFUL: # <<<<<<<<<<<<<< * # AuthenticationOk * self.result_type = RESULT_OK */ switch (__pyx_v_status) { case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_SUCCESSFUL: /* "asyncpg/protocol/coreproto.pyx":572 * if status == AUTH_SUCCESSFUL: * # AuthenticationOk * self.result_type = RESULT_OK # <<<<<<<<<<<<<< * * elif status == AUTH_REQUIRED_PASSWORD: */ __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_OK; /* "asyncpg/protocol/coreproto.pyx":570 * status = self.buffer.read_int32() * * if status == AUTH_SUCCESSFUL: # <<<<<<<<<<<<<< * # AuthenticationOk * self.result_type = RESULT_OK */ break; case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_PASSWORD: /* "asyncpg/protocol/coreproto.pyx":576 * elif status == AUTH_REQUIRED_PASSWORD: * # AuthenticationCleartextPassword * self.result_type = RESULT_OK # <<<<<<<<<<<<<< * self.auth_msg = self._auth_password_message_cleartext() * */ __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_OK; /* "asyncpg/protocol/coreproto.pyx":577 * # AuthenticationCleartextPassword * self.result_type = RESULT_OK * self.auth_msg = self._auth_password_message_cleartext() # <<<<<<<<<<<<<< * * elif status == AUTH_REQUIRED_PASSWORDMD5: */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_password_message_cleartext(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_auth_msg, __pyx_t_2) < 0) __PYX_ERR(6, 577, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":574 * self.result_type = RESULT_OK * * elif status == AUTH_REQUIRED_PASSWORD: # <<<<<<<<<<<<<< * # AuthenticationCleartextPassword * self.result_type = RESULT_OK */ break; case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_PASSWORDMD5: /* "asyncpg/protocol/coreproto.pyx":582 * # AuthenticationMD5Password * # Note: MD5 salt is passed as a four-byte sequence * md5_salt = self.buffer.read_bytes(4) # <<<<<<<<<<<<<< * self.auth_msg = self._auth_password_message_md5(md5_salt) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_bytes(__pyx_v_self->buffer, 4); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_md5_salt = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":583 * # Note: MD5 salt is passed as a four-byte sequence * md5_salt = self.buffer.read_bytes(4) * self.auth_msg = self._auth_password_message_md5(md5_salt) # <<<<<<<<<<<<<< * * elif status == AUTH_REQUIRED_SASL: */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_password_message_md5(__pyx_v_self, __pyx_v_md5_salt); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_auth_msg, __pyx_t_2) < 0) __PYX_ERR(6, 583, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":579 * self.auth_msg = self._auth_password_message_cleartext() * * elif status == AUTH_REQUIRED_PASSWORDMD5: # <<<<<<<<<<<<<< * # AuthenticationMD5Password * # Note: MD5 salt is passed as a four-byte sequence */ break; case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_SASL: /* "asyncpg/protocol/coreproto.pyx":590 * # to follow the SCRAM protocol defined in RFC 5802. * # get the SASL authentication methods that the server is providing * sasl_auth_methods = [] # <<<<<<<<<<<<<< * unsupported_sasl_auth_methods = [] * # determine if the advertised authentication methods are supported, */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_sasl_auth_methods = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":591 * # get the SASL authentication methods that the server is providing * sasl_auth_methods = [] * unsupported_sasl_auth_methods = [] # <<<<<<<<<<<<<< * # determine if the advertised authentication methods are supported, * # and if so, add them to the list */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_unsupported_sasl_auth_methods = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":594 * # determine if the advertised authentication methods are supported, * # and if so, add them to the list * auth_method = self.buffer.read_null_str() # <<<<<<<<<<<<<< * while auth_method: * if auth_method in SCRAMAuthentication.AUTHENTICATION_METHODS: */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_null_str(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_auth_method = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":595 * # and if so, add them to the list * auth_method = self.buffer.read_null_str() * while auth_method: # <<<<<<<<<<<<<< * if auth_method in SCRAMAuthentication.AUTHENTICATION_METHODS: * sasl_auth_methods.append(auth_method) */ while (1) { __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_auth_method); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(6, 595, __pyx_L1_error) if (!__pyx_t_3) break; /* "asyncpg/protocol/coreproto.pyx":596 * auth_method = self.buffer.read_null_str() * while auth_method: * if auth_method in SCRAMAuthentication.AUTHENTICATION_METHODS: # <<<<<<<<<<<<<< * sasl_auth_methods.append(auth_method) * else: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication), __pyx_n_s_AUTHENTICATION_METHODS); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_auth_method, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(6, 596, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":597 * while auth_method: * if auth_method in SCRAMAuthentication.AUTHENTICATION_METHODS: * sasl_auth_methods.append(auth_method) # <<<<<<<<<<<<<< * else: * unsupported_sasl_auth_methods.append(auth_method) */ __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_sasl_auth_methods, __pyx_v_auth_method); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 597, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":596 * auth_method = self.buffer.read_null_str() * while auth_method: * if auth_method in SCRAMAuthentication.AUTHENTICATION_METHODS: # <<<<<<<<<<<<<< * sasl_auth_methods.append(auth_method) * else: */ goto __pyx_L5; } /* "asyncpg/protocol/coreproto.pyx":599 * sasl_auth_methods.append(auth_method) * else: * unsupported_sasl_auth_methods.append(auth_method) # <<<<<<<<<<<<<< * auth_method = self.buffer.read_null_str() * */ /*else*/ { __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_unsupported_sasl_auth_methods, __pyx_v_auth_method); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 599, __pyx_L1_error) } __pyx_L5:; /* "asyncpg/protocol/coreproto.pyx":600 * else: * unsupported_sasl_auth_methods.append(auth_method) * auth_method = self.buffer.read_null_str() # <<<<<<<<<<<<<< * * # if none of the advertised authentication methods are supported, */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_null_str(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_auth_method, __pyx_t_2); __pyx_t_2 = 0; } /* "asyncpg/protocol/coreproto.pyx":605 * # raise an error * # otherwise, initialize the SASL authentication exchange * if not sasl_auth_methods: # <<<<<<<<<<<<<< * unsupported_sasl_auth_methods = [m.decode("ascii") * for m in unsupported_sasl_auth_methods] */ __pyx_t_3 = (PyList_GET_SIZE(__pyx_v_sasl_auth_methods) != 0); __pyx_t_5 = (!__pyx_t_3); if (__pyx_t_5) { /* "asyncpg/protocol/coreproto.pyx":606 * # otherwise, initialize the SASL authentication exchange * if not sasl_auth_methods: * unsupported_sasl_auth_methods = [m.decode("ascii") # <<<<<<<<<<<<<< * for m in unsupported_sasl_auth_methods] * self.result_type = RESULT_FAILED */ { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 606, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/coreproto.pyx":607 * if not sasl_auth_methods: * unsupported_sasl_auth_methods = [m.decode("ascii") * for m in unsupported_sasl_auth_methods] # <<<<<<<<<<<<<< * self.result_type = RESULT_FAILED * self.result = apg_exc.InterfaceError( */ __pyx_t_6 = __pyx_v_unsupported_sasl_auth_methods; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(6, 607, __pyx_L9_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_8 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(6, 607, __pyx_L9_error) #else __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 607, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_m, __pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":606 * # otherwise, initialize the SASL authentication exchange * if not sasl_auth_methods: * unsupported_sasl_auth_methods = [m.decode("ascii") # <<<<<<<<<<<<<< * for m in unsupported_sasl_auth_methods] * self.result_type = RESULT_FAILED */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr9__pyx_v_m, __pyx_n_s_decode); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 606, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_n_u_ascii}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 606, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(6, 606, __pyx_L9_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":607 * if not sasl_auth_methods: * unsupported_sasl_auth_methods = [m.decode("ascii") * for m in unsupported_sasl_auth_methods] # <<<<<<<<<<<<<< * self.result_type = RESULT_FAILED * self.result = apg_exc.InterfaceError( */ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_m); __pyx_8genexpr9__pyx_v_m = 0; goto __pyx_L13_exit_scope; __pyx_L9_error:; __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_m); __pyx_8genexpr9__pyx_v_m = 0; goto __pyx_L1_error; __pyx_L13_exit_scope:; } /* exit inner scope */ __Pyx_DECREF_SET(__pyx_v_unsupported_sasl_auth_methods, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":608 * unsupported_sasl_auth_methods = [m.decode("ascii") * for m in unsupported_sasl_auth_methods] * self.result_type = RESULT_FAILED # <<<<<<<<<<<<<< * self.result = apg_exc.InterfaceError( * 'unsupported SASL Authentication methods requested by the ' */ __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED; /* "asyncpg/protocol/coreproto.pyx":609 * for m in unsupported_sasl_auth_methods] * self.result_type = RESULT_FAILED * self.result = apg_exc.InterfaceError( # <<<<<<<<<<<<<< * 'unsupported SASL Authentication methods requested by the ' * 'server: {!r}'.format( */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/coreproto.pyx":611 * self.result = apg_exc.InterfaceError( * 'unsupported SASL Authentication methods requested by the ' * 'server: {!r}'.format( # <<<<<<<<<<<<<< * ", ".join(unsupported_sasl_auth_methods))) * else: */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unsupported_SASL_Authentication, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); /* "asyncpg/protocol/coreproto.pyx":612 * 'unsupported SASL Authentication methods requested by the ' * 'server: {!r}'.format( * ", ".join(unsupported_sasl_auth_methods))) # <<<<<<<<<<<<<< * else: * self.auth_msg = self._auth_password_message_sasl_initial( */ __pyx_t_10 = PyUnicode_Join(__pyx_kp_u__36, __pyx_v_unsupported_sasl_auth_methods); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_10}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_t_9 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_6}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } /* "asyncpg/protocol/coreproto.pyx":609 * for m in unsupported_sasl_auth_methods] * self.result_type = RESULT_FAILED * self.result = apg_exc.InterfaceError( # <<<<<<<<<<<<<< * 'unsupported SASL Authentication methods requested by the ' * 'server: {!r}'.format( */ __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->result); __Pyx_DECREF(__pyx_v_self->result); __pyx_v_self->result = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":605 * # raise an error * # otherwise, initialize the SASL authentication exchange * if not sasl_auth_methods: # <<<<<<<<<<<<<< * unsupported_sasl_auth_methods = [m.decode("ascii") * for m in unsupported_sasl_auth_methods] */ goto __pyx_L6; } /* "asyncpg/protocol/coreproto.pyx":614 * ", ".join(unsupported_sasl_auth_methods))) * else: * self.auth_msg = self._auth_password_message_sasl_initial( # <<<<<<<<<<<<<< * sasl_auth_methods) * */ /*else*/ { /* "asyncpg/protocol/coreproto.pyx":615 * else: * self.auth_msg = self._auth_password_message_sasl_initial( * sasl_auth_methods) # <<<<<<<<<<<<<< * * elif status == AUTH_SASL_CONTINUE: */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_password_message_sasl_initial(__pyx_v_self, __pyx_v_sasl_auth_methods); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/coreproto.pyx":614 * ", ".join(unsupported_sasl_auth_methods))) * else: * self.auth_msg = self._auth_password_message_sasl_initial( # <<<<<<<<<<<<<< * sasl_auth_methods) * */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_auth_msg, __pyx_t_2) < 0) __PYX_ERR(6, 614, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L6:; /* "asyncpg/protocol/coreproto.pyx":585 * self.auth_msg = self._auth_password_message_md5(md5_salt) * * elif status == AUTH_REQUIRED_SASL: # <<<<<<<<<<<<<< * # AuthenticationSASL * # This requires making additional requests to the server in order */ break; case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_SASL_CONTINUE: /* "asyncpg/protocol/coreproto.pyx":623 * # if this is valid. * # The client builds a challenge response to the server * server_response = self.buffer.consume_message() # <<<<<<<<<<<<<< * self.auth_msg = self._auth_password_message_sasl_continue( * server_response) */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->consume_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_server_response = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":624 * # The client builds a challenge response to the server * server_response = self.buffer.consume_message() * self.auth_msg = self._auth_password_message_sasl_continue( # <<<<<<<<<<<<<< * server_response) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_password_message_sasl_continue(__pyx_v_self, __pyx_v_server_response); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_auth_msg, __pyx_t_2) < 0) __PYX_ERR(6, 624, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":617 * sasl_auth_methods) * * elif status == AUTH_SASL_CONTINUE: # <<<<<<<<<<<<<< * # AUTH_SASL_CONTINUE * # this requeires sending the second part of the SASL exchange, where */ break; case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_SASL_FINAL: /* "asyncpg/protocol/coreproto.pyx":629 * elif status == AUTH_SASL_FINAL: * # AUTH_SASL_FINAL * server_response = self.buffer.consume_message() # <<<<<<<<<<<<<< * if not self.scram.verify_server_final_message(server_response): * self.result_type = RESULT_FAILED */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->consume_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_server_response = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":630 * # AUTH_SASL_FINAL * server_response = self.buffer.consume_message() * if not self.scram.verify_server_final_message(server_response): # <<<<<<<<<<<<<< * self.result_type = RESULT_FAILED * self.result = apg_exc.InterfaceError( */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_verify_server_final_message(__pyx_v_self->scram, __pyx_v_server_response); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(6, 630, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = (!__pyx_t_5); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":631 * server_response = self.buffer.consume_message() * if not self.scram.verify_server_final_message(server_response): * self.result_type = RESULT_FAILED # <<<<<<<<<<<<<< * self.result = apg_exc.InterfaceError( * 'could not verify server signature for ' */ __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED; /* "asyncpg/protocol/coreproto.pyx":632 * if not self.scram.verify_server_final_message(server_response): * self.result_type = RESULT_FAILED * self.result = apg_exc.InterfaceError( # <<<<<<<<<<<<<< * 'could not verify server signature for ' * 'SCRAM authentciation: scram-sha-256', */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_kp_u_could_not_verify_server_signatur}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->result); __Pyx_DECREF(__pyx_v_self->result); __pyx_v_self->result = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":630 * # AUTH_SASL_FINAL * server_response = self.buffer.consume_message() * if not self.scram.verify_server_final_message(server_response): # <<<<<<<<<<<<<< * self.result_type = RESULT_FAILED * self.result = apg_exc.InterfaceError( */ } /* "asyncpg/protocol/coreproto.pyx":636 * 'SCRAM authentciation: scram-sha-256', * ) * self.scram = None # <<<<<<<<<<<<<< * * elif status in (AUTH_REQUIRED_GSS, AUTH_REQUIRED_SSPI): */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF((PyObject *)__pyx_v_self->scram); __Pyx_DECREF((PyObject *)__pyx_v_self->scram); __pyx_v_self->scram = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)Py_None); /* "asyncpg/protocol/coreproto.pyx":627 * server_response) * * elif status == AUTH_SASL_FINAL: # <<<<<<<<<<<<<< * # AUTH_SASL_FINAL * server_response = self.buffer.consume_message() */ break; case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_GSS: /* "asyncpg/protocol/coreproto.pyx":638 * self.scram = None * * elif status in (AUTH_REQUIRED_GSS, AUTH_REQUIRED_SSPI): # <<<<<<<<<<<<<< * # AUTH_REQUIRED_SSPI is the same as AUTH_REQUIRED_GSS, except that * # it uses protocol negotiation with SSPI clients. Both methods use */ case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_SSPI: /* "asyncpg/protocol/coreproto.pyx":642 * # it uses protocol negotiation with SSPI clients. Both methods use * # AUTH_REQUIRED_GSS_CONTINUE for subsequent authentication steps. * if self.gss_ctx is not None: # <<<<<<<<<<<<<< * self.result_type = RESULT_FAILED * self.result = apg_exc.InterfaceError( */ __pyx_t_3 = (__pyx_v_self->gss_ctx != Py_None); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":643 * # AUTH_REQUIRED_GSS_CONTINUE for subsequent authentication steps. * if self.gss_ctx is not None: * self.result_type = RESULT_FAILED # <<<<<<<<<<<<<< * self.result = apg_exc.InterfaceError( * 'duplicate GSSAPI/SSPI authentication request') */ __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED; /* "asyncpg/protocol/coreproto.pyx":644 * if self.gss_ctx is not None: * self.result_type = RESULT_FAILED * self.result = apg_exc.InterfaceError( # <<<<<<<<<<<<<< * 'duplicate GSSAPI/SSPI authentication request') * else: */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_kp_u_duplicate_GSSAPI_SSPI_authentica}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->result); __Pyx_DECREF(__pyx_v_self->result); __pyx_v_self->result = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":642 * # it uses protocol negotiation with SSPI clients. Both methods use * # AUTH_REQUIRED_GSS_CONTINUE for subsequent authentication steps. * if self.gss_ctx is not None: # <<<<<<<<<<<<<< * self.result_type = RESULT_FAILED * self.result = apg_exc.InterfaceError( */ goto __pyx_L15; } /* "asyncpg/protocol/coreproto.pyx":647 * 'duplicate GSSAPI/SSPI authentication request') * else: * if self.con_params.gsslib == 'gssapi': # <<<<<<<<<<<<<< * self._auth_gss_init_gssapi() * else: */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->con_params, __pyx_n_s_gsslib); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_gssapi, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(6, 647, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":648 * else: * if self.con_params.gsslib == 'gssapi': * self._auth_gss_init_gssapi() # <<<<<<<<<<<<<< * else: * self._auth_gss_init_sspi(status == AUTH_REQUIRED_SSPI) */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_gss_init_gssapi(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":647 * 'duplicate GSSAPI/SSPI authentication request') * else: * if self.con_params.gsslib == 'gssapi': # <<<<<<<<<<<<<< * self._auth_gss_init_gssapi() * else: */ goto __pyx_L16; } /* "asyncpg/protocol/coreproto.pyx":650 * self._auth_gss_init_gssapi() * else: * self._auth_gss_init_sspi(status == AUTH_REQUIRED_SSPI) # <<<<<<<<<<<<<< * self.auth_msg = self._auth_gss_step(None) * */ /*else*/ { __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_gss_init_sspi(__pyx_v_self, (__pyx_v_status == __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_SSPI)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L16:; /* "asyncpg/protocol/coreproto.pyx":651 * else: * self._auth_gss_init_sspi(status == AUTH_REQUIRED_SSPI) * self.auth_msg = self._auth_gss_step(None) # <<<<<<<<<<<<<< * * elif status == AUTH_REQUIRED_GSS_CONTINUE: */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_gss_step(__pyx_v_self, ((PyObject*)Py_None)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_auth_msg, __pyx_t_2) < 0) __PYX_ERR(6, 651, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L15:; /* "asyncpg/protocol/coreproto.pyx":638 * self.scram = None * * elif status in (AUTH_REQUIRED_GSS, AUTH_REQUIRED_SSPI): # <<<<<<<<<<<<<< * # AUTH_REQUIRED_SSPI is the same as AUTH_REQUIRED_GSS, except that * # it uses protocol negotiation with SSPI clients. Both methods use */ break; case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_GSS_CONTINUE: /* "asyncpg/protocol/coreproto.pyx":654 * * elif status == AUTH_REQUIRED_GSS_CONTINUE: * server_response = self.buffer.consume_message() # <<<<<<<<<<<<<< * self.auth_msg = self._auth_gss_step(server_response) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->consume_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_server_response = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":655 * elif status == AUTH_REQUIRED_GSS_CONTINUE: * server_response = self.buffer.consume_message() * self.auth_msg = self._auth_gss_step(server_response) # <<<<<<<<<<<<<< * * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_gss_step(__pyx_v_self, __pyx_v_server_response); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_auth_msg, __pyx_t_2) < 0) __PYX_ERR(6, 655, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":653 * self.auth_msg = self._auth_gss_step(None) * * elif status == AUTH_REQUIRED_GSS_CONTINUE: # <<<<<<<<<<<<<< * server_response = self.buffer.consume_message() * self.auth_msg = self._auth_gss_step(server_response) */ break; default: /* "asyncpg/protocol/coreproto.pyx":658 * * else: * self.result_type = RESULT_FAILED # <<<<<<<<<<<<<< * self.result = apg_exc.InterfaceError( * 'unsupported authentication method requested by the ' */ __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED; /* "asyncpg/protocol/coreproto.pyx":659 * else: * self.result_type = RESULT_FAILED * self.result = apg_exc.InterfaceError( # <<<<<<<<<<<<<< * 'unsupported authentication method requested by the ' * 'server: {!r}'.format(AUTH_METHOD_NAME.get(status, status))) */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/coreproto.pyx":661 * self.result = apg_exc.InterfaceError( * 'unsupported authentication method requested by the ' * 'server: {!r}'.format(AUTH_METHOD_NAME.get(status, status))) # <<<<<<<<<<<<<< * * if status not in (AUTH_SASL_CONTINUE, AUTH_SASL_FINAL, */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unsupported_authentication_metho, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (unlikely(__pyx_v_7asyncpg_8protocol_8protocol_AUTH_METHOD_NAME == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(6, 661, __pyx_L1_error) } __pyx_t_10 = __Pyx_PyInt_From_int32_t(__pyx_v_status); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_PyInt_From_int32_t(__pyx_v_status); if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyDict_GetItemDefault(__pyx_v_7asyncpg_8protocol_8protocol_AUTH_METHOD_NAME, __pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_13}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_t_9 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_8}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } /* "asyncpg/protocol/coreproto.pyx":659 * else: * self.result_type = RESULT_FAILED * self.result = apg_exc.InterfaceError( # <<<<<<<<<<<<<< * 'unsupported authentication method requested by the ' * 'server: {!r}'.format(AUTH_METHOD_NAME.get(status, status))) */ __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->result); __Pyx_DECREF(__pyx_v_self->result); __pyx_v_self->result = __pyx_t_2; __pyx_t_2 = 0; break; } /* "asyncpg/protocol/coreproto.pyx":663 * 'server: {!r}'.format(AUTH_METHOD_NAME.get(status, status))) * * if status not in (AUTH_SASL_CONTINUE, AUTH_SASL_FINAL, # <<<<<<<<<<<<<< * AUTH_REQUIRED_GSS_CONTINUE): * self.buffer.discard_message() */ switch (__pyx_v_status) { case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_SASL_CONTINUE: case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_SASL_FINAL: case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_GSS_CONTINUE: /* "asyncpg/protocol/coreproto.pyx":664 * * if status not in (AUTH_SASL_CONTINUE, AUTH_SASL_FINAL, * AUTH_REQUIRED_GSS_CONTINUE): # <<<<<<<<<<<<<< * self.buffer.discard_message() * */ __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":663 * 'server: {!r}'.format(AUTH_METHOD_NAME.get(status, status))) * * if status not in (AUTH_SASL_CONTINUE, AUTH_SASL_FINAL, # <<<<<<<<<<<<<< * AUTH_REQUIRED_GSS_CONTINUE): * self.buffer.discard_message() */ break; default: __pyx_t_3 = 1; break; } __pyx_t_5 = __pyx_t_3; if (__pyx_t_5) { /* "asyncpg/protocol/coreproto.pyx":665 * if status not in (AUTH_SASL_CONTINUE, AUTH_SASL_FINAL, * AUTH_REQUIRED_GSS_CONTINUE): * self.buffer.discard_message() # <<<<<<<<<<<<<< * * cdef _auth_password_message_cleartext(self): */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":663 * 'server: {!r}'.format(AUTH_METHOD_NAME.get(status, status))) * * if status not in (AUTH_SASL_CONTINUE, AUTH_SASL_FINAL, # <<<<<<<<<<<<<< * AUTH_REQUIRED_GSS_CONTINUE): * self.buffer.discard_message() */ } /* "asyncpg/protocol/coreproto.pyx":561 * self._on_notification(pid, channel, payload) * * cdef _parse_msg_authentication(self): # <<<<<<<<<<<<<< * cdef: * int32_t status */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._parse_msg_authentication", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_md5_salt); __Pyx_XDECREF(__pyx_v_sasl_auth_methods); __Pyx_XDECREF(__pyx_v_unsupported_sasl_auth_methods); __Pyx_XDECREF(__pyx_v_auth_method); __Pyx_XDECREF(__pyx_v_server_response); __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_m); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":667 * self.buffer.discard_message() * * cdef _auth_password_message_cleartext(self): # <<<<<<<<<<<<<< * cdef: * WriteBuffer msg */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_cleartext(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_msg = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_auth_password_message_cleartext", 1); /* "asyncpg/protocol/coreproto.pyx":671 * WriteBuffer msg * * msg = WriteBuffer.new_message(b'p') # <<<<<<<<<<<<<< * msg.write_bytestring(self.password.encode(self.encoding)) * msg.end_message() */ __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('p')); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_msg = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":672 * * msg = WriteBuffer.new_message(b'p') * msg.write_bytestring(self.password.encode(self.encoding)) # <<<<<<<<<<<<<< * msg.end_message() * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_password); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->encoding}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(6, 672, __pyx_L1_error) __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_msg->__pyx_vtab)->write_bytestring(__pyx_v_msg, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":673 * msg = WriteBuffer.new_message(b'p') * msg.write_bytestring(self.password.encode(self.encoding)) * msg.end_message() # <<<<<<<<<<<<<< * * return msg */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_msg->__pyx_vtab)->end_message(__pyx_v_msg); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":675 * msg.end_message() * * return msg # <<<<<<<<<<<<<< * * cdef _auth_password_message_md5(self, bytes salt): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_msg); __pyx_r = ((PyObject *)__pyx_v_msg); goto __pyx_L0; /* "asyncpg/protocol/coreproto.pyx":667 * self.buffer.discard_message() * * cdef _auth_password_message_cleartext(self): # <<<<<<<<<<<<<< * cdef: * WriteBuffer msg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._auth_password_message_cleartext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_msg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":677 * return msg * * cdef _auth_password_message_md5(self, bytes salt): # <<<<<<<<<<<<<< * cdef: * WriteBuffer msg */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_md5(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_salt) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_msg = 0; PyObject *__pyx_v_userpass = NULL; PyObject *__pyx_v_md5_1 = NULL; PyObject *__pyx_v_md5_2 = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_auth_password_message_md5", 1); /* "asyncpg/protocol/coreproto.pyx":681 * WriteBuffer msg * * msg = WriteBuffer.new_message(b'p') # <<<<<<<<<<<<<< * * # 'md5' + md5(md5(password + username) + salt)) */ __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('p')); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_msg = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":684 * * # 'md5' + md5(md5(password + username) + salt)) * userpass = (self.password or '') + (self.user or '') # <<<<<<<<<<<<<< * md5_1 = hashlib.md5(userpass.encode(self.encoding)).hexdigest() * md5_2 = hashlib.md5(md5_1.encode('ascii') + salt).hexdigest() */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_password); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(6, 684, __pyx_L1_error) if (!__pyx_t_3) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L3_bool_binop_done; } __Pyx_INCREF(__pyx_kp_u__34); __pyx_t_1 = __pyx_kp_u__34; __pyx_L3_bool_binop_done:; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_user); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(6, 684, __pyx_L1_error) if (!__pyx_t_3) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5_bool_binop_done; } __Pyx_INCREF(__pyx_kp_u__34); __pyx_t_2 = __pyx_kp_u__34; __pyx_L5_bool_binop_done:; __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_userpass = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":685 * # 'md5' + md5(md5(password + username) + salt)) * userpass = (self.password or '') + (self.user or '') * md5_1 = hashlib.md5(userpass.encode(self.encoding)).hexdigest() # <<<<<<<<<<<<<< * md5_2 = hashlib.md5(md5_1.encode('ascii') + salt).hexdigest() * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hashlib); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_md5); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_userpass, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_self->encoding}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_hexdigest); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_md5_1 = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":686 * userpass = (self.password or '') + (self.user or '') * md5_1 = hashlib.md5(userpass.encode(self.encoding)).hexdigest() * md5_2 = hashlib.md5(md5_1.encode('ascii') + salt).hexdigest() # <<<<<<<<<<<<<< * * msg.write_bytestring(b'md5' + md5_2.encode('ascii')) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_hashlib); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_md5); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_md5_1, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_n_u_ascii}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_v_salt); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_6}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_hexdigest); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_md5_2 = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":688 * md5_2 = hashlib.md5(md5_1.encode('ascii') + salt).hexdigest() * * msg.write_bytestring(b'md5' + md5_2.encode('ascii')) # <<<<<<<<<<<<<< * msg.end_message() * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_md5_2, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_n_u_ascii}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_1 = PyNumber_Add(__pyx_n_b_md5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(6, 688, __pyx_L1_error) __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_msg->__pyx_vtab)->write_bytestring(__pyx_v_msg, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":689 * * msg.write_bytestring(b'md5' + md5_2.encode('ascii')) * msg.end_message() # <<<<<<<<<<<<<< * * return msg */ __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_msg->__pyx_vtab)->end_message(__pyx_v_msg); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":691 * msg.end_message() * * return msg # <<<<<<<<<<<<<< * * cdef _auth_password_message_sasl_initial(self, list sasl_auth_methods): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_msg); __pyx_r = ((PyObject *)__pyx_v_msg); goto __pyx_L0; /* "asyncpg/protocol/coreproto.pyx":677 * return msg * * cdef _auth_password_message_md5(self, bytes salt): # <<<<<<<<<<<<<< * cdef: * WriteBuffer msg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._auth_password_message_md5", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_msg); __Pyx_XDECREF(__pyx_v_userpass); __Pyx_XDECREF(__pyx_v_md5_1); __Pyx_XDECREF(__pyx_v_md5_2); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":693 * return msg * * cdef _auth_password_message_sasl_initial(self, list sasl_auth_methods): # <<<<<<<<<<<<<< * cdef: * WriteBuffer msg */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_sasl_initial(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_sasl_auth_methods) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_msg = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_auth_password_message_sasl_initial", 1); /* "asyncpg/protocol/coreproto.pyx":698 * * # use the first supported advertized mechanism * self.scram = SCRAMAuthentication(sasl_auth_methods[0]) # <<<<<<<<<<<<<< * # this involves a call and response with the server * msg = WriteBuffer.new_message(b'p') */ if (unlikely(__pyx_v_sasl_auth_methods == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(6, 698, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_sasl_auth_methods, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF((PyObject *)__pyx_v_self->scram); __Pyx_DECREF((PyObject *)__pyx_v_self->scram); __pyx_v_self->scram = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":700 * self.scram = SCRAMAuthentication(sasl_auth_methods[0]) * # this involves a call and response with the server * msg = WriteBuffer.new_message(b'p') # <<<<<<<<<<<<<< * msg.write_bytes(self.scram.create_client_first_message(self.user or '')) * msg.end_message() */ __pyx_t_2 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('p')); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_msg = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":701 * # this involves a call and response with the server * msg = WriteBuffer.new_message(b'p') * msg.write_bytes(self.scram.create_client_first_message(self.user or '')) # <<<<<<<<<<<<<< * msg.end_message() * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_user); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(6, 701, __pyx_L1_error) if (!__pyx_t_3) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(6, 701, __pyx_L1_error) __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L3_bool_binop_done; } __Pyx_INCREF(__pyx_kp_u__34); __pyx_t_2 = __pyx_kp_u__34; __pyx_L3_bool_binop_done:; __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_create_client_first_message(__pyx_v_self->scram, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(6, 701, __pyx_L1_error) __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_msg->__pyx_vtab)->write_bytes(__pyx_v_msg, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":702 * msg = WriteBuffer.new_message(b'p') * msg.write_bytes(self.scram.create_client_first_message(self.user or '')) * msg.end_message() # <<<<<<<<<<<<<< * * return msg */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_msg->__pyx_vtab)->end_message(__pyx_v_msg); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":704 * msg.end_message() * * return msg # <<<<<<<<<<<<<< * * cdef _auth_password_message_sasl_continue(self, bytes server_response): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_msg); __pyx_r = ((PyObject *)__pyx_v_msg); goto __pyx_L0; /* "asyncpg/protocol/coreproto.pyx":693 * return msg * * cdef _auth_password_message_sasl_initial(self, list sasl_auth_methods): # <<<<<<<<<<<<<< * cdef: * WriteBuffer msg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._auth_password_message_sasl_initial", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_msg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":706 * return msg * * cdef _auth_password_message_sasl_continue(self, bytes server_response): # <<<<<<<<<<<<<< * cdef: * WriteBuffer msg */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_sasl_continue(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_server_response) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_msg = 0; PyObject *__pyx_v_client_final_message = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_auth_password_message_sasl_continue", 1); /* "asyncpg/protocol/coreproto.pyx":711 * * # determine if there is a valid server response * self.scram.parse_server_first_message(server_response) # <<<<<<<<<<<<<< * # this involves a call and response with the server * msg = WriteBuffer.new_message(b'p') */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_parse_server_first_message(__pyx_v_self->scram, __pyx_v_server_response); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":713 * self.scram.parse_server_first_message(server_response) * # this involves a call and response with the server * msg = WriteBuffer.new_message(b'p') # <<<<<<<<<<<<<< * client_final_message = self.scram.create_client_final_message( * self.password or '') */ __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('p')); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_msg = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":715 * msg = WriteBuffer.new_message(b'p') * client_final_message = self.scram.create_client_final_message( * self.password or '') # <<<<<<<<<<<<<< * msg.write_bytes(client_final_message) * msg.end_message() */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_password); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(6, 715, __pyx_L1_error) if (!__pyx_t_3) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(6, 715, __pyx_L1_error) __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L3_bool_binop_done; } __Pyx_INCREF(__pyx_kp_u__34); __pyx_t_1 = __pyx_kp_u__34; __pyx_L3_bool_binop_done:; /* "asyncpg/protocol/coreproto.pyx":714 * # this involves a call and response with the server * msg = WriteBuffer.new_message(b'p') * client_final_message = self.scram.create_client_final_message( # <<<<<<<<<<<<<< * self.password or '') * msg.write_bytes(client_final_message) */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_create_client_final_message(__pyx_v_self->scram, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_client_final_message = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":716 * client_final_message = self.scram.create_client_final_message( * self.password or '') * msg.write_bytes(client_final_message) # <<<<<<<<<<<<<< * msg.end_message() * */ if (!(likely(PyBytes_CheckExact(__pyx_v_client_final_message))||((__pyx_v_client_final_message) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_v_client_final_message))) __PYX_ERR(6, 716, __pyx_L1_error) __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_msg->__pyx_vtab)->write_bytes(__pyx_v_msg, ((PyObject*)__pyx_v_client_final_message)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":717 * self.password or '') * msg.write_bytes(client_final_message) * msg.end_message() # <<<<<<<<<<<<<< * * return msg */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_msg->__pyx_vtab)->end_message(__pyx_v_msg); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":719 * msg.end_message() * * return msg # <<<<<<<<<<<<<< * * cdef _auth_gss_init_gssapi(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_msg); __pyx_r = ((PyObject *)__pyx_v_msg); goto __pyx_L0; /* "asyncpg/protocol/coreproto.pyx":706 * return msg * * cdef _auth_password_message_sasl_continue(self, bytes server_response): # <<<<<<<<<<<<<< * cdef: * WriteBuffer msg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._auth_password_message_sasl_continue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_msg); __Pyx_XDECREF(__pyx_v_client_final_message); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":721 * return msg * * cdef _auth_gss_init_gssapi(self): # <<<<<<<<<<<<<< * try: * import gssapi */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_init_gssapi(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { PyObject *__pyx_v_gssapi = NULL; PyObject *__pyx_v_service_name = NULL; PyObject *__pyx_v_host = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; unsigned int __pyx_t_11; PyObject *(*__pyx_t_12)(PyObject *); Py_ssize_t __pyx_t_13; Py_UCS4 __pyx_t_14; PyObject *__pyx_t_15 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_auth_gss_init_gssapi", 1); /* "asyncpg/protocol/coreproto.pyx":722 * * cdef _auth_gss_init_gssapi(self): * try: # <<<<<<<<<<<<<< * import gssapi * except ModuleNotFoundError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "asyncpg/protocol/coreproto.pyx":723 * cdef _auth_gss_init_gssapi(self): * try: * import gssapi # <<<<<<<<<<<<<< * except ModuleNotFoundError: * raise apg_exc.InterfaceError( */ __pyx_t_4 = __Pyx_ImportDottedModule(__pyx_n_s_gssapi, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 723, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_gssapi = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":722 * * cdef _auth_gss_init_gssapi(self): * try: # <<<<<<<<<<<<<< * import gssapi * except ModuleNotFoundError: */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":724 * try: * import gssapi * except ModuleNotFoundError: # <<<<<<<<<<<<<< * raise apg_exc.InterfaceError( * 'gssapi module not found; please install asyncpg[gssauth] to ' */ __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ModuleNotFoundError); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 724, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_ErrRestore(__pyx_t_4, __pyx_t_5, __pyx_t_6); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; if (__pyx_t_8) { __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._auth_gss_init_gssapi", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(6, 724, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); /* "asyncpg/protocol/coreproto.pyx":725 * import gssapi * except ModuleNotFoundError: * raise apg_exc.InterfaceError( # <<<<<<<<<<<<<< * 'gssapi module not found; please install asyncpg[gssauth] to ' * 'use asyncpg with Kerberos/GSSAPI/SSPI authentication' */ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 725, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 725, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_kp_u_gssapi_module_not_found_please_i}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 725, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } /* "asyncpg/protocol/coreproto.pyx":728 * 'gssapi module not found; please install asyncpg[gssauth] to ' * 'use asyncpg with Kerberos/GSSAPI/SSPI authentication' * ) from None # <<<<<<<<<<<<<< * * service_name, host = self._auth_gss_get_service() */ __Pyx_Raise(__pyx_t_7, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(6, 725, __pyx_L5_except_error) } goto __pyx_L5_except_error; /* "asyncpg/protocol/coreproto.pyx":722 * * cdef _auth_gss_init_gssapi(self): * try: # <<<<<<<<<<<<<< * import gssapi * except ModuleNotFoundError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L8_try_end:; } /* "asyncpg/protocol/coreproto.pyx":730 * ) from None * * service_name, host = self._auth_gss_get_service() # <<<<<<<<<<<<<< * self.gss_ctx = gssapi.SecurityContext( * name=gssapi.Name( */ __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_gss_get_service(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(6, 730, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_5 = __pyx_t_12(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_12(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_7), 2) < 0) __PYX_ERR(6, 730, __pyx_L1_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L12_unpacking_done; __pyx_L11_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(6, 730, __pyx_L1_error) __pyx_L12_unpacking_done:; } __pyx_v_service_name = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_host = __pyx_t_6; __pyx_t_6 = 0; /* "asyncpg/protocol/coreproto.pyx":731 * * service_name, host = self._auth_gss_get_service() * self.gss_ctx = gssapi.SecurityContext( # <<<<<<<<<<<<<< * name=gssapi.Name( * f'{service_name}@{host}', gssapi.NameType.hostbased_service), */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_gssapi, __pyx_n_s_SecurityContext); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/coreproto.pyx":732 * service_name, host = self._auth_gss_get_service() * self.gss_ctx = gssapi.SecurityContext( * name=gssapi.Name( # <<<<<<<<<<<<<< * f'{service_name}@{host}', gssapi.NameType.hostbased_service), * usage='initiate') */ __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_gssapi, __pyx_n_s_Name); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* "asyncpg/protocol/coreproto.pyx":733 * self.gss_ctx = gssapi.SecurityContext( * name=gssapi.Name( * f'{service_name}@{host}', gssapi.NameType.hostbased_service), # <<<<<<<<<<<<<< * usage='initiate') * */ __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_13 = 0; __pyx_t_14 = 127; __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_v_service_name, __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_14; __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = 0; __Pyx_INCREF(__pyx_kp_u__38); __pyx_t_13 += 1; __Pyx_GIVEREF(__pyx_kp_u__38); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_kp_u__38); __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_v_host, __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_14; __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_10, 3, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_gssapi, __pyx_n_s_NameType); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_hostbased_service); if (unlikely(!__pyx_t_15)) __PYX_ERR(6, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_9, __pyx_t_15}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_11, 2+__pyx_t_11); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_name, __pyx_t_5) < 0) __PYX_ERR(6, 732, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_usage, __pyx_n_u_initiate) < 0) __PYX_ERR(6, 732, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":731 * * service_name, host = self._auth_gss_get_service() * self.gss_ctx = gssapi.SecurityContext( # <<<<<<<<<<<<<< * name=gssapi.Name( * f'{service_name}@{host}', gssapi.NameType.hostbased_service), */ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->gss_ctx); __Pyx_DECREF(__pyx_v_self->gss_ctx); __pyx_v_self->gss_ctx = __pyx_t_5; __pyx_t_5 = 0; /* "asyncpg/protocol/coreproto.pyx":721 * return msg * * cdef _auth_gss_init_gssapi(self): # <<<<<<<<<<<<<< * try: * import gssapi */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._auth_gss_init_gssapi", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_gssapi); __Pyx_XDECREF(__pyx_v_service_name); __Pyx_XDECREF(__pyx_v_host); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":736 * usage='initiate') * * cdef _auth_gss_init_sspi(self, bint negotiate): # <<<<<<<<<<<<<< * try: * import sspilib */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_init_sspi(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, int __pyx_v_negotiate) { PyObject *__pyx_v_sspilib = NULL; PyObject *__pyx_v_service_name = NULL; PyObject *__pyx_v_host = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; unsigned int __pyx_t_11; PyObject *(*__pyx_t_12)(PyObject *); Py_ssize_t __pyx_t_13; Py_UCS4 __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_auth_gss_init_sspi", 1); /* "asyncpg/protocol/coreproto.pyx":737 * * cdef _auth_gss_init_sspi(self, bint negotiate): * try: # <<<<<<<<<<<<<< * import sspilib * except ModuleNotFoundError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "asyncpg/protocol/coreproto.pyx":738 * cdef _auth_gss_init_sspi(self, bint negotiate): * try: * import sspilib # <<<<<<<<<<<<<< * except ModuleNotFoundError: * raise apg_exc.InterfaceError( */ __pyx_t_4 = __Pyx_ImportDottedModule(__pyx_n_s_sspilib, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 738, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_sspilib = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":737 * * cdef _auth_gss_init_sspi(self, bint negotiate): * try: # <<<<<<<<<<<<<< * import sspilib * except ModuleNotFoundError: */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":739 * try: * import sspilib * except ModuleNotFoundError: # <<<<<<<<<<<<<< * raise apg_exc.InterfaceError( * 'sspilib module not found; please install asyncpg[gssauth] to ' */ __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ModuleNotFoundError); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 739, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_ErrRestore(__pyx_t_4, __pyx_t_5, __pyx_t_6); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; if (__pyx_t_8) { __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._auth_gss_init_sspi", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(6, 739, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); /* "asyncpg/protocol/coreproto.pyx":740 * import sspilib * except ModuleNotFoundError: * raise apg_exc.InterfaceError( # <<<<<<<<<<<<<< * 'sspilib module not found; please install asyncpg[gssauth] to ' * 'use asyncpg with Kerberos/GSSAPI/SSPI authentication' */ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 740, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 740, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_kp_u_sspilib_module_not_found_please}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 740, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } /* "asyncpg/protocol/coreproto.pyx":743 * 'sspilib module not found; please install asyncpg[gssauth] to ' * 'use asyncpg with Kerberos/GSSAPI/SSPI authentication' * ) from None # <<<<<<<<<<<<<< * * service_name, host = self._auth_gss_get_service() */ __Pyx_Raise(__pyx_t_7, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(6, 740, __pyx_L5_except_error) } goto __pyx_L5_except_error; /* "asyncpg/protocol/coreproto.pyx":737 * * cdef _auth_gss_init_sspi(self, bint negotiate): * try: # <<<<<<<<<<<<<< * import sspilib * except ModuleNotFoundError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L8_try_end:; } /* "asyncpg/protocol/coreproto.pyx":745 * ) from None * * service_name, host = self._auth_gss_get_service() # <<<<<<<<<<<<<< * self.gss_ctx = sspilib.ClientSecurityContext( * target_name=f'{service_name}/{host}', */ __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_gss_get_service(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(6, 745, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); index = 0; __pyx_t_5 = __pyx_t_12(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_12(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_7), 2) < 0) __PYX_ERR(6, 745, __pyx_L1_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L12_unpacking_done; __pyx_L11_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(6, 745, __pyx_L1_error) __pyx_L12_unpacking_done:; } __pyx_v_service_name = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_host = __pyx_t_6; __pyx_t_6 = 0; /* "asyncpg/protocol/coreproto.pyx":746 * * service_name, host = self._auth_gss_get_service() * self.gss_ctx = sspilib.ClientSecurityContext( # <<<<<<<<<<<<<< * target_name=f'{service_name}/{host}', * credential=sspilib.UserCredential( */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_sspilib, __pyx_n_s_ClientSecurityContext); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/coreproto.pyx":747 * service_name, host = self._auth_gss_get_service() * self.gss_ctx = sspilib.ClientSecurityContext( * target_name=f'{service_name}/{host}', # <<<<<<<<<<<<<< * credential=sspilib.UserCredential( * protocol='Negotiate' if negotiate else 'Kerberos')) */ __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_13 = 0; __pyx_t_14 = 127; __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_service_name, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_14; __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = 0; __Pyx_INCREF(__pyx_kp_u__39); __pyx_t_13 += 1; __Pyx_GIVEREF(__pyx_kp_u__39); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_u__39); __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_host, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_14; __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_target_name, __pyx_t_7) < 0) __PYX_ERR(6, 747, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/coreproto.pyx":748 * self.gss_ctx = sspilib.ClientSecurityContext( * target_name=f'{service_name}/{host}', * credential=sspilib.UserCredential( # <<<<<<<<<<<<<< * protocol='Negotiate' if negotiate else 'Kerberos')) * */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_sspilib, __pyx_n_s_UserCredential); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* "asyncpg/protocol/coreproto.pyx":749 * target_name=f'{service_name}/{host}', * credential=sspilib.UserCredential( * protocol='Negotiate' if negotiate else 'Kerberos')) # <<<<<<<<<<<<<< * * cdef _auth_gss_get_service(self): */ __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_v_negotiate) { __Pyx_INCREF(__pyx_n_u_Negotiate); __pyx_t_10 = __pyx_n_u_Negotiate; } else { __Pyx_INCREF(__pyx_n_u_Kerberos); __pyx_t_10 = __pyx_n_u_Kerberos; } if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_protocol, __pyx_t_10) < 0) __PYX_ERR(6, 749, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/coreproto.pyx":748 * self.gss_ctx = sspilib.ClientSecurityContext( * target_name=f'{service_name}/{host}', * credential=sspilib.UserCredential( # <<<<<<<<<<<<<< * protocol='Negotiate' if negotiate else 'Kerberos')) * */ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_credential, __pyx_t_10) < 0) __PYX_ERR(6, 747, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/coreproto.pyx":746 * * service_name, host = self._auth_gss_get_service() * self.gss_ctx = sspilib.ClientSecurityContext( # <<<<<<<<<<<<<< * target_name=f'{service_name}/{host}', * credential=sspilib.UserCredential( */ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GIVEREF(__pyx_t_10); __Pyx_GOTREF(__pyx_v_self->gss_ctx); __Pyx_DECREF(__pyx_v_self->gss_ctx); __pyx_v_self->gss_ctx = __pyx_t_10; __pyx_t_10 = 0; /* "asyncpg/protocol/coreproto.pyx":736 * usage='initiate') * * cdef _auth_gss_init_sspi(self, bint negotiate): # <<<<<<<<<<<<<< * try: * import sspilib */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._auth_gss_init_sspi", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_sspilib); __Pyx_XDECREF(__pyx_v_service_name); __Pyx_XDECREF(__pyx_v_host); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":751 * protocol='Negotiate' if negotiate else 'Kerberos')) * * cdef _auth_gss_get_service(self): # <<<<<<<<<<<<<< * service_name = self.con_params.krbsrvname or 'postgres' * if isinstance(self.address, str): */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_get_service(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { PyObject *__pyx_v_service_name = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_auth_gss_get_service", 1); /* "asyncpg/protocol/coreproto.pyx":752 * * cdef _auth_gss_get_service(self): * service_name = self.con_params.krbsrvname or 'postgres' # <<<<<<<<<<<<<< * if isinstance(self.address, str): * raise apg_exc.InternalClientError( */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->con_params, __pyx_n_s_krbsrvname); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(6, 752, __pyx_L1_error) if (!__pyx_t_3) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L3_bool_binop_done; } __Pyx_INCREF(__pyx_n_u_postgres); __pyx_t_1 = __pyx_n_u_postgres; __pyx_L3_bool_binop_done:; __pyx_v_service_name = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":753 * cdef _auth_gss_get_service(self): * service_name = self.con_params.krbsrvname or 'postgres' * if isinstance(self.address, str): # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * 'GSSAPI/SSPI authentication is only supported for TCP/IP ' */ __pyx_t_1 = __pyx_v_self->address; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyUnicode_Check(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_3)) { /* "asyncpg/protocol/coreproto.pyx":754 * service_name = self.con_params.krbsrvname or 'postgres' * if isinstance(self.address, str): * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * 'GSSAPI/SSPI authentication is only supported for TCP/IP ' * 'connections') */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_GSSAPI_SSPI_authentication_is_on}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(6, 754, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":753 * cdef _auth_gss_get_service(self): * service_name = self.con_params.krbsrvname or 'postgres' * if isinstance(self.address, str): # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * 'GSSAPI/SSPI authentication is only supported for TCP/IP ' */ } /* "asyncpg/protocol/coreproto.pyx":758 * 'connections') * * return service_name, self.address[0] # <<<<<<<<<<<<<< * * cdef _auth_gss_step(self, bytes server_response): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->address, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_service_name); __Pyx_GIVEREF(__pyx_v_service_name); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_service_name)) __PYX_ERR(6, 758, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(6, 758, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "asyncpg/protocol/coreproto.pyx":751 * protocol='Negotiate' if negotiate else 'Kerberos')) * * cdef _auth_gss_get_service(self): # <<<<<<<<<<<<<< * service_name = self.con_params.krbsrvname or 'postgres' * if isinstance(self.address, str): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._auth_gss_get_service", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_service_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":760 * return service_name, self.address[0] * * cdef _auth_gss_step(self, bytes server_response): # <<<<<<<<<<<<<< * cdef: * WriteBuffer msg */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_step(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_server_response) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_msg = 0; PyObject *__pyx_v_token = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_auth_gss_step", 1); /* "asyncpg/protocol/coreproto.pyx":764 * WriteBuffer msg * * token = self.gss_ctx.step(server_response) # <<<<<<<<<<<<<< * if not token: * self.gss_ctx = None */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->gss_ctx, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_server_response}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_token = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":765 * * token = self.gss_ctx.step(server_response) * if not token: # <<<<<<<<<<<<<< * self.gss_ctx = None * return None */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_token); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(6, 765, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { /* "asyncpg/protocol/coreproto.pyx":766 * token = self.gss_ctx.step(server_response) * if not token: * self.gss_ctx = None # <<<<<<<<<<<<<< * return None * msg = WriteBuffer.new_message(b'p') */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->gss_ctx); __Pyx_DECREF(__pyx_v_self->gss_ctx); __pyx_v_self->gss_ctx = Py_None; /* "asyncpg/protocol/coreproto.pyx":767 * if not token: * self.gss_ctx = None * return None # <<<<<<<<<<<<<< * msg = WriteBuffer.new_message(b'p') * msg.write_bytes(token) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/protocol/coreproto.pyx":765 * * token = self.gss_ctx.step(server_response) * if not token: # <<<<<<<<<<<<<< * self.gss_ctx = None * return None */ } /* "asyncpg/protocol/coreproto.pyx":768 * self.gss_ctx = None * return None * msg = WriteBuffer.new_message(b'p') # <<<<<<<<<<<<<< * msg.write_bytes(token) * msg.end_message() */ __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('p')); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_msg = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":769 * return None * msg = WriteBuffer.new_message(b'p') * msg.write_bytes(token) # <<<<<<<<<<<<<< * msg.end_message() * */ if (!(likely(PyBytes_CheckExact(__pyx_v_token))||((__pyx_v_token) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_v_token))) __PYX_ERR(6, 769, __pyx_L1_error) __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_msg->__pyx_vtab)->write_bytes(__pyx_v_msg, ((PyObject*)__pyx_v_token)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":770 * msg = WriteBuffer.new_message(b'p') * msg.write_bytes(token) * msg.end_message() # <<<<<<<<<<<<<< * * return msg */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_msg->__pyx_vtab)->end_message(__pyx_v_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":772 * msg.end_message() * * return msg # <<<<<<<<<<<<<< * * cdef _parse_msg_ready_for_query(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_msg); __pyx_r = ((PyObject *)__pyx_v_msg); goto __pyx_L0; /* "asyncpg/protocol/coreproto.pyx":760 * return service_name, self.address[0] * * cdef _auth_gss_step(self, bytes server_response): # <<<<<<<<<<<<<< * cdef: * WriteBuffer msg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._auth_gss_step", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_msg); __Pyx_XDECREF(__pyx_v_token); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":774 * return msg * * cdef _parse_msg_ready_for_query(self): # <<<<<<<<<<<<<< * cdef char status = self.buffer.read_byte() * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_ready_for_query(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { char __pyx_v_status; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_msg_ready_for_query", 1); /* "asyncpg/protocol/coreproto.pyx":775 * * cdef _parse_msg_ready_for_query(self): * cdef char status = self.buffer.read_byte() # <<<<<<<<<<<<<< * * if status == b'I': */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_byte(__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((char)-1) && PyErr_Occurred())) __PYX_ERR(6, 775, __pyx_L1_error) __pyx_v_status = __pyx_t_1; /* "asyncpg/protocol/coreproto.pyx":777 * cdef char status = self.buffer.read_byte() * * if status == b'I': # <<<<<<<<<<<<<< * self.xact_status = PQTRANS_IDLE * elif status == b'T': */ switch (__pyx_v_status) { case 'I': /* "asyncpg/protocol/coreproto.pyx":778 * * if status == b'I': * self.xact_status = PQTRANS_IDLE # <<<<<<<<<<<<<< * elif status == b'T': * self.xact_status = PQTRANS_INTRANS */ __pyx_v_self->xact_status = __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_IDLE; /* "asyncpg/protocol/coreproto.pyx":777 * cdef char status = self.buffer.read_byte() * * if status == b'I': # <<<<<<<<<<<<<< * self.xact_status = PQTRANS_IDLE * elif status == b'T': */ break; case 'T': /* "asyncpg/protocol/coreproto.pyx":780 * self.xact_status = PQTRANS_IDLE * elif status == b'T': * self.xact_status = PQTRANS_INTRANS # <<<<<<<<<<<<<< * elif status == b'E': * self.xact_status = PQTRANS_INERROR */ __pyx_v_self->xact_status = __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_INTRANS; /* "asyncpg/protocol/coreproto.pyx":779 * if status == b'I': * self.xact_status = PQTRANS_IDLE * elif status == b'T': # <<<<<<<<<<<<<< * self.xact_status = PQTRANS_INTRANS * elif status == b'E': */ break; case 'E': /* "asyncpg/protocol/coreproto.pyx":782 * self.xact_status = PQTRANS_INTRANS * elif status == b'E': * self.xact_status = PQTRANS_INERROR # <<<<<<<<<<<<<< * else: * self.xact_status = PQTRANS_UNKNOWN */ __pyx_v_self->xact_status = __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_INERROR; /* "asyncpg/protocol/coreproto.pyx":781 * elif status == b'T': * self.xact_status = PQTRANS_INTRANS * elif status == b'E': # <<<<<<<<<<<<<< * self.xact_status = PQTRANS_INERROR * else: */ break; default: /* "asyncpg/protocol/coreproto.pyx":784 * self.xact_status = PQTRANS_INERROR * else: * self.xact_status = PQTRANS_UNKNOWN # <<<<<<<<<<<<<< * * cdef _parse_msg_error_response(self, is_error): */ __pyx_v_self->xact_status = __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_UNKNOWN; break; } /* "asyncpg/protocol/coreproto.pyx":774 * return msg * * cdef _parse_msg_ready_for_query(self): # <<<<<<<<<<<<<< * cdef char status = self.buffer.read_byte() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._parse_msg_ready_for_query", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":786 * self.xact_status = PQTRANS_UNKNOWN * * cdef _parse_msg_error_response(self, is_error): # <<<<<<<<<<<<<< * cdef: * char code */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_error_response(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_is_error) { char __pyx_v_code; PyObject *__pyx_v_message = 0; PyObject *__pyx_v_parsed = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse_msg_error_response", 1); /* "asyncpg/protocol/coreproto.pyx":790 * char code * bytes message * dict parsed = {} # <<<<<<<<<<<<<< * * while True: */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_parsed = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":792 * dict parsed = {} * * while True: # <<<<<<<<<<<<<< * code = self.buffer.read_byte() * if code == 0: */ while (1) { /* "asyncpg/protocol/coreproto.pyx":793 * * while True: * code = self.buffer.read_byte() # <<<<<<<<<<<<<< * if code == 0: * break */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_byte(__pyx_v_self->buffer); if (unlikely(__pyx_t_2 == ((char)-1) && PyErr_Occurred())) __PYX_ERR(6, 793, __pyx_L1_error) __pyx_v_code = __pyx_t_2; /* "asyncpg/protocol/coreproto.pyx":794 * while True: * code = self.buffer.read_byte() * if code == 0: # <<<<<<<<<<<<<< * break * */ __pyx_t_3 = (__pyx_v_code == 0); if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":795 * code = self.buffer.read_byte() * if code == 0: * break # <<<<<<<<<<<<<< * * message = self.buffer.read_null_str() */ goto __pyx_L4_break; /* "asyncpg/protocol/coreproto.pyx":794 * while True: * code = self.buffer.read_byte() * if code == 0: # <<<<<<<<<<<<<< * break * */ } /* "asyncpg/protocol/coreproto.pyx":797 * break * * message = self.buffer.read_null_str() # <<<<<<<<<<<<<< * * parsed[chr(code)] = message.decode() */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_null_str(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(6, 797, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_message, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":799 * message = self.buffer.read_null_str() * * parsed[chr(code)] = message.decode() # <<<<<<<<<<<<<< * * if is_error: */ if (unlikely(__pyx_v_message == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode"); __PYX_ERR(6, 799, __pyx_L1_error) } __pyx_t_1 = __Pyx_decode_bytes(__pyx_v_message, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_From_char(__pyx_v_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely((PyDict_SetItem(__pyx_v_parsed, __pyx_t_5, __pyx_t_1) < 0))) __PYX_ERR(6, 799, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L4_break:; /* "asyncpg/protocol/coreproto.pyx":801 * parsed[chr(code)] = message.decode() * * if is_error: # <<<<<<<<<<<<<< * self.result_type = RESULT_FAILED * self.result = parsed */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_is_error); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(6, 801, __pyx_L1_error) if (__pyx_t_3) { /* "asyncpg/protocol/coreproto.pyx":802 * * if is_error: * self.result_type = RESULT_FAILED # <<<<<<<<<<<<<< * self.result = parsed * else: */ __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED; /* "asyncpg/protocol/coreproto.pyx":803 * if is_error: * self.result_type = RESULT_FAILED * self.result = parsed # <<<<<<<<<<<<<< * else: * return parsed */ __Pyx_INCREF(__pyx_v_parsed); __Pyx_GIVEREF(__pyx_v_parsed); __Pyx_GOTREF(__pyx_v_self->result); __Pyx_DECREF(__pyx_v_self->result); __pyx_v_self->result = __pyx_v_parsed; /* "asyncpg/protocol/coreproto.pyx":801 * parsed[chr(code)] = message.decode() * * if is_error: # <<<<<<<<<<<<<< * self.result_type = RESULT_FAILED * self.result = parsed */ goto __pyx_L6; } /* "asyncpg/protocol/coreproto.pyx":805 * self.result = parsed * else: * return parsed # <<<<<<<<<<<<<< * * cdef _push_result(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_parsed); __pyx_r = __pyx_v_parsed; goto __pyx_L0; } __pyx_L6:; /* "asyncpg/protocol/coreproto.pyx":786 * self.xact_status = PQTRANS_UNKNOWN * * cdef _parse_msg_error_response(self, is_error): # <<<<<<<<<<<<<< * cdef: * char code */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._parse_msg_error_response", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_message); __Pyx_XDECREF(__pyx_v_parsed); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":807 * return parsed * * cdef _push_result(self): # <<<<<<<<<<<<<< * try: * self._on_result() */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__push_result(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; char const *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_push_result", 1); /* "asyncpg/protocol/coreproto.pyx":808 * * cdef _push_result(self): * try: # <<<<<<<<<<<<<< * self._on_result() * finally: */ /*try:*/ { /* "asyncpg/protocol/coreproto.pyx":809 * cdef _push_result(self): * try: * self._on_result() # <<<<<<<<<<<<<< * finally: * self._set_state(PROTOCOL_IDLE) */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_on_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 809, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "asyncpg/protocol/coreproto.pyx":811 * self._on_result() * finally: * self._set_state(PROTOCOL_IDLE) # <<<<<<<<<<<<<< * self._reset_result() * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_IDLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":812 * finally: * self._set_state(PROTOCOL_IDLE) * self._reset_result() # <<<<<<<<<<<<<< * * cdef _reset_result(self): */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_reset_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __pyx_t_2 = __pyx_lineno; __pyx_t_3 = __pyx_clineno; __pyx_t_4 = __pyx_filename; { /* "asyncpg/protocol/coreproto.pyx":811 * self._on_result() * finally: * self._set_state(PROTOCOL_IDLE) # <<<<<<<<<<<<<< * self._reset_result() * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_IDLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 811, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":812 * finally: * self._set_state(PROTOCOL_IDLE) * self._reset_result() # <<<<<<<<<<<<<< * * cdef _reset_result(self): */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_reset_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 812, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestore(__pyx_t_5, __pyx_t_6, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_3; __pyx_filename = __pyx_t_4; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "asyncpg/protocol/coreproto.pyx":807 * return parsed * * cdef _push_result(self): # <<<<<<<<<<<<<< * try: * self._on_result() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._push_result", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":814 * self._reset_result() * * cdef _reset_result(self): # <<<<<<<<<<<<<< * self.result_type = RESULT_OK * self.result = None */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__reset_result(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_reset_result", 1); /* "asyncpg/protocol/coreproto.pyx":815 * * cdef _reset_result(self): * self.result_type = RESULT_OK # <<<<<<<<<<<<<< * self.result = None * self.result_param_desc = None */ __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_OK; /* "asyncpg/protocol/coreproto.pyx":816 * cdef _reset_result(self): * self.result_type = RESULT_OK * self.result = None # <<<<<<<<<<<<<< * self.result_param_desc = None * self.result_row_desc = None */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->result); __Pyx_DECREF(__pyx_v_self->result); __pyx_v_self->result = Py_None; /* "asyncpg/protocol/coreproto.pyx":817 * self.result_type = RESULT_OK * self.result = None * self.result_param_desc = None # <<<<<<<<<<<<<< * self.result_row_desc = None * self.result_status_msg = None */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->result_param_desc); __Pyx_DECREF(__pyx_v_self->result_param_desc); __pyx_v_self->result_param_desc = ((PyObject*)Py_None); /* "asyncpg/protocol/coreproto.pyx":818 * self.result = None * self.result_param_desc = None * self.result_row_desc = None # <<<<<<<<<<<<<< * self.result_status_msg = None * self.result_execute_completed = False */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->result_row_desc); __Pyx_DECREF(__pyx_v_self->result_row_desc); __pyx_v_self->result_row_desc = ((PyObject*)Py_None); /* "asyncpg/protocol/coreproto.pyx":819 * self.result_param_desc = None * self.result_row_desc = None * self.result_status_msg = None # <<<<<<<<<<<<<< * self.result_execute_completed = False * self._discard_data = False */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->result_status_msg); __Pyx_DECREF(__pyx_v_self->result_status_msg); __pyx_v_self->result_status_msg = ((PyObject*)Py_None); /* "asyncpg/protocol/coreproto.pyx":820 * self.result_row_desc = None * self.result_status_msg = None * self.result_execute_completed = False # <<<<<<<<<<<<<< * self._discard_data = False * */ __pyx_v_self->result_execute_completed = 0; /* "asyncpg/protocol/coreproto.pyx":821 * self.result_status_msg = None * self.result_execute_completed = False * self._discard_data = False # <<<<<<<<<<<<<< * * # executemany support data */ __pyx_v_self->_discard_data = 0; /* "asyncpg/protocol/coreproto.pyx":824 * * # executemany support data * self._execute_iter = None # <<<<<<<<<<<<<< * self._execute_portal_name = None * self._execute_stmt_name = None */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_execute_iter); __Pyx_DECREF(__pyx_v_self->_execute_iter); __pyx_v_self->_execute_iter = Py_None; /* "asyncpg/protocol/coreproto.pyx":825 * # executemany support data * self._execute_iter = None * self._execute_portal_name = None # <<<<<<<<<<<<<< * self._execute_stmt_name = None * */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_execute_portal_name); __Pyx_DECREF(__pyx_v_self->_execute_portal_name); __pyx_v_self->_execute_portal_name = ((PyObject*)Py_None); /* "asyncpg/protocol/coreproto.pyx":826 * self._execute_iter = None * self._execute_portal_name = None * self._execute_stmt_name = None # <<<<<<<<<<<<<< * * cdef _set_state(self, ProtocolState new_state): */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_execute_stmt_name); __Pyx_DECREF(__pyx_v_self->_execute_stmt_name); __pyx_v_self->_execute_stmt_name = ((PyObject*)Py_None); /* "asyncpg/protocol/coreproto.pyx":814 * self._reset_result() * * cdef _reset_result(self): # <<<<<<<<<<<<<< * self.result_type = RESULT_OK * self.result = None */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":828 * self._execute_stmt_name = None * * cdef _set_state(self, ProtocolState new_state): # <<<<<<<<<<<<<< * if new_state == PROTOCOL_IDLE: * if self.state == PROTOCOL_FAILED: */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState __pyx_v_new_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_set_state", 1); /* "asyncpg/protocol/coreproto.pyx":829 * * cdef _set_state(self, ProtocolState new_state): * if new_state == PROTOCOL_IDLE: # <<<<<<<<<<<<<< * if self.state == PROTOCOL_FAILED: * raise apg_exc.InternalClientError( */ switch (__pyx_v_new_state) { case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_IDLE: /* "asyncpg/protocol/coreproto.pyx":830 * cdef _set_state(self, ProtocolState new_state): * if new_state == PROTOCOL_IDLE: * if self.state == PROTOCOL_FAILED: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * 'cannot switch to "idle" state; ' */ switch (__pyx_v_self->state) { case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_FAILED: /* "asyncpg/protocol/coreproto.pyx":831 * if new_state == PROTOCOL_IDLE: * if self.state == PROTOCOL_FAILED: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * 'cannot switch to "idle" state; ' * 'protocol is in the "failed" state') */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_cannot_switch_to_idle_state_prot}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(6, 831, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":830 * cdef _set_state(self, ProtocolState new_state): * if new_state == PROTOCOL_IDLE: * if self.state == PROTOCOL_FAILED: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * 'cannot switch to "idle" state; ' */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_IDLE: /* "asyncpg/protocol/coreproto.pyx":834 * 'cannot switch to "idle" state; ' * 'protocol is in the "failed" state') * elif self.state == PROTOCOL_IDLE: # <<<<<<<<<<<<<< * pass * else: */ break; default: /* "asyncpg/protocol/coreproto.pyx":837 * pass * else: * self.state = new_state # <<<<<<<<<<<<<< * * elif new_state == PROTOCOL_FAILED: */ __pyx_v_self->state = __pyx_v_new_state; break; } /* "asyncpg/protocol/coreproto.pyx":829 * * cdef _set_state(self, ProtocolState new_state): * if new_state == PROTOCOL_IDLE: # <<<<<<<<<<<<<< * if self.state == PROTOCOL_FAILED: * raise apg_exc.InternalClientError( */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_FAILED: /* "asyncpg/protocol/coreproto.pyx":840 * * elif new_state == PROTOCOL_FAILED: * self.state = PROTOCOL_FAILED # <<<<<<<<<<<<<< * * elif new_state == PROTOCOL_CANCELLED: */ __pyx_v_self->state = __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_FAILED; /* "asyncpg/protocol/coreproto.pyx":839 * self.state = new_state * * elif new_state == PROTOCOL_FAILED: # <<<<<<<<<<<<<< * self.state = PROTOCOL_FAILED * */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CANCELLED: /* "asyncpg/protocol/coreproto.pyx":843 * * elif new_state == PROTOCOL_CANCELLED: * self.state = PROTOCOL_CANCELLED # <<<<<<<<<<<<<< * * elif new_state == PROTOCOL_TERMINATING: */ __pyx_v_self->state = __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CANCELLED; /* "asyncpg/protocol/coreproto.pyx":842 * self.state = PROTOCOL_FAILED * * elif new_state == PROTOCOL_CANCELLED: # <<<<<<<<<<<<<< * self.state = PROTOCOL_CANCELLED * */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_TERMINATING: /* "asyncpg/protocol/coreproto.pyx":846 * * elif new_state == PROTOCOL_TERMINATING: * self.state = PROTOCOL_TERMINATING # <<<<<<<<<<<<<< * * else: */ __pyx_v_self->state = __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_TERMINATING; /* "asyncpg/protocol/coreproto.pyx":845 * self.state = PROTOCOL_CANCELLED * * elif new_state == PROTOCOL_TERMINATING: # <<<<<<<<<<<<<< * self.state = PROTOCOL_TERMINATING * */ break; default: /* "asyncpg/protocol/coreproto.pyx":849 * * else: * if self.state == PROTOCOL_IDLE: # <<<<<<<<<<<<<< * self.state = new_state * */ __pyx_t_5 = (__pyx_v_self->state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_IDLE); if (__pyx_t_5) { /* "asyncpg/protocol/coreproto.pyx":850 * else: * if self.state == PROTOCOL_IDLE: * self.state = new_state # <<<<<<<<<<<<<< * * elif (self.state == PROTOCOL_COPY_OUT and */ __pyx_v_self->state = __pyx_v_new_state; /* "asyncpg/protocol/coreproto.pyx":849 * * else: * if self.state == PROTOCOL_IDLE: # <<<<<<<<<<<<<< * self.state = new_state * */ goto __pyx_L3; } /* "asyncpg/protocol/coreproto.pyx":852 * self.state = new_state * * elif (self.state == PROTOCOL_COPY_OUT and # <<<<<<<<<<<<<< * new_state == PROTOCOL_COPY_OUT_DATA): * self.state = new_state */ __pyx_t_6 = (__pyx_v_self->state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT); if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } /* "asyncpg/protocol/coreproto.pyx":853 * * elif (self.state == PROTOCOL_COPY_OUT and * new_state == PROTOCOL_COPY_OUT_DATA): # <<<<<<<<<<<<<< * self.state = new_state * */ __pyx_t_6 = (__pyx_v_new_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DATA); __pyx_t_5 = __pyx_t_6; __pyx_L4_bool_binop_done:; /* "asyncpg/protocol/coreproto.pyx":852 * self.state = new_state * * elif (self.state == PROTOCOL_COPY_OUT and # <<<<<<<<<<<<<< * new_state == PROTOCOL_COPY_OUT_DATA): * self.state = new_state */ if (__pyx_t_5) { /* "asyncpg/protocol/coreproto.pyx":854 * elif (self.state == PROTOCOL_COPY_OUT and * new_state == PROTOCOL_COPY_OUT_DATA): * self.state = new_state # <<<<<<<<<<<<<< * * elif (self.state == PROTOCOL_COPY_OUT_DATA and */ __pyx_v_self->state = __pyx_v_new_state; /* "asyncpg/protocol/coreproto.pyx":852 * self.state = new_state * * elif (self.state == PROTOCOL_COPY_OUT and # <<<<<<<<<<<<<< * new_state == PROTOCOL_COPY_OUT_DATA): * self.state = new_state */ goto __pyx_L3; } /* "asyncpg/protocol/coreproto.pyx":856 * self.state = new_state * * elif (self.state == PROTOCOL_COPY_OUT_DATA and # <<<<<<<<<<<<<< * new_state == PROTOCOL_COPY_OUT_DONE): * self.state = new_state */ __pyx_t_6 = (__pyx_v_self->state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DATA); if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L6_bool_binop_done; } /* "asyncpg/protocol/coreproto.pyx":857 * * elif (self.state == PROTOCOL_COPY_OUT_DATA and * new_state == PROTOCOL_COPY_OUT_DONE): # <<<<<<<<<<<<<< * self.state = new_state * */ __pyx_t_6 = (__pyx_v_new_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DONE); __pyx_t_5 = __pyx_t_6; __pyx_L6_bool_binop_done:; /* "asyncpg/protocol/coreproto.pyx":856 * self.state = new_state * * elif (self.state == PROTOCOL_COPY_OUT_DATA and # <<<<<<<<<<<<<< * new_state == PROTOCOL_COPY_OUT_DONE): * self.state = new_state */ if (__pyx_t_5) { /* "asyncpg/protocol/coreproto.pyx":858 * elif (self.state == PROTOCOL_COPY_OUT_DATA and * new_state == PROTOCOL_COPY_OUT_DONE): * self.state = new_state # <<<<<<<<<<<<<< * * elif (self.state == PROTOCOL_COPY_IN and */ __pyx_v_self->state = __pyx_v_new_state; /* "asyncpg/protocol/coreproto.pyx":856 * self.state = new_state * * elif (self.state == PROTOCOL_COPY_OUT_DATA and # <<<<<<<<<<<<<< * new_state == PROTOCOL_COPY_OUT_DONE): * self.state = new_state */ goto __pyx_L3; } /* "asyncpg/protocol/coreproto.pyx":860 * self.state = new_state * * elif (self.state == PROTOCOL_COPY_IN and # <<<<<<<<<<<<<< * new_state == PROTOCOL_COPY_IN_DATA): * self.state = new_state */ __pyx_t_6 = (__pyx_v_self->state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN); if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L8_bool_binop_done; } /* "asyncpg/protocol/coreproto.pyx":861 * * elif (self.state == PROTOCOL_COPY_IN and * new_state == PROTOCOL_COPY_IN_DATA): # <<<<<<<<<<<<<< * self.state = new_state * */ __pyx_t_6 = (__pyx_v_new_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN_DATA); __pyx_t_5 = __pyx_t_6; __pyx_L8_bool_binop_done:; /* "asyncpg/protocol/coreproto.pyx":860 * self.state = new_state * * elif (self.state == PROTOCOL_COPY_IN and # <<<<<<<<<<<<<< * new_state == PROTOCOL_COPY_IN_DATA): * self.state = new_state */ if (likely(__pyx_t_5)) { /* "asyncpg/protocol/coreproto.pyx":862 * elif (self.state == PROTOCOL_COPY_IN and * new_state == PROTOCOL_COPY_IN_DATA): * self.state = new_state # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_FAILED: */ __pyx_v_self->state = __pyx_v_new_state; /* "asyncpg/protocol/coreproto.pyx":860 * self.state = new_state * * elif (self.state == PROTOCOL_COPY_IN and # <<<<<<<<<<<<<< * new_state == PROTOCOL_COPY_IN_DATA): * self.state = new_state */ goto __pyx_L3; } /* "asyncpg/protocol/coreproto.pyx":864 * self.state = new_state * * elif self.state == PROTOCOL_FAILED: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * 'cannot switch to state {}; ' */ __pyx_t_5 = (__pyx_v_self->state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_FAILED); if (unlikely(__pyx_t_5)) { /* "asyncpg/protocol/coreproto.pyx":865 * * elif self.state == PROTOCOL_FAILED: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * 'cannot switch to state {}; ' * 'protocol is in the "failed" state'.format(new_state)) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":867 * raise apg_exc.InternalClientError( * 'cannot switch to state {}; ' * 'protocol is in the "failed" state'.format(new_state)) # <<<<<<<<<<<<<< * else: * raise apg_exc.InternalClientError( */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_cannot_switch_to_state_protocol, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_new_state); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_8}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(6, 865, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":864 * self.state = new_state * * elif self.state == PROTOCOL_FAILED: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * 'cannot switch to state {}; ' */ } /* "asyncpg/protocol/coreproto.pyx":869 * 'protocol is in the "failed" state'.format(new_state)) * else: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * 'cannot switch to state {}; ' * 'another operation ({}) is in progress'.format( */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":871 * raise apg_exc.InternalClientError( * 'cannot switch to state {}; ' * 'another operation ({}) is in progress'.format( # <<<<<<<<<<<<<< * new_state, self.state)) * */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_cannot_switch_to_state_another_o, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* "asyncpg/protocol/coreproto.pyx":872 * 'cannot switch to state {}; ' * 'another operation ({}) is in progress'.format( * new_state, self.state)) # <<<<<<<<<<<<<< * * cdef _ensure_connected(self): */ __pyx_t_8 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_new_state); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_self->state); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_8, __pyx_t_9}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(6, 869, __pyx_L1_error) } __pyx_L3:; break; } /* "asyncpg/protocol/coreproto.pyx":828 * self._execute_stmt_name = None * * cdef _set_state(self, ProtocolState new_state): # <<<<<<<<<<<<<< * if new_state == PROTOCOL_IDLE: * if self.state == PROTOCOL_FAILED: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":874 * new_state, self.state)) * * cdef _ensure_connected(self): # <<<<<<<<<<<<<< * if self.con_status != CONNECTION_OK: * raise apg_exc.InternalClientError('not connected') */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__ensure_connected(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_ensure_connected", 1); /* "asyncpg/protocol/coreproto.pyx":875 * * cdef _ensure_connected(self): * if self.con_status != CONNECTION_OK: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError('not connected') * */ __pyx_t_1 = (__pyx_v_self->con_status != __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_OK); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/coreproto.pyx":876 * cdef _ensure_connected(self): * if self.con_status != CONNECTION_OK: * raise apg_exc.InternalClientError('not connected') # <<<<<<<<<<<<<< * * cdef WriteBuffer _build_parse_message(self, str stmt_name, str query): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_not_connected}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(6, 876, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":875 * * cdef _ensure_connected(self): * if self.con_status != CONNECTION_OK: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError('not connected') * */ } /* "asyncpg/protocol/coreproto.pyx":874 * new_state, self.state)) * * cdef _ensure_connected(self): # <<<<<<<<<<<<<< * if self.con_status != CONNECTION_OK: * raise apg_exc.InternalClientError('not connected') */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._ensure_connected", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":878 * raise apg_exc.InternalClientError('not connected') * * cdef WriteBuffer _build_parse_message(self, str stmt_name, str query): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * */ static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_parse_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_stmt_name, PyObject *__pyx_v_query) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_build_parse_message", 1); /* "asyncpg/protocol/coreproto.pyx":881 * cdef WriteBuffer buf * * buf = WriteBuffer.new_message(b'P') # <<<<<<<<<<<<<< * buf.write_str(stmt_name, self.encoding) * buf.write_str(query, self.encoding) */ __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('P')); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":882 * * buf = WriteBuffer.new_message(b'P') * buf.write_str(stmt_name, self.encoding) # <<<<<<<<<<<<<< * buf.write_str(query, self.encoding) * buf.write_int16(0) */ __pyx_t_1 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_v_stmt_name, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":883 * buf = WriteBuffer.new_message(b'P') * buf.write_str(stmt_name, self.encoding) * buf.write_str(query, self.encoding) # <<<<<<<<<<<<<< * buf.write_int16(0) * */ __pyx_t_2 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_v_query, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":884 * buf.write_str(stmt_name, self.encoding) * buf.write_str(query, self.encoding) * buf.write_int16(0) # <<<<<<<<<<<<<< * * buf.end_message() */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":886 * buf.write_int16(0) * * buf.end_message() # <<<<<<<<<<<<<< * return buf * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":887 * * buf.end_message() * return buf # <<<<<<<<<<<<<< * * cdef WriteBuffer _build_bind_message(self, str portal_name, */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_buf); __pyx_r = __pyx_v_buf; goto __pyx_L0; /* "asyncpg/protocol/coreproto.pyx":878 * raise apg_exc.InternalClientError('not connected') * * cdef WriteBuffer _build_parse_message(self, str stmt_name, str query): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._build_parse_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":889 * return buf * * cdef WriteBuffer _build_bind_message(self, str portal_name, # <<<<<<<<<<<<<< * str stmt_name, * WriteBuffer bind_data): */ static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_bind_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_stmt_name, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_bind_data) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_build_bind_message", 1); /* "asyncpg/protocol/coreproto.pyx":894 * cdef WriteBuffer buf * * buf = WriteBuffer.new_message(b'B') # <<<<<<<<<<<<<< * buf.write_str(portal_name, self.encoding) * buf.write_str(stmt_name, self.encoding) */ __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('B')); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":895 * * buf = WriteBuffer.new_message(b'B') * buf.write_str(portal_name, self.encoding) # <<<<<<<<<<<<<< * buf.write_str(stmt_name, self.encoding) * */ __pyx_t_1 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_v_portal_name, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":896 * buf = WriteBuffer.new_message(b'B') * buf.write_str(portal_name, self.encoding) * buf.write_str(stmt_name, self.encoding) # <<<<<<<<<<<<<< * * # Arguments */ __pyx_t_2 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_v_stmt_name, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":899 * * # Arguments * buf.write_buffer(bind_data) # <<<<<<<<<<<<<< * * buf.end_message() */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, __pyx_v_bind_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":901 * buf.write_buffer(bind_data) * * buf.end_message() # <<<<<<<<<<<<<< * return buf * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":902 * * buf.end_message() * return buf # <<<<<<<<<<<<<< * * cdef WriteBuffer _build_empty_bind_data(self): */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_buf); __pyx_r = __pyx_v_buf; goto __pyx_L0; /* "asyncpg/protocol/coreproto.pyx":889 * return buf * * cdef WriteBuffer _build_bind_message(self, str portal_name, # <<<<<<<<<<<<<< * str stmt_name, * WriteBuffer bind_data): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._build_bind_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":904 * return buf * * cdef WriteBuffer _build_empty_bind_data(self): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * buf = WriteBuffer.new() */ static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_empty_bind_data(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_build_empty_bind_data", 1); /* "asyncpg/protocol/coreproto.pyx":906 * cdef WriteBuffer _build_empty_bind_data(self): * cdef WriteBuffer buf * buf = WriteBuffer.new() # <<<<<<<<<<<<<< * buf.write_int16(0) # The number of parameter format codes * buf.write_int16(0) # The number of parameter values */ __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":907 * cdef WriteBuffer buf * buf = WriteBuffer.new() * buf.write_int16(0) # The number of parameter format codes # <<<<<<<<<<<<<< * buf.write_int16(0) # The number of parameter values * buf.write_int16(0) # The number of result-column format codes */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":908 * buf = WriteBuffer.new() * buf.write_int16(0) # The number of parameter format codes * buf.write_int16(0) # The number of parameter values # <<<<<<<<<<<<<< * buf.write_int16(0) # The number of result-column format codes * return buf */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":909 * buf.write_int16(0) # The number of parameter format codes * buf.write_int16(0) # The number of parameter values * buf.write_int16(0) # The number of result-column format codes # <<<<<<<<<<<<<< * return buf * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 909, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":910 * buf.write_int16(0) # The number of parameter values * buf.write_int16(0) # The number of result-column format codes * return buf # <<<<<<<<<<<<<< * * cdef WriteBuffer _build_execute_message(self, str portal_name, */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_buf); __pyx_r = __pyx_v_buf; goto __pyx_L0; /* "asyncpg/protocol/coreproto.pyx":904 * return buf * * cdef WriteBuffer _build_empty_bind_data(self): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * buf = WriteBuffer.new() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._build_empty_bind_data", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":912 * return buf * * cdef WriteBuffer _build_execute_message(self, str portal_name, # <<<<<<<<<<<<<< * int32_t limit): * cdef WriteBuffer buf */ static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_execute_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, int32_t __pyx_v_limit) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_build_execute_message", 1); /* "asyncpg/protocol/coreproto.pyx":916 * cdef WriteBuffer buf * * buf = WriteBuffer.new_message(b'E') # <<<<<<<<<<<<<< * buf.write_str(portal_name, self.encoding) # name of the portal * buf.write_int32(limit) # number of rows to return; 0 - all */ __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('E')); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":917 * * buf = WriteBuffer.new_message(b'E') * buf.write_str(portal_name, self.encoding) # name of the portal # <<<<<<<<<<<<<< * buf.write_int32(limit) # number of rows to return; 0 - all * */ __pyx_t_1 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_v_portal_name, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":918 * buf = WriteBuffer.new_message(b'E') * buf.write_str(portal_name, self.encoding) # name of the portal * buf.write_int32(limit) # number of rows to return; 0 - all # <<<<<<<<<<<<<< * * buf.end_message() */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_v_limit); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":920 * buf.write_int32(limit) # number of rows to return; 0 - all * * buf.end_message() # <<<<<<<<<<<<<< * return buf * */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":921 * * buf.end_message() * return buf # <<<<<<<<<<<<<< * * # API for subclasses */ __Pyx_XDECREF((PyObject *)__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_buf); __pyx_r = __pyx_v_buf; goto __pyx_L0; /* "asyncpg/protocol/coreproto.pyx":912 * return buf * * cdef WriteBuffer _build_execute_message(self, str portal_name, # <<<<<<<<<<<<<< * int32_t limit): * cdef WriteBuffer buf */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._build_execute_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":925 * # API for subclasses * * cdef _connect(self): # <<<<<<<<<<<<<< * cdef: * WriteBuffer buf */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__connect(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_outbuf = 0; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; PyObject *__pyx_t_6 = NULL; Py_ssize_t __pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_t_9; int __pyx_t_10; int32_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_connect", 1); /* "asyncpg/protocol/coreproto.pyx":930 * WriteBuffer outbuf * * if self.con_status != CONNECTION_BAD: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError('already connected') * */ __pyx_t_1 = (__pyx_v_self->con_status != __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_BAD); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/coreproto.pyx":931 * * if self.con_status != CONNECTION_BAD: * raise apg_exc.InternalClientError('already connected') # <<<<<<<<<<<<<< * * self._set_state(PROTOCOL_AUTH) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_already_connected}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(6, 931, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":930 * WriteBuffer outbuf * * if self.con_status != CONNECTION_BAD: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError('already connected') * */ } /* "asyncpg/protocol/coreproto.pyx":933 * raise apg_exc.InternalClientError('already connected') * * self._set_state(PROTOCOL_AUTH) # <<<<<<<<<<<<<< * self.con_status = CONNECTION_STARTED * */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_AUTH); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":934 * * self._set_state(PROTOCOL_AUTH) * self.con_status = CONNECTION_STARTED # <<<<<<<<<<<<<< * * # Assemble a startup message */ __pyx_v_self->con_status = __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_STARTED; /* "asyncpg/protocol/coreproto.pyx":937 * * # Assemble a startup message * buf = WriteBuffer() # <<<<<<<<<<<<<< * * # protocol version */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":940 * * # protocol version * buf.write_int16(3) # <<<<<<<<<<<<<< * buf.write_int16(0) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, 3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":941 * # protocol version * buf.write_int16(3) * buf.write_int16(0) # <<<<<<<<<<<<<< * * buf.write_bytestring(b'client_encoding') */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":943 * buf.write_int16(0) * * buf.write_bytestring(b'client_encoding') # <<<<<<<<<<<<<< * buf.write_bytestring("'{}'".format(self.encoding).encode('ascii')) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_bytestring(__pyx_v_buf, __pyx_n_b_client_encoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":944 * * buf.write_bytestring(b'client_encoding') * buf.write_bytestring("'{}'".format(self.encoding).encode('ascii')) # <<<<<<<<<<<<<< * * buf.write_str('user', self.encoding) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u__40, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_self->encoding}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_n_u_ascii}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_2))) __PYX_ERR(6, 944, __pyx_L1_error) __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_bytestring(__pyx_v_buf, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":946 * buf.write_bytestring("'{}'".format(self.encoding).encode('ascii')) * * buf.write_str('user', self.encoding) # <<<<<<<<<<<<<< * buf.write_str(self.con_params.user, self.encoding) * */ __pyx_t_3 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_n_u_user, ((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":947 * * buf.write_str('user', self.encoding) * buf.write_str(self.con_params.user, self.encoding) # <<<<<<<<<<<<<< * * buf.write_str('database', self.encoding) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->con_params, __pyx_n_s_user); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 947, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(6, 947, __pyx_L1_error) __pyx_t_3 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, ((PyObject*)__pyx_t_2), ((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 947, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":949 * buf.write_str(self.con_params.user, self.encoding) * * buf.write_str('database', self.encoding) # <<<<<<<<<<<<<< * buf.write_str(self.con_params.database, self.encoding) * */ __pyx_t_4 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_n_u_database, ((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":950 * * buf.write_str('database', self.encoding) * buf.write_str(self.con_params.database, self.encoding) # <<<<<<<<<<<<<< * * if self.con_params.server_settings is not None: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->con_params, __pyx_n_s_database); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_3))) __PYX_ERR(6, 950, __pyx_L1_error) __pyx_t_4 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, ((PyObject*)__pyx_t_3), ((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":952 * buf.write_str(self.con_params.database, self.encoding) * * if self.con_params.server_settings is not None: # <<<<<<<<<<<<<< * for k, v in self.con_params.server_settings.items(): * buf.write_str(k, self.encoding) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->con_params, __pyx_n_s_server_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = (__pyx_t_2 != Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "asyncpg/protocol/coreproto.pyx":953 * * if self.con_params.server_settings is not None: * for k, v in self.con_params.server_settings.items(): # <<<<<<<<<<<<<< * buf.write_str(k, self.encoding) * buf.write_str(v, self.encoding) */ __pyx_t_7 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->con_params, __pyx_n_s_server_settings); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__pyx_t_4 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(6, 953, __pyx_L1_error) } __pyx_t_3 = __Pyx_dict_iterator(__pyx_t_4, 0, __pyx_n_s_items, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, &__pyx_t_3, &__pyx_t_4, NULL, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(6, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":954 * if self.con_params.server_settings is not None: * for k, v in self.con_params.server_settings.items(): * buf.write_str(k, self.encoding) # <<<<<<<<<<<<<< * buf.write_str(v, self.encoding) * */ if (!(likely(PyUnicode_CheckExact(__pyx_v_k))||((__pyx_v_k) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_k))) __PYX_ERR(6, 954, __pyx_L1_error) __pyx_t_4 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, ((PyObject*)__pyx_v_k), ((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":955 * for k, v in self.con_params.server_settings.items(): * buf.write_str(k, self.encoding) * buf.write_str(v, self.encoding) # <<<<<<<<<<<<<< * * buf.write_bytestring(b'') */ if (!(likely(PyUnicode_CheckExact(__pyx_v_v))||((__pyx_v_v) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_v))) __PYX_ERR(6, 955, __pyx_L1_error) __pyx_t_3 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, ((PyObject*)__pyx_v_v), ((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":952 * buf.write_str(self.con_params.database, self.encoding) * * if self.con_params.server_settings is not None: # <<<<<<<<<<<<<< * for k, v in self.con_params.server_settings.items(): * buf.write_str(k, self.encoding) */ } /* "asyncpg/protocol/coreproto.pyx":957 * buf.write_str(v, self.encoding) * * buf.write_bytestring(b'') # <<<<<<<<<<<<<< * * # Send the buffer */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_bytestring(__pyx_v_buf, __pyx_kp_b__34); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":960 * * # Send the buffer * outbuf = WriteBuffer() # <<<<<<<<<<<<<< * outbuf.write_int32(buf.len() + 4) * outbuf.write_buffer(buf) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 960, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_outbuf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":961 * # Send the buffer * outbuf = WriteBuffer() * outbuf.write_int32(buf.len() + 4) # <<<<<<<<<<<<<< * outbuf.write_buffer(buf) * self._write(outbuf) */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_4, 4, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __Pyx_PyInt_As_int32_t(__pyx_t_4); if (unlikely((__pyx_t_11 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 961, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_outbuf->__pyx_vtab)->write_int32(__pyx_v_outbuf, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":962 * outbuf = WriteBuffer() * outbuf.write_int32(buf.len() + 4) * outbuf.write_buffer(buf) # <<<<<<<<<<<<<< * self._write(outbuf) * */ __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_outbuf->__pyx_vtab)->write_buffer(__pyx_v_outbuf, __pyx_v_buf); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":963 * outbuf.write_int32(buf.len() + 4) * outbuf.write_buffer(buf) * self._write(outbuf) # <<<<<<<<<<<<<< * * cdef _send_parse_message(self, str stmt_name, str query): */ __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_outbuf)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 963, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/coreproto.pyx":925 * # API for subclasses * * cdef _connect(self): # <<<<<<<<<<<<<< * cdef: * WriteBuffer buf */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._connect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XDECREF((PyObject *)__pyx_v_outbuf); __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF(__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":965 * self._write(outbuf) * * cdef _send_parse_message(self, str stmt_name, str query): # <<<<<<<<<<<<<< * cdef: * WriteBuffer msg */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__send_parse_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_stmt_name, PyObject *__pyx_v_query) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_msg = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_send_parse_message", 1); /* "asyncpg/protocol/coreproto.pyx":969 * WriteBuffer msg * * self._ensure_connected() # <<<<<<<<<<<<<< * msg = self._build_parse_message(stmt_name, query) * self._write(msg) */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_ensure_connected(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":970 * * self._ensure_connected() * msg = self._build_parse_message(stmt_name, query) # <<<<<<<<<<<<<< * self._write(msg) * */ __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_parse_message(__pyx_v_self, __pyx_v_stmt_name, __pyx_v_query)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_msg = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":971 * self._ensure_connected() * msg = self._build_parse_message(stmt_name, query) * self._write(msg) # <<<<<<<<<<<<<< * * cdef _prepare_and_describe(self, str stmt_name, str query): */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_msg)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":965 * self._write(outbuf) * * cdef _send_parse_message(self, str stmt_name, str query): # <<<<<<<<<<<<<< * cdef: * WriteBuffer msg */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._send_parse_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_msg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":973 * self._write(msg) * * cdef _prepare_and_describe(self, str stmt_name, str query): # <<<<<<<<<<<<<< * cdef: * WriteBuffer packet */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__prepare_and_describe(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_stmt_name, PyObject *__pyx_v_query) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_packet = 0; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_prepare_and_describe", 1); /* "asyncpg/protocol/coreproto.pyx":978 * WriteBuffer buf * * self._ensure_connected() # <<<<<<<<<<<<<< * self._set_state(PROTOCOL_PREPARE) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_ensure_connected(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":979 * * self._ensure_connected() * self._set_state(PROTOCOL_PREPARE) # <<<<<<<<<<<<<< * * packet = self._build_parse_message(stmt_name, query) */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_PREPARE); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":981 * self._set_state(PROTOCOL_PREPARE) * * packet = self._build_parse_message(stmt_name, query) # <<<<<<<<<<<<<< * * buf = WriteBuffer.new_message(b'D') */ __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_parse_message(__pyx_v_self, __pyx_v_stmt_name, __pyx_v_query)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_packet = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":983 * packet = self._build_parse_message(stmt_name, query) * * buf = WriteBuffer.new_message(b'D') # <<<<<<<<<<<<<< * buf.write_byte(b'S') * buf.write_str(stmt_name, self.encoding) */ __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('D')); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":984 * * buf = WriteBuffer.new_message(b'D') * buf.write_byte(b'S') # <<<<<<<<<<<<<< * buf.write_str(stmt_name, self.encoding) * buf.end_message() */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_byte(__pyx_v_buf, 'S'); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":985 * buf = WriteBuffer.new_message(b'D') * buf.write_byte(b'S') * buf.write_str(stmt_name, self.encoding) # <<<<<<<<<<<<<< * buf.end_message() * packet.write_buffer(buf) */ __pyx_t_1 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_v_stmt_name, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":986 * buf.write_byte(b'S') * buf.write_str(stmt_name, self.encoding) * buf.end_message() # <<<<<<<<<<<<<< * packet.write_buffer(buf) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":987 * buf.write_str(stmt_name, self.encoding) * buf.end_message() * packet.write_buffer(buf) # <<<<<<<<<<<<<< * * packet.write_bytes(FLUSH_MESSAGE) */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_packet->__pyx_vtab)->write_buffer(__pyx_v_packet, __pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":989 * packet.write_buffer(buf) * * packet.write_bytes(FLUSH_MESSAGE) # <<<<<<<<<<<<<< * * self._write(packet) */ __pyx_t_2 = __pyx_v_7asyncpg_8protocol_8protocol_FLUSH_MESSAGE; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_packet->__pyx_vtab)->write_bytes(__pyx_v_packet, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":991 * packet.write_bytes(FLUSH_MESSAGE) * * self._write(packet) # <<<<<<<<<<<<<< * * cdef _send_bind_message(self, str portal_name, str stmt_name, */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_packet)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":973 * self._write(msg) * * cdef _prepare_and_describe(self, str stmt_name, str query): # <<<<<<<<<<<<<< * cdef: * WriteBuffer packet */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._prepare_and_describe", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_packet); __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":993 * self._write(packet) * * cdef _send_bind_message(self, str portal_name, str stmt_name, # <<<<<<<<<<<<<< * WriteBuffer bind_data, int32_t limit): * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__send_bind_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_stmt_name, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_bind_data, int32_t __pyx_v_limit) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_packet = 0; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_send_bind_message", 1); /* "asyncpg/protocol/coreproto.pyx":1000 * WriteBuffer buf * * buf = self._build_bind_message(portal_name, stmt_name, bind_data) # <<<<<<<<<<<<<< * packet = buf * */ __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_bind_message(__pyx_v_self, __pyx_v_portal_name, __pyx_v_stmt_name, __pyx_v_bind_data)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1001 * * buf = self._build_bind_message(portal_name, stmt_name, bind_data) * packet = buf # <<<<<<<<<<<<<< * * buf = self._build_execute_message(portal_name, limit) */ __Pyx_INCREF((PyObject *)__pyx_v_buf); __pyx_v_packet = __pyx_v_buf; /* "asyncpg/protocol/coreproto.pyx":1003 * packet = buf * * buf = self._build_execute_message(portal_name, limit) # <<<<<<<<<<<<<< * packet.write_buffer(buf) * */ __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_execute_message(__pyx_v_self, __pyx_v_portal_name, __pyx_v_limit)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_buf, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1)); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1004 * * buf = self._build_execute_message(portal_name, limit) * packet.write_buffer(buf) # <<<<<<<<<<<<<< * * packet.write_bytes(SYNC_MESSAGE) */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_packet->__pyx_vtab)->write_buffer(__pyx_v_packet, __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1006 * packet.write_buffer(buf) * * packet.write_bytes(SYNC_MESSAGE) # <<<<<<<<<<<<<< * * self._write(packet) */ __pyx_t_1 = __pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_packet->__pyx_vtab)->write_bytes(__pyx_v_packet, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":1008 * packet.write_bytes(SYNC_MESSAGE) * * self._write(packet) # <<<<<<<<<<<<<< * * cdef _bind_execute(self, str portal_name, str stmt_name, */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_packet)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1008, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":993 * self._write(packet) * * cdef _send_bind_message(self, str portal_name, str stmt_name, # <<<<<<<<<<<<<< * WriteBuffer bind_data, int32_t limit): * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._send_bind_message", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_packet); __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":1010 * self._write(packet) * * cdef _bind_execute(self, str portal_name, str stmt_name, # <<<<<<<<<<<<<< * WriteBuffer bind_data, int32_t limit): * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_stmt_name, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_bind_data, int32_t __pyx_v_limit) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_bind_execute", 1); /* "asyncpg/protocol/coreproto.pyx":1015 * cdef WriteBuffer buf * * self._ensure_connected() # <<<<<<<<<<<<<< * self._set_state(PROTOCOL_BIND_EXECUTE) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_ensure_connected(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1015, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1016 * * self._ensure_connected() * self._set_state(PROTOCOL_BIND_EXECUTE) # <<<<<<<<<<<<<< * * self.result = [] */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND_EXECUTE); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1018 * self._set_state(PROTOCOL_BIND_EXECUTE) * * self.result = [] # <<<<<<<<<<<<<< * * self._send_bind_message(portal_name, stmt_name, bind_data, limit) */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->result); __Pyx_DECREF(__pyx_v_self->result); __pyx_v_self->result = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1020 * self.result = [] * * self._send_bind_message(portal_name, stmt_name, bind_data, limit) # <<<<<<<<<<<<<< * * cdef bint _bind_execute_many(self, str portal_name, str stmt_name, */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_send_bind_message(__pyx_v_self, __pyx_v_portal_name, __pyx_v_stmt_name, __pyx_v_bind_data, __pyx_v_limit); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1010 * self._write(packet) * * cdef _bind_execute(self, str portal_name, str stmt_name, # <<<<<<<<<<<<<< * WriteBuffer bind_data, int32_t limit): * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._bind_execute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":1022 * self._send_bind_message(portal_name, stmt_name, bind_data, limit) * * cdef bint _bind_execute_many(self, str portal_name, str stmt_name, # <<<<<<<<<<<<<< * object bind_data, bint return_rows): * self._ensure_connected() */ static int __pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_stmt_name, PyObject *__pyx_v_bind_data, int __pyx_v_return_rows) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_more __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_bind_execute_many", 1); /* "asyncpg/protocol/coreproto.pyx":1024 * cdef bint _bind_execute_many(self, str portal_name, str stmt_name, * object bind_data, bint return_rows): * self._ensure_connected() # <<<<<<<<<<<<<< * self._set_state(PROTOCOL_BIND_EXECUTE_MANY) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_ensure_connected(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1025 * object bind_data, bint return_rows): * self._ensure_connected() * self._set_state(PROTOCOL_BIND_EXECUTE_MANY) # <<<<<<<<<<<<<< * * self.result = [] if return_rows else None */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND_EXECUTE_MANY); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1027 * self._set_state(PROTOCOL_BIND_EXECUTE_MANY) * * self.result = [] if return_rows else None # <<<<<<<<<<<<<< * self._discard_data = not return_rows * self._execute_iter = bind_data */ if (__pyx_v_return_rows) { __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->result); __Pyx_DECREF(__pyx_v_self->result); __pyx_v_self->result = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1028 * * self.result = [] if return_rows else None * self._discard_data = not return_rows # <<<<<<<<<<<<<< * self._execute_iter = bind_data * self._execute_portal_name = portal_name */ __pyx_v_self->_discard_data = (!__pyx_v_return_rows); /* "asyncpg/protocol/coreproto.pyx":1029 * self.result = [] if return_rows else None * self._discard_data = not return_rows * self._execute_iter = bind_data # <<<<<<<<<<<<<< * self._execute_portal_name = portal_name * self._execute_stmt_name = stmt_name */ __Pyx_INCREF(__pyx_v_bind_data); __Pyx_GIVEREF(__pyx_v_bind_data); __Pyx_GOTREF(__pyx_v_self->_execute_iter); __Pyx_DECREF(__pyx_v_self->_execute_iter); __pyx_v_self->_execute_iter = __pyx_v_bind_data; /* "asyncpg/protocol/coreproto.pyx":1030 * self._discard_data = not return_rows * self._execute_iter = bind_data * self._execute_portal_name = portal_name # <<<<<<<<<<<<<< * self._execute_stmt_name = stmt_name * return self._bind_execute_many_more(True) */ __Pyx_INCREF(__pyx_v_portal_name); __Pyx_GIVEREF(__pyx_v_portal_name); __Pyx_GOTREF(__pyx_v_self->_execute_portal_name); __Pyx_DECREF(__pyx_v_self->_execute_portal_name); __pyx_v_self->_execute_portal_name = __pyx_v_portal_name; /* "asyncpg/protocol/coreproto.pyx":1031 * self._execute_iter = bind_data * self._execute_portal_name = portal_name * self._execute_stmt_name = stmt_name # <<<<<<<<<<<<<< * return self._bind_execute_many_more(True) * */ __Pyx_INCREF(__pyx_v_stmt_name); __Pyx_GIVEREF(__pyx_v_stmt_name); __Pyx_GOTREF(__pyx_v_self->_execute_stmt_name); __Pyx_DECREF(__pyx_v_self->_execute_stmt_name); __pyx_v_self->_execute_stmt_name = __pyx_v_stmt_name; /* "asyncpg/protocol/coreproto.pyx":1032 * self._execute_portal_name = portal_name * self._execute_stmt_name = stmt_name * return self._bind_execute_many_more(True) # <<<<<<<<<<<<<< * * cdef bint _bind_execute_many_more(self, bint first=False): */ __pyx_t_4.__pyx_n = 1; __pyx_t_4.first = 1; __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_bind_execute_many_more(__pyx_v_self, &__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 1032, __pyx_L1_error) __pyx_r = __pyx_t_3; goto __pyx_L0; /* "asyncpg/protocol/coreproto.pyx":1022 * self._send_bind_message(portal_name, stmt_name, bind_data, limit) * * cdef bint _bind_execute_many(self, str portal_name, str stmt_name, # <<<<<<<<<<<<<< * object bind_data, bint return_rows): * self._ensure_connected() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":1034 * return self._bind_execute_many_more(True) * * cdef bint _bind_execute_many_more(self, bint first=False): # <<<<<<<<<<<<<< * cdef: * WriteBuffer packet */ static int __pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_more(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_more *__pyx_optional_args) { int __pyx_v_first = ((int)0); struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_packet = 0; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_v_buffers = 0; PyObject *__pyx_v_ex = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_fail __pyx_t_13; int __pyx_t_14; char const *__pyx_t_15; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_bind_execute_many_more", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_first = __pyx_optional_args->first; } } /* "asyncpg/protocol/coreproto.pyx":1038 * WriteBuffer packet * WriteBuffer buf * list buffers = [] # <<<<<<<<<<<<<< * * # as we keep sending, the server may return an error early */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buffers = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1041 * * # as we keep sending, the server may return an error early * if self.result_type == RESULT_FAILED: # <<<<<<<<<<<<<< * self._write(SYNC_MESSAGE) * return False */ __pyx_t_2 = (__pyx_v_self->result_type == __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED); if (__pyx_t_2) { /* "asyncpg/protocol/coreproto.pyx":1042 * # as we keep sending, the server may return an error early * if self.result_type == RESULT_FAILED: * self._write(SYNC_MESSAGE) # <<<<<<<<<<<<<< * return False * */ __pyx_t_1 = __pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1042, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":1043 * if self.result_type == RESULT_FAILED: * self._write(SYNC_MESSAGE) * return False # <<<<<<<<<<<<<< * * # collect up to four 32KB buffers to send */ __pyx_r = 0; goto __pyx_L0; /* "asyncpg/protocol/coreproto.pyx":1041 * * # as we keep sending, the server may return an error early * if self.result_type == RESULT_FAILED: # <<<<<<<<<<<<<< * self._write(SYNC_MESSAGE) * return False */ } /* "asyncpg/protocol/coreproto.pyx":1047 * # collect up to four 32KB buffers to send * # https://github.com/MagicStack/asyncpg/pull/289#issuecomment-391215051 * while len(buffers) < _EXECUTE_MANY_BUF_NUM: # <<<<<<<<<<<<<< * packet = WriteBuffer.new() * */ while (1) { __pyx_t_4 = __Pyx_PyList_GET_SIZE(__pyx_v_buffers); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(6, 1047, __pyx_L1_error) __pyx_t_2 = (__pyx_t_4 < 4); if (!__pyx_t_2) break; /* "asyncpg/protocol/coreproto.pyx":1048 * # https://github.com/MagicStack/asyncpg/pull/289#issuecomment-391215051 * while len(buffers) < _EXECUTE_MANY_BUF_NUM: * packet = WriteBuffer.new() # <<<<<<<<<<<<<< * * # fill one 32KB buffer */ __pyx_t_3 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_packet, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_3)); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":1051 * * # fill one 32KB buffer * while packet.len() < _EXECUTE_MANY_BUF_SIZE: # <<<<<<<<<<<<<< * try: * # grab one item from the input */ while (1) { __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_packet); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_int_32768, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1051, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(6, 1051, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_2) break; /* "asyncpg/protocol/coreproto.pyx":1052 * # fill one 32KB buffer * while packet.len() < _EXECUTE_MANY_BUF_SIZE: * try: # <<<<<<<<<<<<<< * # grab one item from the input * buf = next(self._execute_iter) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); /*try:*/ { /* "asyncpg/protocol/coreproto.pyx":1054 * try: * # grab one item from the input * buf = next(self._execute_iter) # <<<<<<<<<<<<<< * * # reached the end of the input */ __pyx_t_1 = __pyx_v_self->_execute_iter; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1054, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_buf, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1)); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1052 * # fill one 32KB buffer * while packet.len() < _EXECUTE_MANY_BUF_SIZE: * try: # <<<<<<<<<<<<<< * # grab one item from the input * buf = next(self._execute_iter) */ } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L15_try_end; __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":1057 * * # reached the end of the input * except StopIteration: # <<<<<<<<<<<<<< * if first: * # if we never send anything, simply set the result */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_8) { __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._bind_execute_many_more", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_9) < 0) __PYX_ERR(6, 1057, __pyx_L10_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_9); /* "asyncpg/protocol/coreproto.pyx":1058 * # reached the end of the input * except StopIteration: * if first: # <<<<<<<<<<<<<< * # if we never send anything, simply set the result * self._push_result() */ if (__pyx_v_first) { /* "asyncpg/protocol/coreproto.pyx":1060 * if first: * # if we never send anything, simply set the result * self._push_result() # <<<<<<<<<<<<<< * else: * # otherwise, append SYNC and send the buffers */ __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 1060, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/coreproto.pyx":1058 * # reached the end of the input * except StopIteration: * if first: # <<<<<<<<<<<<<< * # if we never send anything, simply set the result * self._push_result() */ goto __pyx_L18; } /* "asyncpg/protocol/coreproto.pyx":1063 * else: * # otherwise, append SYNC and send the buffers * packet.write_bytes(SYNC_MESSAGE) # <<<<<<<<<<<<<< * buffers.append(memoryview(packet)) * self._writelines(buffers) */ /*else*/ { __pyx_t_10 = __pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE; __Pyx_INCREF(__pyx_t_10); __pyx_t_11 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_packet->__pyx_vtab)->write_bytes(__pyx_v_packet, ((PyObject*)__pyx_t_10)); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 1063, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/coreproto.pyx":1064 * # otherwise, append SYNC and send the buffers * packet.write_bytes(SYNC_MESSAGE) * buffers.append(memoryview(packet)) # <<<<<<<<<<<<<< * self._writelines(buffers) * return False */ __pyx_t_11 = PyMemoryView_FromObject(((PyObject *)__pyx_v_packet)); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 1064, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_buffers, __pyx_t_11); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(6, 1064, __pyx_L10_except_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/coreproto.pyx":1065 * packet.write_bytes(SYNC_MESSAGE) * buffers.append(memoryview(packet)) * self._writelines(buffers) # <<<<<<<<<<<<<< * return False * */ __pyx_t_11 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_writelines(__pyx_v_self, __pyx_v_buffers); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 1065, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __pyx_L18:; /* "asyncpg/protocol/coreproto.pyx":1066 * buffers.append(memoryview(packet)) * self._writelines(buffers) * return False # <<<<<<<<<<<<<< * * # error in input, give up the buffers and cleanup */ __pyx_r = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L11_except_return; } /* "asyncpg/protocol/coreproto.pyx":1069 * * # error in input, give up the buffers and cleanup * except Exception as ex: # <<<<<<<<<<<<<< * self._bind_execute_many_fail(ex, first) * return False */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_8) { __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._bind_execute_many_more", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(6, 1069, __pyx_L10_except_error) __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_v_ex = __pyx_t_3; /*try:*/ { /* "asyncpg/protocol/coreproto.pyx":1070 * # error in input, give up the buffers and cleanup * except Exception as ex: * self._bind_execute_many_fail(ex, first) # <<<<<<<<<<<<<< * return False * */ __pyx_t_13.__pyx_n = 1; __pyx_t_13.first = __pyx_v_first; __pyx_t_11 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_bind_execute_many_fail(__pyx_v_self, __pyx_v_ex, &__pyx_t_13); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 1070, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/coreproto.pyx":1071 * except Exception as ex: * self._bind_execute_many_fail(ex, first) * return False # <<<<<<<<<<<<<< * * # all good, write to the buffer */ __pyx_r = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L23_return; } /* "asyncpg/protocol/coreproto.pyx":1069 * * # error in input, give up the buffers and cleanup * except Exception as ex: # <<<<<<<<<<<<<< * self._bind_execute_many_fail(ex, first) * return False */ /*finally:*/ { __pyx_L24_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __pyx_t_8 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename; { __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); } __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18); __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15; goto __pyx_L10_except_error; } __pyx_L23_return: { __pyx_t_2 = __pyx_r; __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = 0; __pyx_r = __pyx_t_2; goto __pyx_L11_except_return; } } } goto __pyx_L10_except_error; /* "asyncpg/protocol/coreproto.pyx":1052 * # fill one 32KB buffer * while packet.len() < _EXECUTE_MANY_BUF_SIZE: * try: # <<<<<<<<<<<<<< * # grab one item from the input * buf = next(self._execute_iter) */ __pyx_L10_except_error:; __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); goto __pyx_L1_error; __pyx_L11_except_return:; __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); goto __pyx_L0; __pyx_L15_try_end:; } /* "asyncpg/protocol/coreproto.pyx":1074 * * # all good, write to the buffer * first = False # <<<<<<<<<<<<<< * packet.write_buffer( * self._build_bind_message( */ __pyx_v_first = 0; /* "asyncpg/protocol/coreproto.pyx":1077 * packet.write_buffer( * self._build_bind_message( * self._execute_portal_name, # <<<<<<<<<<<<<< * self._execute_stmt_name, * buf, */ __pyx_t_1 = __pyx_v_self->_execute_portal_name; __Pyx_INCREF(__pyx_t_1); /* "asyncpg/protocol/coreproto.pyx":1078 * self._build_bind_message( * self._execute_portal_name, * self._execute_stmt_name, # <<<<<<<<<<<<<< * buf, * ) */ __pyx_t_3 = __pyx_v_self->_execute_stmt_name; __Pyx_INCREF(__pyx_t_3); /* "asyncpg/protocol/coreproto.pyx":1076 * first = False * packet.write_buffer( * self._build_bind_message( # <<<<<<<<<<<<<< * self._execute_portal_name, * self._execute_stmt_name, */ __pyx_t_9 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_bind_message(__pyx_v_self, ((PyObject*)__pyx_t_1), ((PyObject*)__pyx_t_3), __pyx_v_buf)); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 1076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":1075 * # all good, write to the buffer * first = False * packet.write_buffer( # <<<<<<<<<<<<<< * self._build_bind_message( * self._execute_portal_name, */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_packet->__pyx_vtab)->write_buffer(__pyx_v_packet, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":1083 * ) * packet.write_buffer( * self._build_execute_message(self._execute_portal_name, 0, # <<<<<<<<<<<<<< * ) * ) */ __pyx_t_3 = __pyx_v_self->_execute_portal_name; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_execute_message(__pyx_v_self, ((PyObject*)__pyx_t_3), 0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":1082 * ) * ) * packet.write_buffer( # <<<<<<<<<<<<<< * self._build_execute_message(self._execute_portal_name, 0, * ) */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_packet->__pyx_vtab)->write_buffer(__pyx_v_packet, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "asyncpg/protocol/coreproto.pyx":1088 * * # collected one buffer * buffers.append(memoryview(packet)) # <<<<<<<<<<<<<< * * # write to the wire, and signal the caller for more to send */ __pyx_t_3 = PyMemoryView_FromObject(((PyObject *)__pyx_v_packet)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1088, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_buffers, __pyx_t_3); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(6, 1088, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "asyncpg/protocol/coreproto.pyx":1091 * * # write to the wire, and signal the caller for more to send * self._writelines(buffers) # <<<<<<<<<<<<<< * return True * */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_writelines(__pyx_v_self, __pyx_v_buffers); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1091, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":1092 * # write to the wire, and signal the caller for more to send * self._writelines(buffers) * return True # <<<<<<<<<<<<<< * * cdef _bind_execute_many_fail(self, object error, bint first=False): */ __pyx_r = 1; goto __pyx_L0; /* "asyncpg/protocol/coreproto.pyx":1034 * return self._bind_execute_many_more(True) * * cdef bint _bind_execute_many_more(self, bint first=False): # <<<<<<<<<<<<<< * cdef: * WriteBuffer packet */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._bind_execute_many_more", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_packet); __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XDECREF(__pyx_v_buffers); __Pyx_XDECREF(__pyx_v_ex); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":1094 * return True * * cdef _bind_execute_many_fail(self, object error, bint first=False): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_fail(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_error, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_fail *__pyx_optional_args) { int __pyx_v_first = ((int)0); struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_bind_execute_many_fail", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_first = __pyx_optional_args->first; } } /* "asyncpg/protocol/coreproto.pyx":1097 * cdef WriteBuffer buf * * self.result_type = RESULT_FAILED # <<<<<<<<<<<<<< * self.result = error * if first: */ __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED; /* "asyncpg/protocol/coreproto.pyx":1098 * * self.result_type = RESULT_FAILED * self.result = error # <<<<<<<<<<<<<< * if first: * self._push_result() */ __Pyx_INCREF(__pyx_v_error); __Pyx_GIVEREF(__pyx_v_error); __Pyx_GOTREF(__pyx_v_self->result); __Pyx_DECREF(__pyx_v_self->result); __pyx_v_self->result = __pyx_v_error; /* "asyncpg/protocol/coreproto.pyx":1099 * self.result_type = RESULT_FAILED * self.result = error * if first: # <<<<<<<<<<<<<< * self._push_result() * elif self.is_in_transaction(): */ if (__pyx_v_first) { /* "asyncpg/protocol/coreproto.pyx":1100 * self.result = error * if first: * self._push_result() # <<<<<<<<<<<<<< * elif self.is_in_transaction(): * # we're in an explicit transaction, just SYNC */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1099 * self.result_type = RESULT_FAILED * self.result = error * if first: # <<<<<<<<<<<<<< * self._push_result() * elif self.is_in_transaction(): */ goto __pyx_L3; } /* "asyncpg/protocol/coreproto.pyx":1101 * if first: * self._push_result() * elif self.is_in_transaction(): # <<<<<<<<<<<<<< * # we're in an explicit transaction, just SYNC * self._write(SYNC_MESSAGE) */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->is_in_transaction(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(6, 1101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "asyncpg/protocol/coreproto.pyx":1103 * elif self.is_in_transaction(): * # we're in an explicit transaction, just SYNC * self._write(SYNC_MESSAGE) # <<<<<<<<<<<<<< * else: * # In an implicit transaction, if `ignore_till_sync` is set, */ __pyx_t_1 = __pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":1101 * if first: * self._push_result() * elif self.is_in_transaction(): # <<<<<<<<<<<<<< * # we're in an explicit transaction, just SYNC * self._write(SYNC_MESSAGE) */ goto __pyx_L3; } /* "asyncpg/protocol/coreproto.pyx":1112 * # GOTCHA: cannot use simple query message here, because it is * # ignored if `ignore_till_sync` is set. * buf = self._build_parse_message('', 'ROLLBACK') # <<<<<<<<<<<<<< * buf.write_buffer(self._build_bind_message( * '', '', self._build_empty_bind_data())) */ /*else*/ { __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_parse_message(__pyx_v_self, __pyx_kp_u__34, __pyx_n_u_ROLLBACK)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":1114 * buf = self._build_parse_message('', 'ROLLBACK') * buf.write_buffer(self._build_bind_message( * '', '', self._build_empty_bind_data())) # <<<<<<<<<<<<<< * buf.write_buffer(self._build_execute_message('', 0)) * buf.write_bytes(SYNC_MESSAGE) */ __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_empty_bind_data(__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/protocol/coreproto.pyx":1113 * # ignored if `ignore_till_sync` is set. * buf = self._build_parse_message('', 'ROLLBACK') * buf.write_buffer(self._build_bind_message( # <<<<<<<<<<<<<< * '', '', self._build_empty_bind_data())) * buf.write_buffer(self._build_execute_message('', 0)) */ __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_bind_message(__pyx_v_self, __pyx_kp_u__34, __pyx_kp_u__34, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_3))); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":1115 * buf.write_buffer(self._build_bind_message( * '', '', self._build_empty_bind_data())) * buf.write_buffer(self._build_execute_message('', 0)) # <<<<<<<<<<<<<< * buf.write_bytes(SYNC_MESSAGE) * self._write(buf) */ __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_execute_message(__pyx_v_self, __pyx_kp_u__34, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1116 * '', '', self._build_empty_bind_data())) * buf.write_buffer(self._build_execute_message('', 0)) * buf.write_bytes(SYNC_MESSAGE) # <<<<<<<<<<<<<< * self._write(buf) * */ __pyx_t_1 = __pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_v_buf, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":1117 * buf.write_buffer(self._build_execute_message('', 0)) * buf.write_bytes(SYNC_MESSAGE) * self._write(buf) # <<<<<<<<<<<<<< * * cdef _execute(self, str portal_name, int32_t limit): */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; /* "asyncpg/protocol/coreproto.pyx":1094 * return True * * cdef _bind_execute_many_fail(self, object error, bint first=False): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._bind_execute_many_fail", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":1119 * self._write(buf) * * cdef _execute(self, str portal_name, int32_t limit): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__execute(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, int32_t __pyx_v_limit) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_execute", 1); /* "asyncpg/protocol/coreproto.pyx":1122 * cdef WriteBuffer buf * * self._ensure_connected() # <<<<<<<<<<<<<< * self._set_state(PROTOCOL_EXECUTE) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_ensure_connected(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1123 * * self._ensure_connected() * self._set_state(PROTOCOL_EXECUTE) # <<<<<<<<<<<<<< * * self.result = [] */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_EXECUTE); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1125 * self._set_state(PROTOCOL_EXECUTE) * * self.result = [] # <<<<<<<<<<<<<< * * buf = self._build_execute_message(portal_name, limit) */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->result); __Pyx_DECREF(__pyx_v_self->result); __pyx_v_self->result = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1127 * self.result = [] * * buf = self._build_execute_message(portal_name, limit) # <<<<<<<<<<<<<< * * buf.write_bytes(SYNC_MESSAGE) */ __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_execute_message(__pyx_v_self, __pyx_v_portal_name, __pyx_v_limit)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1129 * buf = self._build_execute_message(portal_name, limit) * * buf.write_bytes(SYNC_MESSAGE) # <<<<<<<<<<<<<< * * self._write(buf) */ __pyx_t_1 = __pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_v_buf, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":1131 * buf.write_bytes(SYNC_MESSAGE) * * self._write(buf) # <<<<<<<<<<<<<< * * cdef _bind(self, str portal_name, str stmt_name, */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":1119 * self._write(buf) * * cdef _execute(self, str portal_name, int32_t limit): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._execute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":1133 * self._write(buf) * * cdef _bind(self, str portal_name, str stmt_name, # <<<<<<<<<<<<<< * WriteBuffer bind_data): * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_stmt_name, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_bind_data) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_bind", 1); /* "asyncpg/protocol/coreproto.pyx":1138 * cdef WriteBuffer buf * * self._ensure_connected() # <<<<<<<<<<<<<< * self._set_state(PROTOCOL_BIND) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_ensure_connected(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1139 * * self._ensure_connected() * self._set_state(PROTOCOL_BIND) # <<<<<<<<<<<<<< * * buf = self._build_bind_message(portal_name, stmt_name, bind_data) */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1141 * self._set_state(PROTOCOL_BIND) * * buf = self._build_bind_message(portal_name, stmt_name, bind_data) # <<<<<<<<<<<<<< * * buf.write_bytes(SYNC_MESSAGE) */ __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_bind_message(__pyx_v_self, __pyx_v_portal_name, __pyx_v_stmt_name, __pyx_v_bind_data)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1143 * buf = self._build_bind_message(portal_name, stmt_name, bind_data) * * buf.write_bytes(SYNC_MESSAGE) # <<<<<<<<<<<<<< * * self._write(buf) */ __pyx_t_1 = __pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_v_buf, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":1145 * buf.write_bytes(SYNC_MESSAGE) * * self._write(buf) # <<<<<<<<<<<<<< * * cdef _close(self, str name, bint is_portal): */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":1133 * self._write(buf) * * cdef _bind(self, str portal_name, str stmt_name, # <<<<<<<<<<<<<< * WriteBuffer bind_data): * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._bind", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":1147 * self._write(buf) * * cdef _close(self, str name, bint is_portal): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__close(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_name, int __pyx_v_is_portal) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_close", 1); /* "asyncpg/protocol/coreproto.pyx":1150 * cdef WriteBuffer buf * * self._ensure_connected() # <<<<<<<<<<<<<< * self._set_state(PROTOCOL_CLOSE_STMT_PORTAL) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_ensure_connected(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1151 * * self._ensure_connected() * self._set_state(PROTOCOL_CLOSE_STMT_PORTAL) # <<<<<<<<<<<<<< * * buf = WriteBuffer.new_message(b'C') */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CLOSE_STMT_PORTAL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1153 * self._set_state(PROTOCOL_CLOSE_STMT_PORTAL) * * buf = WriteBuffer.new_message(b'C') # <<<<<<<<<<<<<< * * if is_portal: */ __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('C')); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1155 * buf = WriteBuffer.new_message(b'C') * * if is_portal: # <<<<<<<<<<<<<< * buf.write_byte(b'P') * else: */ if (__pyx_v_is_portal) { /* "asyncpg/protocol/coreproto.pyx":1156 * * if is_portal: * buf.write_byte(b'P') # <<<<<<<<<<<<<< * else: * buf.write_byte(b'S') */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_byte(__pyx_v_buf, 'P'); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1155 * buf = WriteBuffer.new_message(b'C') * * if is_portal: # <<<<<<<<<<<<<< * buf.write_byte(b'P') * else: */ goto __pyx_L3; } /* "asyncpg/protocol/coreproto.pyx":1158 * buf.write_byte(b'P') * else: * buf.write_byte(b'S') # <<<<<<<<<<<<<< * * buf.write_str(name, self.encoding) */ /*else*/ { __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_byte(__pyx_v_buf, 'S'); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "asyncpg/protocol/coreproto.pyx":1160 * buf.write_byte(b'S') * * buf.write_str(name, self.encoding) # <<<<<<<<<<<<<< * buf.end_message() * */ __pyx_t_1 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_v_name, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":1161 * * buf.write_str(name, self.encoding) * buf.end_message() # <<<<<<<<<<<<<< * * buf.write_bytes(SYNC_MESSAGE) */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":1163 * buf.end_message() * * buf.write_bytes(SYNC_MESSAGE) # <<<<<<<<<<<<<< * * self._write(buf) */ __pyx_t_2 = __pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_v_buf, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1165 * buf.write_bytes(SYNC_MESSAGE) * * self._write(buf) # <<<<<<<<<<<<<< * * cdef _simple_query(self, str query): */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1147 * self._write(buf) * * cdef _close(self, str name, bint is_portal): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._close", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":1167 * self._write(buf) * * cdef _simple_query(self, str query): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * self._ensure_connected() */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__simple_query(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_query) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_simple_query", 1); /* "asyncpg/protocol/coreproto.pyx":1169 * cdef _simple_query(self, str query): * cdef WriteBuffer buf * self._ensure_connected() # <<<<<<<<<<<<<< * self._set_state(PROTOCOL_SIMPLE_QUERY) * buf = WriteBuffer.new_message(b'Q') */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_ensure_connected(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1170 * cdef WriteBuffer buf * self._ensure_connected() * self._set_state(PROTOCOL_SIMPLE_QUERY) # <<<<<<<<<<<<<< * buf = WriteBuffer.new_message(b'Q') * buf.write_str(query, self.encoding) */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_SIMPLE_QUERY); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1171 * self._ensure_connected() * self._set_state(PROTOCOL_SIMPLE_QUERY) * buf = WriteBuffer.new_message(b'Q') # <<<<<<<<<<<<<< * buf.write_str(query, self.encoding) * buf.end_message() */ __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('Q')); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1172 * self._set_state(PROTOCOL_SIMPLE_QUERY) * buf = WriteBuffer.new_message(b'Q') * buf.write_str(query, self.encoding) # <<<<<<<<<<<<<< * buf.end_message() * self._write(buf) */ __pyx_t_1 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_v_query, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":1173 * buf = WriteBuffer.new_message(b'Q') * buf.write_str(query, self.encoding) * buf.end_message() # <<<<<<<<<<<<<< * self._write(buf) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":1174 * buf.write_str(query, self.encoding) * buf.end_message() * self._write(buf) # <<<<<<<<<<<<<< * * cdef _copy_out(self, str copy_stmt): */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":1167 * self._write(buf) * * cdef _simple_query(self, str query): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * self._ensure_connected() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._simple_query", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":1176 * self._write(buf) * * cdef _copy_out(self, str copy_stmt): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__copy_out(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_copy_stmt) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_copy_out", 1); /* "asyncpg/protocol/coreproto.pyx":1179 * cdef WriteBuffer buf * * self._ensure_connected() # <<<<<<<<<<<<<< * self._set_state(PROTOCOL_COPY_OUT) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_ensure_connected(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1180 * * self._ensure_connected() * self._set_state(PROTOCOL_COPY_OUT) # <<<<<<<<<<<<<< * * # Send the COPY .. TO STDOUT using the SimpleQuery protocol. */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1183 * * # Send the COPY .. TO STDOUT using the SimpleQuery protocol. * buf = WriteBuffer.new_message(b'Q') # <<<<<<<<<<<<<< * buf.write_str(copy_stmt, self.encoding) * buf.end_message() */ __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('Q')); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1184 * # Send the COPY .. TO STDOUT using the SimpleQuery protocol. * buf = WriteBuffer.new_message(b'Q') * buf.write_str(copy_stmt, self.encoding) # <<<<<<<<<<<<<< * buf.end_message() * self._write(buf) */ __pyx_t_1 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_v_copy_stmt, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":1185 * buf = WriteBuffer.new_message(b'Q') * buf.write_str(copy_stmt, self.encoding) * buf.end_message() # <<<<<<<<<<<<<< * self._write(buf) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":1186 * buf.write_str(copy_stmt, self.encoding) * buf.end_message() * self._write(buf) # <<<<<<<<<<<<<< * * cdef _copy_in(self, str copy_stmt): */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":1176 * self._write(buf) * * cdef _copy_out(self, str copy_stmt): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":1188 * self._write(buf) * * cdef _copy_in(self, str copy_stmt): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__copy_in(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_copy_stmt) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_copy_in", 1); /* "asyncpg/protocol/coreproto.pyx":1191 * cdef WriteBuffer buf * * self._ensure_connected() # <<<<<<<<<<<<<< * self._set_state(PROTOCOL_COPY_IN) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_ensure_connected(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1192 * * self._ensure_connected() * self._set_state(PROTOCOL_COPY_IN) # <<<<<<<<<<<<<< * * buf = WriteBuffer.new_message(b'Q') */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1194 * self._set_state(PROTOCOL_COPY_IN) * * buf = WriteBuffer.new_message(b'Q') # <<<<<<<<<<<<<< * buf.write_str(copy_stmt, self.encoding) * buf.end_message() */ __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('Q')); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1195 * * buf = WriteBuffer.new_message(b'Q') * buf.write_str(copy_stmt, self.encoding) # <<<<<<<<<<<<<< * buf.end_message() * self._write(buf) */ __pyx_t_1 = __pyx_v_self->encoding; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_v_copy_stmt, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":1196 * buf = WriteBuffer.new_message(b'Q') * buf.write_str(copy_stmt, self.encoding) * buf.end_message() # <<<<<<<<<<<<<< * self._write(buf) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":1197 * buf.write_str(copy_stmt, self.encoding) * buf.end_message() * self._write(buf) # <<<<<<<<<<<<<< * * cdef _terminate(self): */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":1188 * self._write(buf) * * cdef _copy_in(self, str copy_stmt): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":1199 * self._write(buf) * * cdef _terminate(self): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * self._ensure_connected() */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__terminate(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_terminate", 1); /* "asyncpg/protocol/coreproto.pyx":1201 * cdef _terminate(self): * cdef WriteBuffer buf * self._ensure_connected() # <<<<<<<<<<<<<< * self._set_state(PROTOCOL_TERMINATING) * buf = WriteBuffer.new_message(b'X') */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_ensure_connected(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1202 * cdef WriteBuffer buf * self._ensure_connected() * self._set_state(PROTOCOL_TERMINATING) # <<<<<<<<<<<<<< * buf = WriteBuffer.new_message(b'X') * buf.end_message() */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_TERMINATING); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1203 * self._ensure_connected() * self._set_state(PROTOCOL_TERMINATING) * buf = WriteBuffer.new_message(b'X') # <<<<<<<<<<<<<< * buf.end_message() * self._write(buf) */ __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('X')); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1204 * self._set_state(PROTOCOL_TERMINATING) * buf = WriteBuffer.new_message(b'X') * buf.end_message() # <<<<<<<<<<<<<< * self._write(buf) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1205 * buf = WriteBuffer.new_message(b'X') * buf.end_message() * self._write(buf) # <<<<<<<<<<<<<< * * cdef _write(self, buf): */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/coreproto.pyx":1199 * self._write(buf) * * cdef _terminate(self): # <<<<<<<<<<<<<< * cdef WriteBuffer buf * self._ensure_connected() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._terminate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":1207 * self._write(buf) * * cdef _write(self, buf): # <<<<<<<<<<<<<< * raise NotImplementedError * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_write", 1); /* "asyncpg/protocol/coreproto.pyx":1208 * * cdef _write(self, buf): * raise NotImplementedError # <<<<<<<<<<<<<< * * cdef _writelines(self, list buffers): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(6, 1208, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":1207 * self._write(buf) * * cdef _write(self, buf): # <<<<<<<<<<<<<< * raise NotImplementedError * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._write", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":1210 * raise NotImplementedError * * cdef _writelines(self, list buffers): # <<<<<<<<<<<<<< * raise NotImplementedError * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__writelines(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_buffers) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_writelines", 1); /* "asyncpg/protocol/coreproto.pyx":1211 * * cdef _writelines(self, list buffers): * raise NotImplementedError # <<<<<<<<<<<<<< * * cdef _decode_row(self, const char* buf, ssize_t buf_len): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(6, 1211, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":1210 * raise NotImplementedError * * cdef _writelines(self, list buffers): # <<<<<<<<<<<<<< * raise NotImplementedError * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._writelines", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":1213 * raise NotImplementedError * * cdef _decode_row(self, const char* buf, ssize_t buf_len): # <<<<<<<<<<<<<< * pass * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__decode_row(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED char const *__pyx_v_buf, CYTHON_UNUSED Py_ssize_t __pyx_v_buf_len) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_decode_row", 1); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":1216 * pass * * cdef _set_server_parameter(self, name, val): # <<<<<<<<<<<<<< * pass * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__set_server_parameter(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_val) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_set_server_parameter", 1); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":1219 * pass * * cdef _on_result(self): # <<<<<<<<<<<<<< * pass * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_result(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_on_result", 1); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":1222 * pass * * cdef _on_notice(self, parsed): # <<<<<<<<<<<<<< * pass * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_notice(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_parsed) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_on_notice", 1); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":1225 * pass * * cdef _on_notification(self, pid, channel, payload): # <<<<<<<<<<<<<< * pass * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_notification(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_pid, CYTHON_UNUSED PyObject *__pyx_v_channel, CYTHON_UNUSED PyObject *__pyx_v_payload) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_on_notification", 1); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pyx":1228 * pass * * cdef _on_connection_lost(self, exc): # <<<<<<<<<<<<<< * pass * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_connection_lost(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_on_connection_lost", 1); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pxd":97 * object gss_ctx * * readonly int32_t backend_pid # <<<<<<<<<<<<<< * readonly int32_t backend_secret * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_11backend_pid_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_11backend_pid_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_11backend_pid___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_11backend_pid___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->backend_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol.backend_pid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/coreproto.pxd":98 * * readonly int32_t backend_pid * readonly int32_t backend_secret # <<<<<<<<<<<<<< * * ## Result */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_14backend_secret_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_14backend_secret_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_14backend_secret___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_14backend_secret___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->backend_secret); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol.backend_secret.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_5__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12CoreProtocol_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_5__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_4__reduce_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_4__reduce_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = (self._discard_data, self._execute_iter, self._execute_portal_name, self._execute_stmt_name, self._skip_discard, self.address, self.backend_pid, self.backend_secret, self.buffer, self.con_params, self.con_status, self.encoding, self.gss_ctx, self.result, self.result_execute_completed, self.result_param_desc, self.result_row_desc, self.result_status_msg, self.result_type, self.scram, self.state, self.transport, self.xact_status) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_discard_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_skip_discard); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_self->backend_pid); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_self->backend_secret); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(__pyx_v_self->con_status); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_self->result_execute_completed); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(__pyx_v_self->result_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_self->state); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(__pyx_v_self->xact_status); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(23); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->_execute_iter); __Pyx_GIVEREF(__pyx_v_self->_execute_iter); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_self->_execute_iter)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->_execute_portal_name); __Pyx_GIVEREF(__pyx_v_self->_execute_portal_name); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_self->_execute_portal_name)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->_execute_stmt_name); __Pyx_GIVEREF(__pyx_v_self->_execute_stmt_name); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_v_self->_execute_stmt_name)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->address); __Pyx_GIVEREF(__pyx_v_self->address); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_v_self->address)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_self->buffer); __Pyx_GIVEREF((PyObject *)__pyx_v_self->buffer); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 8, ((PyObject *)__pyx_v_self->buffer))) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->con_params); __Pyx_GIVEREF(__pyx_v_self->con_params); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 9, __pyx_v_self->con_params)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 10, __pyx_t_5)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->encoding); __Pyx_GIVEREF(__pyx_v_self->encoding); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 11, __pyx_v_self->encoding)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->gss_ctx); __Pyx_GIVEREF(__pyx_v_self->gss_ctx); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 12, __pyx_v_self->gss_ctx)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->result); __Pyx_GIVEREF(__pyx_v_self->result); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 13, __pyx_v_self->result)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 14, __pyx_t_6)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->result_param_desc); __Pyx_GIVEREF(__pyx_v_self->result_param_desc); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 15, __pyx_v_self->result_param_desc)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->result_row_desc); __Pyx_GIVEREF(__pyx_v_self->result_row_desc); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 16, __pyx_v_self->result_row_desc)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->result_status_msg); __Pyx_GIVEREF(__pyx_v_self->result_status_msg); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 17, __pyx_v_self->result_status_msg)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 18, __pyx_t_7)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_self->scram); __Pyx_GIVEREF((PyObject *)__pyx_v_self->scram); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 19, ((PyObject *)__pyx_v_self->scram))) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 20, __pyx_t_8)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->transport); __Pyx_GIVEREF(__pyx_v_self->transport); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 21, __pyx_v_self->transport)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 22, __pyx_t_9)) __PYX_ERR(2, 5, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_v_state = ((PyObject*)__pyx_t_10); __pyx_t_10 = 0; /* "(tree fragment)":6 * cdef bint use_setstate * state = (self._discard_data, self._execute_iter, self._execute_portal_name, self._execute_stmt_name, self._skip_discard, self.address, self.backend_pid, self.backend_secret, self.buffer, self.con_params, self.con_status, self.encoding, self.gss_ctx, self.result, self.result_execute_completed, self.result_param_desc, self.result_row_desc, self.result_status_msg, self.result_type, self.scram, self.state, self.transport, self.xact_status) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_10 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_v__dict = __pyx_t_10; __pyx_t_10 = 0; /* "(tree fragment)":7 * state = (self._discard_data, self._execute_iter, self._execute_portal_name, self._execute_stmt_name, self._skip_discard, self.address, self.backend_pid, self.backend_secret, self.buffer, self.con_params, self.con_status, self.encoding, self.gss_ctx, self.result, self.result_execute_completed, self.result_param_desc, self.result_row_desc, self.result_status_msg, self.result_type, self.scram, self.state, self.transport, self.xact_status) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_11 = (__pyx_v__dict != Py_None); if (__pyx_t_11) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v__dict)) __PYX_ERR(2, 8, __pyx_L1_error); __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_9)); __pyx_t_9 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = self._execute_iter is not None or self._execute_portal_name is not None or self._execute_stmt_name is not None or self.address is not None or self.buffer is not None or self.con_params is not None or self.encoding is not None or self.gss_ctx is not None or self.result is not None or self.result_param_desc is not None or self.result_row_desc is not None or self.result_status_msg is not None or self.scram is not None or self.transport is not None */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = (self._discard_data, self._execute_iter, self._execute_portal_name, self._execute_stmt_name, self._skip_discard, self.address, self.backend_pid, self.backend_secret, self.buffer, self.con_params, self.con_status, self.encoding, self.gss_ctx, self.result, self.result_execute_completed, self.result_param_desc, self.result_row_desc, self.result_status_msg, self.result_type, self.scram, self.state, self.transport, self.xact_status) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = self._execute_iter is not None or self._execute_portal_name is not None or self._execute_stmt_name is not None or self.address is not None or self.buffer is not None or self.con_params is not None or self.encoding is not None or self.gss_ctx is not None or self.result is not None or self.result_param_desc is not None or self.result_row_desc is not None or self.result_status_msg is not None or self.scram is not None or self.transport is not None # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, None), state */ /*else*/ { __pyx_t_12 = (__pyx_v_self->_execute_iter != Py_None); if (!__pyx_t_12) { } else { __pyx_t_11 = __pyx_t_12; goto __pyx_L4_bool_binop_done; } __pyx_t_12 = (__pyx_v_self->_execute_portal_name != ((PyObject*)Py_None)); if (!__pyx_t_12) { } else { __pyx_t_11 = __pyx_t_12; goto __pyx_L4_bool_binop_done; } __pyx_t_12 = (__pyx_v_self->_execute_stmt_name != ((PyObject*)Py_None)); if (!__pyx_t_12) { } else { __pyx_t_11 = __pyx_t_12; goto __pyx_L4_bool_binop_done; } __pyx_t_12 = (__pyx_v_self->address != Py_None); if (!__pyx_t_12) { } else { __pyx_t_11 = __pyx_t_12; goto __pyx_L4_bool_binop_done; } __pyx_t_12 = (((PyObject *)__pyx_v_self->buffer) != Py_None); if (!__pyx_t_12) { } else { __pyx_t_11 = __pyx_t_12; goto __pyx_L4_bool_binop_done; } __pyx_t_12 = (__pyx_v_self->con_params != Py_None); if (!__pyx_t_12) { } else { __pyx_t_11 = __pyx_t_12; goto __pyx_L4_bool_binop_done; } __pyx_t_12 = (__pyx_v_self->encoding != ((PyObject*)Py_None)); if (!__pyx_t_12) { } else { __pyx_t_11 = __pyx_t_12; goto __pyx_L4_bool_binop_done; } __pyx_t_12 = (__pyx_v_self->gss_ctx != Py_None); if (!__pyx_t_12) { } else { __pyx_t_11 = __pyx_t_12; goto __pyx_L4_bool_binop_done; } __pyx_t_12 = (__pyx_v_self->result != Py_None); if (!__pyx_t_12) { } else { __pyx_t_11 = __pyx_t_12; goto __pyx_L4_bool_binop_done; } __pyx_t_12 = (__pyx_v_self->result_param_desc != ((PyObject*)Py_None)); if (!__pyx_t_12) { } else { __pyx_t_11 = __pyx_t_12; goto __pyx_L4_bool_binop_done; } __pyx_t_12 = (__pyx_v_self->result_row_desc != ((PyObject*)Py_None)); if (!__pyx_t_12) { } else { __pyx_t_11 = __pyx_t_12; goto __pyx_L4_bool_binop_done; } __pyx_t_12 = (__pyx_v_self->result_status_msg != ((PyObject*)Py_None)); if (!__pyx_t_12) { } else { __pyx_t_11 = __pyx_t_12; goto __pyx_L4_bool_binop_done; } __pyx_t_12 = (((PyObject *)__pyx_v_self->scram) != Py_None); if (!__pyx_t_12) { } else { __pyx_t_11 = __pyx_t_12; goto __pyx_L4_bool_binop_done; } __pyx_t_12 = (__pyx_v_self->transport != Py_None); __pyx_t_11 = __pyx_t_12; __pyx_L4_bool_binop_done:; __pyx_v_use_setstate = __pyx_t_11; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = self._execute_iter is not None or self._execute_portal_name is not None or self._execute_stmt_name is not None or self.address is not None or self.buffer is not None or self.con_params is not None or self.encoding is not None or self.gss_ctx is not None or self.result is not None or self.result_param_desc is not None or self.result_row_desc is not None or self.result_status_msg is not None or self.scram is not None or self.transport is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, None), state * else: */ if (__pyx_v_use_setstate) { /* "(tree fragment)":13 * use_setstate = self._execute_iter is not None or self._execute_portal_name is not None or self._execute_stmt_name is not None or self.address is not None or self.buffer is not None or self.con_params is not None or self.encoding is not None or self.gss_ctx is not None or self.result is not None or self.result_param_desc is not None or self.result_row_desc is not None or self.result_status_msg is not None or self.scram is not None or self.transport is not None * if use_setstate: * return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_pyx_unpickle_CoreProtocol); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_int_175807176); __Pyx_GIVEREF(__pyx_int_175807176); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_175807176)) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, Py_None)) __PYX_ERR(2, 13, __pyx_L1_error); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9)) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10)) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_state)) __PYX_ERR(2, 13, __pyx_L1_error); __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = self._execute_iter is not None or self._execute_portal_name is not None or self._execute_stmt_name is not None or self.address is not None or self.buffer is not None or self.con_params is not None or self.encoding is not None or self.gss_ctx is not None or self.result is not None or self.result_param_desc is not None or self.result_row_desc is not None or self.result_status_msg is not None or self.scram is not None or self.transport is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, None), state * else: * return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_CoreProtocol__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_pyx_unpickle_CoreProtocol); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_int_175807176); __Pyx_GIVEREF(__pyx_int_175807176); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_175807176)) __PYX_ERR(2, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_state)) __PYX_ERR(2, 15, __pyx_L1_error); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8)) __PYX_ERR(2, 15, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10)) __PYX_ERR(2, 15, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_10 = 0; __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_CoreProtocol__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_7__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12CoreProtocol_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_7__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 16, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 16, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 16, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_6__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_6__setstate_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":17 * return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_CoreProtocol__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 17, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_CoreProtocol__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_CoreProtocol__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pyx":14 * cdef class PreparedStatementState: * * def __cinit__( # <<<<<<<<<<<<<< * self, * str name, */ /* Python wrapper */ static int __pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_query = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_protocol = 0; PyTypeObject *__pyx_v_record_class = 0; int __pyx_v_ignore_custom_codec; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_query,&__pyx_n_s_protocol,&__pyx_n_s_record_class,&__pyx_n_s_ignore_custom_codec,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 14, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_query)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 14, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); __PYX_ERR(7, 14, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_protocol)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 14, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); __PYX_ERR(7, 14, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_record_class)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 14, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); __PYX_ERR(7, 14, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ignore_custom_codec)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 14, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); __PYX_ERR(7, 14, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(7, 14, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); } __pyx_v_name = ((PyObject*)values[0]); __pyx_v_query = ((PyObject*)values[1]); __pyx_v_protocol = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)values[2]); __pyx_v_record_class = ((PyTypeObject*)values[3]); __pyx_v_ignore_custom_codec = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_ignore_custom_codec == (int)-1) && PyErr_Occurred())) __PYX_ERR(7, 20, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, __pyx_nargs); __PYX_ERR(7, 14, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(7, 16, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_query), (&PyUnicode_Type), 1, "query", 1))) __PYX_ERR(7, 17, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_protocol), __pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, 1, "protocol", 0))) __PYX_ERR(7, 18, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_record_class), (&PyType_Type), 1, "record_class", 1))) __PYX_ERR(7, 19, __pyx_L1_error) __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState___cinit__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self), __pyx_v_name, __pyx_v_query, __pyx_v_protocol, __pyx_v_record_class, __pyx_v_ignore_custom_codec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_query, struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_protocol, PyTypeObject *__pyx_v_record_class, int __pyx_v_ignore_custom_codec) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__cinit__", 1); /* "asyncpg/protocol/prepared_stmt.pyx":22 * bint ignore_custom_codec * ): * self.name = name # <<<<<<<<<<<<<< * self.query = query * self.settings = protocol.settings */ __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_v_name; /* "asyncpg/protocol/prepared_stmt.pyx":23 * ): * self.name = name * self.query = query # <<<<<<<<<<<<<< * self.settings = protocol.settings * self.row_desc = self.parameters_desc = None */ __Pyx_INCREF(__pyx_v_query); __Pyx_GIVEREF(__pyx_v_query); __Pyx_GOTREF(__pyx_v_self->query); __Pyx_DECREF(__pyx_v_self->query); __pyx_v_self->query = __pyx_v_query; /* "asyncpg/protocol/prepared_stmt.pyx":24 * self.name = name * self.query = query * self.settings = protocol.settings # <<<<<<<<<<<<<< * self.row_desc = self.parameters_desc = None * self.args_codecs = self.rows_codecs = None */ __pyx_t_1 = ((PyObject *)__pyx_v_protocol->settings); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF((PyObject *)__pyx_v_self->settings); __Pyx_DECREF((PyObject *)__pyx_v_self->settings); __pyx_v_self->settings = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":25 * self.query = query * self.settings = protocol.settings * self.row_desc = self.parameters_desc = None # <<<<<<<<<<<<<< * self.args_codecs = self.rows_codecs = None * self.args_num = self.cols_num = 0 */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->row_desc); __Pyx_DECREF(__pyx_v_self->row_desc); __pyx_v_self->row_desc = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->parameters_desc); __Pyx_DECREF(__pyx_v_self->parameters_desc); __pyx_v_self->parameters_desc = ((PyObject*)Py_None); /* "asyncpg/protocol/prepared_stmt.pyx":26 * self.settings = protocol.settings * self.row_desc = self.parameters_desc = None * self.args_codecs = self.rows_codecs = None # <<<<<<<<<<<<<< * self.args_num = self.cols_num = 0 * self.cols_desc = None */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->args_codecs); __Pyx_DECREF(__pyx_v_self->args_codecs); __pyx_v_self->args_codecs = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->rows_codecs); __Pyx_DECREF(__pyx_v_self->rows_codecs); __pyx_v_self->rows_codecs = ((PyObject*)Py_None); /* "asyncpg/protocol/prepared_stmt.pyx":27 * self.row_desc = self.parameters_desc = None * self.args_codecs = self.rows_codecs = None * self.args_num = self.cols_num = 0 # <<<<<<<<<<<<<< * self.cols_desc = None * self.closed = False */ __pyx_v_self->args_num = 0; __pyx_v_self->cols_num = 0; /* "asyncpg/protocol/prepared_stmt.pyx":28 * self.args_codecs = self.rows_codecs = None * self.args_num = self.cols_num = 0 * self.cols_desc = None # <<<<<<<<<<<<<< * self.closed = False * self.prepared = True */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->cols_desc); __Pyx_DECREF(__pyx_v_self->cols_desc); __pyx_v_self->cols_desc = Py_None; /* "asyncpg/protocol/prepared_stmt.pyx":29 * self.args_num = self.cols_num = 0 * self.cols_desc = None * self.closed = False # <<<<<<<<<<<<<< * self.prepared = True * self.refs = 0 */ __pyx_v_self->closed = 0; /* "asyncpg/protocol/prepared_stmt.pyx":30 * self.cols_desc = None * self.closed = False * self.prepared = True # <<<<<<<<<<<<<< * self.refs = 0 * self.record_class = record_class */ __pyx_v_self->prepared = 1; /* "asyncpg/protocol/prepared_stmt.pyx":31 * self.closed = False * self.prepared = True * self.refs = 0 # <<<<<<<<<<<<<< * self.record_class = record_class * self.ignore_custom_codec = ignore_custom_codec */ __pyx_v_self->refs = 0; /* "asyncpg/protocol/prepared_stmt.pyx":32 * self.prepared = True * self.refs = 0 * self.record_class = record_class # <<<<<<<<<<<<<< * self.ignore_custom_codec = ignore_custom_codec * */ __Pyx_INCREF((PyObject *)__pyx_v_record_class); __Pyx_GIVEREF((PyObject *)__pyx_v_record_class); __Pyx_GOTREF((PyObject *)__pyx_v_self->record_class); __Pyx_DECREF((PyObject *)__pyx_v_self->record_class); __pyx_v_self->record_class = __pyx_v_record_class; /* "asyncpg/protocol/prepared_stmt.pyx":33 * self.refs = 0 * self.record_class = record_class * self.ignore_custom_codec = ignore_custom_codec # <<<<<<<<<<<<<< * * def _get_parameters(self): */ __pyx_v_self->ignore_custom_codec = __pyx_v_ignore_custom_codec; /* "asyncpg/protocol/prepared_stmt.pyx":14 * cdef class PreparedStatementState: * * def __cinit__( # <<<<<<<<<<<<<< * self, * str name, */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pyx":35 * self.ignore_custom_codec = ignore_custom_codec * * def _get_parameters(self): # <<<<<<<<<<<<<< * cdef Codec codec * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_3_get_parameters(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_3_get_parameters = {"_get_parameters", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_3_get_parameters, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_3_get_parameters(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_parameters (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_get_parameters", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_get_parameters", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_2_get_parameters(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_2_get_parameters(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; PyObject *__pyx_v_result = NULL; PyObject *__pyx_v_oid = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; uint32_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; unsigned int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_parameters", 1); /* "asyncpg/protocol/prepared_stmt.pyx":38 * cdef Codec codec * * result = [] # <<<<<<<<<<<<<< * for oid in self.parameters_desc: * codec = self.settings.get_data_codec(oid) */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":39 * * result = [] * for oid in self.parameters_desc: # <<<<<<<<<<<<<< * codec = self.settings.get_data_codec(oid) * if codec is None: */ if (unlikely(__pyx_v_self->parameters_desc == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(7, 39, __pyx_L1_error) } __pyx_t_1 = __pyx_v_self->parameters_desc; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(7, 39, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(7, 39, __pyx_L1_error) #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_oid, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":40 * result = [] * for oid in self.parameters_desc: * codec = self.settings.get_data_codec(oid) # <<<<<<<<<<<<<< * if codec is None: * raise exceptions.InternalClientError( */ __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 40, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec(__pyx_v_self->settings, __pyx_t_4, 0, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_3)); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":41 * for oid in self.parameters_desc: * codec = self.settings.get_data_codec(oid) * if codec is None: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * 'missing codec information for OID {}'.format(oid)) */ __pyx_t_5 = (((PyObject *)__pyx_v_codec) == Py_None); if (unlikely(__pyx_t_5)) { /* "asyncpg/protocol/prepared_stmt.pyx":42 * codec = self.settings.get_data_codec(oid) * if codec is None: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * 'missing codec information for OID {}'.format(oid)) * result.append(apg_types.Type( */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":43 * if codec is None: * raise exceptions.InternalClientError( * 'missing codec information for OID {}'.format(oid)) # <<<<<<<<<<<<<< * result.append(apg_types.Type( * oid, codec.name, codec.kind, codec.schema)) */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_missing_codec_information_for_OI, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_oid}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_8 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(7, 42, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":41 * for oid in self.parameters_desc: * codec = self.settings.get_data_codec(oid) * if codec is None: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * 'missing codec information for OID {}'.format(oid)) */ } /* "asyncpg/protocol/prepared_stmt.pyx":44 * raise exceptions.InternalClientError( * 'missing codec information for OID {}'.format(oid)) * result.append(apg_types.Type( # <<<<<<<<<<<<<< * oid, codec.name, codec.kind, codec.schema)) * */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_apg_types); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Type); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":45 * 'missing codec information for OID {}'.format(oid)) * result.append(apg_types.Type( * oid, codec.name, codec.kind, codec.schema)) # <<<<<<<<<<<<<< * * return tuple(result) */ __pyx_t_7 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_v_oid, __pyx_v_codec->name, __pyx_v_codec->kind, __pyx_v_codec->schema}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 4+__pyx_t_10); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } /* "asyncpg/protocol/prepared_stmt.pyx":44 * raise exceptions.InternalClientError( * 'missing codec information for OID {}'.format(oid)) * result.append(apg_types.Type( # <<<<<<<<<<<<<< * oid, codec.name, codec.kind, codec.schema)) * */ __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(7, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":39 * * result = [] * for oid in self.parameters_desc: # <<<<<<<<<<<<<< * codec = self.settings.get_data_codec(oid) * if codec is None: */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":47 * oid, codec.name, codec.kind, codec.schema)) * * return tuple(result) # <<<<<<<<<<<<<< * * def _get_attributes(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/prepared_stmt.pyx":35 * self.ignore_custom_codec = ignore_custom_codec * * def _get_parameters(self): # <<<<<<<<<<<<<< * cdef Codec codec * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._get_parameters", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF(__pyx_v_oid); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pyx":49 * return tuple(result) * * def _get_attributes(self): # <<<<<<<<<<<<<< * cdef Codec codec * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_5_get_attributes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_5_get_attributes = {"_get_attributes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_5_get_attributes, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_5_get_attributes(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_attributes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_get_attributes", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_get_attributes", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_4_get_attributes(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_4_get_attributes(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; PyObject *__pyx_v_result = NULL; PyObject *__pyx_v_d = NULL; PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_oid = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; uint32_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; unsigned int __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_attributes", 1); /* "asyncpg/protocol/prepared_stmt.pyx":52 * cdef Codec codec * * if not self.row_desc: # <<<<<<<<<<<<<< * return () * */ __pyx_t_1 = (__pyx_v_self->row_desc != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->row_desc) != 0); __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "asyncpg/protocol/prepared_stmt.pyx":53 * * if not self.row_desc: * return () # <<<<<<<<<<<<<< * * result = [] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_empty_tuple); __pyx_r = __pyx_empty_tuple; goto __pyx_L0; /* "asyncpg/protocol/prepared_stmt.pyx":52 * cdef Codec codec * * if not self.row_desc: # <<<<<<<<<<<<<< * return () * */ } /* "asyncpg/protocol/prepared_stmt.pyx":55 * return () * * result = [] # <<<<<<<<<<<<<< * for d in self.row_desc: * name = d[0] */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":56 * * result = [] * for d in self.row_desc: # <<<<<<<<<<<<<< * name = d[0] * oid = d[3] */ if (unlikely(__pyx_v_self->row_desc == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(7, 56, __pyx_L1_error) } __pyx_t_3 = __pyx_v_self->row_desc; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(7, 56, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(7, 56, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":57 * result = [] * for d in self.row_desc: * name = d[0] # <<<<<<<<<<<<<< * oid = d[3] * */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_d, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":58 * for d in self.row_desc: * name = d[0] * oid = d[3] # <<<<<<<<<<<<<< * * codec = self.settings.get_data_codec(oid) */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_d, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_oid, __pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":60 * oid = d[3] * * codec = self.settings.get_data_codec(oid) # <<<<<<<<<<<<<< * if codec is None: * raise exceptions.InternalClientError( */ __pyx_t_6 = __Pyx_PyInt_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_6 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 60, __pyx_L1_error) __pyx_t_5 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec(__pyx_v_self->settings, __pyx_t_6, 0, NULL)); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_5)); __pyx_t_5 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":61 * * codec = self.settings.get_data_codec(oid) * if codec is None: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * 'missing codec information for OID {}'.format(oid)) */ __pyx_t_2 = (((PyObject *)__pyx_v_codec) == Py_None); if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/prepared_stmt.pyx":62 * codec = self.settings.get_data_codec(oid) * if codec is None: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * 'missing codec information for OID {}'.format(oid)) * */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":63 * if codec is None: * raise exceptions.InternalClientError( * 'missing codec information for OID {}'.format(oid)) # <<<<<<<<<<<<<< * * name = name.decode(self.settings._encoding) */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_missing_codec_information_for_OI, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_oid}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_t_9 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_7}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(7, 62, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":61 * * codec = self.settings.get_data_codec(oid) * if codec is None: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * 'missing codec information for OID {}'.format(oid)) */ } /* "asyncpg/protocol/prepared_stmt.pyx":65 * 'missing codec information for OID {}'.format(oid)) * * name = name.decode(self.settings._encoding) # <<<<<<<<<<<<<< * * result.append( */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_decode); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_self->settings->_encoding}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":68 * * result.append( * apg_types.Attribute(name, # <<<<<<<<<<<<<< * apg_types.Type(oid, codec.name, codec.kind, codec.schema))) * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_apg_types); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Attribute); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":69 * result.append( * apg_types.Attribute(name, * apg_types.Type(oid, codec.name, codec.kind, codec.schema))) # <<<<<<<<<<<<<< * * return tuple(result) */ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_apg_types); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_Type); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_9, __pyx_v_oid, __pyx_v_codec->name, __pyx_v_codec->kind, __pyx_v_codec->schema}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_11, 4+__pyx_t_11); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __pyx_t_10 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_v_name, __pyx_t_8}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_11, 2+__pyx_t_11); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } /* "asyncpg/protocol/prepared_stmt.pyx":67 * name = name.decode(self.settings._encoding) * * result.append( # <<<<<<<<<<<<<< * apg_types.Attribute(name, * apg_types.Type(oid, codec.name, codec.kind, codec.schema))) */ __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_5); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(7, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":56 * * result = [] * for d in self.row_desc: # <<<<<<<<<<<<<< * name = d[0] * oid = d[3] */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":71 * apg_types.Type(oid, codec.name, codec.kind, codec.schema))) * * return tuple(result) # <<<<<<<<<<<<<< * * def _init_types(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/protocol/prepared_stmt.pyx":49 * return tuple(result) * * def _get_attributes(self): # <<<<<<<<<<<<<< * cdef Codec codec * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._get_attributes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF(__pyx_v_d); __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_oid); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pyx":73 * return tuple(result) * * def _init_types(self): # <<<<<<<<<<<<<< * cdef: * Codec codec */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_7_init_types(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_7_init_types = {"_init_types", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_7_init_types, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_7_init_types(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_init_types (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_init_types", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_init_types", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_6_init_types(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_6_init_types(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; PyObject *__pyx_v_missing = 0; PyObject *__pyx_v_p_oid = NULL; PyObject *__pyx_v_rdesc = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; uint32_t __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_init_types", 1); /* "asyncpg/protocol/prepared_stmt.pyx":76 * cdef: * Codec codec * set missing = set() # <<<<<<<<<<<<<< * * if self.parameters_desc: */ __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_missing = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":78 * set missing = set() * * if self.parameters_desc: # <<<<<<<<<<<<<< * for p_oid in self.parameters_desc: * codec = self.settings.get_data_codec(p_oid) */ __pyx_t_2 = (__pyx_v_self->parameters_desc != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->parameters_desc) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/prepared_stmt.pyx":79 * * if self.parameters_desc: * for p_oid in self.parameters_desc: # <<<<<<<<<<<<<< * codec = self.settings.get_data_codec(p_oid) * if codec is None or not codec.has_encoder(): */ if (unlikely(__pyx_v_self->parameters_desc == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(7, 79, __pyx_L1_error) } __pyx_t_1 = __pyx_v_self->parameters_desc; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(7, 79, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(7, 79, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XDECREF_SET(__pyx_v_p_oid, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":80 * if self.parameters_desc: * for p_oid in self.parameters_desc: * codec = self.settings.get_data_codec(p_oid) # <<<<<<<<<<<<<< * if codec is None or not codec.has_encoder(): * missing.add(p_oid) */ __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_v_p_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 80, __pyx_L1_error) __pyx_t_4 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec(__pyx_v_self->settings, ((uint32_t)__pyx_t_5), 0, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_4)); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":81 * for p_oid in self.parameters_desc: * codec = self.settings.get_data_codec(p_oid) * if codec is None or not codec.has_encoder(): # <<<<<<<<<<<<<< * missing.add(p_oid) * */ __pyx_t_6 = (((PyObject *)__pyx_v_codec) == Py_None); if (!__pyx_t_6) { } else { __pyx_t_2 = __pyx_t_6; goto __pyx_L7_bool_binop_done; } __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_encoder(__pyx_v_codec); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(7, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = (!__pyx_t_6); __pyx_t_2 = __pyx_t_7; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { /* "asyncpg/protocol/prepared_stmt.pyx":82 * codec = self.settings.get_data_codec(p_oid) * if codec is None or not codec.has_encoder(): * missing.add(p_oid) # <<<<<<<<<<<<<< * * if self.row_desc: */ __pyx_t_8 = PySet_Add(__pyx_v_missing, __pyx_v_p_oid); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(7, 82, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":81 * for p_oid in self.parameters_desc: * codec = self.settings.get_data_codec(p_oid) * if codec is None or not codec.has_encoder(): # <<<<<<<<<<<<<< * missing.add(p_oid) * */ } /* "asyncpg/protocol/prepared_stmt.pyx":79 * * if self.parameters_desc: * for p_oid in self.parameters_desc: # <<<<<<<<<<<<<< * codec = self.settings.get_data_codec(p_oid) * if codec is None or not codec.has_encoder(): */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":78 * set missing = set() * * if self.parameters_desc: # <<<<<<<<<<<<<< * for p_oid in self.parameters_desc: * codec = self.settings.get_data_codec(p_oid) */ } /* "asyncpg/protocol/prepared_stmt.pyx":84 * missing.add(p_oid) * * if self.row_desc: # <<<<<<<<<<<<<< * for rdesc in self.row_desc: * codec = self.settings.get_data_codec((rdesc[3])) */ __pyx_t_2 = (__pyx_v_self->row_desc != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->row_desc) != 0); if (__pyx_t_2) { /* "asyncpg/protocol/prepared_stmt.pyx":85 * * if self.row_desc: * for rdesc in self.row_desc: # <<<<<<<<<<<<<< * codec = self.settings.get_data_codec((rdesc[3])) * if codec is None or not codec.has_decoder(): */ if (unlikely(__pyx_v_self->row_desc == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(7, 85, __pyx_L1_error) } __pyx_t_1 = __pyx_v_self->row_desc; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(7, 85, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(7, 85, __pyx_L1_error) #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XDECREF_SET(__pyx_v_rdesc, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":86 * if self.row_desc: * for rdesc in self.row_desc: * codec = self.settings.get_data_codec((rdesc[3])) # <<<<<<<<<<<<<< * if codec is None or not codec.has_decoder(): * missing.add(rdesc[3]) */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_rdesc, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec(__pyx_v_self->settings, ((uint32_t)__pyx_t_5), 0, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_4)); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":87 * for rdesc in self.row_desc: * codec = self.settings.get_data_codec((rdesc[3])) * if codec is None or not codec.has_decoder(): # <<<<<<<<<<<<<< * missing.add(rdesc[3]) * */ __pyx_t_7 = (((PyObject *)__pyx_v_codec) == Py_None); if (!__pyx_t_7) { } else { __pyx_t_2 = __pyx_t_7; goto __pyx_L14_bool_binop_done; } __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder(__pyx_v_codec); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(7, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = (!__pyx_t_7); __pyx_t_2 = __pyx_t_6; __pyx_L14_bool_binop_done:; if (__pyx_t_2) { /* "asyncpg/protocol/prepared_stmt.pyx":88 * codec = self.settings.get_data_codec((rdesc[3])) * if codec is None or not codec.has_decoder(): * missing.add(rdesc[3]) # <<<<<<<<<<<<<< * * return missing */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_rdesc, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = PySet_Add(__pyx_v_missing, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(7, 88, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":87 * for rdesc in self.row_desc: * codec = self.settings.get_data_codec((rdesc[3])) * if codec is None or not codec.has_decoder(): # <<<<<<<<<<<<<< * missing.add(rdesc[3]) * */ } /* "asyncpg/protocol/prepared_stmt.pyx":85 * * if self.row_desc: * for rdesc in self.row_desc: # <<<<<<<<<<<<<< * codec = self.settings.get_data_codec((rdesc[3])) * if codec is None or not codec.has_decoder(): */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":84 * missing.add(p_oid) * * if self.row_desc: # <<<<<<<<<<<<<< * for rdesc in self.row_desc: * codec = self.settings.get_data_codec((rdesc[3])) */ } /* "asyncpg/protocol/prepared_stmt.pyx":90 * missing.add(rdesc[3]) * * return missing # <<<<<<<<<<<<<< * * cpdef _init_codecs(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_missing); __pyx_r = __pyx_v_missing; goto __pyx_L0; /* "asyncpg/protocol/prepared_stmt.pyx":73 * return tuple(result) * * def _init_types(self): # <<<<<<<<<<<<<< * cdef: * Codec codec */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._init_types", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XDECREF(__pyx_v_missing); __Pyx_XDECREF(__pyx_v_p_oid); __Pyx_XDECREF(__pyx_v_rdesc); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pyx":92 * return missing * * cpdef _init_codecs(self): # <<<<<<<<<<<<<< * self._ensure_args_encoder() * self._ensure_rows_decoder() */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_9_init_codecs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__init_codecs(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_init_codecs", 1); /* "asyncpg/protocol/prepared_stmt.pyx":93 * * cpdef _init_codecs(self): * self._ensure_args_encoder() # <<<<<<<<<<<<<< * self._ensure_rows_decoder() * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_args_encoder(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":94 * cpdef _init_codecs(self): * self._ensure_args_encoder() * self._ensure_rows_decoder() # <<<<<<<<<<<<<< * * def attach(self): */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_rows_decoder(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":92 * return missing * * cpdef _init_codecs(self): # <<<<<<<<<<<<<< * self._ensure_args_encoder() * self._ensure_rows_decoder() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._init_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_9_init_codecs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_9_init_codecs = {"_init_codecs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_9_init_codecs, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_9_init_codecs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_init_codecs (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_init_codecs", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_init_codecs", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_8_init_codecs(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_8_init_codecs(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_init_codecs", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__init_codecs(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._init_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pyx":96 * self._ensure_rows_decoder() * * def attach(self): # <<<<<<<<<<<<<< * self.refs += 1 * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_11attach(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_11attach = {"attach", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_11attach, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_11attach(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("attach (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("attach", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "attach", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_10attach(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_10attach(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("attach", 1); /* "asyncpg/protocol/prepared_stmt.pyx":97 * * def attach(self): * self.refs += 1 # <<<<<<<<<<<<<< * * def detach(self): */ __pyx_v_self->refs = (__pyx_v_self->refs + 1); /* "asyncpg/protocol/prepared_stmt.pyx":96 * self._ensure_rows_decoder() * * def attach(self): # <<<<<<<<<<<<<< * self.refs += 1 * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pyx":99 * self.refs += 1 * * def detach(self): # <<<<<<<<<<<<<< * self.refs -= 1 * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_13detach(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_13detach = {"detach", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_13detach, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_13detach(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("detach (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("detach", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "detach", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_12detach(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_12detach(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("detach", 1); /* "asyncpg/protocol/prepared_stmt.pyx":100 * * def detach(self): * self.refs -= 1 # <<<<<<<<<<<<<< * * def mark_closed(self): */ __pyx_v_self->refs = (__pyx_v_self->refs - 1); /* "asyncpg/protocol/prepared_stmt.pyx":99 * self.refs += 1 * * def detach(self): # <<<<<<<<<<<<<< * self.refs -= 1 * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pyx":102 * self.refs -= 1 * * def mark_closed(self): # <<<<<<<<<<<<<< * self.closed = True * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_15mark_closed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_15mark_closed = {"mark_closed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_15mark_closed, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_15mark_closed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mark_closed (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("mark_closed", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "mark_closed", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_14mark_closed(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_14mark_closed(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mark_closed", 1); /* "asyncpg/protocol/prepared_stmt.pyx":103 * * def mark_closed(self): * self.closed = True # <<<<<<<<<<<<<< * * def mark_unprepared(self): */ __pyx_v_self->closed = 1; /* "asyncpg/protocol/prepared_stmt.pyx":102 * self.refs -= 1 * * def mark_closed(self): # <<<<<<<<<<<<<< * self.closed = True * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pyx":105 * self.closed = True * * def mark_unprepared(self): # <<<<<<<<<<<<<< * if self.name: * raise exceptions.InternalClientError( */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_17mark_unprepared(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_17mark_unprepared = {"mark_unprepared", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_17mark_unprepared, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_17mark_unprepared(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mark_unprepared (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("mark_unprepared", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "mark_unprepared", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_16mark_unprepared(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_16mark_unprepared(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mark_unprepared", 1); /* "asyncpg/protocol/prepared_stmt.pyx":106 * * def mark_unprepared(self): * if self.name: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * "named prepared statements cannot be marked unprepared") */ __pyx_t_1 = (__pyx_v_self->name != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_self->name) != 0); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/prepared_stmt.pyx":107 * def mark_unprepared(self): * if self.name: * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * "named prepared statements cannot be marked unprepared") * self.prepared = False */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_named_prepared_statements_cannot}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(7, 107, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":106 * * def mark_unprepared(self): * if self.name: # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * "named prepared statements cannot be marked unprepared") */ } /* "asyncpg/protocol/prepared_stmt.pyx":109 * raise exceptions.InternalClientError( * "named prepared statements cannot be marked unprepared") * self.prepared = False # <<<<<<<<<<<<<< * * cdef _encode_bind_msg(self, args, int seqno = -1): */ __pyx_v_self->prepared = 0; /* "asyncpg/protocol/prepared_stmt.pyx":105 * self.closed = True * * def mark_unprepared(self): # <<<<<<<<<<<<<< * if self.name: * raise exceptions.InternalClientError( */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState.mark_unprepared", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pyx":111 * self.prepared = False * * cdef _encode_bind_msg(self, args, int seqno = -1): # <<<<<<<<<<<<<< * cdef: * int idx */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, PyObject *__pyx_v_args, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg *__pyx_optional_args) { int __pyx_v_seqno = ((int)-1); int __pyx_v_idx; struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_writer = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; Py_ssize_t __pyx_v_num_args_passed; PyObject *__pyx_v_hint = NULL; PyObject *__pyx_v_arg = NULL; PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_pos = NULL; PyObject *__pyx_v_value_repr = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; Py_UCS4 __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; int16_t __pyx_t_10; int16_t __pyx_t_11; int __pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; int __pyx_t_16; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; int __pyx_t_20; char const *__pyx_t_21; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; PyObject *__pyx_t_25 = NULL; PyObject *__pyx_t_26 = NULL; PyObject *__pyx_t_27 = NULL; char const *__pyx_t_28; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_encode_bind_msg", 1); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_seqno = __pyx_optional_args->seqno; } } /* "asyncpg/protocol/prepared_stmt.pyx":117 * Codec codec * * if not cpython.PySequence_Check(args): # <<<<<<<<<<<<<< * if seqno >= 0: * raise exceptions.DataError( */ __pyx_t_1 = (!PySequence_Check(__pyx_v_args)); if (__pyx_t_1) { /* "asyncpg/protocol/prepared_stmt.pyx":118 * * if not cpython.PySequence_Check(args): * if seqno >= 0: # <<<<<<<<<<<<<< * raise exceptions.DataError( * f'invalid input in executemany() argument sequence ' */ __pyx_t_1 = (__pyx_v_seqno >= 0); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/prepared_stmt.pyx":119 * if not cpython.PySequence_Check(args): * if seqno >= 0: * raise exceptions.DataError( # <<<<<<<<<<<<<< * f'invalid input in executemany() argument sequence ' * f'element #{seqno}: expected a sequence, got ' */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DataError); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":120 * if seqno >= 0: * raise exceptions.DataError( * f'invalid input in executemany() argument sequence ' # <<<<<<<<<<<<<< * f'element #{seqno}: expected a sequence, got ' * f'{type(args).__name__}' */ __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_6 = 127; __Pyx_INCREF(__pyx_kp_u_invalid_input_in_executemany_arg); __pyx_t_5 += 58; __Pyx_GIVEREF(__pyx_kp_u_invalid_input_in_executemany_arg); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_invalid_input_in_executemany_arg); /* "asyncpg/protocol/prepared_stmt.pyx":121 * raise exceptions.DataError( * f'invalid input in executemany() argument sequence ' * f'element #{seqno}: expected a sequence, got ' # <<<<<<<<<<<<<< * f'{type(args).__name__}' * ) */ __pyx_t_7 = __Pyx_PyUnicode_From_int(__pyx_v_seqno, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7); __pyx_t_7 = 0; __Pyx_INCREF(__pyx_kp_u_expected_a_sequence_got); __pyx_t_5 += 27; __Pyx_GIVEREF(__pyx_kp_u_expected_a_sequence_got); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_expected_a_sequence_got); /* "asyncpg/protocol/prepared_stmt.pyx":122 * f'invalid input in executemany() argument sequence ' * f'element #{seqno}: expected a sequence, got ' * f'{type(args).__name__}' # <<<<<<<<<<<<<< * ) * else: */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_args)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_6; __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":120 * if seqno >= 0: * raise exceptions.DataError( * f'invalid input in executemany() argument sequence ' # <<<<<<<<<<<<<< * f'element #{seqno}: expected a sequence, got ' * f'{type(args).__name__}' */ __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_3, 4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_8}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(7, 119, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":118 * * if not cpython.PySequence_Check(args): * if seqno >= 0: # <<<<<<<<<<<<<< * raise exceptions.DataError( * f'invalid input in executemany() argument sequence ' */ } /* "asyncpg/protocol/prepared_stmt.pyx":127 * # Non executemany() callers do not pass user input directly, * # so bad input is a bug. * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * f'Bind: expected a sequence, got {type(args).__name__}') * */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":128 * # so bad input is a bug. * raise exceptions.InternalClientError( * f'Bind: expected a sequence, got {type(args).__name__}') # <<<<<<<<<<<<<< * * if len(args) > 32767: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_args)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Bind_expected_a_sequence_got, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(7, 127, __pyx_L1_error) } /* "asyncpg/protocol/prepared_stmt.pyx":117 * Codec codec * * if not cpython.PySequence_Check(args): # <<<<<<<<<<<<<< * if seqno >= 0: * raise exceptions.DataError( */ } /* "asyncpg/protocol/prepared_stmt.pyx":130 * f'Bind: expected a sequence, got {type(args).__name__}') * * if len(args) > 32767: # <<<<<<<<<<<<<< * raise exceptions.InterfaceError( * 'the number of query arguments cannot exceed 32767') */ __pyx_t_5 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(7, 130, __pyx_L1_error) __pyx_t_1 = (__pyx_t_5 > 0x7FFF); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/prepared_stmt.pyx":131 * * if len(args) > 32767: * raise exceptions.InterfaceError( # <<<<<<<<<<<<<< * 'the number of query arguments cannot exceed 32767') * */ __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_kp_u_the_number_of_query_arguments_ca}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(7, 131, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":130 * f'Bind: expected a sequence, got {type(args).__name__}') * * if len(args) > 32767: # <<<<<<<<<<<<<< * raise exceptions.InterfaceError( * 'the number of query arguments cannot exceed 32767') */ } /* "asyncpg/protocol/prepared_stmt.pyx":134 * 'the number of query arguments cannot exceed 32767') * * writer = WriteBuffer.new() # <<<<<<<<<<<<<< * * num_args_passed = len(args) */ __pyx_t_2 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_writer = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":136 * writer = WriteBuffer.new() * * num_args_passed = len(args) # <<<<<<<<<<<<<< * if self.args_num != num_args_passed: * hint = 'Check the query against the passed list of arguments.' */ __pyx_t_5 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(7, 136, __pyx_L1_error) __pyx_v_num_args_passed = __pyx_t_5; /* "asyncpg/protocol/prepared_stmt.pyx":137 * * num_args_passed = len(args) * if self.args_num != num_args_passed: # <<<<<<<<<<<<<< * hint = 'Check the query against the passed list of arguments.' * */ __pyx_t_1 = (__pyx_v_self->args_num != __pyx_v_num_args_passed); if (__pyx_t_1) { /* "asyncpg/protocol/prepared_stmt.pyx":138 * num_args_passed = len(args) * if self.args_num != num_args_passed: * hint = 'Check the query against the passed list of arguments.' # <<<<<<<<<<<<<< * * if self.args_num == 0: */ __Pyx_INCREF(__pyx_kp_u_Check_the_query_against_the_pass); __pyx_v_hint = __pyx_kp_u_Check_the_query_against_the_pass; /* "asyncpg/protocol/prepared_stmt.pyx":140 * hint = 'Check the query against the passed list of arguments.' * * if self.args_num == 0: # <<<<<<<<<<<<<< * # If the server was expecting zero arguments, it is likely * # that the user tried to parametrize a statement that does */ __pyx_t_1 = (__pyx_v_self->args_num == 0); if (__pyx_t_1) { /* "asyncpg/protocol/prepared_stmt.pyx":144 * # that the user tried to parametrize a statement that does * # not support parameters. * hint += (r' Note that parameters are supported only in' # <<<<<<<<<<<<<< * r' SELECT, INSERT, UPDATE, DELETE, MERGE and VALUES' * r' statements, and will *not* work in statements ' */ __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_hint, __pyx_kp_u_Note_that_parameters_are_suppor); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_hint, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":140 * hint = 'Check the query against the passed list of arguments.' * * if self.args_num == 0: # <<<<<<<<<<<<<< * # If the server was expecting zero arguments, it is likely * # that the user tried to parametrize a statement that does */ } /* "asyncpg/protocol/prepared_stmt.pyx":149 * r' like CREATE VIEW or DECLARE CURSOR.') * * raise exceptions.InterfaceError( # <<<<<<<<<<<<<< * 'the server expects {x} argument{s} for this query, ' * '{y} {w} passed'.format( */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":151 * raise exceptions.InterfaceError( * 'the server expects {x} argument{s} for this query, ' * '{y} {w} passed'.format( # <<<<<<<<<<<<<< * x=self.args_num, s='s' if self.args_num != 1 else '', * y=num_args_passed, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_the_server_expects_x_argument_s, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/prepared_stmt.pyx":152 * 'the server expects {x} argument{s} for this query, ' * '{y} {w} passed'.format( * x=self.args_num, s='s' if self.args_num != 1 else '', # <<<<<<<<<<<<<< * y=num_args_passed, * w='was' if num_args_passed == 1 else 'were'), */ __pyx_t_8 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_PyInt_From_int16_t(__pyx_v_self->args_num); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_x, __pyx_t_3) < 0) __PYX_ERR(7, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = (__pyx_v_self->args_num != 1); if (__pyx_t_1) { __Pyx_INCREF(__pyx_n_u_s_2); __pyx_t_3 = __pyx_n_u_s_2; } else { __Pyx_INCREF(__pyx_kp_u__34); __pyx_t_3 = __pyx_kp_u__34; } if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_s_2, __pyx_t_3) < 0) __PYX_ERR(7, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":153 * '{y} {w} passed'.format( * x=self.args_num, s='s' if self.args_num != 1 else '', * y=num_args_passed, # <<<<<<<<<<<<<< * w='was' if num_args_passed == 1 else 'were'), * hint=hint) */ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_num_args_passed); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(7, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":154 * x=self.args_num, s='s' if self.args_num != 1 else '', * y=num_args_passed, * w='was' if num_args_passed == 1 else 'were'), # <<<<<<<<<<<<<< * hint=hint) * */ __pyx_t_1 = (__pyx_v_num_args_passed == 1); if (__pyx_t_1) { __Pyx_INCREF(__pyx_n_u_was); __pyx_t_3 = __pyx_n_u_was; } else { __Pyx_INCREF(__pyx_n_u_were); __pyx_t_3 = __pyx_n_u_were; } if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_w, __pyx_t_3) < 0) __PYX_ERR(7, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":151 * raise exceptions.InterfaceError( * 'the server expects {x} argument{s} for this query, ' * '{y} {w} passed'.format( # <<<<<<<<<<<<<< * x=self.args_num, s='s' if self.args_num != 1 else '', * y=num_args_passed, */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":149 * r' like CREATE VIEW or DECLARE CURSOR.') * * raise exceptions.InterfaceError( # <<<<<<<<<<<<<< * 'the server expects {x} argument{s} for this query, ' * '{y} {w} passed'.format( */ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3)) __PYX_ERR(7, 149, __pyx_L1_error); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":155 * y=num_args_passed, * w='was' if num_args_passed == 1 else 'were'), * hint=hint) # <<<<<<<<<<<<<< * * if self.have_text_args: */ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hint, __pyx_v_hint) < 0) __PYX_ERR(7, 155, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":149 * r' like CREATE VIEW or DECLARE CURSOR.') * * raise exceptions.InterfaceError( # <<<<<<<<<<<<<< * 'the server expects {x} argument{s} for this query, ' * '{y} {w} passed'.format( */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(7, 149, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":137 * * num_args_passed = len(args) * if self.args_num != num_args_passed: # <<<<<<<<<<<<<< * hint = 'Check the query against the passed list of arguments.' * */ } /* "asyncpg/protocol/prepared_stmt.pyx":157 * hint=hint) * * if self.have_text_args: # <<<<<<<<<<<<<< * writer.write_int16(self.args_num) * for idx in range(self.args_num): */ if (__pyx_v_self->have_text_args) { /* "asyncpg/protocol/prepared_stmt.pyx":158 * * if self.have_text_args: * writer.write_int16(self.args_num) # <<<<<<<<<<<<<< * for idx in range(self.args_num): * codec = (self.args_codecs[idx]) */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_writer->__pyx_vtab)->write_int16(__pyx_v_writer, __pyx_v_self->args_num); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":159 * if self.have_text_args: * writer.write_int16(self.args_num) * for idx in range(self.args_num): # <<<<<<<<<<<<<< * codec = (self.args_codecs[idx]) * writer.write_int16(codec.format) */ __pyx_t_10 = __pyx_v_self->args_num; __pyx_t_11 = __pyx_t_10; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_idx = __pyx_t_12; /* "asyncpg/protocol/prepared_stmt.pyx":160 * writer.write_int16(self.args_num) * for idx in range(self.args_num): * codec = (self.args_codecs[idx]) # <<<<<<<<<<<<<< * writer.write_int16(codec.format) * else: */ if (unlikely(__pyx_v_self->args_codecs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(7, 160, __pyx_L1_error) } __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->args_codecs, __pyx_v_idx, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_3)); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":161 * for idx in range(self.args_num): * codec = (self.args_codecs[idx]) * writer.write_int16(codec.format) # <<<<<<<<<<<<<< * else: * # All arguments are in binary format */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_writer->__pyx_vtab)->write_int16(__pyx_v_writer, ((int16_t)__pyx_v_codec->format)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "asyncpg/protocol/prepared_stmt.pyx":157 * hint=hint) * * if self.have_text_args: # <<<<<<<<<<<<<< * writer.write_int16(self.args_num) * for idx in range(self.args_num): */ goto __pyx_L8; } /* "asyncpg/protocol/prepared_stmt.pyx":164 * else: * # All arguments are in binary format * writer.write_int32(0x00010001) # <<<<<<<<<<<<<< * * writer.write_int16(self.args_num) */ /*else*/ { __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_writer->__pyx_vtab)->write_int32(__pyx_v_writer, 0x00010001); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L8:; /* "asyncpg/protocol/prepared_stmt.pyx":166 * writer.write_int32(0x00010001) * * writer.write_int16(self.args_num) # <<<<<<<<<<<<<< * * for idx in range(self.args_num): */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_writer->__pyx_vtab)->write_int16(__pyx_v_writer, __pyx_v_self->args_num); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":168 * writer.write_int16(self.args_num) * * for idx in range(self.args_num): # <<<<<<<<<<<<<< * arg = args[idx] * if arg is None: */ __pyx_t_10 = __pyx_v_self->args_num; __pyx_t_11 = __pyx_t_10; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_idx = __pyx_t_12; /* "asyncpg/protocol/prepared_stmt.pyx":169 * * for idx in range(self.args_num): * arg = args[idx] # <<<<<<<<<<<<<< * if arg is None: * writer.write_int32(-1) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_args, __pyx_v_idx, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":170 * for idx in range(self.args_num): * arg = args[idx] * if arg is None: # <<<<<<<<<<<<<< * writer.write_int32(-1) * else: */ __pyx_t_1 = (__pyx_v_arg == Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/prepared_stmt.pyx":171 * arg = args[idx] * if arg is None: * writer.write_int32(-1) # <<<<<<<<<<<<<< * else: * codec = (self.args_codecs[idx]) */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_writer->__pyx_vtab)->write_int32(__pyx_v_writer, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":170 * for idx in range(self.args_num): * arg = args[idx] * if arg is None: # <<<<<<<<<<<<<< * writer.write_int32(-1) * else: */ goto __pyx_L13; } /* "asyncpg/protocol/prepared_stmt.pyx":173 * writer.write_int32(-1) * else: * codec = (self.args_codecs[idx]) # <<<<<<<<<<<<<< * try: * codec.encode(self.settings, writer, arg) */ /*else*/ { if (unlikely(__pyx_v_self->args_codecs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(7, 173, __pyx_L1_error) } __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_self->args_codecs, __pyx_v_idx, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2)); __pyx_t_2 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":174 * else: * codec = (self.args_codecs[idx]) * try: # <<<<<<<<<<<<<< * codec.encode(self.settings, writer, arg) * except (AssertionError, exceptions.InternalClientError): */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); /*try:*/ { /* "asyncpg/protocol/prepared_stmt.pyx":175 * codec = (self.args_codecs[idx]) * try: * codec.encode(self.settings, writer, arg) # <<<<<<<<<<<<<< * except (AssertionError, exceptions.InternalClientError): * # These are internal errors and should raise as-is. */ __pyx_t_2 = ((PyObject *)__pyx_v_self->settings); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_t_2), __pyx_v_writer, __pyx_v_arg); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 175, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":174 * else: * codec = (self.args_codecs[idx]) * try: # <<<<<<<<<<<<<< * codec.encode(self.settings, writer, arg) * except (AssertionError, exceptions.InternalClientError): */ } __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L21_try_end; __pyx_L14_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":176 * try: * codec.encode(self.settings, writer, arg) * except (AssertionError, exceptions.InternalClientError): # <<<<<<<<<<<<<< * # These are internal errors and should raise as-is. * raise */ __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_2, &__pyx_t_8); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 176, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 176, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_16 = __Pyx_PyErr_GivenExceptionMatches2(__pyx_t_3, __pyx_builtin_AssertionError, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_ErrRestore(__pyx_t_3, __pyx_t_2, __pyx_t_8); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_8 = 0; if (__pyx_t_16) { __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._encode_bind_msg", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(7, 176, __pyx_L16_except_error) __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /* "asyncpg/protocol/prepared_stmt.pyx":178 * except (AssertionError, exceptions.InternalClientError): * # These are internal errors and should raise as-is. * raise # <<<<<<<<<<<<<< * except exceptions.InterfaceError as e: * # This is already a descriptive error, but annotate */ __Pyx_GIVEREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ErrRestoreWithState(__pyx_t_8, __pyx_t_2, __pyx_t_3); __pyx_t_8 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __PYX_ERR(7, 178, __pyx_L16_except_error) } /* "asyncpg/protocol/prepared_stmt.pyx":179 * # These are internal errors and should raise as-is. * raise * except exceptions.InterfaceError as e: # <<<<<<<<<<<<<< * # This is already a descriptive error, but annotate * # with argument name for clarity. */ __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_2, &__pyx_t_8); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 179, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 179, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_16 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_3, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_ErrRestore(__pyx_t_3, __pyx_t_2, __pyx_t_8); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_8 = 0; if (__pyx_t_16) { __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._encode_bind_msg", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(7, 179, __pyx_L16_except_error) __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_v_e = __pyx_t_2; /*try:*/ { /* "asyncpg/protocol/prepared_stmt.pyx":182 * # This is already a descriptive error, but annotate * # with argument name for clarity. * pos = f'${idx + 1}' # <<<<<<<<<<<<<< * if seqno >= 0: * pos = ( */ __pyx_t_4 = __Pyx_PyUnicode_From_long((__pyx_v_idx + 1), 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 182, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u__41, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 182, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_pos = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":183 * # with argument name for clarity. * pos = f'${idx + 1}' * if seqno >= 0: # <<<<<<<<<<<<<< * pos = ( * f'{pos} in element #{seqno} of' */ __pyx_t_1 = (__pyx_v_seqno >= 0); if (__pyx_t_1) { /* "asyncpg/protocol/prepared_stmt.pyx":185 * if seqno >= 0: * pos = ( * f'{pos} in element #{seqno} of' # <<<<<<<<<<<<<< * f' executemany() sequence' * ) */ __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 185, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = 0; __pyx_t_6 = 127; __Pyx_INCREF(__pyx_v_pos); __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_pos) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_pos) : __pyx_t_6; __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_pos); __Pyx_GIVEREF(__pyx_v_pos); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_pos); __Pyx_INCREF(__pyx_kp_u_in_element); __pyx_t_5 += 13; __Pyx_GIVEREF(__pyx_kp_u_in_element); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_kp_u_in_element); __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_seqno, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 185, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u_of_executemany_sequence); __pyx_t_5 += 26; __Pyx_GIVEREF(__pyx_kp_u_of_executemany_sequence); PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_kp_u_of_executemany_sequence); __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_7, 4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 185, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_pos, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":183 * # with argument name for clarity. * pos = f'${idx + 1}' * if seqno >= 0: # <<<<<<<<<<<<<< * pos = ( * f'{pos} in element #{seqno} of' */ } /* "asyncpg/protocol/prepared_stmt.pyx":188 * f' executemany() sequence' * ) * raise e.with_msg( # <<<<<<<<<<<<<< * f'query argument {pos}: {e.args[0]}' * ) from None */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_with_msg); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 188, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_7); /* "asyncpg/protocol/prepared_stmt.pyx":189 * ) * raise e.with_msg( * f'query argument {pos}: {e.args[0]}' # <<<<<<<<<<<<<< * ) from None * except Exception as e: */ __pyx_t_17 = PyTuple_New(4); if (unlikely(!__pyx_t_17)) __PYX_ERR(7, 189, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_5 = 0; __pyx_t_6 = 127; __Pyx_INCREF(__pyx_kp_u_query_argument); __pyx_t_5 += 15; __Pyx_GIVEREF(__pyx_kp_u_query_argument); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_kp_u_query_argument); __Pyx_INCREF(__pyx_v_pos); __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_pos) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_pos) : __pyx_t_6; __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_pos); __Pyx_GIVEREF(__pyx_v_pos); PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_v_pos); __Pyx_INCREF(__pyx_kp_u__42); __pyx_t_5 += 2; __Pyx_GIVEREF(__pyx_kp_u__42); PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_kp_u__42); __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_args); if (unlikely(!__pyx_t_18)) __PYX_ERR(7, 189, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_19 = __Pyx_GetItemInt(__pyx_t_18, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(7, 189, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = __Pyx_PyObject_FormatSimple(__pyx_t_19, __pyx_empty_unicode); if (unlikely(!__pyx_t_18)) __PYX_ERR(7, 189, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_18) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_18) : __pyx_t_6; __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_18); __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_17, 3, __pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = __Pyx_PyUnicode_Join(__pyx_t_17, 4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_18)) __PYX_ERR(7, 189, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_17 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_17)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_t_18}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 188, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } /* "asyncpg/protocol/prepared_stmt.pyx":190 * raise e.with_msg( * f'query argument {pos}: {e.args[0]}' * ) from None # <<<<<<<<<<<<<< * except Exception as e: * # Everything else is assumed to be an encoding error */ __Pyx_Raise(__pyx_t_4, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(7, 188, __pyx_L29_error) } /* "asyncpg/protocol/prepared_stmt.pyx":179 * # These are internal errors and should raise as-is. * raise * except exceptions.InterfaceError as e: # <<<<<<<<<<<<<< * # This is already a descriptive error, but annotate * # with argument name for clarity. */ /*finally:*/ { __pyx_L29_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_26); __Pyx_XGOTREF(__pyx_t_27); __pyx_t_16 = __pyx_lineno; __pyx_t_20 = __pyx_clineno; __pyx_t_21 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_XGIVEREF(__pyx_t_27); __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_26, __pyx_t_27); } __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ErrRestore(__pyx_t_22, __pyx_t_23, __pyx_t_24); __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_lineno = __pyx_t_16; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_21; goto __pyx_L16_except_error; } } } /* "asyncpg/protocol/prepared_stmt.pyx":191 * f'query argument {pos}: {e.args[0]}' * ) from None * except Exception as e: # <<<<<<<<<<<<<< * # Everything else is assumed to be an encoding error * # due to invalid input. */ __pyx_t_20 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_20) { __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._encode_bind_msg", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_8) < 0) __PYX_ERR(7, 191, __pyx_L16_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_v_e = __pyx_t_2; /*try:*/ { /* "asyncpg/protocol/prepared_stmt.pyx":194 * # Everything else is assumed to be an encoding error * # due to invalid input. * pos = f'${idx + 1}' # <<<<<<<<<<<<<< * if seqno >= 0: * pos = ( */ __pyx_t_4 = __Pyx_PyUnicode_From_long((__pyx_v_idx + 1), 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 194, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u__41, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 194, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_pos = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":195 * # due to invalid input. * pos = f'${idx + 1}' * if seqno >= 0: # <<<<<<<<<<<<<< * pos = ( * f'{pos} in element #{seqno} of' */ __pyx_t_1 = (__pyx_v_seqno >= 0); if (__pyx_t_1) { /* "asyncpg/protocol/prepared_stmt.pyx":197 * if seqno >= 0: * pos = ( * f'{pos} in element #{seqno} of' # <<<<<<<<<<<<<< * f' executemany() sequence' * ) */ __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 197, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = 0; __pyx_t_6 = 127; __Pyx_INCREF(__pyx_v_pos); __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_pos) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_pos) : __pyx_t_6; __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_pos); __Pyx_GIVEREF(__pyx_v_pos); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_pos); __Pyx_INCREF(__pyx_kp_u_in_element); __pyx_t_5 += 13; __Pyx_GIVEREF(__pyx_kp_u_in_element); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_kp_u_in_element); __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_seqno, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 197, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_kp_u_of_executemany_sequence); __pyx_t_5 += 26; __Pyx_GIVEREF(__pyx_kp_u_of_executemany_sequence); PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_kp_u_of_executemany_sequence); __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_7, 4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 197, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_pos, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":195 * # due to invalid input. * pos = f'${idx + 1}' * if seqno >= 0: # <<<<<<<<<<<<<< * pos = ( * f'{pos} in element #{seqno} of' */ } /* "asyncpg/protocol/prepared_stmt.pyx":200 * f' executemany() sequence' * ) * value_repr = repr(arg) # <<<<<<<<<<<<<< * if len(value_repr) > 40: * value_repr = value_repr[:40] + '...' */ __pyx_t_4 = PyObject_Repr(__pyx_v_arg); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 200, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_value_repr = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":201 * ) * value_repr = repr(arg) * if len(value_repr) > 40: # <<<<<<<<<<<<<< * value_repr = value_repr[:40] + '...' * */ __pyx_t_5 = PyObject_Length(__pyx_v_value_repr); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(7, 201, __pyx_L41_error) __pyx_t_1 = (__pyx_t_5 > 40); if (__pyx_t_1) { /* "asyncpg/protocol/prepared_stmt.pyx":202 * value_repr = repr(arg) * if len(value_repr) > 40: * value_repr = value_repr[:40] + '...' # <<<<<<<<<<<<<< * * raise exceptions.DataError( */ __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_value_repr, 0, 40, NULL, NULL, &__pyx_slice__43, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 202, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__44); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 202, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_value_repr, __pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":201 * ) * value_repr = repr(arg) * if len(value_repr) > 40: # <<<<<<<<<<<<<< * value_repr = value_repr[:40] + '...' * */ } /* "asyncpg/protocol/prepared_stmt.pyx":204 * value_repr = value_repr[:40] + '...' * * raise exceptions.DataError( # <<<<<<<<<<<<<< * f'invalid input for query argument' * f' {pos}: {value_repr} ({e})' */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 204, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_DataError); if (unlikely(!__pyx_t_18)) __PYX_ERR(7, 204, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":205 * * raise exceptions.DataError( * f'invalid input for query argument' # <<<<<<<<<<<<<< * f' {pos}: {value_repr} ({e})' * ) from e */ __pyx_t_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 205, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = 127; __Pyx_INCREF(__pyx_kp_u_invalid_input_for_query_argument); __pyx_t_5 += 33; __Pyx_GIVEREF(__pyx_kp_u_invalid_input_for_query_argument); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_invalid_input_for_query_argument); /* "asyncpg/protocol/prepared_stmt.pyx":206 * raise exceptions.DataError( * f'invalid input for query argument' * f' {pos}: {value_repr} ({e})' # <<<<<<<<<<<<<< * ) from e * */ __Pyx_INCREF(__pyx_v_pos); __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_pos) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_pos) : __pyx_t_6; __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_pos); __Pyx_GIVEREF(__pyx_v_pos); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_pos); __Pyx_INCREF(__pyx_kp_u__42); __pyx_t_5 += 2; __Pyx_GIVEREF(__pyx_kp_u__42); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u__42); __pyx_t_17 = __Pyx_PyObject_FormatSimple(__pyx_v_value_repr, __pyx_empty_unicode); if (unlikely(!__pyx_t_17)) __PYX_ERR(7, 206, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_17) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_17) : __pyx_t_6; __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_17); __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_17); __pyx_t_17 = 0; __Pyx_INCREF(__pyx_kp_u__45); __pyx_t_5 += 2; __Pyx_GIVEREF(__pyx_kp_u__45); PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u__45); __pyx_t_17 = __Pyx_PyObject_FormatSimple(__pyx_v_e, __pyx_empty_unicode); if (unlikely(!__pyx_t_17)) __PYX_ERR(7, 206, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_17) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_17) : __pyx_t_6; __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_17); __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_17); __pyx_t_17 = 0; __Pyx_INCREF(__pyx_kp_u__8); __pyx_t_5 += 1; __Pyx_GIVEREF(__pyx_kp_u__8); PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_kp_u__8); /* "asyncpg/protocol/prepared_stmt.pyx":205 * * raise exceptions.DataError( * f'invalid input for query argument' # <<<<<<<<<<<<<< * f' {pos}: {value_repr} ({e})' * ) from e */ __pyx_t_17 = __Pyx_PyUnicode_Join(__pyx_t_4, 7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_17)) __PYX_ERR(7, 205, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_18))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_18); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_18, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_17}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 204, __pyx_L41_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; } /* "asyncpg/protocol/prepared_stmt.pyx":207 * f'invalid input for query argument' * f' {pos}: {value_repr} ({e})' * ) from e # <<<<<<<<<<<<<< * * if self.have_text_cols: */ __Pyx_Raise(__pyx_t_7, 0, 0, __pyx_v_e); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(7, 204, __pyx_L41_error) } /* "asyncpg/protocol/prepared_stmt.pyx":191 * f'query argument {pos}: {e.args[0]}' * ) from None * except Exception as e: # <<<<<<<<<<<<<< * # Everything else is assumed to be an encoding error * # due to invalid input. */ /*finally:*/ { __pyx_L41_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_27 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25) < 0)) __Pyx_ErrFetch(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25); __Pyx_XGOTREF(__pyx_t_27); __Pyx_XGOTREF(__pyx_t_26); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_22); __pyx_t_20 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_28 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_23, __pyx_t_22); } __Pyx_XGIVEREF(__pyx_t_27); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_ErrRestore(__pyx_t_27, __pyx_t_26, __pyx_t_25); __pyx_t_27 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_lineno = __pyx_t_20; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_28; goto __pyx_L16_except_error; } } } goto __pyx_L16_except_error; /* "asyncpg/protocol/prepared_stmt.pyx":174 * else: * codec = (self.args_codecs[idx]) * try: # <<<<<<<<<<<<<< * codec.encode(self.settings, writer, arg) * except (AssertionError, exceptions.InternalClientError): */ __pyx_L16_except_error:; __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); goto __pyx_L1_error; __pyx_L21_try_end:; } } __pyx_L13:; } /* "asyncpg/protocol/prepared_stmt.pyx":209 * ) from e * * if self.have_text_cols: # <<<<<<<<<<<<<< * writer.write_int16(self.cols_num) * for idx in range(self.cols_num): */ if (__pyx_v_self->have_text_cols) { /* "asyncpg/protocol/prepared_stmt.pyx":210 * * if self.have_text_cols: * writer.write_int16(self.cols_num) # <<<<<<<<<<<<<< * for idx in range(self.cols_num): * codec = (self.rows_codecs[idx]) */ __pyx_t_8 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_writer->__pyx_vtab)->write_int16(__pyx_v_writer, __pyx_v_self->cols_num); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":211 * if self.have_text_cols: * writer.write_int16(self.cols_num) * for idx in range(self.cols_num): # <<<<<<<<<<<<<< * codec = (self.rows_codecs[idx]) * writer.write_int16(codec.format) */ __pyx_t_10 = __pyx_v_self->cols_num; __pyx_t_11 = __pyx_t_10; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_idx = __pyx_t_12; /* "asyncpg/protocol/prepared_stmt.pyx":212 * writer.write_int16(self.cols_num) * for idx in range(self.cols_num): * codec = (self.rows_codecs[idx]) # <<<<<<<<<<<<<< * writer.write_int16(codec.format) * else: */ if (unlikely(__pyx_v_self->rows_codecs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(7, 212, __pyx_L1_error) } __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v_self->rows_codecs, __pyx_v_idx, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = __pyx_t_8; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2)); __pyx_t_2 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":213 * for idx in range(self.cols_num): * codec = (self.rows_codecs[idx]) * writer.write_int16(codec.format) # <<<<<<<<<<<<<< * else: * # All columns are in binary format */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_writer->__pyx_vtab)->write_int16(__pyx_v_writer, ((int16_t)__pyx_v_codec->format)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "asyncpg/protocol/prepared_stmt.pyx":209 * ) from e * * if self.have_text_cols: # <<<<<<<<<<<<<< * writer.write_int16(self.cols_num) * for idx in range(self.cols_num): */ goto __pyx_L49; } /* "asyncpg/protocol/prepared_stmt.pyx":216 * else: * # All columns are in binary format * writer.write_int32(0x00010001) # <<<<<<<<<<<<<< * * return writer */ /*else*/ { __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_writer->__pyx_vtab)->write_int32(__pyx_v_writer, 0x00010001); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L49:; /* "asyncpg/protocol/prepared_stmt.pyx":218 * writer.write_int32(0x00010001) * * return writer # <<<<<<<<<<<<<< * * cdef _ensure_rows_decoder(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_writer); __pyx_r = ((PyObject *)__pyx_v_writer); goto __pyx_L0; /* "asyncpg/protocol/prepared_stmt.pyx":111 * self.prepared = False * * cdef _encode_bind_msg(self, args, int seqno = -1): # <<<<<<<<<<<<<< * cdef: * int idx */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_17); __Pyx_XDECREF(__pyx_t_18); __Pyx_XDECREF(__pyx_t_19); __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._encode_bind_msg", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_writer); __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XDECREF(__pyx_v_hint); __Pyx_XDECREF(__pyx_v_arg); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_pos); __Pyx_XDECREF(__pyx_v_value_repr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pyx":220 * return writer * * cdef _ensure_rows_decoder(self): # <<<<<<<<<<<<<< * cdef: * list cols_names */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_rows_decoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) { PyObject *__pyx_v_cols_names = 0; PyObject *__pyx_v_cols_mapping = 0; PyObject *__pyx_v_row = 0; uint32_t __pyx_v_oid; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; PyObject *__pyx_v_codecs = 0; long __pyx_v_i; PyObject *__pyx_v_col_name = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int16_t __pyx_t_6; int __pyx_t_7; uint32_t __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_ensure_rows_decoder", 1); /* "asyncpg/protocol/prepared_stmt.pyx":229 * list codecs * * if self.cols_desc is not None: # <<<<<<<<<<<<<< * return * */ __pyx_t_1 = (__pyx_v_self->cols_desc != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/prepared_stmt.pyx":230 * * if self.cols_desc is not None: * return # <<<<<<<<<<<<<< * * if self.cols_num == 0: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/protocol/prepared_stmt.pyx":229 * list codecs * * if self.cols_desc is not None: # <<<<<<<<<<<<<< * return * */ } /* "asyncpg/protocol/prepared_stmt.pyx":232 * return * * if self.cols_num == 0: # <<<<<<<<<<<<<< * self.cols_desc = record.ApgRecordDesc_New({}, ()) * return */ __pyx_t_1 = (__pyx_v_self->cols_num == 0); if (__pyx_t_1) { /* "asyncpg/protocol/prepared_stmt.pyx":233 * * if self.cols_num == 0: * self.cols_desc = record.ApgRecordDesc_New({}, ()) # <<<<<<<<<<<<<< * return * */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ApgRecordDesc_New(__pyx_t_2, __pyx_empty_tuple); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->cols_desc); __Pyx_DECREF(__pyx_v_self->cols_desc); __pyx_v_self->cols_desc = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":234 * if self.cols_num == 0: * self.cols_desc = record.ApgRecordDesc_New({}, ()) * return # <<<<<<<<<<<<<< * * cols_mapping = collections.OrderedDict() */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/protocol/prepared_stmt.pyx":232 * return * * if self.cols_num == 0: # <<<<<<<<<<<<<< * self.cols_desc = record.ApgRecordDesc_New({}, ()) * return */ } /* "asyncpg/protocol/prepared_stmt.pyx":236 * return * * cols_mapping = collections.OrderedDict() # <<<<<<<<<<<<<< * cols_names = [] * codecs = [] */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_collections); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_cols_mapping = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":237 * * cols_mapping = collections.OrderedDict() * cols_names = [] # <<<<<<<<<<<<<< * codecs = [] * for i from 0 <= i < self.cols_num: */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_cols_names = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":238 * cols_mapping = collections.OrderedDict() * cols_names = [] * codecs = [] # <<<<<<<<<<<<<< * for i from 0 <= i < self.cols_num: * row = self.row_desc[i] */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_codecs = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":239 * cols_names = [] * codecs = [] * for i from 0 <= i < self.cols_num: # <<<<<<<<<<<<<< * row = self.row_desc[i] * col_name = row[0].decode(self.settings._encoding) */ __pyx_t_6 = __pyx_v_self->cols_num; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { /* "asyncpg/protocol/prepared_stmt.pyx":240 * codecs = [] * for i from 0 <= i < self.cols_num: * row = self.row_desc[i] # <<<<<<<<<<<<<< * col_name = row[0].decode(self.settings._encoding) * cols_mapping[col_name] = i */ if (unlikely(__pyx_v_self->row_desc == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(7, 240, __pyx_L1_error) } __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->row_desc, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_3))) __PYX_ERR(7, 240, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_row, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":241 * for i from 0 <= i < self.cols_num: * row = self.row_desc[i] * col_name = row[0].decode(self.settings._encoding) # <<<<<<<<<<<<<< * cols_mapping[col_name] = i * cols_names.append(col_name) */ if (unlikely(__pyx_v_row == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(7, 241, __pyx_L1_error) } __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_row, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_self->settings->_encoding}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_XDECREF_SET(__pyx_v_col_name, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":242 * row = self.row_desc[i] * col_name = row[0].decode(self.settings._encoding) * cols_mapping[col_name] = i # <<<<<<<<<<<<<< * cols_names.append(col_name) * oid = row[3] */ __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely((PyObject_SetItem(__pyx_v_cols_mapping, __pyx_v_col_name, __pyx_t_3) < 0))) __PYX_ERR(7, 242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":243 * col_name = row[0].decode(self.settings._encoding) * cols_mapping[col_name] = i * cols_names.append(col_name) # <<<<<<<<<<<<<< * oid = row[3] * codec = self.settings.get_data_codec( */ __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_cols_names, __pyx_v_col_name); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(7, 243, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":244 * cols_mapping[col_name] = i * cols_names.append(col_name) * oid = row[3] # <<<<<<<<<<<<<< * codec = self.settings.get_data_codec( * oid, ignore_custom_codec=self.ignore_custom_codec) */ if (unlikely(__pyx_v_row == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(7, 244, __pyx_L1_error) } __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_row, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_8 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 244, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_oid = __pyx_t_8; /* "asyncpg/protocol/prepared_stmt.pyx":245 * cols_names.append(col_name) * oid = row[3] * codec = self.settings.get_data_codec( # <<<<<<<<<<<<<< * oid, ignore_custom_codec=self.ignore_custom_codec) * if codec is None or not codec.has_decoder(): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->settings), __pyx_n_s_get_data_codec); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/protocol/prepared_stmt.pyx":246 * oid = row[3] * codec = self.settings.get_data_codec( * oid, ignore_custom_codec=self.ignore_custom_codec) # <<<<<<<<<<<<<< * if codec is None or not codec.has_decoder(): * raise exceptions.InternalClientError( */ __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/prepared_stmt.pyx":245 * cols_names.append(col_name) * oid = row[3] * codec = self.settings.get_data_codec( # <<<<<<<<<<<<<< * oid, ignore_custom_codec=self.ignore_custom_codec) * if codec is None or not codec.has_decoder(): */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(7, 245, __pyx_L1_error); __pyx_t_2 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":246 * oid = row[3] * codec = self.settings.get_data_codec( * oid, ignore_custom_codec=self.ignore_custom_codec) # <<<<<<<<<<<<<< * if codec is None or not codec.has_decoder(): * raise exceptions.InternalClientError( */ __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_self->ignore_custom_codec); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ignore_custom_codec, __pyx_t_9) < 0) __PYX_ERR(7, 246, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":245 * cols_names.append(col_name) * oid = row[3] * codec = self.settings.get_data_codec( # <<<<<<<<<<<<<< * oid, ignore_custom_codec=self.ignore_custom_codec) * if codec is None or not codec.has_decoder(): */ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(7, 245, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_9)); __pyx_t_9 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":247 * codec = self.settings.get_data_codec( * oid, ignore_custom_codec=self.ignore_custom_codec) * if codec is None or not codec.has_decoder(): # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * 'no decoder for OID {}'.format(oid)) */ __pyx_t_10 = (((PyObject *)__pyx_v_codec) == Py_None); if (!__pyx_t_10) { } else { __pyx_t_1 = __pyx_t_10; goto __pyx_L8_bool_binop_done; } __pyx_t_9 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder(__pyx_v_codec); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(7, 247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_11 = (!__pyx_t_10); __pyx_t_1 = __pyx_t_11; __pyx_L8_bool_binop_done:; if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/prepared_stmt.pyx":248 * oid, ignore_custom_codec=self.ignore_custom_codec) * if codec is None or not codec.has_decoder(): * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * 'no decoder for OID {}'.format(oid)) * if not codec.is_binary(): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":249 * if codec is None or not codec.has_decoder(): * raise exceptions.InternalClientError( * 'no decoder for OID {}'.format(oid)) # <<<<<<<<<<<<<< * if not codec.is_binary(): * self.have_text_cols = True */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_no_decoder_for_OID, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_12 = __Pyx_PyInt_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_12)) __PYX_ERR(7, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_12}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(7, 248, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":247 * codec = self.settings.get_data_codec( * oid, ignore_custom_codec=self.ignore_custom_codec) * if codec is None or not codec.has_decoder(): # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * 'no decoder for OID {}'.format(oid)) */ } /* "asyncpg/protocol/prepared_stmt.pyx":250 * raise exceptions.InternalClientError( * 'no decoder for OID {}'.format(oid)) * if not codec.is_binary(): # <<<<<<<<<<<<<< * self.have_text_cols = True * */ __pyx_t_9 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_is_binary(__pyx_v_codec); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(7, 250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_11 = (!__pyx_t_1); if (__pyx_t_11) { /* "asyncpg/protocol/prepared_stmt.pyx":251 * 'no decoder for OID {}'.format(oid)) * if not codec.is_binary(): * self.have_text_cols = True # <<<<<<<<<<<<<< * * codecs.append(codec) */ __pyx_v_self->have_text_cols = 1; /* "asyncpg/protocol/prepared_stmt.pyx":250 * raise exceptions.InternalClientError( * 'no decoder for OID {}'.format(oid)) * if not codec.is_binary(): # <<<<<<<<<<<<<< * self.have_text_cols = True * */ } /* "asyncpg/protocol/prepared_stmt.pyx":253 * self.have_text_cols = True * * codecs.append(codec) # <<<<<<<<<<<<<< * * self.cols_desc = record.ApgRecordDesc_New( */ __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_codecs, ((PyObject *)__pyx_v_codec)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(7, 253, __pyx_L1_error) } /* "asyncpg/protocol/prepared_stmt.pyx":256 * * self.cols_desc = record.ApgRecordDesc_New( * cols_mapping, tuple(cols_names)) # <<<<<<<<<<<<<< * * self.rows_codecs = tuple(codecs) */ __pyx_t_9 = PyList_AsTuple(__pyx_v_cols_names); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); /* "asyncpg/protocol/prepared_stmt.pyx":255 * codecs.append(codec) * * self.cols_desc = record.ApgRecordDesc_New( # <<<<<<<<<<<<<< * cols_mapping, tuple(cols_names)) * */ __pyx_t_4 = ApgRecordDesc_New(__pyx_v_cols_mapping, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->cols_desc); __Pyx_DECREF(__pyx_v_self->cols_desc); __pyx_v_self->cols_desc = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":258 * cols_mapping, tuple(cols_names)) * * self.rows_codecs = tuple(codecs) # <<<<<<<<<<<<<< * * cdef _ensure_args_encoder(self): */ __pyx_t_4 = PyList_AsTuple(__pyx_v_codecs); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->rows_codecs); __Pyx_DECREF(__pyx_v_self->rows_codecs); __pyx_v_self->rows_codecs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":220 * return writer * * cdef _ensure_rows_decoder(self): # <<<<<<<<<<<<<< * cdef: * list cols_names */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._ensure_rows_decoder", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_cols_names); __Pyx_XDECREF(__pyx_v_cols_mapping); __Pyx_XDECREF(__pyx_v_row); __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XDECREF(__pyx_v_codecs); __Pyx_XDECREF(__pyx_v_col_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pyx":260 * self.rows_codecs = tuple(codecs) * * cdef _ensure_args_encoder(self): # <<<<<<<<<<<<<< * cdef: * uint32_t p_oid */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_args_encoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) { uint32_t __pyx_v_p_oid; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; PyObject *__pyx_v_codecs = 0; long __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int16_t __pyx_t_4; uint32_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; unsigned int __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_ensure_args_encoder", 1); /* "asyncpg/protocol/prepared_stmt.pyx":264 * uint32_t p_oid * Codec codec * list codecs = [] # <<<<<<<<<<<<<< * * if self.args_num == 0 or self.args_codecs is not None: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_codecs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":266 * list codecs = [] * * if self.args_num == 0 or self.args_codecs is not None: # <<<<<<<<<<<<<< * return * */ __pyx_t_3 = (__pyx_v_self->args_num == 0); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_self->args_codecs != ((PyObject*)Py_None)); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "asyncpg/protocol/prepared_stmt.pyx":267 * * if self.args_num == 0 or self.args_codecs is not None: * return # <<<<<<<<<<<<<< * * for i from 0 <= i < self.args_num: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/protocol/prepared_stmt.pyx":266 * list codecs = [] * * if self.args_num == 0 or self.args_codecs is not None: # <<<<<<<<<<<<<< * return * */ } /* "asyncpg/protocol/prepared_stmt.pyx":269 * return * * for i from 0 <= i < self.args_num: # <<<<<<<<<<<<<< * p_oid = self.parameters_desc[i] * codec = self.settings.get_data_codec( */ __pyx_t_4 = __pyx_v_self->args_num; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { /* "asyncpg/protocol/prepared_stmt.pyx":270 * * for i from 0 <= i < self.args_num: * p_oid = self.parameters_desc[i] # <<<<<<<<<<<<<< * codec = self.settings.get_data_codec( * p_oid, ignore_custom_codec=self.ignore_custom_codec) */ if (unlikely(__pyx_v_self->parameters_desc == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(7, 270, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->parameters_desc, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_t_1); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_p_oid = __pyx_t_5; /* "asyncpg/protocol/prepared_stmt.pyx":271 * for i from 0 <= i < self.args_num: * p_oid = self.parameters_desc[i] * codec = self.settings.get_data_codec( # <<<<<<<<<<<<<< * p_oid, ignore_custom_codec=self.ignore_custom_codec) * if codec is None or not codec.has_encoder(): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->settings), __pyx_n_s_get_data_codec); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "asyncpg/protocol/prepared_stmt.pyx":272 * p_oid = self.parameters_desc[i] * codec = self.settings.get_data_codec( * p_oid, ignore_custom_codec=self.ignore_custom_codec) # <<<<<<<<<<<<<< * if codec is None or not codec.has_encoder(): * raise exceptions.InternalClientError( */ __pyx_t_6 = __Pyx_PyInt_From_uint32_t(__pyx_v_p_oid); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "asyncpg/protocol/prepared_stmt.pyx":271 * for i from 0 <= i < self.args_num: * p_oid = self.parameters_desc[i] * codec = self.settings.get_data_codec( # <<<<<<<<<<<<<< * p_oid, ignore_custom_codec=self.ignore_custom_codec) * if codec is None or not codec.has_encoder(): */ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6)) __PYX_ERR(7, 271, __pyx_L1_error); __pyx_t_6 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":272 * p_oid = self.parameters_desc[i] * codec = self.settings.get_data_codec( * p_oid, ignore_custom_codec=self.ignore_custom_codec) # <<<<<<<<<<<<<< * if codec is None or not codec.has_encoder(): * raise exceptions.InternalClientError( */ __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_self->ignore_custom_codec); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_ignore_custom_codec, __pyx_t_8) < 0) __PYX_ERR(7, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":271 * for i from 0 <= i < self.args_num: * p_oid = self.parameters_desc[i] * codec = self.settings.get_data_codec( # <<<<<<<<<<<<<< * p_oid, ignore_custom_codec=self.ignore_custom_codec) * if codec is None or not codec.has_encoder(): */ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(7, 271, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_8)); __pyx_t_8 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":273 * codec = self.settings.get_data_codec( * p_oid, ignore_custom_codec=self.ignore_custom_codec) * if codec is None or not codec.has_encoder(): # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * 'no encoder for OID {}'.format(p_oid)) */ __pyx_t_3 = (((PyObject *)__pyx_v_codec) == Py_None); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L9_bool_binop_done; } __pyx_t_8 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_encoder(__pyx_v_codec); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(7, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = (!__pyx_t_3); __pyx_t_2 = __pyx_t_9; __pyx_L9_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/prepared_stmt.pyx":274 * p_oid, ignore_custom_codec=self.ignore_custom_codec) * if codec is None or not codec.has_encoder(): * raise exceptions.InternalClientError( # <<<<<<<<<<<<<< * 'no encoder for OID {}'.format(p_oid)) * if codec.type not in {}: */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":275 * if codec is None or not codec.has_encoder(): * raise exceptions.InternalClientError( * 'no encoder for OID {}'.format(p_oid)) # <<<<<<<<<<<<<< * if codec.type not in {}: * self.have_text_args = True */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_no_encoder_for_OID, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyInt_From_uint32_t(__pyx_v_p_oid); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_10}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_1 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_6}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(7, 274, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":273 * codec = self.settings.get_data_codec( * p_oid, ignore_custom_codec=self.ignore_custom_codec) * if codec is None or not codec.has_encoder(): # <<<<<<<<<<<<<< * raise exceptions.InternalClientError( * 'no encoder for OID {}'.format(p_oid)) */ } /* "asyncpg/protocol/prepared_stmt.pyx":276 * raise exceptions.InternalClientError( * 'no encoder for OID {}'.format(p_oid)) * if codec.type not in {}: # <<<<<<<<<<<<<< * self.have_text_args = True * */ __pyx_t_8 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_CodecType(__pyx_v_codec->type); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_8, __pyx_t_7, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 276, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { /* "asyncpg/protocol/prepared_stmt.pyx":277 * 'no encoder for OID {}'.format(p_oid)) * if codec.type not in {}: * self.have_text_args = True # <<<<<<<<<<<<<< * * codecs.append(codec) */ __pyx_v_self->have_text_args = 1; /* "asyncpg/protocol/prepared_stmt.pyx":276 * raise exceptions.InternalClientError( * 'no encoder for OID {}'.format(p_oid)) * if codec.type not in {}: # <<<<<<<<<<<<<< * self.have_text_args = True * */ } /* "asyncpg/protocol/prepared_stmt.pyx":279 * self.have_text_args = True * * codecs.append(codec) # <<<<<<<<<<<<<< * * self.args_codecs = tuple(codecs) */ __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_codecs, ((PyObject *)__pyx_v_codec)); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(7, 279, __pyx_L1_error) } /* "asyncpg/protocol/prepared_stmt.pyx":281 * codecs.append(codec) * * self.args_codecs = tuple(codecs) # <<<<<<<<<<<<<< * * cdef _set_row_desc(self, object desc): */ __pyx_t_7 = PyList_AsTuple(__pyx_v_codecs); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __Pyx_GOTREF(__pyx_v_self->args_codecs); __Pyx_DECREF(__pyx_v_self->args_codecs); __pyx_v_self->args_codecs = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":260 * self.rows_codecs = tuple(codecs) * * cdef _ensure_args_encoder(self): # <<<<<<<<<<<<<< * cdef: * uint32_t p_oid */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._ensure_args_encoder", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XDECREF(__pyx_v_codecs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pyx":283 * self.args_codecs = tuple(codecs) * * cdef _set_row_desc(self, object desc): # <<<<<<<<<<<<<< * self.row_desc = _decode_row_desc(desc) * self.cols_num = (len(self.row_desc)) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_row_desc(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, PyObject *__pyx_v_desc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_set_row_desc", 1); /* "asyncpg/protocol/prepared_stmt.pyx":284 * * cdef _set_row_desc(self, object desc): * self.row_desc = _decode_row_desc(desc) # <<<<<<<<<<<<<< * self.cols_num = (len(self.row_desc)) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol__decode_row_desc(__pyx_v_desc); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(7, 284, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->row_desc); __Pyx_DECREF(__pyx_v_self->row_desc); __pyx_v_self->row_desc = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":285 * cdef _set_row_desc(self, object desc): * self.row_desc = _decode_row_desc(desc) * self.cols_num = (len(self.row_desc)) # <<<<<<<<<<<<<< * * cdef _set_args_desc(self, object desc): */ __pyx_t_1 = __pyx_v_self->row_desc; __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(7, 285, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(7, 285, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->cols_num = ((int16_t)__pyx_t_2); /* "asyncpg/protocol/prepared_stmt.pyx":283 * self.args_codecs = tuple(codecs) * * cdef _set_row_desc(self, object desc): # <<<<<<<<<<<<<< * self.row_desc = _decode_row_desc(desc) * self.cols_num = (len(self.row_desc)) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._set_row_desc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pyx":287 * self.cols_num = (len(self.row_desc)) * * cdef _set_args_desc(self, object desc): # <<<<<<<<<<<<<< * self.parameters_desc = _decode_parameters_desc(desc) * self.args_num = (len(self.parameters_desc)) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_args_desc(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, PyObject *__pyx_v_desc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_set_args_desc", 1); /* "asyncpg/protocol/prepared_stmt.pyx":288 * * cdef _set_args_desc(self, object desc): * self.parameters_desc = _decode_parameters_desc(desc) # <<<<<<<<<<<<<< * self.args_num = (len(self.parameters_desc)) * */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol__decode_parameters_desc(__pyx_v_desc); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(7, 288, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->parameters_desc); __Pyx_DECREF(__pyx_v_self->parameters_desc); __pyx_v_self->parameters_desc = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":289 * cdef _set_args_desc(self, object desc): * self.parameters_desc = _decode_parameters_desc(desc) * self.args_num = (len(self.parameters_desc)) # <<<<<<<<<<<<<< * * cdef _decode_row(self, const char* cbuf, ssize_t buf_len): */ __pyx_t_1 = __pyx_v_self->parameters_desc; __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(7, 289, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(7, 289, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->args_num = ((int16_t)__pyx_t_2); /* "asyncpg/protocol/prepared_stmt.pyx":287 * self.cols_num = (len(self.row_desc)) * * cdef _set_args_desc(self, object desc): # <<<<<<<<<<<<<< * self.parameters_desc = _decode_parameters_desc(desc) * self.args_num = (len(self.parameters_desc)) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._set_args_desc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pyx":291 * self.args_num = (len(self.parameters_desc)) * * cdef _decode_row(self, const char* cbuf, ssize_t buf_len): # <<<<<<<<<<<<<< * cdef: * Codec codec */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__decode_row(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, char const *__pyx_v_cbuf, Py_ssize_t __pyx_v_buf_len) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0; int16_t __pyx_v_fnum; int32_t __pyx_v_flen; PyObject *__pyx_v_dec_row = 0; PyObject *__pyx_v_rows_codecs = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings = 0; int32_t __pyx_v_i; struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer __pyx_v_rbuf; Py_ssize_t __pyx_v_bl; PyObject *__pyx_v_val = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; unsigned int __pyx_t_10; int16_t __pyx_t_11; int16_t __pyx_t_12; int32_t __pyx_t_13; Py_ssize_t __pyx_t_14; PyObject *__pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_decode_row", 1); /* "asyncpg/protocol/prepared_stmt.pyx":297 * int32_t flen * object dec_row * tuple rows_codecs = self.rows_codecs # <<<<<<<<<<<<<< * ConnectionSettings settings = self.settings * int32_t i */ __pyx_t_1 = __pyx_v_self->rows_codecs; __Pyx_INCREF(__pyx_t_1); __pyx_v_rows_codecs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":298 * object dec_row * tuple rows_codecs = self.rows_codecs * ConnectionSettings settings = self.settings # <<<<<<<<<<<<<< * int32_t i * FRBuffer rbuf */ __pyx_t_1 = ((PyObject *)__pyx_v_self->settings); __Pyx_INCREF(__pyx_t_1); __pyx_v_settings = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":303 * ssize_t bl * * frb_init(&rbuf, cbuf, buf_len) # <<<<<<<<<<<<<< * * fnum = hton.unpack_int16(frb_read(&rbuf, 2)) */ __pyx_f_7asyncpg_7pgproto_7pgproto_frb_init((&__pyx_v_rbuf), __pyx_v_cbuf, __pyx_v_buf_len); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 303, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":305 * frb_init(&rbuf, cbuf, buf_len) * * fnum = hton.unpack_int16(frb_read(&rbuf, 2)) # <<<<<<<<<<<<<< * * if fnum != self.cols_num: */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read((&__pyx_v_rbuf), 2); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(7, 305, __pyx_L1_error) __pyx_v_fnum = unpack_int16(__pyx_t_2); /* "asyncpg/protocol/prepared_stmt.pyx":307 * fnum = hton.unpack_int16(frb_read(&rbuf, 2)) * * if fnum != self.cols_num: # <<<<<<<<<<<<<< * raise exceptions.ProtocolError( * 'the number of columns in the result row ({}) is ' */ __pyx_t_3 = (__pyx_v_fnum != __pyx_v_self->cols_num); if (unlikely(__pyx_t_3)) { /* "asyncpg/protocol/prepared_stmt.pyx":308 * * if fnum != self.cols_num: * raise exceptions.ProtocolError( # <<<<<<<<<<<<<< * 'the number of columns in the result row ({}) is ' * 'different from what was described ({})'.format( */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ProtocolError); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":310 * raise exceptions.ProtocolError( * 'the number of columns in the result row ({}) is ' * 'different from what was described ({})'.format( # <<<<<<<<<<<<<< * fnum, self.cols_num)) * */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_the_number_of_columns_in_the_res, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "asyncpg/protocol/prepared_stmt.pyx":311 * 'the number of columns in the result row ({}) is ' * 'different from what was described ({})'.format( * fnum, self.cols_num)) # <<<<<<<<<<<<<< * * dec_row = record.ApgRecord_New(self.record_class, self.cols_desc, fnum) */ __pyx_t_7 = __Pyx_PyInt_From_int16_t(__pyx_v_fnum); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_int16_t(__pyx_v_self->cols_num); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(7, 308, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":307 * fnum = hton.unpack_int16(frb_read(&rbuf, 2)) * * if fnum != self.cols_num: # <<<<<<<<<<<<<< * raise exceptions.ProtocolError( * 'the number of columns in the result row ({}) is ' */ } /* "asyncpg/protocol/prepared_stmt.pyx":313 * fnum, self.cols_num)) * * dec_row = record.ApgRecord_New(self.record_class, self.cols_desc, fnum) # <<<<<<<<<<<<<< * for i in range(fnum): * flen = hton.unpack_int32(frb_read(&rbuf, 4)) */ __pyx_t_1 = ((PyObject *)__pyx_v_self->record_class); __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = __pyx_v_self->cols_desc; __Pyx_INCREF(__pyx_t_5); __pyx_t_4 = ApgRecord_New(((PyTypeObject*)__pyx_t_1), __pyx_t_5, __pyx_v_fnum); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_dec_row = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":314 * * dec_row = record.ApgRecord_New(self.record_class, self.cols_desc, fnum) * for i in range(fnum): # <<<<<<<<<<<<<< * flen = hton.unpack_int32(frb_read(&rbuf, 4)) * */ __pyx_t_11 = __pyx_v_fnum; __pyx_t_12 = __pyx_t_11; for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { __pyx_v_i = __pyx_t_13; /* "asyncpg/protocol/prepared_stmt.pyx":315 * dec_row = record.ApgRecord_New(self.record_class, self.cols_desc, fnum) * for i in range(fnum): * flen = hton.unpack_int32(frb_read(&rbuf, 4)) # <<<<<<<<<<<<<< * * if flen == -1: */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read((&__pyx_v_rbuf), 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(7, 315, __pyx_L1_error) __pyx_v_flen = unpack_int32(__pyx_t_2); /* "asyncpg/protocol/prepared_stmt.pyx":317 * flen = hton.unpack_int32(frb_read(&rbuf, 4)) * * if flen == -1: # <<<<<<<<<<<<<< * val = None * else: */ __pyx_t_3 = (__pyx_v_flen == -1L); if (__pyx_t_3) { /* "asyncpg/protocol/prepared_stmt.pyx":318 * * if flen == -1: * val = None # <<<<<<<<<<<<<< * else: * # Clamp buffer size to that of the reported field length */ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_val, Py_None); /* "asyncpg/protocol/prepared_stmt.pyx":317 * flen = hton.unpack_int32(frb_read(&rbuf, 4)) * * if flen == -1: # <<<<<<<<<<<<<< * val = None * else: */ goto __pyx_L6; } /* "asyncpg/protocol/prepared_stmt.pyx":323 * # to make sure that codecs can rely on read_all() working * # properly. * bl = frb_get_len(&rbuf) # <<<<<<<<<<<<<< * if flen > bl: * frb_check(&rbuf, flen) */ /*else*/ { __pyx_t_14 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_get_len((&__pyx_v_rbuf)); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 323, __pyx_L1_error) __pyx_v_bl = __pyx_t_14; /* "asyncpg/protocol/prepared_stmt.pyx":324 * # properly. * bl = frb_get_len(&rbuf) * if flen > bl: # <<<<<<<<<<<<<< * frb_check(&rbuf, flen) * frb_set_len(&rbuf, flen) */ __pyx_t_3 = (__pyx_v_flen > __pyx_v_bl); if (__pyx_t_3) { /* "asyncpg/protocol/prepared_stmt.pyx":325 * bl = frb_get_len(&rbuf) * if flen > bl: * frb_check(&rbuf, flen) # <<<<<<<<<<<<<< * frb_set_len(&rbuf, flen) * codec = cpython.PyTuple_GET_ITEM(rows_codecs, i) */ __pyx_t_4 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_check((&__pyx_v_rbuf), __pyx_v_flen); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":324 * # properly. * bl = frb_get_len(&rbuf) * if flen > bl: # <<<<<<<<<<<<<< * frb_check(&rbuf, flen) * frb_set_len(&rbuf, flen) */ } /* "asyncpg/protocol/prepared_stmt.pyx":326 * if flen > bl: * frb_check(&rbuf, flen) * frb_set_len(&rbuf, flen) # <<<<<<<<<<<<<< * codec = cpython.PyTuple_GET_ITEM(rows_codecs, i) * val = codec.decode(settings, &rbuf) */ __pyx_f_7asyncpg_7pgproto_7pgproto_frb_set_len((&__pyx_v_rbuf), __pyx_v_flen); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 326, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":327 * frb_check(&rbuf, flen) * frb_set_len(&rbuf, flen) * codec = cpython.PyTuple_GET_ITEM(rows_codecs, i) # <<<<<<<<<<<<<< * val = codec.decode(settings, &rbuf) * if frb_get_len(&rbuf) != 0: */ __pyx_t_15 = PyTuple_GET_ITEM(__pyx_v_rows_codecs, __pyx_v_i); __pyx_t_4 = ((PyObject *)__pyx_t_15); __Pyx_INCREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_4)); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":328 * frb_set_len(&rbuf, flen) * codec = cpython.PyTuple_GET_ITEM(rows_codecs, i) * val = codec.decode(settings, &rbuf) # <<<<<<<<<<<<<< * if frb_get_len(&rbuf) != 0: * raise BufferError( */ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode(__pyx_v_codec, __pyx_v_settings, (&__pyx_v_rbuf)); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":329 * codec = cpython.PyTuple_GET_ITEM(rows_codecs, i) * val = codec.decode(settings, &rbuf) * if frb_get_len(&rbuf) != 0: # <<<<<<<<<<<<<< * raise BufferError( * 'unexpected trailing {} bytes in buffer'.format( */ __pyx_t_14 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_get_len((&__pyx_v_rbuf)); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 329, __pyx_L1_error) __pyx_t_3 = (__pyx_t_14 != 0); if (unlikely(__pyx_t_3)) { /* "asyncpg/protocol/prepared_stmt.pyx":331 * if frb_get_len(&rbuf) != 0: * raise BufferError( * 'unexpected trailing {} bytes in buffer'.format( # <<<<<<<<<<<<<< * frb_get_len(&rbuf))) * frb_set_len(&rbuf, bl - flen) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_trailing_bytes_in_buf, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "asyncpg/protocol/prepared_stmt.pyx":332 * raise BufferError( * 'unexpected trailing {} bytes in buffer'.format( * frb_get_len(&rbuf))) # <<<<<<<<<<<<<< * frb_set_len(&rbuf, bl - flen) * */ __pyx_t_14 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_get_len((&__pyx_v_rbuf)); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 332, __pyx_L1_error) __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_1}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* "asyncpg/protocol/prepared_stmt.pyx":330 * val = codec.decode(settings, &rbuf) * if frb_get_len(&rbuf) != 0: * raise BufferError( # <<<<<<<<<<<<<< * 'unexpected trailing {} bytes in buffer'.format( * frb_get_len(&rbuf))) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_BufferError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(7, 330, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":329 * codec = cpython.PyTuple_GET_ITEM(rows_codecs, i) * val = codec.decode(settings, &rbuf) * if frb_get_len(&rbuf) != 0: # <<<<<<<<<<<<<< * raise BufferError( * 'unexpected trailing {} bytes in buffer'.format( */ } /* "asyncpg/protocol/prepared_stmt.pyx":333 * 'unexpected trailing {} bytes in buffer'.format( * frb_get_len(&rbuf))) * frb_set_len(&rbuf, bl - flen) # <<<<<<<<<<<<<< * * cpython.Py_INCREF(val) */ __pyx_f_7asyncpg_7pgproto_7pgproto_frb_set_len((&__pyx_v_rbuf), (__pyx_v_bl - __pyx_v_flen)); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 333, __pyx_L1_error) } __pyx_L6:; /* "asyncpg/protocol/prepared_stmt.pyx":335 * frb_set_len(&rbuf, bl - flen) * * cpython.Py_INCREF(val) # <<<<<<<<<<<<<< * record.ApgRecord_SET_ITEM(dec_row, i, val) * */ Py_INCREF(__pyx_v_val); /* "asyncpg/protocol/prepared_stmt.pyx":336 * * cpython.Py_INCREF(val) * record.ApgRecord_SET_ITEM(dec_row, i, val) # <<<<<<<<<<<<<< * * if frb_get_len(&rbuf) != 0: */ ApgRecord_SET_ITEM(__pyx_v_dec_row, __pyx_v_i, __pyx_v_val); } /* "asyncpg/protocol/prepared_stmt.pyx":338 * record.ApgRecord_SET_ITEM(dec_row, i, val) * * if frb_get_len(&rbuf) != 0: # <<<<<<<<<<<<<< * raise BufferError('unexpected trailing {} bytes in buffer'.format( * frb_get_len(&rbuf))) */ __pyx_t_14 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_get_len((&__pyx_v_rbuf)); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 338, __pyx_L1_error) __pyx_t_3 = (__pyx_t_14 != 0); if (unlikely(__pyx_t_3)) { /* "asyncpg/protocol/prepared_stmt.pyx":339 * * if frb_get_len(&rbuf) != 0: * raise BufferError('unexpected trailing {} bytes in buffer'.format( # <<<<<<<<<<<<<< * frb_get_len(&rbuf))) * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unexpected_trailing_bytes_in_buf, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/prepared_stmt.pyx":340 * if frb_get_len(&rbuf) != 0: * raise BufferError('unexpected trailing {} bytes in buffer'.format( * frb_get_len(&rbuf))) # <<<<<<<<<<<<<< * * return dec_row */ __pyx_t_14 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_get_len((&__pyx_v_rbuf)); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 340, __pyx_L1_error) __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_1}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/protocol/prepared_stmt.pyx":339 * * if frb_get_len(&rbuf) != 0: * raise BufferError('unexpected trailing {} bytes in buffer'.format( # <<<<<<<<<<<<<< * frb_get_len(&rbuf))) * */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_BufferError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(7, 339, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":338 * record.ApgRecord_SET_ITEM(dec_row, i, val) * * if frb_get_len(&rbuf) != 0: # <<<<<<<<<<<<<< * raise BufferError('unexpected trailing {} bytes in buffer'.format( * frb_get_len(&rbuf))) */ } /* "asyncpg/protocol/prepared_stmt.pyx":342 * frb_get_len(&rbuf))) * * return dec_row # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_dec_row); __pyx_r = __pyx_v_dec_row; goto __pyx_L0; /* "asyncpg/protocol/prepared_stmt.pyx":291 * self.args_num = (len(self.parameters_desc)) * * cdef _decode_row(self, const char* cbuf, ssize_t buf_len): # <<<<<<<<<<<<<< * cdef: * Codec codec */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._decode_row", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_codec); __Pyx_XDECREF(__pyx_v_dec_row); __Pyx_XDECREF(__pyx_v_rows_codecs); __Pyx_XDECREF((PyObject *)__pyx_v_settings); __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pxd":10 * cdef class PreparedStatementState: * cdef: * readonly str name # <<<<<<<<<<<<<< * readonly str query * readonly bint closed */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_4name_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_4name___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_4name___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->name); __pyx_r = __pyx_v_self->name; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pxd":11 * cdef: * readonly str name * readonly str query # <<<<<<<<<<<<<< * readonly bint closed * readonly bint prepared */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_5query_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_5query_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_5query___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_5query___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->query); __pyx_r = __pyx_v_self->query; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pxd":12 * readonly str name * readonly str query * readonly bint closed # <<<<<<<<<<<<<< * readonly bint prepared * readonly int refs */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_6closed_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_6closed_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_6closed___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_6closed___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->closed); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState.closed.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pxd":13 * readonly str query * readonly bint closed * readonly bint prepared # <<<<<<<<<<<<<< * readonly int refs * readonly type record_class */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_8prepared_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_8prepared_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_8prepared___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_8prepared___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->prepared); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState.prepared.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pxd":14 * readonly bint closed * readonly bint prepared * readonly int refs # <<<<<<<<<<<<<< * readonly type record_class * readonly bint ignore_custom_codec */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_4refs_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_4refs_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_4refs___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_4refs___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->refs); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState.refs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pxd":15 * readonly bint prepared * readonly int refs * readonly type record_class # <<<<<<<<<<<<<< * readonly bint ignore_custom_codec * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_12record_class_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_12record_class_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_12record_class___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_12record_class___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self->record_class); __pyx_r = ((PyObject *)__pyx_v_self->record_class); goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pxd":16 * readonly int refs * readonly type record_class * readonly bint ignore_custom_codec # <<<<<<<<<<<<<< * * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_19ignore_custom_codec_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_19ignore_custom_codec_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_19ignore_custom_codec___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_19ignore_custom_codec___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->ignore_custom_codec); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState.ignore_custom_codec.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_19__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_19__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_19__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_19__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_18__reduce_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(2, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_21__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_21__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_21__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_21__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_20__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":4 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< */ __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); __PYX_ERR(2, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pyx":345 * * * cdef _decode_parameters_desc(object desc): # <<<<<<<<<<<<<< * cdef: * ReadBuffer reader */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__decode_parameters_desc(PyObject *__pyx_v_desc) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_reader = 0; int16_t __pyx_v_nparams; uint32_t __pyx_v_p_oid; PyObject *__pyx_v_result = 0; CYTHON_UNUSED long __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int16_t __pyx_t_2; int32_t __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_decode_parameters_desc", 1); /* "asyncpg/protocol/prepared_stmt.pyx":350 * int16_t nparams * uint32_t p_oid * list result = [] # <<<<<<<<<<<<<< * * reader = ReadBuffer.new_message_parser(desc) */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":352 * list result = [] * * reader = ReadBuffer.new_message_parser(desc) # <<<<<<<<<<<<<< * nparams = reader.read_int16() * */ __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_ReadBuffer->new_message_parser(__pyx_v_desc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_reader = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":353 * * reader = ReadBuffer.new_message_parser(desc) * nparams = reader.read_int16() # <<<<<<<<<<<<<< * * for i from 0 <= i < nparams: */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_reader->__pyx_vtab)->read_int16(__pyx_v_reader); if (unlikely(__pyx_t_2 == ((int16_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 353, __pyx_L1_error) __pyx_v_nparams = __pyx_t_2; /* "asyncpg/protocol/prepared_stmt.pyx":355 * nparams = reader.read_int16() * * for i from 0 <= i < nparams: # <<<<<<<<<<<<<< * p_oid = reader.read_int32() * result.append(p_oid) */ __pyx_t_2 = __pyx_v_nparams; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { /* "asyncpg/protocol/prepared_stmt.pyx":356 * * for i from 0 <= i < nparams: * p_oid = reader.read_int32() # <<<<<<<<<<<<<< * result.append(p_oid) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_reader->__pyx_vtab)->read_int32(__pyx_v_reader); if (unlikely(__pyx_t_3 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 356, __pyx_L1_error) __pyx_v_p_oid = ((uint32_t)__pyx_t_3); /* "asyncpg/protocol/prepared_stmt.pyx":357 * for i from 0 <= i < nparams: * p_oid = reader.read_int32() * result.append(p_oid) # <<<<<<<<<<<<<< * * return result */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_p_oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(7, 357, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "asyncpg/protocol/prepared_stmt.pyx":359 * result.append(p_oid) * * return result # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/protocol/prepared_stmt.pyx":345 * * * cdef _decode_parameters_desc(object desc): # <<<<<<<<<<<<<< * cdef: * ReadBuffer reader */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol._decode_parameters_desc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_reader); __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/prepared_stmt.pyx":362 * * * cdef _decode_row_desc(object desc): # <<<<<<<<<<<<<< * cdef: * ReadBuffer reader */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__decode_row_desc(PyObject *__pyx_v_desc) { struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_reader = 0; int16_t __pyx_v_nfields; PyObject *__pyx_v_f_name = 0; uint32_t __pyx_v_f_table_oid; int16_t __pyx_v_f_column_num; uint32_t __pyx_v_f_dt_oid; int16_t __pyx_v_f_dt_size; int32_t __pyx_v_f_dt_mod; int16_t __pyx_v_f_format; PyObject *__pyx_v_result = 0; CYTHON_UNUSED long __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int16_t __pyx_t_2; int32_t __pyx_t_3; int16_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_decode_row_desc", 1); /* "asyncpg/protocol/prepared_stmt.pyx":378 * list result * * reader = ReadBuffer.new_message_parser(desc) # <<<<<<<<<<<<<< * nfields = reader.read_int16() * result = [] */ __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_ReadBuffer->new_message_parser(__pyx_v_desc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_reader = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":379 * * reader = ReadBuffer.new_message_parser(desc) * nfields = reader.read_int16() # <<<<<<<<<<<<<< * result = [] * */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_reader->__pyx_vtab)->read_int16(__pyx_v_reader); if (unlikely(__pyx_t_2 == ((int16_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 379, __pyx_L1_error) __pyx_v_nfields = __pyx_t_2; /* "asyncpg/protocol/prepared_stmt.pyx":380 * reader = ReadBuffer.new_message_parser(desc) * nfields = reader.read_int16() * result = [] # <<<<<<<<<<<<<< * * for i from 0 <= i < nfields: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":382 * result = [] * * for i from 0 <= i < nfields: # <<<<<<<<<<<<<< * f_name = reader.read_null_str() * f_table_oid = reader.read_int32() */ __pyx_t_2 = __pyx_v_nfields; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { /* "asyncpg/protocol/prepared_stmt.pyx":383 * * for i from 0 <= i < nfields: * f_name = reader.read_null_str() # <<<<<<<<<<<<<< * f_table_oid = reader.read_int32() * f_column_num = reader.read_int16() */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_reader->__pyx_vtab)->read_null_str(__pyx_v_reader); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(7, 383, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_f_name, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":384 * for i from 0 <= i < nfields: * f_name = reader.read_null_str() * f_table_oid = reader.read_int32() # <<<<<<<<<<<<<< * f_column_num = reader.read_int16() * f_dt_oid = reader.read_int32() */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_reader->__pyx_vtab)->read_int32(__pyx_v_reader); if (unlikely(__pyx_t_3 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 384, __pyx_L1_error) __pyx_v_f_table_oid = ((uint32_t)__pyx_t_3); /* "asyncpg/protocol/prepared_stmt.pyx":385 * f_name = reader.read_null_str() * f_table_oid = reader.read_int32() * f_column_num = reader.read_int16() # <<<<<<<<<<<<<< * f_dt_oid = reader.read_int32() * f_dt_size = reader.read_int16() */ __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_reader->__pyx_vtab)->read_int16(__pyx_v_reader); if (unlikely(__pyx_t_4 == ((int16_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 385, __pyx_L1_error) __pyx_v_f_column_num = __pyx_t_4; /* "asyncpg/protocol/prepared_stmt.pyx":386 * f_table_oid = reader.read_int32() * f_column_num = reader.read_int16() * f_dt_oid = reader.read_int32() # <<<<<<<<<<<<<< * f_dt_size = reader.read_int16() * f_dt_mod = reader.read_int32() */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_reader->__pyx_vtab)->read_int32(__pyx_v_reader); if (unlikely(__pyx_t_3 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 386, __pyx_L1_error) __pyx_v_f_dt_oid = ((uint32_t)__pyx_t_3); /* "asyncpg/protocol/prepared_stmt.pyx":387 * f_column_num = reader.read_int16() * f_dt_oid = reader.read_int32() * f_dt_size = reader.read_int16() # <<<<<<<<<<<<<< * f_dt_mod = reader.read_int32() * f_format = reader.read_int16() */ __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_reader->__pyx_vtab)->read_int16(__pyx_v_reader); if (unlikely(__pyx_t_4 == ((int16_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 387, __pyx_L1_error) __pyx_v_f_dt_size = __pyx_t_4; /* "asyncpg/protocol/prepared_stmt.pyx":388 * f_dt_oid = reader.read_int32() * f_dt_size = reader.read_int16() * f_dt_mod = reader.read_int32() # <<<<<<<<<<<<<< * f_format = reader.read_int16() * */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_reader->__pyx_vtab)->read_int32(__pyx_v_reader); if (unlikely(__pyx_t_3 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 388, __pyx_L1_error) __pyx_v_f_dt_mod = __pyx_t_3; /* "asyncpg/protocol/prepared_stmt.pyx":389 * f_dt_size = reader.read_int16() * f_dt_mod = reader.read_int32() * f_format = reader.read_int16() # <<<<<<<<<<<<<< * * result.append( */ __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_reader->__pyx_vtab)->read_int16(__pyx_v_reader); if (unlikely(__pyx_t_4 == ((int16_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 389, __pyx_L1_error) __pyx_v_f_format = __pyx_t_4; /* "asyncpg/protocol/prepared_stmt.pyx":392 * * result.append( * (f_name, f_table_oid, f_column_num, f_dt_oid, # <<<<<<<<<<<<<< * f_dt_size, f_dt_mod, f_format)) * */ __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_f_table_oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_From_int16_t(__pyx_v_f_column_num); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_uint32_t(__pyx_v_f_dt_oid); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "asyncpg/protocol/prepared_stmt.pyx":393 * result.append( * (f_name, f_table_oid, f_column_num, f_dt_oid, * f_dt_size, f_dt_mod, f_format)) # <<<<<<<<<<<<<< * * return result */ __pyx_t_7 = __Pyx_PyInt_From_int16_t(__pyx_v_f_dt_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyInt_From_int32_t(__pyx_v_f_dt_mod); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_int16_t(__pyx_v_f_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); /* "asyncpg/protocol/prepared_stmt.pyx":392 * * result.append( * (f_name, f_table_oid, f_column_num, f_dt_oid, # <<<<<<<<<<<<<< * f_dt_size, f_dt_mod, f_format)) * */ __pyx_t_10 = PyTuple_New(7); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v_f_name); __Pyx_GIVEREF(__pyx_v_f_name); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_f_name)) __PYX_ERR(7, 392, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_1)) __PYX_ERR(7, 392, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_5)) __PYX_ERR(7, 392, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_6)) __PYX_ERR(7, 392, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_7)) __PYX_ERR(7, 392, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_8)) __PYX_ERR(7, 392, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_9)) __PYX_ERR(7, 392, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":391 * f_format = reader.read_int16() * * result.append( # <<<<<<<<<<<<<< * (f_name, f_table_oid, f_column_num, f_dt_oid, * f_dt_size, f_dt_mod, f_format)) */ __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_10); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(7, 391, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } /* "asyncpg/protocol/prepared_stmt.pyx":395 * f_dt_size, f_dt_mod, f_format)) * * return result # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "asyncpg/protocol/prepared_stmt.pyx":362 * * * cdef _decode_row_desc(object desc): # <<<<<<<<<<<<<< * cdef: * ReadBuffer reader */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("asyncpg.protocol.protocol._decode_row_desc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_reader); __Pyx_XDECREF(__pyx_v_f_name); __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":76 * * cdef class BaseProtocol(CoreProtocol): * def __init__(self, addr, connected_fut, con_params, record_class: type, loop): # <<<<<<<<<<<<<< * # type of `con_params` is `_ConnectionParameters` * CoreProtocol.__init__(self, addr, con_params) */ /* Python wrapper */ static int __pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_addr = 0; PyObject *__pyx_v_connected_fut = 0; PyObject *__pyx_v_con_params = 0; PyTypeObject *__pyx_v_record_class = 0; PyObject *__pyx_v_loop = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_addr,&__pyx_n_s_connected_fut,&__pyx_n_s_con_params,&__pyx_n_s_record_class,&__pyx_n_s_loop,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_addr)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_connected_fut)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 1); __PYX_ERR(0, 76, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_con_params)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 2); __PYX_ERR(0, 76, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_record_class)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 3); __PYX_ERR(0, 76, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_loop)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 4); __PYX_ERR(0, 76, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 76, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); } __pyx_v_addr = values[0]; __pyx_v_connected_fut = values[1]; __pyx_v_con_params = values[2]; __pyx_v_record_class = ((PyTypeObject*)values[3]); __pyx_v_loop = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 76, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_record_class), (&PyType_Type), 0, "record_class", 1))) __PYX_ERR(0, 76, __pyx_L1_error) __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol___init__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_addr, __pyx_v_connected_fut, __pyx_v_con_params, __pyx_v_record_class, __pyx_v_loop); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol___init__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_addr, PyObject *__pyx_v_connected_fut, PyObject *__pyx_v_con_params, PyTypeObject *__pyx_v_record_class, PyObject *__pyx_v_loop) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "asyncpg/protocol/protocol.pyx":78 * def __init__(self, addr, connected_fut, con_params, record_class: type, loop): * # type of `con_params` is `_ConnectionParameters` * CoreProtocol.__init__(self, addr, con_params) # <<<<<<<<<<<<<< * * self.loop = loop */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_addr, __pyx_v_con_params}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":80 * CoreProtocol.__init__(self, addr, con_params) * * self.loop = loop # <<<<<<<<<<<<<< * self.transport = None * self.waiter = connected_fut */ __Pyx_INCREF(__pyx_v_loop); __Pyx_GIVEREF(__pyx_v_loop); __Pyx_GOTREF(__pyx_v_self->loop); __Pyx_DECREF(__pyx_v_self->loop); __pyx_v_self->loop = __pyx_v_loop; /* "asyncpg/protocol/protocol.pyx":81 * * self.loop = loop * self.transport = None # <<<<<<<<<<<<<< * self.waiter = connected_fut * self.cancel_waiter = None */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->__pyx_base.transport); __Pyx_DECREF(__pyx_v_self->__pyx_base.transport); __pyx_v_self->__pyx_base.transport = Py_None; /* "asyncpg/protocol/protocol.pyx":82 * self.loop = loop * self.transport = None * self.waiter = connected_fut # <<<<<<<<<<<<<< * self.cancel_waiter = None * self.cancel_sent_waiter = None */ __Pyx_INCREF(__pyx_v_connected_fut); __Pyx_GIVEREF(__pyx_v_connected_fut); __Pyx_GOTREF(__pyx_v_self->waiter); __Pyx_DECREF(__pyx_v_self->waiter); __pyx_v_self->waiter = __pyx_v_connected_fut; /* "asyncpg/protocol/protocol.pyx":83 * self.transport = None * self.waiter = connected_fut * self.cancel_waiter = None # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->cancel_waiter); __Pyx_DECREF(__pyx_v_self->cancel_waiter); __pyx_v_self->cancel_waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":84 * self.waiter = connected_fut * self.cancel_waiter = None * self.cancel_sent_waiter = None # <<<<<<<<<<<<<< * * self.settings = ConnectionSettings((addr, con_params.database)) */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->cancel_sent_waiter); __Pyx_DECREF(__pyx_v_self->cancel_sent_waiter); __pyx_v_self->cancel_sent_waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":86 * self.cancel_sent_waiter = None * * self.settings = ConnectionSettings((addr, con_params.database)) # <<<<<<<<<<<<<< * self.record_class = record_class * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_con_params, __pyx_n_s_database); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_addr); __Pyx_GIVEREF(__pyx_v_addr); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_addr)) __PYX_ERR(0, 86, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF((PyObject *)__pyx_v_self->settings); __Pyx_DECREF((PyObject *)__pyx_v_self->settings); __pyx_v_self->settings = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":87 * * self.settings = ConnectionSettings((addr, con_params.database)) * self.record_class = record_class # <<<<<<<<<<<<<< * * self.statement = None */ __Pyx_INCREF((PyObject *)__pyx_v_record_class); __Pyx_GIVEREF((PyObject *)__pyx_v_record_class); __Pyx_GOTREF((PyObject *)__pyx_v_self->record_class); __Pyx_DECREF((PyObject *)__pyx_v_self->record_class); __pyx_v_self->record_class = __pyx_v_record_class; /* "asyncpg/protocol/protocol.pyx":89 * self.record_class = record_class * * self.statement = None # <<<<<<<<<<<<<< * self.return_extra = False * */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF((PyObject *)__pyx_v_self->statement); __Pyx_DECREF((PyObject *)__pyx_v_self->statement); __pyx_v_self->statement = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)Py_None); /* "asyncpg/protocol/protocol.pyx":90 * * self.statement = None * self.return_extra = False # <<<<<<<<<<<<<< * * self.last_query = None */ __pyx_v_self->return_extra = 0; /* "asyncpg/protocol/protocol.pyx":92 * self.return_extra = False * * self.last_query = None # <<<<<<<<<<<<<< * * self.closing = False */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->last_query); __Pyx_DECREF(__pyx_v_self->last_query); __pyx_v_self->last_query = ((PyObject*)Py_None); /* "asyncpg/protocol/protocol.pyx":94 * self.last_query = None * * self.closing = False # <<<<<<<<<<<<<< * self.is_reading = True * self.writing_allowed = asyncio.Event() */ __pyx_v_self->closing = 0; /* "asyncpg/protocol/protocol.pyx":95 * * self.closing = False * self.is_reading = True # <<<<<<<<<<<<<< * self.writing_allowed = asyncio.Event() * self.writing_allowed.set() */ __pyx_v_self->is_reading = 1; /* "asyncpg/protocol/protocol.pyx":96 * self.closing = False * self.is_reading = True * self.writing_allowed = asyncio.Event() # <<<<<<<<<<<<<< * self.writing_allowed.set() * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Event); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_writing_allowed, __pyx_t_1) < 0) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":97 * self.is_reading = True * self.writing_allowed = asyncio.Event() * self.writing_allowed.set() # <<<<<<<<<<<<<< * * self.timeout_handle = None */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_writing_allowed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":99 * self.writing_allowed.set() * * self.timeout_handle = None # <<<<<<<<<<<<<< * * self.queries_count = 0 */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->timeout_handle); __Pyx_DECREF(__pyx_v_self->timeout_handle); __pyx_v_self->timeout_handle = Py_None; /* "asyncpg/protocol/protocol.pyx":101 * self.timeout_handle = None * * self.queries_count = 0 # <<<<<<<<<<<<<< * * self._is_ssl = False */ __pyx_v_self->queries_count = 0; /* "asyncpg/protocol/protocol.pyx":103 * self.queries_count = 0 * * self._is_ssl = False # <<<<<<<<<<<<<< * * try: */ __pyx_v_self->_is_ssl = 0; /* "asyncpg/protocol/protocol.pyx":105 * self._is_ssl = False * * try: # <<<<<<<<<<<<<< * self.create_future = loop.create_future * except AttributeError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":106 * * try: * self.create_future = loop.create_future # <<<<<<<<<<<<<< * except AttributeError: * self.create_future = self._create_future_fallback */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_loop, __pyx_n_s_create_future); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->create_future); __Pyx_DECREF(__pyx_v_self->create_future); __pyx_v_self->create_future = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":105 * self._is_ssl = False * * try: # <<<<<<<<<<<<<< * self.create_future = loop.create_future * except AttributeError: */ } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":107 * try: * self.create_future = loop.create_future * except AttributeError: # <<<<<<<<<<<<<< * self.create_future = self._create_future_fallback * */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_8) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 107, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /* "asyncpg/protocol/protocol.pyx":108 * self.create_future = loop.create_future * except AttributeError: * self.create_future = self._create_future_fallback # <<<<<<<<<<<<<< * * def set_connection(self, connection): */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_future_fallback); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 108, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __Pyx_GOTREF(__pyx_v_self->create_future); __Pyx_DECREF(__pyx_v_self->create_future); __pyx_v_self->create_future = __pyx_t_9; __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; /* "asyncpg/protocol/protocol.pyx":105 * self._is_ssl = False * * try: # <<<<<<<<<<<<<< * self.create_future = loop.create_future * except AttributeError: */ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); __pyx_L8_try_end:; } /* "asyncpg/protocol/protocol.pyx":76 * * cdef class BaseProtocol(CoreProtocol): * def __init__(self, addr, connected_fut, con_params, record_class: type, loop): # <<<<<<<<<<<<<< * # type of `con_params` is `_ConnectionParameters` * CoreProtocol.__init__(self, addr, con_params) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":110 * self.create_future = self._create_future_fallback * * def set_connection(self, connection): # <<<<<<<<<<<<<< * self.conref = weakref.ref(connection) * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_3set_connection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_3set_connection = {"set_connection", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_3set_connection, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_3set_connection(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_connection = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_connection (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_connection,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_connection)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_connection") < 0)) __PYX_ERR(0, 110, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_connection = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_connection", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 110, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.set_connection", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_2set_connection(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_connection); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_2set_connection(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_connection) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_connection", 1); /* "asyncpg/protocol/protocol.pyx":111 * * def set_connection(self, connection): * self.conref = weakref.ref(connection) # <<<<<<<<<<<<<< * * cdef get_connection(self): */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_weakref); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ref); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_connection}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->conref); __Pyx_DECREF(__pyx_v_self->conref); __pyx_v_self->conref = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":110 * self.create_future = self._create_future_fallback * * def set_connection(self, connection): # <<<<<<<<<<<<<< * self.conref = weakref.ref(connection) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.set_connection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":113 * self.conref = weakref.ref(connection) * * cdef get_connection(self): # <<<<<<<<<<<<<< * if self.conref is not None: * return self.conref() */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_get_connection(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_connection", 1); /* "asyncpg/protocol/protocol.pyx":114 * * cdef get_connection(self): * if self.conref is not None: # <<<<<<<<<<<<<< * return self.conref() * else: */ __pyx_t_1 = (__pyx_v_self->conref != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":115 * cdef get_connection(self): * if self.conref is not None: * return self.conref() # <<<<<<<<<<<<<< * else: * return None */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->conref); __pyx_t_3 = __pyx_v_self->conref; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":114 * * cdef get_connection(self): * if self.conref is not None: # <<<<<<<<<<<<<< * return self.conref() * else: */ } /* "asyncpg/protocol/protocol.pyx":117 * return self.conref() * else: * return None # <<<<<<<<<<<<<< * * def get_server_pid(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "asyncpg/protocol/protocol.pyx":113 * self.conref = weakref.ref(connection) * * cdef get_connection(self): # <<<<<<<<<<<<<< * if self.conref is not None: * return self.conref() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.get_connection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":119 * return None * * def get_server_pid(self): # <<<<<<<<<<<<<< * return self.backend_pid * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_5get_server_pid(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_5get_server_pid = {"get_server_pid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_5get_server_pid, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_5get_server_pid(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_server_pid (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_server_pid", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_server_pid", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_4get_server_pid(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_4get_server_pid(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_server_pid", 1); /* "asyncpg/protocol/protocol.pyx":120 * * def get_server_pid(self): * return self.backend_pid # <<<<<<<<<<<<<< * * def get_settings(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->__pyx_base.backend_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":119 * return None * * def get_server_pid(self): # <<<<<<<<<<<<<< * return self.backend_pid * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.get_server_pid", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":122 * return self.backend_pid * * def get_settings(self): # <<<<<<<<<<<<<< * return self.settings * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_7get_settings(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_7get_settings = {"get_settings", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_7get_settings, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_7get_settings(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_settings (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_settings", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_settings", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_6get_settings(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_6get_settings(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_settings", 1); /* "asyncpg/protocol/protocol.pyx":123 * * def get_settings(self): * return self.settings # <<<<<<<<<<<<<< * * def get_record_class(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self->settings); __pyx_r = ((PyObject *)__pyx_v_self->settings); goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":122 * return self.backend_pid * * def get_settings(self): # <<<<<<<<<<<<<< * return self.settings * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":125 * return self.settings * * def get_record_class(self): # <<<<<<<<<<<<<< * return self.record_class * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_9get_record_class(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_9get_record_class = {"get_record_class", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_9get_record_class, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_9get_record_class(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_record_class (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_record_class", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_record_class", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_8get_record_class(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_8get_record_class(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_record_class", 1); /* "asyncpg/protocol/protocol.pyx":126 * * def get_record_class(self): * return self.record_class # <<<<<<<<<<<<<< * * cdef inline resume_reading(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF((PyObject *)__pyx_v_self->record_class); __pyx_r = ((PyObject *)__pyx_v_self->record_class); goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":125 * return self.settings * * def get_record_class(self): # <<<<<<<<<<<<<< * return self.record_class * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":128 * return self.record_class * * cdef inline resume_reading(self): # <<<<<<<<<<<<<< * if not self.is_reading: * self.is_reading = True */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_resume_reading(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("resume_reading", 1); /* "asyncpg/protocol/protocol.pyx":129 * * cdef inline resume_reading(self): * if not self.is_reading: # <<<<<<<<<<<<<< * self.is_reading = True * self.transport.resume_reading() */ __pyx_t_1 = (!__pyx_v_self->is_reading); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":130 * cdef inline resume_reading(self): * if not self.is_reading: * self.is_reading = True # <<<<<<<<<<<<<< * self.transport.resume_reading() * */ __pyx_v_self->is_reading = 1; /* "asyncpg/protocol/protocol.pyx":131 * if not self.is_reading: * self.is_reading = True * self.transport.resume_reading() # <<<<<<<<<<<<<< * * cdef inline pause_reading(self): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.transport, __pyx_n_s_resume_reading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":129 * * cdef inline resume_reading(self): * if not self.is_reading: # <<<<<<<<<<<<<< * self.is_reading = True * self.transport.resume_reading() */ } /* "asyncpg/protocol/protocol.pyx":128 * return self.record_class * * cdef inline resume_reading(self): # <<<<<<<<<<<<<< * if not self.is_reading: * self.is_reading = True */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.resume_reading", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":133 * self.transport.resume_reading() * * cdef inline pause_reading(self): # <<<<<<<<<<<<<< * if self.is_reading: * self.is_reading = False */ static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_pause_reading(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pause_reading", 1); /* "asyncpg/protocol/protocol.pyx":134 * * cdef inline pause_reading(self): * if self.is_reading: # <<<<<<<<<<<<<< * self.is_reading = False * self.transport.pause_reading() */ if (__pyx_v_self->is_reading) { /* "asyncpg/protocol/protocol.pyx":135 * cdef inline pause_reading(self): * if self.is_reading: * self.is_reading = False # <<<<<<<<<<<<<< * self.transport.pause_reading() * */ __pyx_v_self->is_reading = 0; /* "asyncpg/protocol/protocol.pyx":136 * if self.is_reading: * self.is_reading = False * self.transport.pause_reading() # <<<<<<<<<<<<<< * * @cython.iterable_coroutine */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.transport, __pyx_n_s_pause_reading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":134 * * cdef inline pause_reading(self): * if self.is_reading: # <<<<<<<<<<<<<< * self.is_reading = False * self.transport.pause_reading() */ } /* "asyncpg/protocol/protocol.pyx":133 * self.transport.resume_reading() * * cdef inline pause_reading(self): # <<<<<<<<<<<<<< * if self.is_reading: * self.is_reading = False */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.pause_reading", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_12generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":138 * self.transport.pause_reading() * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def prepare(self, stmt_name, query, timeout, * *, */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_11prepare(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_11prepare = {"prepare", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_11prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_11prepare(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_stmt_name = 0; PyObject *__pyx_v_query = 0; PyObject *__pyx_v_timeout = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state = 0; PyObject *__pyx_v_ignore_custom_codec = 0; PyObject *__pyx_v_record_class = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("prepare (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stmt_name,&__pyx_n_s_query,&__pyx_n_s_timeout,&__pyx_n_s_record_class,&__pyx_n_s_state,&__pyx_n_s_ignore_custom_codec,0}; /* "asyncpg/protocol/protocol.pyx":141 * async def prepare(self, stmt_name, query, timeout, * *, * PreparedStatementState state=None, # <<<<<<<<<<<<<< * ignore_custom_codec=False, * record_class): */ values[4] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)Py_None)); /* "asyncpg/protocol/protocol.pyx":142 * *, * PreparedStatementState state=None, * ignore_custom_codec=False, # <<<<<<<<<<<<<< * record_class): * if self.cancel_waiter is not None: */ values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); if (likely(__pyx_kwds)) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stmt_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_query)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("prepare", 1, 3, 3, 1); __PYX_ERR(0, 138, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("prepare", 1, 3, 3, 2); __PYX_ERR(0, 138, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_record_class)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) else { __Pyx_RaiseKeywordRequired("prepare", __pyx_n_s_record_class); __PYX_ERR(0, 138, __pyx_L3_error) } } if (kw_args > 0 && likely(kw_args <= 2)) { Py_ssize_t index; for (index = 4; index < 6 && kw_args > 0; index++) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "prepare") < 0)) __PYX_ERR(0, 138, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { __Pyx_RaiseKeywordRequired("prepare", __pyx_n_s_record_class); __PYX_ERR(0, 138, __pyx_L3_error) } __pyx_v_stmt_name = values[0]; __pyx_v_query = values[1]; __pyx_v_timeout = values[2]; __pyx_v_record_class = values[3]; __pyx_v_state = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)values[4]); __pyx_v_ignore_custom_codec = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("prepare", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 138, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 1, "state", 0))) __PYX_ERR(0, 141, __pyx_L1_error) __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_10prepare(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_stmt_name, __pyx_v_query, __pyx_v_timeout, __pyx_v_state, __pyx_v_ignore_custom_codec, __pyx_v_record_class); /* "asyncpg/protocol/protocol.pyx":138 * self.transport.pause_reading() * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def prepare(self, stmt_name, query, timeout, * *, */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_10prepare(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_stmt_name, PyObject *__pyx_v_query, PyObject *__pyx_v_timeout, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_ignore_custom_codec, PyObject *__pyx_v_record_class) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("prepare", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 138, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_stmt_name = __pyx_v_stmt_name; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_stmt_name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_stmt_name); __pyx_cur_scope->__pyx_v_query = __pyx_v_query; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_query); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_query); __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout); __pyx_cur_scope->__pyx_v_state = __pyx_v_state; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __pyx_cur_scope->__pyx_v_ignore_custom_codec = __pyx_v_ignore_custom_codec; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ignore_custom_codec); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ignore_custom_codec); __pyx_cur_scope->__pyx_v_record_class = __pyx_v_record_class; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_record_class); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_record_class); { __pyx_CoroutineObject *gen = __Pyx_IterableCoroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_12generator, __pyx_codeobj__46, (PyObject *) __pyx_cur_scope, __pyx_n_s_prepare, __pyx_n_s_BaseProtocol_prepare, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_12generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *)__pyx_generator->closure); PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; unsigned int __pyx_t_12; int __pyx_t_13; char const *__pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("prepare", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L5_resume_from_await; case 2: goto __pyx_L7_resume_from_await; case 3: goto __pyx_L29_resume_from_await; case 4: goto __pyx_L32_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 138, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":144 * ignore_custom_codec=False, * record_class): * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":145 * record_class): * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L5_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 145, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 145, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":144 * ignore_custom_codec=False, * record_class): * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ } /* "asyncpg/protocol/protocol.pyx":146 * if self.cancel_waiter is not None: * await self.cancel_waiter * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":147 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 147, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 147, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":148 * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter * self.cancel_sent_waiter = None # <<<<<<<<<<<<<< * * self._check_state() */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":146 * if self.cancel_waiter is not None: * await self.cancel_waiter * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ } /* "asyncpg/protocol/protocol.pyx":150 * self.cancel_sent_waiter = None * * self._check_state() # <<<<<<<<<<<<<< * timeout = self._get_timeout_impl(timeout) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_check_state(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":151 * * self._check_state() * timeout = self._get_timeout_impl(timeout) # <<<<<<<<<<<<<< * * waiter = self._new_waiter(timeout) */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":153 * timeout = self._get_timeout_impl(timeout) * * waiter = self._new_waiter(timeout) # <<<<<<<<<<<<<< * try: * self._prepare_and_describe(stmt_name, query) # network op */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_waiter = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":154 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._prepare_and_describe(stmt_name, query) # network op * self.last_query = query */ /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":155 * waiter = self._new_waiter(timeout) * try: * self._prepare_and_describe(stmt_name, query) # network op # <<<<<<<<<<<<<< * self.last_query = query * if state is None: */ if (!(likely(PyUnicode_CheckExact(__pyx_cur_scope->__pyx_v_stmt_name))||((__pyx_cur_scope->__pyx_v_stmt_name) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_cur_scope->__pyx_v_stmt_name))) __PYX_ERR(0, 155, __pyx_L11_error) if (!(likely(PyUnicode_CheckExact(__pyx_cur_scope->__pyx_v_query))||((__pyx_cur_scope->__pyx_v_query) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_cur_scope->__pyx_v_query))) __PYX_ERR(0, 155, __pyx_L11_error) __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._prepare_and_describe(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject*)__pyx_cur_scope->__pyx_v_stmt_name), ((PyObject*)__pyx_cur_scope->__pyx_v_query)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":156 * try: * self._prepare_and_describe(stmt_name, query) # network op * self.last_query = query # <<<<<<<<<<<<<< * if state is None: * state = PreparedStatementState( */ if (!(likely(PyUnicode_CheckExact(__pyx_cur_scope->__pyx_v_query))||((__pyx_cur_scope->__pyx_v_query) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_cur_scope->__pyx_v_query))) __PYX_ERR(0, 156, __pyx_L11_error) __pyx_t_2 = __pyx_cur_scope->__pyx_v_query; __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->last_query); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->last_query); __pyx_cur_scope->__pyx_v_self->last_query = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":157 * self._prepare_and_describe(stmt_name, query) # network op * self.last_query = query * if state is None: # <<<<<<<<<<<<<< * state = PreparedStatementState( * stmt_name, query, self, record_class, ignore_custom_codec) */ __pyx_t_1 = (((PyObject *)__pyx_cur_scope->__pyx_v_state) == Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":158 * self.last_query = query * if state is None: * state = PreparedStatementState( # <<<<<<<<<<<<<< * stmt_name, query, self, record_class, ignore_custom_codec) * self.statement = state */ __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_stmt_name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_stmt_name); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_stmt_name)) __PYX_ERR(0, 158, __pyx_L11_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_query); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_query); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_cur_scope->__pyx_v_query)) __PYX_ERR(0, 158, __pyx_L11_error); __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_cur_scope->__pyx_v_self))) __PYX_ERR(0, 158, __pyx_L11_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_record_class); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_record_class); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_cur_scope->__pyx_v_record_class)) __PYX_ERR(0, 158, __pyx_L11_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ignore_custom_codec); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ignore_custom_codec); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_cur_scope->__pyx_v_ignore_custom_codec)) __PYX_ERR(0, 158, __pyx_L11_error); __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState), __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_state, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_t_6)); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":157 * self._prepare_and_describe(stmt_name, query) # network op * self.last_query = query * if state is None: # <<<<<<<<<<<<<< * state = PreparedStatementState( * stmt_name, query, self, record_class, ignore_custom_codec) */ } /* "asyncpg/protocol/protocol.pyx":160 * state = PreparedStatementState( * stmt_name, query, self, record_class, ignore_custom_codec) * self.statement = state # <<<<<<<<<<<<<< * except Exception as ex: * waiter.set_exception(ex) */ __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_self->statement); __Pyx_DECREF((PyObject *)__pyx_cur_scope->__pyx_v_self->statement); __pyx_cur_scope->__pyx_v_self->statement = __pyx_cur_scope->__pyx_v_state; /* "asyncpg/protocol/protocol.pyx":154 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._prepare_and_describe(stmt_name, query) # network op * self.last_query = query */ } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L16_try_end; __pyx_L11_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":161 * stmt_name, query, self, record_class, ignore_custom_codec) * self.statement = state * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_7) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_2, &__pyx_t_8) < 0) __PYX_ERR(0, 161, __pyx_L13_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_ex = __pyx_t_2; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":162 * self.statement = state * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 162, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 162, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/protocol.pyx":163 * except Exception as ex: * waiter.set_exception(ex) * self._coreproto_error() # <<<<<<<<<<<<<< * finally: * return await waiter */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_coreproto_error(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 163, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } /* "asyncpg/protocol/protocol.pyx":161 * stmt_name, query, self, record_class, ignore_custom_codec) * self.statement = state * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ /*finally:*/ { /*normal exit:*/{ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0; goto __pyx_L24; } __pyx_L23_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __pyx_t_7 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); } __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17); __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; goto __pyx_L13_except_error; } __pyx_L24:; } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; /* "asyncpg/protocol/protocol.pyx":154 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._prepare_and_describe(stmt_name, query) # network op * self.last_query = query */ __pyx_L13_except_error:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L9_error; __pyx_L12_exception_handled:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); __pyx_L16_try_end:; } } /* "asyncpg/protocol/protocol.pyx":165 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * @cython.iterable_coroutine */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L29_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 165, __pyx_L1_error) __pyx_t_8 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_8 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_8) < 0) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L0; } __pyx_L9_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_18); { __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_t_0 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_1 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_t_2 = __pyx_t_5; __Pyx_XGIVEREF(__pyx_t_18); __pyx_cur_scope->__pyx_t_3 = __pyx_t_18; __Pyx_XGIVEREF(__pyx_t_19); __pyx_cur_scope->__pyx_t_4 = __pyx_t_19; __Pyx_XGIVEREF(__pyx_t_20); __pyx_cur_scope->__pyx_t_5 = __pyx_t_20; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 4; return __pyx_r; __pyx_L32_resume_from_await:; __pyx_t_3 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_3); __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_5); __pyx_t_18 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_18); __pyx_t_19 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_19); __pyx_t_20 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_20); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 165, __pyx_L31_error) __pyx_t_8 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_8 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_8) < 0) __PYX_ERR(0, 165, __pyx_L31_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L30_return; } __pyx_L30_return:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18); } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; goto __pyx_L0; __pyx_L31_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18); } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; goto __pyx_L1_error; } } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "asyncpg/protocol/protocol.pyx":138 * self.transport.pause_reading() * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def prepare(self, stmt_name, query, timeout, * *, */ /* function exit code */ __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("prepare", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_15generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":167 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def bind_execute( * self, */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_14bind_execute(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_14bind_execute = {"bind_execute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_14bind_execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_14bind_execute(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_portal_name = 0; PyObject *__pyx_v_limit = 0; PyObject *__pyx_v_return_extra = 0; PyObject *__pyx_v_timeout = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bind_execute (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,&__pyx_n_s_args,&__pyx_n_s_portal_name,&__pyx_n_s_limit,&__pyx_n_s_return_extra,&__pyx_n_s_timeout,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bind_execute", 1, 6, 6, 1); __PYX_ERR(0, 167, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_portal_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bind_execute", 1, 6, 6, 2); __PYX_ERR(0, 167, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_limit)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bind_execute", 1, 6, 6, 3); __PYX_ERR(0, 167, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_return_extra)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bind_execute", 1, 6, 6, 4); __PYX_ERR(0, 167, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bind_execute", 1, 6, 6, 5); __PYX_ERR(0, 167, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "bind_execute") < 0)) __PYX_ERR(0, 167, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 6)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); } __pyx_v_state = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)values[0]); __pyx_v_args = values[1]; __pyx_v_portal_name = ((PyObject*)values[2]); __pyx_v_limit = ((PyObject*)values[3]); __pyx_v_return_extra = values[4]; __pyx_v_timeout = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("bind_execute", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 167, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 0, "state", 0))) __PYX_ERR(0, 170, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_portal_name), (&PyUnicode_Type), 0, "portal_name", 1))) __PYX_ERR(0, 172, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_limit), (&PyInt_Type), 0, "limit", 1))) __PYX_ERR(0, 173, __pyx_L1_error) __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_13bind_execute(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_state, __pyx_v_args, __pyx_v_portal_name, __pyx_v_limit, __pyx_v_return_extra, __pyx_v_timeout); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_13bind_execute(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_args, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_limit, PyObject *__pyx_v_return_extra, PyObject *__pyx_v_timeout) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bind_execute", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 167, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_state = __pyx_v_state; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __pyx_cur_scope->__pyx_v_args = __pyx_v_args; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args); __pyx_cur_scope->__pyx_v_portal_name = __pyx_v_portal_name; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_portal_name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_portal_name); __pyx_cur_scope->__pyx_v_limit = __pyx_v_limit; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_limit); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_limit); __pyx_cur_scope->__pyx_v_return_extra = __pyx_v_return_extra; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_return_extra); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_return_extra); __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout); { __pyx_CoroutineObject *gen = __Pyx_IterableCoroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_15generator1, __pyx_codeobj__47, (PyObject *) __pyx_cur_scope, __pyx_n_s_bind_execute, __pyx_n_s_BaseProtocol_bind_execute, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_15generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *)__pyx_generator->closure); PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int32_t __pyx_t_8; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; unsigned int __pyx_t_13; int __pyx_t_14; char const *__pyx_t_15; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bind_execute", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L5_resume_from_await; case 2: goto __pyx_L7_resume_from_await; case 3: goto __pyx_L29_resume_from_await; case 4: goto __pyx_L32_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 167, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":177 * timeout, * ): * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":178 * ): * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L5_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 178, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 178, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":177 * timeout, * ): * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ } /* "asyncpg/protocol/protocol.pyx":179 * if self.cancel_waiter is not None: * await self.cancel_waiter * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":180 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 180, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 180, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":181 * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter * self.cancel_sent_waiter = None # <<<<<<<<<<<<<< * * self._check_state() */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":179 * if self.cancel_waiter is not None: * await self.cancel_waiter * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ } /* "asyncpg/protocol/protocol.pyx":183 * self.cancel_sent_waiter = None * * self._check_state() # <<<<<<<<<<<<<< * timeout = self._get_timeout_impl(timeout) * args_buf = state._encode_bind_msg(args) */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_check_state(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":184 * * self._check_state() * timeout = self._get_timeout_impl(timeout) # <<<<<<<<<<<<<< * args_buf = state._encode_bind_msg(args) * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":185 * self._check_state() * timeout = self._get_timeout_impl(timeout) * args_buf = state._encode_bind_msg(args) # <<<<<<<<<<<<<< * * waiter = self._new_waiter(timeout) */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg(__pyx_cur_scope->__pyx_v_state, __pyx_cur_scope->__pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_args_buf = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":187 * args_buf = state._encode_bind_msg(args) * * waiter = self._new_waiter(timeout) # <<<<<<<<<<<<<< * try: * if not state.prepared: */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_waiter = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":188 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * if not state.prepared: * self._send_parse_message(state.name, state.query) */ /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":189 * waiter = self._new_waiter(timeout) * try: * if not state.prepared: # <<<<<<<<<<<<<< * self._send_parse_message(state.name, state.query) * */ __pyx_t_1 = (!__pyx_cur_scope->__pyx_v_state->prepared); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":190 * try: * if not state.prepared: * self._send_parse_message(state.name, state.query) # <<<<<<<<<<<<<< * * self._bind_execute( */ __pyx_t_2 = __pyx_cur_scope->__pyx_v_state->name; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = __pyx_cur_scope->__pyx_v_state->query; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._send_parse_message(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject*)__pyx_t_2), ((PyObject*)__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 190, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/protocol.pyx":189 * waiter = self._new_waiter(timeout) * try: * if not state.prepared: # <<<<<<<<<<<<<< * self._send_parse_message(state.name, state.query) * */ } /* "asyncpg/protocol/protocol.pyx":194 * self._bind_execute( * portal_name, * state.name, # <<<<<<<<<<<<<< * args_buf, * limit) # network op */ __pyx_t_7 = __pyx_cur_scope->__pyx_v_state->name; __Pyx_INCREF(__pyx_t_7); /* "asyncpg/protocol/protocol.pyx":195 * portal_name, * state.name, * args_buf, # <<<<<<<<<<<<<< * limit) # network op * */ if (!(likely(((__pyx_cur_scope->__pyx_v_args_buf) == Py_None) || likely(__Pyx_TypeTest(__pyx_cur_scope->__pyx_v_args_buf, __pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer))))) __PYX_ERR(0, 195, __pyx_L11_error) /* "asyncpg/protocol/protocol.pyx":196 * state.name, * args_buf, * limit) # network op # <<<<<<<<<<<<<< * * self.last_query = state.query */ __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_cur_scope->__pyx_v_limit); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 196, __pyx_L11_error) /* "asyncpg/protocol/protocol.pyx":192 * self._send_parse_message(state.name, state.query) * * self._bind_execute( # <<<<<<<<<<<<<< * portal_name, * state.name, */ __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._bind_execute(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_portal_name, ((PyObject*)__pyx_t_7), ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_args_buf), __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 192, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":198 * limit) # network op * * self.last_query = state.query # <<<<<<<<<<<<<< * self.statement = state * self.return_extra = return_extra */ __pyx_t_6 = __pyx_cur_scope->__pyx_v_state->query; __Pyx_INCREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->last_query); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->last_query); __pyx_cur_scope->__pyx_v_self->last_query = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":199 * * self.last_query = state.query * self.statement = state # <<<<<<<<<<<<<< * self.return_extra = return_extra * self.queries_count += 1 */ __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_self->statement); __Pyx_DECREF((PyObject *)__pyx_cur_scope->__pyx_v_self->statement); __pyx_cur_scope->__pyx_v_self->statement = __pyx_cur_scope->__pyx_v_state; /* "asyncpg/protocol/protocol.pyx":200 * self.last_query = state.query * self.statement = state * self.return_extra = return_extra # <<<<<<<<<<<<<< * self.queries_count += 1 * except Exception as ex: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_return_extra); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L11_error) __pyx_cur_scope->__pyx_v_self->return_extra = __pyx_t_1; /* "asyncpg/protocol/protocol.pyx":201 * self.statement = state * self.return_extra = return_extra * self.queries_count += 1 # <<<<<<<<<<<<<< * except Exception as ex: * waiter.set_exception(ex) */ __pyx_cur_scope->__pyx_v_self->queries_count = (__pyx_cur_scope->__pyx_v_self->queries_count + 1); /* "asyncpg/protocol/protocol.pyx":188 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * if not state.prepared: * self._send_parse_message(state.name, state.query) */ } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L16_try_end; __pyx_L11_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/protocol.pyx":202 * self.return_extra = return_extra * self.queries_count += 1 * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_9) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(0, 202, __pyx_L13_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_v_ex = __pyx_t_7; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":203 * self.queries_count += 1 * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 203, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; __pyx_t_13 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_13 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 203, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/protocol.pyx":204 * except Exception as ex: * waiter.set_exception(ex) * self._coreproto_error() # <<<<<<<<<<<<<< * finally: * return await waiter */ __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_coreproto_error(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 204, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } /* "asyncpg/protocol/protocol.pyx":202 * self.return_extra = return_extra * self.queries_count += 1 * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ /*finally:*/ { /*normal exit:*/{ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0; goto __pyx_L24; } __pyx_L23_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __pyx_t_9 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); } __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18); __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15; goto __pyx_L13_except_error; } __pyx_L24:; } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; /* "asyncpg/protocol/protocol.pyx":188 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * if not state.prepared: * self._send_parse_message(state.name, state.query) */ __pyx_L13_except_error:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L9_error; __pyx_L12_exception_handled:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); __pyx_L16_try_end:; } } /* "asyncpg/protocol/protocol.pyx":206 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * @cython.iterable_coroutine */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L29_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 206, __pyx_L1_error) __pyx_t_2 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_2 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_2) < 0) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; } __pyx_L9_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_19); { __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_t_0 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_1 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_t_2 = __pyx_t_5; __Pyx_XGIVEREF(__pyx_t_19); __pyx_cur_scope->__pyx_t_3 = __pyx_t_19; __Pyx_XGIVEREF(__pyx_t_20); __pyx_cur_scope->__pyx_t_4 = __pyx_t_20; __Pyx_XGIVEREF(__pyx_t_21); __pyx_cur_scope->__pyx_t_5 = __pyx_t_21; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 4; return __pyx_r; __pyx_L32_resume_from_await:; __pyx_t_3 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_3); __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_5); __pyx_t_19 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_19); __pyx_t_20 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_20); __pyx_t_21 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_21); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 206, __pyx_L31_error) __pyx_t_2 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_2 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_2) < 0) __PYX_ERR(0, 206, __pyx_L31_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L30_return; } __pyx_L30_return:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19); } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; goto __pyx_L0; __pyx_L31_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19); } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; goto __pyx_L1_error; } } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "asyncpg/protocol/protocol.pyx":167 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def bind_execute( * self, */ /* function exit code */ __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("bind_execute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_18generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":208 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def bind_execute_many( * self, */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many = {"bind_execute_many", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_portal_name = 0; PyObject *__pyx_v_timeout = 0; PyObject *__pyx_v_return_rows = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bind_execute_many (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,&__pyx_n_s_args,&__pyx_n_s_portal_name,&__pyx_n_s_timeout,&__pyx_n_s_return_rows,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 208, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 208, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bind_execute_many", 1, 5, 5, 1); __PYX_ERR(0, 208, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_portal_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 208, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bind_execute_many", 1, 5, 5, 2); __PYX_ERR(0, 208, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 208, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bind_execute_many", 1, 5, 5, 3); __PYX_ERR(0, 208, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_return_rows)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 208, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bind_execute_many", 1, 5, 5, 4); __PYX_ERR(0, 208, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "bind_execute_many") < 0)) __PYX_ERR(0, 208, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); } __pyx_v_state = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)values[0]); __pyx_v_args = values[1]; __pyx_v_portal_name = ((PyObject*)values[2]); __pyx_v_timeout = values[3]; __pyx_v_return_rows = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("bind_execute_many", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 208, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 0, "state", 0))) __PYX_ERR(0, 211, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_portal_name), (&PyUnicode_Type), 0, "portal_name", 1))) __PYX_ERR(0, 213, __pyx_L1_error) __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_16bind_execute_many(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_state, __pyx_v_args, __pyx_v_portal_name, __pyx_v_timeout, __pyx_v_return_rows); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many_2generator17(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":230 * # this generator expression to keep the memory pressure under * # control. * data_gen = (state._encode_bind_msg(b, i) for i, b in enumerate(args)) # <<<<<<<<<<<<<< * arg_bufs = iter(data_gen) * */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 230, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *) __pyx_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many_2generator17, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_bind_execute_many_locals_genexpr, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute_many.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many_2generator17(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; int __pyx_t_6; struct __pyx_opt_args_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L6_resume_from_yield; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_INCREF(__pyx_int_0); __pyx_t_1 = __pyx_int_0; if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 230, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_2 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 230, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 230, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 230, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 230, __pyx_L1_error) #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 230, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_b); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_b, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_state)) { __Pyx_RaiseClosureNameError("state"); __PYX_ERR(0, 230, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_i); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L1_error) __pyx_t_7.__pyx_n = 1; __pyx_t_7.seqno = __pyx_t_6; __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_state, __pyx_cur_scope->__pyx_v_b, &__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __Pyx_XGIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __pyx_cur_scope->__pyx_t_3 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, yielding value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L6_resume_from_yield:; __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_2); __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; __pyx_t_4 = __pyx_cur_scope->__pyx_t_3; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 230, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":208 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def bind_execute_many( * self, */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_16bind_execute_many(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_args, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_timeout, PyObject *__pyx_v_return_rows) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *__pyx_cur_scope; PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many_2generator17 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bind_execute_many", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 208, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_state = __pyx_v_state; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __pyx_cur_scope->__pyx_v_args = __pyx_v_args; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args); __pyx_cur_scope->__pyx_v_portal_name = __pyx_v_portal_name; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_portal_name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_portal_name); __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout); __pyx_cur_scope->__pyx_v_return_rows = __pyx_v_return_rows; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_return_rows); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_return_rows); { __pyx_CoroutineObject *gen = __Pyx_IterableCoroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_18generator2, __pyx_codeobj__48, (PyObject *) __pyx_cur_scope, __pyx_n_s_bind_execute_many, __pyx_n_s_BaseProtocol_bind_execute_many, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XDECREF(__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many_2generator17); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_18generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *)__pyx_generator->closure); PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; int __pyx_t_18; int __pyx_t_19; char const *__pyx_t_20; PyObject *__pyx_t_21 = NULL; char const *__pyx_t_22; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bind_execute_many", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L5_resume_from_await; case 2: goto __pyx_L7_resume_from_await; case 3: goto __pyx_L34_resume_from_await; case 4: goto __pyx_L35_resume_from_await; case 5: goto __pyx_L63_resume_from_await; case 6: goto __pyx_L66_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 208, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":217 * return_rows: bool, * ): * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":218 * ): * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L5_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 218, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 218, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":217 * return_rows: bool, * ): * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ } /* "asyncpg/protocol/protocol.pyx":219 * if self.cancel_waiter is not None: * await self.cancel_waiter * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":220 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 220, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 220, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":221 * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter * self.cancel_sent_waiter = None # <<<<<<<<<<<<<< * * self._check_state() */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":219 * if self.cancel_waiter is not None: * await self.cancel_waiter * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ } /* "asyncpg/protocol/protocol.pyx":223 * self.cancel_sent_waiter = None * * self._check_state() # <<<<<<<<<<<<<< * timeout = self._get_timeout_impl(timeout) * timer = Timer(timeout) */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_check_state(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":224 * * self._check_state() * timeout = self._get_timeout_impl(timeout) # <<<<<<<<<<<<<< * timer = Timer(timeout) * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":225 * self._check_state() * timeout = self._get_timeout_impl(timeout) * timer = Timer(timeout) # <<<<<<<<<<<<<< * * # Make sure the argument sequence is encoded lazily with */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Timer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_timeout}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_timer = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":230 * # this generator expression to keep the memory pressure under * # control. * data_gen = (state._encode_bind_msg(b, i) for i, b in enumerate(args)) # <<<<<<<<<<<<<< * arg_bufs = iter(data_gen) * */ __pyx_t_2 = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many_genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_data_gen = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":231 * # control. * data_gen = (state._encode_bind_msg(b, i) for i, b in enumerate(args)) * arg_bufs = iter(data_gen) # <<<<<<<<<<<<<< * * waiter = self._new_waiter(timeout) */ __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_data_gen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_arg_bufs = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":233 * arg_bufs = iter(data_gen) * * waiter = self._new_waiter(timeout) # <<<<<<<<<<<<<< * try: * if not state.prepared: */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_waiter = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":234 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * if not state.prepared: * self._send_parse_message(state.name, state.query) */ /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":235 * waiter = self._new_waiter(timeout) * try: * if not state.prepared: # <<<<<<<<<<<<<< * self._send_parse_message(state.name, state.query) * */ __pyx_t_1 = (!__pyx_cur_scope->__pyx_v_state->prepared); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":236 * try: * if not state.prepared: * self._send_parse_message(state.name, state.query) # <<<<<<<<<<<<<< * * more = self._bind_execute_many( */ __pyx_t_2 = __pyx_cur_scope->__pyx_v_state->name; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = __pyx_cur_scope->__pyx_v_state->query; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._send_parse_message(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject*)__pyx_t_2), ((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":235 * waiter = self._new_waiter(timeout) * try: * if not state.prepared: # <<<<<<<<<<<<<< * self._send_parse_message(state.name, state.query) * */ } /* "asyncpg/protocol/protocol.pyx":240 * more = self._bind_execute_many( * portal_name, * state.name, # <<<<<<<<<<<<<< * arg_bufs, * return_rows) # network op */ __pyx_t_4 = __pyx_cur_scope->__pyx_v_state->name; __Pyx_INCREF(__pyx_t_4); /* "asyncpg/protocol/protocol.pyx":242 * state.name, * arg_bufs, * return_rows) # network op # <<<<<<<<<<<<<< * * self.last_query = state.query */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_return_rows); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L11_error) /* "asyncpg/protocol/protocol.pyx":238 * self._send_parse_message(state.name, state.query) * * more = self._bind_execute_many( # <<<<<<<<<<<<<< * portal_name, * state.name, */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._bind_execute_many(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_portal_name, ((PyObject*)__pyx_t_4), __pyx_cur_scope->__pyx_v_arg_bufs, __pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L11_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_cur_scope->__pyx_v_more = __pyx_t_9; /* "asyncpg/protocol/protocol.pyx":244 * return_rows) # network op * * self.last_query = state.query # <<<<<<<<<<<<<< * self.statement = state * self.return_extra = False */ __pyx_t_4 = __pyx_cur_scope->__pyx_v_state->query; __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->last_query); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->last_query); __pyx_cur_scope->__pyx_v_self->last_query = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":245 * * self.last_query = state.query * self.statement = state # <<<<<<<<<<<<<< * self.return_extra = False * self.queries_count += 1 */ __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_self->statement); __Pyx_DECREF((PyObject *)__pyx_cur_scope->__pyx_v_self->statement); __pyx_cur_scope->__pyx_v_self->statement = __pyx_cur_scope->__pyx_v_state; /* "asyncpg/protocol/protocol.pyx":246 * self.last_query = state.query * self.statement = state * self.return_extra = False # <<<<<<<<<<<<<< * self.queries_count += 1 * */ __pyx_cur_scope->__pyx_v_self->return_extra = 0; /* "asyncpg/protocol/protocol.pyx":247 * self.statement = state * self.return_extra = False * self.queries_count += 1 # <<<<<<<<<<<<<< * * while more: */ __pyx_cur_scope->__pyx_v_self->queries_count = (__pyx_cur_scope->__pyx_v_self->queries_count + 1); /* "asyncpg/protocol/protocol.pyx":249 * self.queries_count += 1 * * while more: # <<<<<<<<<<<<<< * with timer: * await compat.wait_for( */ while (1) { if (!__pyx_cur_scope->__pyx_v_more) break; /* "asyncpg/protocol/protocol.pyx":250 * * while more: * with timer: # <<<<<<<<<<<<<< * await compat.wait_for( * self.writing_allowed.wait(), */ /*with:*/ { __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 250, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":251 * while more: * with timer: * await compat.wait_for( # <<<<<<<<<<<<<< * self.writing_allowed.wait(), * timeout=timer.get_remaining_budget()) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_compat); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_wait_for); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":252 * with timer: * await compat.wait_for( * self.writing_allowed.wait(), # <<<<<<<<<<<<<< * timeout=timer.get_remaining_budget()) * # On Windows the above event somehow won't allow context */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_writing_allowed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_wait); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 252, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_14))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } /* "asyncpg/protocol/protocol.pyx":251 * while more: * with timer: * await compat.wait_for( # <<<<<<<<<<<<<< * self.writing_allowed.wait(), * timeout=timer.get_remaining_budget()) */ __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 251, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_4)) __PYX_ERR(0, 251, __pyx_L26_error); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":253 * await compat.wait_for( * self.writing_allowed.wait(), * timeout=timer.get_remaining_budget()) # <<<<<<<<<<<<<< * # On Windows the above event somehow won't allow context * # switch, so forcing one with sleep(0) here */ __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_get_remaining_budget); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 253, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_15))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_15); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_15, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_16, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_t_2) < 0) __PYX_ERR(0, 253, __pyx_L26_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":251 * while more: * with timer: * await compat.wait_for( # <<<<<<<<<<<<<< * self.writing_allowed.wait(), * timeout=timer.get_remaining_budget()) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_14, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_0 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_1 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_2 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_3 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_t_11); __pyx_cur_scope->__pyx_t_4 = __pyx_t_11; __Pyx_XGIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_t_5 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_t_13); __pyx_cur_scope->__pyx_t_6 = __pyx_t_13; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L34_resume_from_await:; __pyx_t_6 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_10 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_10); __pyx_t_11 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_11); __pyx_t_12 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_12); __pyx_t_13 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 251, __pyx_L26_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 251, __pyx_L26_error) } } /* "asyncpg/protocol/protocol.pyx":256 * # On Windows the above event somehow won't allow context * # switch, so forcing one with sleep(0) here * await asyncio.sleep(0) # <<<<<<<<<<<<<< * if not timer.has_budget_greater_than(0): * raise asyncio.TimeoutError */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sleep); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 256, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_14))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_int_0}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_0 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_1 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_2 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_3 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_t_11); __pyx_cur_scope->__pyx_t_4 = __pyx_t_11; __Pyx_XGIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_t_5 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_t_13); __pyx_cur_scope->__pyx_t_6 = __pyx_t_13; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 4; return __pyx_r; __pyx_L35_resume_from_await:; __pyx_t_6 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_10 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_10); __pyx_t_11 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_11); __pyx_t_12 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_12); __pyx_t_13 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 256, __pyx_L26_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 256, __pyx_L26_error) } } /* "asyncpg/protocol/protocol.pyx":250 * * while more: * with timer: # <<<<<<<<<<<<<< * await compat.wait_for( * self.writing_allowed.wait(), */ } __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L33_try_end; __pyx_L26_error:; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /*except:*/ { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_14, &__pyx_t_4) < 0) __PYX_ERR(0, 250, __pyx_L28_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_4); __pyx_t_3 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_14, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L28_except_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_3, NULL); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 250, __pyx_L28_except_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_17); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (__pyx_t_9 < 0) __PYX_ERR(0, 250, __pyx_L28_except_error) __pyx_t_1 = (!__pyx_t_9); if (unlikely(__pyx_t_1)) { __Pyx_GIVEREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_14, __pyx_t_4); __pyx_t_2 = 0; __pyx_t_14 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 250, __pyx_L28_except_error) } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L27_exception_handled; } __pyx_L28_except_error:; __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L11_error; __pyx_L27_exception_handled:; __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_L33_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_10) { __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__49, NULL); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 250, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } goto __pyx_L25; } __pyx_L25:; } goto __pyx_L39; __pyx_L20_error:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L11_error; __pyx_L39:; } /* "asyncpg/protocol/protocol.pyx":257 * # switch, so forcing one with sleep(0) here * await asyncio.sleep(0) * if not timer.has_budget_greater_than(0): # <<<<<<<<<<<<<< * raise asyncio.TimeoutError * more = self._bind_execute_many_more() # network op */ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_has_budget_greater_than); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 257, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_14))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_int_0}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 257, __pyx_L11_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = (!__pyx_t_1); if (unlikely(__pyx_t_9)) { /* "asyncpg/protocol/protocol.pyx":258 * await asyncio.sleep(0) * if not timer.has_budget_greater_than(0): * raise asyncio.TimeoutError # <<<<<<<<<<<<<< * more = self._bind_execute_many_more() # network op * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_TimeoutError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 258, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_14, 0, 0, 0); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __PYX_ERR(0, 258, __pyx_L11_error) /* "asyncpg/protocol/protocol.pyx":257 * # switch, so forcing one with sleep(0) here * await asyncio.sleep(0) * if not timer.has_budget_greater_than(0): # <<<<<<<<<<<<<< * raise asyncio.TimeoutError * more = self._bind_execute_many_more() # network op */ } /* "asyncpg/protocol/protocol.pyx":259 * if not timer.has_budget_greater_than(0): * raise asyncio.TimeoutError * more = self._bind_execute_many_more() # network op # <<<<<<<<<<<<<< * * except asyncio.TimeoutError as e: */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._bind_execute_many_more(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 259, __pyx_L11_error) __pyx_cur_scope->__pyx_v_more = __pyx_t_9; } /* "asyncpg/protocol/protocol.pyx":234 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * if not state.prepared: * self._send_parse_message(state.name, state.query) */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L16_try_end; __pyx_L11_error:; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":261 * more = self._bind_execute_many_more() # network op * * except asyncio.TimeoutError as e: # <<<<<<<<<<<<<< * self._bind_execute_many_fail(e) # network op * */ __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_4, &__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L13_except_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_TimeoutError); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 261, __pyx_L13_except_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_18 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_14, __pyx_t_15); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_ErrRestore(__pyx_t_14, __pyx_t_4, __pyx_t_2); __pyx_t_14 = 0; __pyx_t_4 = 0; __pyx_t_2 = 0; if (__pyx_t_18) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_14) < 0) __PYX_ERR(0, 261, __pyx_L13_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_e = __pyx_t_4; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":262 * * except asyncio.TimeoutError as e: * self._bind_execute_many_fail(e) # network op # <<<<<<<<<<<<<< * * except Exception as ex: */ __pyx_t_15 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._bind_execute_many_fail(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_e, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 262, __pyx_L46_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } /* "asyncpg/protocol/protocol.pyx":261 * more = self._bind_execute_many_more() # network op * * except asyncio.TimeoutError as e: # <<<<<<<<<<<<<< * self._bind_execute_many_fail(e) # network op * */ /*finally:*/ { /*normal exit:*/{ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_e); __pyx_cur_scope->__pyx_v_e = 0; goto __pyx_L47; } __pyx_L46_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_10 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_17 = 0; __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_17, &__pyx_t_21); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_13, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_13, &__pyx_t_12); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_21); __pyx_t_18 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_e); __pyx_cur_scope->__pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_17, __pyx_t_21); } __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ErrRestore(__pyx_t_10, __pyx_t_13, __pyx_t_12); __pyx_t_10 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_17 = 0; __pyx_t_21 = 0; __pyx_lineno = __pyx_t_18; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20; goto __pyx_L13_except_error; } __pyx_L47:; } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L12_exception_handled; } /* "asyncpg/protocol/protocol.pyx":264 * self._bind_execute_many_fail(e) # network op * * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ __pyx_t_19 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_19) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_4, &__pyx_t_2) < 0) __PYX_ERR(0, 264, __pyx_L13_except_error) __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_ex = __pyx_t_4; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":265 * * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L57_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_16 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_15 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 265, __pyx_L57_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; /* "asyncpg/protocol/protocol.pyx":266 * except Exception as ex: * waiter.set_exception(ex) * self._coreproto_error() # <<<<<<<<<<<<<< * finally: * return await waiter */ __pyx_t_15 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_coreproto_error(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 266, __pyx_L57_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } /* "asyncpg/protocol/protocol.pyx":264 * self._bind_execute_many_fail(e) # network op * * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ /*finally:*/ { /*normal exit:*/{ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0; goto __pyx_L58; } __pyx_L57_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_21 = 0; __pyx_t_17 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_10); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_21, &__pyx_t_17, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_21, &__pyx_t_17, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_10); __pyx_t_19 = __pyx_lineno; __pyx_t_18 = __pyx_clineno; __pyx_t_22 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_10); } __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ErrRestore(__pyx_t_21, __pyx_t_17, __pyx_t_11); __pyx_t_21 = 0; __pyx_t_17 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_10 = 0; __pyx_lineno = __pyx_t_19; __pyx_clineno = __pyx_t_18; __pyx_filename = __pyx_t_22; goto __pyx_L13_except_error; } __pyx_L58:; } __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; /* "asyncpg/protocol/protocol.pyx":234 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * if not state.prepared: * self._send_parse_message(state.name, state.query) */ __pyx_L13_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L9_error; __pyx_L12_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L16_try_end:; } } /* "asyncpg/protocol/protocol.pyx":268 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * @cython.iterable_coroutine */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 5; return __pyx_r; __pyx_L63_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 268, __pyx_L1_error) __pyx_t_2 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_2 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_2) < 0) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; } __pyx_L9_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_10 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_13, &__pyx_t_12); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_12); { __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_0 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_1 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_2 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_3 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_t_4 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_t_13); __pyx_cur_scope->__pyx_t_5 = __pyx_t_13; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 6; return __pyx_r; __pyx_L66_resume_from_await:; __pyx_t_6 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_10 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_10); __pyx_t_12 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_12); __pyx_t_13 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 268, __pyx_L65_error) __pyx_t_2 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_2); } else { __pyx_t_2 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_2) < 0) __PYX_ERR(0, 268, __pyx_L65_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L64_return; } __pyx_L64_return:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_13, __pyx_t_12); } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; goto __pyx_L0; __pyx_L65_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_13, __pyx_t_12); } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; goto __pyx_L1_error; } } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "asyncpg/protocol/protocol.pyx":208 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def bind_execute_many( * self, */ /* function exit code */ __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_AddTraceback("bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_21generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":270 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def bind(self, PreparedStatementState state, args, * str portal_name, timeout): */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_20bind(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_20bind = {"bind", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_20bind, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_20bind(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_portal_name = 0; PyObject *__pyx_v_timeout = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bind (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,&__pyx_n_s_args,&__pyx_n_s_portal_name,&__pyx_n_s_timeout,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bind", 1, 4, 4, 1); __PYX_ERR(0, 270, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_portal_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bind", 1, 4, 4, 2); __PYX_ERR(0, 270, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("bind", 1, 4, 4, 3); __PYX_ERR(0, 270, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "bind") < 0)) __PYX_ERR(0, 270, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_state = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)values[0]); __pyx_v_args = values[1]; __pyx_v_portal_name = ((PyObject*)values[2]); __pyx_v_timeout = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("bind", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 270, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 1, "state", 0))) __PYX_ERR(0, 271, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_portal_name), (&PyUnicode_Type), 1, "portal_name", 1))) __PYX_ERR(0, 272, __pyx_L1_error) __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_19bind(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_state, __pyx_v_args, __pyx_v_portal_name, __pyx_v_timeout); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_19bind(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_args, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_timeout) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bind", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 270, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_state = __pyx_v_state; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __pyx_cur_scope->__pyx_v_args = __pyx_v_args; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args); __pyx_cur_scope->__pyx_v_portal_name = __pyx_v_portal_name; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_portal_name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_portal_name); __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout); { __pyx_CoroutineObject *gen = __Pyx_IterableCoroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_21generator3, __pyx_codeobj__50, (PyObject *) __pyx_cur_scope, __pyx_n_s_bind, __pyx_n_s_BaseProtocol_bind, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_21generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *)__pyx_generator->closure); PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; unsigned int __pyx_t_12; int __pyx_t_13; char const *__pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bind", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L5_resume_from_await; case 2: goto __pyx_L7_resume_from_await; case 3: goto __pyx_L28_resume_from_await; case 4: goto __pyx_L31_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 270, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":274 * str portal_name, timeout): * * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":275 * * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L5_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 275, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 275, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":274 * str portal_name, timeout): * * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ } /* "asyncpg/protocol/protocol.pyx":276 * if self.cancel_waiter is not None: * await self.cancel_waiter * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":277 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 277, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 277, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":278 * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter * self.cancel_sent_waiter = None # <<<<<<<<<<<<<< * * self._check_state() */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":276 * if self.cancel_waiter is not None: * await self.cancel_waiter * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ } /* "asyncpg/protocol/protocol.pyx":280 * self.cancel_sent_waiter = None * * self._check_state() # <<<<<<<<<<<<<< * timeout = self._get_timeout_impl(timeout) * args_buf = state._encode_bind_msg(args) */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_check_state(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":281 * * self._check_state() * timeout = self._get_timeout_impl(timeout) # <<<<<<<<<<<<<< * args_buf = state._encode_bind_msg(args) * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":282 * self._check_state() * timeout = self._get_timeout_impl(timeout) * args_buf = state._encode_bind_msg(args) # <<<<<<<<<<<<<< * * waiter = self._new_waiter(timeout) */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg(__pyx_cur_scope->__pyx_v_state, __pyx_cur_scope->__pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_args_buf = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":284 * args_buf = state._encode_bind_msg(args) * * waiter = self._new_waiter(timeout) # <<<<<<<<<<<<<< * try: * self._bind( */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_waiter = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":285 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._bind( * portal_name, */ /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":288 * self._bind( * portal_name, * state.name, # <<<<<<<<<<<<<< * args_buf) # network op * */ __pyx_t_2 = __pyx_cur_scope->__pyx_v_state->name; __Pyx_INCREF(__pyx_t_2); /* "asyncpg/protocol/protocol.pyx":289 * portal_name, * state.name, * args_buf) # network op # <<<<<<<<<<<<<< * * self.last_query = state.query */ if (!(likely(((__pyx_cur_scope->__pyx_v_args_buf) == Py_None) || likely(__Pyx_TypeTest(__pyx_cur_scope->__pyx_v_args_buf, __pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer))))) __PYX_ERR(0, 289, __pyx_L11_error) /* "asyncpg/protocol/protocol.pyx":286 * waiter = self._new_waiter(timeout) * try: * self._bind( # <<<<<<<<<<<<<< * portal_name, * state.name, */ __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._bind(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_portal_name, ((PyObject*)__pyx_t_2), ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_args_buf)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 286, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":291 * args_buf) # network op * * self.last_query = state.query # <<<<<<<<<<<<<< * self.statement = state * except Exception as ex: */ __pyx_t_6 = __pyx_cur_scope->__pyx_v_state->query; __Pyx_INCREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->last_query); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->last_query); __pyx_cur_scope->__pyx_v_self->last_query = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":292 * * self.last_query = state.query * self.statement = state # <<<<<<<<<<<<<< * except Exception as ex: * waiter.set_exception(ex) */ __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_self->statement); __Pyx_DECREF((PyObject *)__pyx_cur_scope->__pyx_v_self->statement); __pyx_cur_scope->__pyx_v_self->statement = __pyx_cur_scope->__pyx_v_state; /* "asyncpg/protocol/protocol.pyx":285 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._bind( * portal_name, */ } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L16_try_end; __pyx_L11_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":293 * self.last_query = state.query * self.statement = state * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_7) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_2, &__pyx_t_8) < 0) __PYX_ERR(0, 293, __pyx_L13_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_ex = __pyx_t_2; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":294 * self.statement = state * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 294, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 294, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/protocol.pyx":295 * except Exception as ex: * waiter.set_exception(ex) * self._coreproto_error() # <<<<<<<<<<<<<< * finally: * return await waiter */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_coreproto_error(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 295, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } /* "asyncpg/protocol/protocol.pyx":293 * self.last_query = state.query * self.statement = state * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ /*finally:*/ { /*normal exit:*/{ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0; goto __pyx_L23; } __pyx_L22_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __pyx_t_7 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); } __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17); __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; goto __pyx_L13_except_error; } __pyx_L23:; } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; /* "asyncpg/protocol/protocol.pyx":285 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._bind( * portal_name, */ __pyx_L13_except_error:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L9_error; __pyx_L12_exception_handled:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); __pyx_L16_try_end:; } } /* "asyncpg/protocol/protocol.pyx":297 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * @cython.iterable_coroutine */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L28_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 297, __pyx_L1_error) __pyx_t_8 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_8 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_8) < 0) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L0; } __pyx_L9_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_18); { __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_t_0 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_1 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_t_2 = __pyx_t_5; __Pyx_XGIVEREF(__pyx_t_18); __pyx_cur_scope->__pyx_t_3 = __pyx_t_18; __Pyx_XGIVEREF(__pyx_t_19); __pyx_cur_scope->__pyx_t_4 = __pyx_t_19; __Pyx_XGIVEREF(__pyx_t_20); __pyx_cur_scope->__pyx_t_5 = __pyx_t_20; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 4; return __pyx_r; __pyx_L31_resume_from_await:; __pyx_t_3 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_3); __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_5); __pyx_t_18 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_18); __pyx_t_19 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_19); __pyx_t_20 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_20); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 297, __pyx_L30_error) __pyx_t_8 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_8 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_8) < 0) __PYX_ERR(0, 297, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L29_return; } __pyx_L29_return:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18); } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; goto __pyx_L0; __pyx_L30_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18); } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; goto __pyx_L1_error; } } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "asyncpg/protocol/protocol.pyx":270 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def bind(self, PreparedStatementState state, args, * str portal_name, timeout): */ /* function exit code */ __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("bind", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_24generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":299 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def execute(self, PreparedStatementState state, * str portal_name, int limit, return_extra, */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_23execute(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_23execute = {"execute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_23execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_23execute(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state = 0; PyObject *__pyx_v_portal_name = 0; int __pyx_v_limit; PyObject *__pyx_v_return_extra = 0; PyObject *__pyx_v_timeout = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[5] = {0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("execute (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,&__pyx_n_s_portal_name,&__pyx_n_s_limit,&__pyx_n_s_return_extra,&__pyx_n_s_timeout,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_portal_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("execute", 1, 5, 5, 1); __PYX_ERR(0, 299, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_limit)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("execute", 1, 5, 5, 2); __PYX_ERR(0, 299, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_return_extra)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("execute", 1, 5, 5, 3); __PYX_ERR(0, 299, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("execute", 1, 5, 5, 4); __PYX_ERR(0, 299, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "execute") < 0)) __PYX_ERR(0, 299, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); } __pyx_v_state = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)values[0]); __pyx_v_portal_name = ((PyObject*)values[1]); __pyx_v_limit = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_limit == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 301, __pyx_L3_error) __pyx_v_return_extra = values[3]; __pyx_v_timeout = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("execute", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 299, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 1, "state", 0))) __PYX_ERR(0, 300, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_portal_name), (&PyUnicode_Type), 1, "portal_name", 1))) __PYX_ERR(0, 301, __pyx_L1_error) __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_22execute(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_state, __pyx_v_portal_name, __pyx_v_limit, __pyx_v_return_extra, __pyx_v_timeout); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_22execute(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_portal_name, int __pyx_v_limit, PyObject *__pyx_v_return_extra, PyObject *__pyx_v_timeout) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("execute", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 299, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_state = __pyx_v_state; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __pyx_cur_scope->__pyx_v_portal_name = __pyx_v_portal_name; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_portal_name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_portal_name); __pyx_cur_scope->__pyx_v_limit = __pyx_v_limit; __pyx_cur_scope->__pyx_v_return_extra = __pyx_v_return_extra; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_return_extra); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_return_extra); __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout); { __pyx_CoroutineObject *gen = __Pyx_IterableCoroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_24generator4, __pyx_codeobj__51, (PyObject *) __pyx_cur_scope, __pyx_n_s_execute, __pyx_n_s_BaseProtocol_execute, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_24generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *)__pyx_generator->closure); PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; unsigned int __pyx_t_12; int __pyx_t_13; char const *__pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("execute", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L5_resume_from_await; case 2: goto __pyx_L7_resume_from_await; case 3: goto __pyx_L28_resume_from_await; case 4: goto __pyx_L31_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 299, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":304 * timeout): * * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":305 * * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L5_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 305, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 305, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":304 * timeout): * * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ } /* "asyncpg/protocol/protocol.pyx":306 * if self.cancel_waiter is not None: * await self.cancel_waiter * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":307 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 307, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 307, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":308 * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter * self.cancel_sent_waiter = None # <<<<<<<<<<<<<< * * self._check_state() */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":306 * if self.cancel_waiter is not None: * await self.cancel_waiter * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ } /* "asyncpg/protocol/protocol.pyx":310 * self.cancel_sent_waiter = None * * self._check_state() # <<<<<<<<<<<<<< * timeout = self._get_timeout_impl(timeout) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_check_state(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":311 * * self._check_state() * timeout = self._get_timeout_impl(timeout) # <<<<<<<<<<<<<< * * waiter = self._new_waiter(timeout) */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":313 * timeout = self._get_timeout_impl(timeout) * * waiter = self._new_waiter(timeout) # <<<<<<<<<<<<<< * try: * self._execute( */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_waiter = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":314 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._execute( * portal_name, */ /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":315 * waiter = self._new_waiter(timeout) * try: * self._execute( # <<<<<<<<<<<<<< * portal_name, * limit) # network op */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._execute(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_portal_name, __pyx_cur_scope->__pyx_v_limit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":319 * limit) # network op * * self.last_query = state.query # <<<<<<<<<<<<<< * self.statement = state * self.return_extra = return_extra */ __pyx_t_2 = __pyx_cur_scope->__pyx_v_state->query; __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->last_query); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->last_query); __pyx_cur_scope->__pyx_v_self->last_query = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":320 * * self.last_query = state.query * self.statement = state # <<<<<<<<<<<<<< * self.return_extra = return_extra * self.queries_count += 1 */ __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_self->statement); __Pyx_DECREF((PyObject *)__pyx_cur_scope->__pyx_v_self->statement); __pyx_cur_scope->__pyx_v_self->statement = __pyx_cur_scope->__pyx_v_state; /* "asyncpg/protocol/protocol.pyx":321 * self.last_query = state.query * self.statement = state * self.return_extra = return_extra # <<<<<<<<<<<<<< * self.queries_count += 1 * except Exception as ex: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_return_extra); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L11_error) __pyx_cur_scope->__pyx_v_self->return_extra = __pyx_t_1; /* "asyncpg/protocol/protocol.pyx":322 * self.statement = state * self.return_extra = return_extra * self.queries_count += 1 # <<<<<<<<<<<<<< * except Exception as ex: * waiter.set_exception(ex) */ __pyx_cur_scope->__pyx_v_self->queries_count = (__pyx_cur_scope->__pyx_v_self->queries_count + 1); /* "asyncpg/protocol/protocol.pyx":314 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._execute( * portal_name, */ } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L16_try_end; __pyx_L11_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":323 * self.return_extra = return_extra * self.queries_count += 1 * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_6) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 323, __pyx_L13_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_v_ex = __pyx_t_7; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":324 * self.queries_count += 1 * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 324, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 324, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/protocol.pyx":325 * except Exception as ex: * waiter.set_exception(ex) * self._coreproto_error() # <<<<<<<<<<<<<< * finally: * return await waiter */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_coreproto_error(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 325, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } /* "asyncpg/protocol/protocol.pyx":323 * self.return_extra = return_extra * self.queries_count += 1 * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ /*finally:*/ { /*normal exit:*/{ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0; goto __pyx_L23; } __pyx_L22_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __pyx_t_6 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); } __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17); __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; goto __pyx_L13_except_error; } __pyx_L23:; } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; /* "asyncpg/protocol/protocol.pyx":314 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._execute( * portal_name, */ __pyx_L13_except_error:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L9_error; __pyx_L12_exception_handled:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); __pyx_L16_try_end:; } } /* "asyncpg/protocol/protocol.pyx":327 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * @cython.iterable_coroutine */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L28_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 327, __pyx_L1_error) __pyx_t_8 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_8 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_8) < 0) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L0; } __pyx_L9_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_18); { __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_t_0 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_1 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_t_2 = __pyx_t_5; __Pyx_XGIVEREF(__pyx_t_18); __pyx_cur_scope->__pyx_t_3 = __pyx_t_18; __Pyx_XGIVEREF(__pyx_t_19); __pyx_cur_scope->__pyx_t_4 = __pyx_t_19; __Pyx_XGIVEREF(__pyx_t_20); __pyx_cur_scope->__pyx_t_5 = __pyx_t_20; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 4; return __pyx_r; __pyx_L31_resume_from_await:; __pyx_t_3 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_3); __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_5); __pyx_t_18 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_18); __pyx_t_19 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_19); __pyx_t_20 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_20); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 327, __pyx_L30_error) __pyx_t_8 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_8 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_8) < 0) __PYX_ERR(0, 327, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L29_return; } __pyx_L29_return:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18); } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; goto __pyx_L0; __pyx_L30_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18); } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; goto __pyx_L1_error; } } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "asyncpg/protocol/protocol.pyx":299 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def execute(self, PreparedStatementState state, * str portal_name, int limit, return_extra, */ /* function exit code */ __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("execute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_27generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":329 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def close_portal(self, str portal_name, timeout): * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_26close_portal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_26close_portal = {"close_portal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_26close_portal, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_26close_portal(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_portal_name = 0; PyObject *__pyx_v_timeout = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close_portal (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_portal_name,&__pyx_n_s_timeout,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_portal_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 329, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 329, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("close_portal", 1, 2, 2, 1); __PYX_ERR(0, 329, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "close_portal") < 0)) __PYX_ERR(0, 329, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_portal_name = ((PyObject*)values[0]); __pyx_v_timeout = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("close_portal", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 329, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.close_portal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_portal_name), (&PyUnicode_Type), 1, "portal_name", 1))) __PYX_ERR(0, 330, __pyx_L1_error) __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_25close_portal(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_portal_name, __pyx_v_timeout); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_25close_portal(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_timeout) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("close_portal", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 329, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_portal_name = __pyx_v_portal_name; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_portal_name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_portal_name); __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout); { __pyx_CoroutineObject *gen = __Pyx_IterableCoroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_27generator5, __pyx_codeobj__52, (PyObject *) __pyx_cur_scope, __pyx_n_s_close_portal, __pyx_n_s_BaseProtocol_close_portal, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.close_portal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_27generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *)__pyx_generator->closure); PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; unsigned int __pyx_t_12; int __pyx_t_13; char const *__pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close_portal", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L5_resume_from_await; case 2: goto __pyx_L7_resume_from_await; case 3: goto __pyx_L28_resume_from_await; case 4: goto __pyx_L31_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 329, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":332 * async def close_portal(self, str portal_name, timeout): * * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":333 * * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L5_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 333, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 333, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":332 * async def close_portal(self, str portal_name, timeout): * * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ } /* "asyncpg/protocol/protocol.pyx":334 * if self.cancel_waiter is not None: * await self.cancel_waiter * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":335 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 335, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 335, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":336 * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter * self.cancel_sent_waiter = None # <<<<<<<<<<<<<< * * self._check_state() */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":334 * if self.cancel_waiter is not None: * await self.cancel_waiter * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ } /* "asyncpg/protocol/protocol.pyx":338 * self.cancel_sent_waiter = None * * self._check_state() # <<<<<<<<<<<<<< * timeout = self._get_timeout_impl(timeout) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_check_state(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":339 * * self._check_state() * timeout = self._get_timeout_impl(timeout) # <<<<<<<<<<<<<< * * waiter = self._new_waiter(timeout) */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":341 * timeout = self._get_timeout_impl(timeout) * * waiter = self._new_waiter(timeout) # <<<<<<<<<<<<<< * try: * self._close( */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_waiter = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":342 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._close( * portal_name, */ /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":343 * waiter = self._new_waiter(timeout) * try: * self._close( # <<<<<<<<<<<<<< * portal_name, * True) # network op */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._close(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_portal_name, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":342 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._close( * portal_name, */ } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L16_try_end; __pyx_L11_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":346 * portal_name, * True) # network op * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_6) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.close_portal", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 346, __pyx_L13_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_v_ex = __pyx_t_7; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":347 * True) # network op * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 347, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 347, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/protocol.pyx":348 * except Exception as ex: * waiter.set_exception(ex) * self._coreproto_error() # <<<<<<<<<<<<<< * finally: * return await waiter */ __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_coreproto_error(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 348, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } /* "asyncpg/protocol/protocol.pyx":346 * portal_name, * True) # network op * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ /*finally:*/ { /*normal exit:*/{ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0; goto __pyx_L23; } __pyx_L22_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __pyx_t_6 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); } __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17); __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; goto __pyx_L13_except_error; } __pyx_L23:; } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; /* "asyncpg/protocol/protocol.pyx":342 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._close( * portal_name, */ __pyx_L13_except_error:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L9_error; __pyx_L12_exception_handled:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); __pyx_L16_try_end:; } } /* "asyncpg/protocol/protocol.pyx":350 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * @cython.iterable_coroutine */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L28_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 350, __pyx_L1_error) __pyx_t_8 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_8 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_8) < 0) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L0; } __pyx_L9_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_18); { __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_t_0 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_1 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_5); __pyx_cur_scope->__pyx_t_2 = __pyx_t_5; __Pyx_XGIVEREF(__pyx_t_18); __pyx_cur_scope->__pyx_t_3 = __pyx_t_18; __Pyx_XGIVEREF(__pyx_t_19); __pyx_cur_scope->__pyx_t_4 = __pyx_t_19; __Pyx_XGIVEREF(__pyx_t_20); __pyx_cur_scope->__pyx_t_5 = __pyx_t_20; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 4; return __pyx_r; __pyx_L31_resume_from_await:; __pyx_t_3 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_3); __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_5 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_5); __pyx_t_18 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_18); __pyx_t_19 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_19); __pyx_t_20 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_20); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 350, __pyx_L30_error) __pyx_t_8 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_8 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_8) < 0) __PYX_ERR(0, 350, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L29_return; } __pyx_L29_return:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18); } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; goto __pyx_L0; __pyx_L30_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18); } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; goto __pyx_L1_error; } } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "asyncpg/protocol/protocol.pyx":329 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def close_portal(self, str portal_name, timeout): * */ /* function exit code */ __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("close_portal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_30generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":352 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def query(self, query, timeout): * if self.cancel_waiter is not None: */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_29query(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_29query = {"query", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_29query, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_29query(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_query = 0; PyObject *__pyx_v_timeout = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("query (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_query,&__pyx_n_s_timeout,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_query)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 352, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 352, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("query", 1, 2, 2, 1); __PYX_ERR(0, 352, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "query") < 0)) __PYX_ERR(0, 352, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_query = values[0]; __pyx_v_timeout = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("query", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 352, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.query", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_28query(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_query, __pyx_v_timeout); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_28query(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_timeout) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("query", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 352, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_query = __pyx_v_query; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_query); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_query); __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout); { __pyx_CoroutineObject *gen = __Pyx_IterableCoroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_30generator6, __pyx_codeobj__53, (PyObject *) __pyx_cur_scope, __pyx_n_s_query, __pyx_n_s_BaseProtocol_query, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.query", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_30generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *)__pyx_generator->closure); PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; char const *__pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("query", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L5_resume_from_await; case 2: goto __pyx_L7_resume_from_await; case 3: goto __pyx_L28_resume_from_await; case 4: goto __pyx_L31_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 352, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":354 * @cython.iterable_coroutine * async def query(self, query, timeout): * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":355 * async def query(self, query, timeout): * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L5_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 355, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 355, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":354 * @cython.iterable_coroutine * async def query(self, query, timeout): * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ } /* "asyncpg/protocol/protocol.pyx":356 * if self.cancel_waiter is not None: * await self.cancel_waiter * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":357 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 357, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 357, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":358 * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter * self.cancel_sent_waiter = None # <<<<<<<<<<<<<< * * self._check_state() */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":356 * if self.cancel_waiter is not None: * await self.cancel_waiter * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ } /* "asyncpg/protocol/protocol.pyx":360 * self.cancel_sent_waiter = None * * self._check_state() # <<<<<<<<<<<<<< * # query() needs to call _get_timeout instead of _get_timeout_impl * # for consistent validation, as it is called differently from */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_check_state(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":364 * # for consistent validation, as it is called differently from * # prepare/bind/execute methods. * timeout = self._get_timeout(timeout) # <<<<<<<<<<<<<< * * waiter = self._new_waiter(timeout) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_get_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_timeout}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":366 * timeout = self._get_timeout(timeout) * * waiter = self._new_waiter(timeout) # <<<<<<<<<<<<<< * try: * self._simple_query(query) # network op */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_waiter = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":367 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._simple_query(query) # network op * self.last_query = query */ /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":368 * waiter = self._new_waiter(timeout) * try: * self._simple_query(query) # network op # <<<<<<<<<<<<<< * self.last_query = query * self.queries_count += 1 */ if (!(likely(PyUnicode_CheckExact(__pyx_cur_scope->__pyx_v_query))||((__pyx_cur_scope->__pyx_v_query) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_cur_scope->__pyx_v_query))) __PYX_ERR(0, 368, __pyx_L11_error) __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._simple_query(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject*)__pyx_cur_scope->__pyx_v_query)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":369 * try: * self._simple_query(query) # network op * self.last_query = query # <<<<<<<<<<<<<< * self.queries_count += 1 * except Exception as ex: */ if (!(likely(PyUnicode_CheckExact(__pyx_cur_scope->__pyx_v_query))||((__pyx_cur_scope->__pyx_v_query) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_cur_scope->__pyx_v_query))) __PYX_ERR(0, 369, __pyx_L11_error) __pyx_t_2 = __pyx_cur_scope->__pyx_v_query; __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->last_query); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->last_query); __pyx_cur_scope->__pyx_v_self->last_query = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":370 * self._simple_query(query) # network op * self.last_query = query * self.queries_count += 1 # <<<<<<<<<<<<<< * except Exception as ex: * waiter.set_exception(ex) */ __pyx_cur_scope->__pyx_v_self->queries_count = (__pyx_cur_scope->__pyx_v_self->queries_count + 1); /* "asyncpg/protocol/protocol.pyx":367 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._simple_query(query) # network op * self.last_query = query */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L16_try_end; __pyx_L11_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":371 * self.last_query = query * self.queries_count += 1 * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_9) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.query", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 371, __pyx_L13_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_ex = __pyx_t_3; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":372 * self.queries_count += 1 * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 372, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 372, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/protocol.pyx":373 * except Exception as ex: * waiter.set_exception(ex) * self._coreproto_error() # <<<<<<<<<<<<<< * finally: * return await waiter */ __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_coreproto_error(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 373, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } /* "asyncpg/protocol/protocol.pyx":371 * self.last_query = query * self.queries_count += 1 * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ /*finally:*/ { /*normal exit:*/{ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0; goto __pyx_L23; } __pyx_L22_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __pyx_t_9 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); } __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17); __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; goto __pyx_L13_except_error; } __pyx_L23:; } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; /* "asyncpg/protocol/protocol.pyx":367 * * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._simple_query(query) # network op * self.last_query = query */ __pyx_L13_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L9_error; __pyx_L12_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L16_try_end:; } } /* "asyncpg/protocol/protocol.pyx":375 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * @cython.iterable_coroutine */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L28_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 375, __pyx_L1_error) __pyx_t_4 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_4 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_4) < 0) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; } __pyx_L9_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_18); { __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_0 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_1 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_2 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_18); __pyx_cur_scope->__pyx_t_3 = __pyx_t_18; __Pyx_XGIVEREF(__pyx_t_19); __pyx_cur_scope->__pyx_t_4 = __pyx_t_19; __Pyx_XGIVEREF(__pyx_t_20); __pyx_cur_scope->__pyx_t_5 = __pyx_t_20; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 4; return __pyx_r; __pyx_L31_resume_from_await:; __pyx_t_6 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_18 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_18); __pyx_t_19 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_19); __pyx_t_20 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_20); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 375, __pyx_L30_error) __pyx_t_4 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_4 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_4) < 0) __PYX_ERR(0, 375, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L29_return; } __pyx_L29_return:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18); } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; goto __pyx_L0; __pyx_L30_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18); } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; goto __pyx_L1_error; } } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "asyncpg/protocol/protocol.pyx":352 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def query(self, query, timeout): * if self.cancel_waiter is not None: */ /* function exit code */ __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("query", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_33generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":377 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def copy_out(self, copy_stmt, sink, timeout): * if self.cancel_waiter is not None: */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_32copy_out(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_32copy_out = {"copy_out", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_32copy_out, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_32copy_out(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_copy_stmt = 0; PyObject *__pyx_v_sink = 0; PyObject *__pyx_v_timeout = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy_out (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_copy_stmt,&__pyx_n_s_sink,&__pyx_n_s_timeout,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_copy_stmt)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 377, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sink)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 377, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("copy_out", 1, 3, 3, 1); __PYX_ERR(0, 377, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 377, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("copy_out", 1, 3, 3, 2); __PYX_ERR(0, 377, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy_out") < 0)) __PYX_ERR(0, 377, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_copy_stmt = values[0]; __pyx_v_sink = values[1]; __pyx_v_timeout = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("copy_out", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 377, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_31copy_out(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_copy_stmt, __pyx_v_sink, __pyx_v_timeout); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":417 * # Make asyncio shut up about unretrieved * # QueryCanceledError * waiter.add_done_callback(lambda f: f.exception()) # <<<<<<<<<<<<<< * raise * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_8copy_out_lambda6(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_8copy_out_lambda6 = {"lambda6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_8copy_out_lambda6, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_8copy_out_lambda6(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_f = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda6 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_f)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda6") < 0)) __PYX_ERR(0, 417, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_f = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("lambda6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 417, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_out.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_lambda_funcdef_lambda6(__pyx_self, __pyx_v_f); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_f) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda6", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_out.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":377 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def copy_out(self, copy_stmt, sink, timeout): * if self.cancel_waiter is not None: */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_31copy_out(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_copy_stmt, PyObject *__pyx_v_sink, PyObject *__pyx_v_timeout) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy_out", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 377, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_copy_stmt = __pyx_v_copy_stmt; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_copy_stmt); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_copy_stmt); __pyx_cur_scope->__pyx_v_sink = __pyx_v_sink; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_sink); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_sink); __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout); { __pyx_CoroutineObject *gen = __Pyx_IterableCoroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_33generator7, __pyx_codeobj__54, (PyObject *) __pyx_cur_scope, __pyx_n_s_copy_out, __pyx_n_s_BaseProtocol_copy_out, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_33generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *)__pyx_generator->closure); PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *(*__pyx_t_12)(PyObject *); PyObject *__pyx_t_13 = NULL; int __pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; int __pyx_t_19; PyObject *__pyx_t_20 = NULL; int __pyx_t_21; char const *__pyx_t_22; PyObject *__pyx_t_23 = NULL; char const *__pyx_t_24; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy_out", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L5_resume_from_await; case 2: goto __pyx_L7_resume_from_await; case 3: goto __pyx_L27_resume_from_await; case 4: goto __pyx_L57_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 377, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":379 * @cython.iterable_coroutine * async def copy_out(self, copy_stmt, sink, timeout): * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":380 * async def copy_out(self, copy_stmt, sink, timeout): * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L5_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 380, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 380, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":379 * @cython.iterable_coroutine * async def copy_out(self, copy_stmt, sink, timeout): * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ } /* "asyncpg/protocol/protocol.pyx":381 * if self.cancel_waiter is not None: * await self.cancel_waiter * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":382 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 382, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 382, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":383 * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter * self.cancel_sent_waiter = None # <<<<<<<<<<<<<< * * self._check_state() */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":381 * if self.cancel_waiter is not None: * await self.cancel_waiter * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ } /* "asyncpg/protocol/protocol.pyx":385 * self.cancel_sent_waiter = None * * self._check_state() # <<<<<<<<<<<<<< * * timeout = self._get_timeout_impl(timeout) */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_check_state(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":387 * self._check_state() * * timeout = self._get_timeout_impl(timeout) # <<<<<<<<<<<<<< * timer = Timer(timeout) * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":388 * * timeout = self._get_timeout_impl(timeout) * timer = Timer(timeout) # <<<<<<<<<<<<<< * * # The copy operation is guarded by a single timeout */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Timer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_timeout}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_timer = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":392 * # The copy operation is guarded by a single timeout * # on the top level. * waiter = self._new_waiter(timer.get_remaining_budget()) # <<<<<<<<<<<<<< * * self._copy_out(copy_stmt) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_get_remaining_budget); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_waiter = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":394 * waiter = self._new_waiter(timer.get_remaining_budget()) * * self._copy_out(copy_stmt) # <<<<<<<<<<<<<< * * try: */ if (!(likely(PyUnicode_CheckExact(__pyx_cur_scope->__pyx_v_copy_stmt))||((__pyx_cur_scope->__pyx_v_copy_stmt) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_cur_scope->__pyx_v_copy_stmt))) __PYX_ERR(0, 394, __pyx_L1_error) __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._copy_out(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject*)__pyx_cur_scope->__pyx_v_copy_stmt)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":396 * self._copy_out(copy_stmt) * * try: # <<<<<<<<<<<<<< * while True: * self.resume_reading() */ /*try:*/ { /* "asyncpg/protocol/protocol.pyx":397 * * try: * while True: # <<<<<<<<<<<<<< * self.resume_reading() * */ while (1) { /* "asyncpg/protocol/protocol.pyx":398 * try: * while True: * self.resume_reading() # <<<<<<<<<<<<<< * * with timer: */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_resume_reading(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":400 * self.resume_reading() * * with timer: # <<<<<<<<<<<<<< * buffer, done, status_msg = await waiter * */ /*with:*/ { __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 400, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":401 * * with timer: * buffer, done, status_msg = await waiter # <<<<<<<<<<<<<< * * # buffer will be empty if CopyDone was received apart from */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_0 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_1 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_2 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_3 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L27_resume_from_await:; __pyx_t_6 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 401, __pyx_L19_error) __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_3 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_3) < 0) __PYX_ERR(0, 401, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_3); } if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 401, __pyx_L19_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_10 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_10); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 401, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 401, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_10); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 401, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); index = 0; __pyx_t_2 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_2)) goto __pyx_L28_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_4 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_4)) goto __pyx_L28_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L28_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 3) < 0) __PYX_ERR(0, 401, __pyx_L19_error) __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L29_unpacking_done; __pyx_L28_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 401, __pyx_L19_error) __pyx_L29_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_buffer); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_buffer, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_done); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_done, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_status_msg); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_status_msg, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; /* "asyncpg/protocol/protocol.pyx":400 * self.resume_reading() * * with timer: # <<<<<<<<<<<<<< * buffer, done, status_msg = await waiter * */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L26_try_end; __pyx_L19_error:; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /*except:*/ { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_10, &__pyx_t_4) < 0) __PYX_ERR(0, 400, __pyx_L21_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_4); __pyx_t_2 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_10, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L21_except_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 400, __pyx_L21_except_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_1 < 0) __PYX_ERR(0, 400, __pyx_L21_except_error) __pyx_t_14 = (!__pyx_t_1); if (unlikely(__pyx_t_14)) { __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_10, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_10 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 400, __pyx_L21_except_error) } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L20_exception_handled; } __pyx_L21_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L9_error; __pyx_L20_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L26_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_6) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__49, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 400, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } goto __pyx_L18; } __pyx_L18:; } goto __pyx_L33; __pyx_L13_error:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_error; __pyx_L33:; } /* "asyncpg/protocol/protocol.pyx":405 * # buffer will be empty if CopyDone was received apart from * # the last CopyData message. * if buffer: # <<<<<<<<<<<<<< * try: * with timer: */ if (unlikely(!__pyx_cur_scope->__pyx_v_buffer)) { __Pyx_RaiseUnboundLocalError("buffer"); __PYX_ERR(0, 405, __pyx_L9_error) } __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_buffer); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 405, __pyx_L9_error) if (__pyx_t_14) { /* "asyncpg/protocol/protocol.pyx":406 * # the last CopyData message. * if buffer: * try: # <<<<<<<<<<<<<< * with timer: * await compat.wait_for( */ { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_9, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":407 * if buffer: * try: * with timer: # <<<<<<<<<<<<<< * await compat.wait_for( * sink(buffer), */ /*with:*/ { __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 407, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_enter); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 407, __pyx_L43_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L43_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_15, &__pyx_t_16); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":408 * try: * with timer: * await compat.wait_for( # <<<<<<<<<<<<<< * sink(buffer), * timeout=timer.get_remaining_budget()) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_compat); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_wait_for); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 408, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":409 * with timer: * await compat.wait_for( * sink(buffer), # <<<<<<<<<<<<<< * timeout=timer.get_remaining_budget()) * except (Exception, asyncio.CancelledError) as ex: */ if (unlikely(!__pyx_cur_scope->__pyx_v_buffer)) { __Pyx_RaiseUnboundLocalError("buffer"); __PYX_ERR(0, 409, __pyx_L49_error) } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_sink); __pyx_t_3 = __pyx_cur_scope->__pyx_v_sink; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_buffer}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "asyncpg/protocol/protocol.pyx":408 * try: * with timer: * await compat.wait_for( # <<<<<<<<<<<<<< * sink(buffer), * timeout=timer.get_remaining_budget()) */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 408, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 408, __pyx_L49_error); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":410 * await compat.wait_for( * sink(buffer), * timeout=timer.get_remaining_budget()) # <<<<<<<<<<<<<< * except (Exception, asyncio.CancelledError) as ex: * # Abort the COPY operation on any error in */ __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 410, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_get_remaining_budget); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 410, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_17 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_17)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_17, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 410, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_t_2) < 0) __PYX_ERR(0, 410, __pyx_L49_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":408 * try: * with timer: * await compat.wait_for( # <<<<<<<<<<<<<< * sink(buffer), * timeout=timer.get_remaining_budget()) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L49_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_0 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_1 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_2 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_3 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_t_13); __pyx_cur_scope->__pyx_t_4 = __pyx_t_13; __Pyx_XGIVEREF(__pyx_t_15); __pyx_cur_scope->__pyx_t_5 = __pyx_t_15; __Pyx_XGIVEREF(__pyx_t_16); __pyx_cur_scope->__pyx_t_6 = __pyx_t_16; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 4; return __pyx_r; __pyx_L57_resume_from_await:; __pyx_t_6 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_9); __pyx_t_13 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_13); __pyx_t_15 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_15); __pyx_t_16 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 408, __pyx_L49_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 408, __pyx_L49_error) } } /* "asyncpg/protocol/protocol.pyx":407 * if buffer: * try: * with timer: # <<<<<<<<<<<<<< * await compat.wait_for( * sink(buffer), */ } __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; goto __pyx_L56_try_end; __pyx_L49_error:; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /*except:*/ { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 407, __pyx_L51_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_3); __pyx_t_10 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 407, __pyx_L51_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 407, __pyx_L51_except_error) __Pyx_GOTREF(__pyx_t_18); __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_18); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; if (__pyx_t_14 < 0) __PYX_ERR(0, 407, __pyx_L51_except_error) __pyx_t_1 = (!__pyx_t_14); if (unlikely(__pyx_t_1)) { __Pyx_GIVEREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_4, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __PYX_ERR(0, 407, __pyx_L51_except_error) } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L50_exception_handled; } __pyx_L51_except_error:; __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_15, __pyx_t_16); goto __pyx_L35_error; __pyx_L50_exception_handled:; __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_15, __pyx_t_16); __pyx_L56_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_7) { __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__49, NULL); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 407, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } goto __pyx_L48; } __pyx_L48:; } goto __pyx_L61; __pyx_L43_error:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L35_error; __pyx_L61:; } /* "asyncpg/protocol/protocol.pyx":406 * # the last CopyData message. * if buffer: * try: # <<<<<<<<<<<<<< * with timer: * await compat.wait_for( */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L42_try_end; __pyx_L35_error:; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":411 * sink(buffer), * timeout=timer.get_remaining_budget()) * except (Exception, asyncio.CancelledError) as ex: # <<<<<<<<<<<<<< * # Abort the COPY operation on any error in * # output sink. */ __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_4, &__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 411, __pyx_L37_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_CancelledError); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 411, __pyx_L37_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_19 = __Pyx_PyErr_GivenExceptionMatches2(__pyx_t_3, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_ErrRestore(__pyx_t_3, __pyx_t_4, __pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_2 = 0; if (__pyx_t_19) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 411, __pyx_L37_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_ex = __pyx_t_4; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":414 * # Abort the COPY operation on any error in * # output sink. * self._request_cancel() # <<<<<<<<<<<<<< * # Make asyncio shut up about unretrieved * # QueryCanceledError */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_request_cancel); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 414, __pyx_L67_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_17 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_17)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_17); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_17, NULL}; __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 414, __pyx_L67_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/protocol.pyx":417 * # Make asyncio shut up about unretrieved * # QueryCanceledError * waiter.add_done_callback(lambda f: f.exception()) # <<<<<<<<<<<<<< * raise * */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_waiter, __pyx_n_s_add_done_callback); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 417, __pyx_L67_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_8copy_out_lambda6, 0, __pyx_n_s_copy_out_locals_lambda, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, NULL); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 417, __pyx_L67_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_20 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_20)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_20); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_20, __pyx_t_17}; __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 417, __pyx_L67_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "asyncpg/protocol/protocol.pyx":418 * # QueryCanceledError * waiter.add_done_callback(lambda f: f.exception()) * raise # <<<<<<<<<<<<<< * * # done will be True upon receipt of CopyDone. */ __Pyx_GIVEREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_4, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __PYX_ERR(0, 418, __pyx_L67_error) } /* "asyncpg/protocol/protocol.pyx":411 * sink(buffer), * timeout=timer.get_remaining_budget()) * except (Exception, asyncio.CancelledError) as ex: # <<<<<<<<<<<<<< * # Abort the COPY operation on any error in * # output sink. */ /*finally:*/ { __pyx_L67_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_7 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_13 = 0; __pyx_t_18 = 0; __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_18, &__pyx_t_23); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_16, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_16, &__pyx_t_15); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_23); __pyx_t_19 = __pyx_lineno; __pyx_t_21 = __pyx_clineno; __pyx_t_22 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_18, __pyx_t_23); } __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ErrRestore(__pyx_t_7, __pyx_t_16, __pyx_t_15); __pyx_t_7 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_13 = 0; __pyx_t_18 = 0; __pyx_t_23 = 0; __pyx_lineno = __pyx_t_19; __pyx_clineno = __pyx_t_21; __pyx_filename = __pyx_t_22; goto __pyx_L37_except_error; } } } goto __pyx_L37_except_error; /* "asyncpg/protocol/protocol.pyx":406 * # the last CopyData message. * if buffer: * try: # <<<<<<<<<<<<<< * with timer: * await compat.wait_for( */ __pyx_L37_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_9, __pyx_t_8); goto __pyx_L9_error; __pyx_L42_try_end:; } /* "asyncpg/protocol/protocol.pyx":405 * # buffer will be empty if CopyDone was received apart from * # the last CopyData message. * if buffer: # <<<<<<<<<<<<<< * try: * with timer: */ } /* "asyncpg/protocol/protocol.pyx":421 * * # done will be True upon receipt of CopyDone. * if done: # <<<<<<<<<<<<<< * break * */ if (unlikely(!__pyx_cur_scope->__pyx_v_done)) { __Pyx_RaiseUnboundLocalError("done"); __PYX_ERR(0, 421, __pyx_L9_error) } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_done); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 421, __pyx_L9_error) if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":422 * # done will be True upon receipt of CopyDone. * if done: * break # <<<<<<<<<<<<<< * * waiter = self._new_waiter(timer.get_remaining_budget()) */ goto __pyx_L12_break; /* "asyncpg/protocol/protocol.pyx":421 * * # done will be True upon receipt of CopyDone. * if done: # <<<<<<<<<<<<<< * break * */ } /* "asyncpg/protocol/protocol.pyx":424 * break * * waiter = self._new_waiter(timer.get_remaining_budget()) # <<<<<<<<<<<<<< * * finally: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_get_remaining_budget); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_waiter); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_waiter, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L12_break:; } /* "asyncpg/protocol/protocol.pyx":427 * * finally: * self.resume_reading() # <<<<<<<<<<<<<< * * return status_msg */ /*finally:*/ { /*normal exit:*/{ __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_resume_reading(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L10; } __pyx_L9_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_6 = 0; __pyx_t_23 = 0; __pyx_t_18 = 0; __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_23, &__pyx_t_18, &__pyx_t_13); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_6) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_21 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_24 = __pyx_filename; { __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_resume_reading(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L75_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_18, __pyx_t_13); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_6 = 0; __pyx_t_23 = 0; __pyx_t_18 = 0; __pyx_t_13 = 0; __pyx_lineno = __pyx_t_21; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_24; goto __pyx_L1_error; __pyx_L75_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_18, __pyx_t_13); } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_23 = 0; __pyx_t_18 = 0; __pyx_t_13 = 0; goto __pyx_L1_error; } __pyx_L10:; } /* "asyncpg/protocol/protocol.pyx":429 * self.resume_reading() * * return status_msg # <<<<<<<<<<<<<< * * @cython.iterable_coroutine */ __Pyx_XDECREF(__pyx_r); if (unlikely(!__pyx_cur_scope->__pyx_v_status_msg)) { __Pyx_RaiseUnboundLocalError("status_msg"); __PYX_ERR(0, 429, __pyx_L1_error) } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_status_msg); goto __pyx_L0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "asyncpg/protocol/protocol.pyx":377 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def copy_out(self, copy_stmt, sink, timeout): * if self.cancel_waiter is not None: */ /* function exit code */ __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_17); __Pyx_XDECREF(__pyx_t_20); __Pyx_AddTraceback("copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_36generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":431 * return status_msg * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def copy_in(self, copy_stmt, reader, data, * records, PreparedStatementState record_stmt, timeout): */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_35copy_in(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_35copy_in = {"copy_in", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_35copy_in, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_35copy_in(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_copy_stmt = 0; PyObject *__pyx_v_reader = 0; PyObject *__pyx_v_data = 0; PyObject *__pyx_v_records = 0; struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_record_stmt = 0; PyObject *__pyx_v_timeout = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy_in (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_copy_stmt,&__pyx_n_s_reader,&__pyx_n_s_data,&__pyx_n_s_records,&__pyx_n_s_record_stmt,&__pyx_n_s_timeout,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_copy_stmt)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reader)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("copy_in", 1, 6, 6, 1); __PYX_ERR(0, 431, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("copy_in", 1, 6, 6, 2); __PYX_ERR(0, 431, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_records)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("copy_in", 1, 6, 6, 3); __PYX_ERR(0, 431, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_record_stmt)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("copy_in", 1, 6, 6, 4); __PYX_ERR(0, 431, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("copy_in", 1, 6, 6, 5); __PYX_ERR(0, 431, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy_in") < 0)) __PYX_ERR(0, 431, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 6)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); } __pyx_v_copy_stmt = values[0]; __pyx_v_reader = values[1]; __pyx_v_data = values[2]; __pyx_v_records = values[3]; __pyx_v_record_stmt = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)values[4]); __pyx_v_timeout = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("copy_in", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 431, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_record_stmt), __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 1, "record_stmt", 0))) __PYX_ERR(0, 433, __pyx_L1_error) __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_34copy_in(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_copy_stmt, __pyx_v_reader, __pyx_v_data, __pyx_v_records, __pyx_v_record_stmt, __pyx_v_timeout); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":561 * self._request_cancel() * # Make asyncio shut up about unretrieved QueryCanceledError * waiter.add_done_callback(lambda f: f.exception()) # <<<<<<<<<<<<<< * raise * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_7copy_in_lambda7(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_7copy_in_lambda7 = {"lambda7", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_7copy_in_lambda7, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_7copy_in_lambda7(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_f = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda7 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_f)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 561, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda7") < 0)) __PYX_ERR(0, 561, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_f = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("lambda7", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 561, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_lambda_funcdef_lambda7(__pyx_self, __pyx_v_f); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_f) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda7", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":431 * return status_msg * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def copy_in(self, copy_stmt, reader, data, * records, PreparedStatementState record_stmt, timeout): */ static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_34copy_in(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_copy_stmt, PyObject *__pyx_v_reader, PyObject *__pyx_v_data, PyObject *__pyx_v_records, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_record_stmt, PyObject *__pyx_v_timeout) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy_in", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 431, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_copy_stmt = __pyx_v_copy_stmt; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_copy_stmt); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_copy_stmt); __pyx_cur_scope->__pyx_v_reader = __pyx_v_reader; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_reader); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_reader); __pyx_cur_scope->__pyx_v_data = __pyx_v_data; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_data); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_data); __pyx_cur_scope->__pyx_v_records = __pyx_v_records; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_records); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_records); __pyx_cur_scope->__pyx_v_record_stmt = __pyx_v_record_stmt; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_record_stmt); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_record_stmt); __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout); { __pyx_CoroutineObject *gen = __Pyx_IterableCoroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_36generator8, __pyx_codeobj__55, (PyObject *) __pyx_cur_scope, __pyx_n_s_copy_in, __pyx_n_s_BaseProtocol_copy_in, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 431, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_36generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *)__pyx_generator->closure); PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; int __pyx_t_10; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; Py_ssize_t __pyx_t_16; Py_ssize_t __pyx_t_17; Py_ssize_t __pyx_t_18; PyObject *__pyx_t_19; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; PyObject *(*__pyx_t_25)(PyObject *); int __pyx_t_26; PyObject *__pyx_t_27 = NULL; PyObject *__pyx_t_28 = NULL; PyObject *__pyx_t_29 = NULL; int __pyx_t_30; char const *__pyx_t_31; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy_in", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L5_resume_from_await; case 2: goto __pyx_L7_resume_from_await; case 3: goto __pyx_L24_resume_from_await; case 4: goto __pyx_L43_resume_from_await; case 5: goto __pyx_L69_resume_from_await; case 6: goto __pyx_L105_resume_from_await; case 7: goto __pyx_L124_resume_from_await; case 8: goto __pyx_L129_resume_from_await; case 9: goto __pyx_L140_resume_from_await; case 10: goto __pyx_L154_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 431, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":439 * Codec codec * * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":440 * * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L5_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 440, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 440, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":439 * Codec codec * * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ } /* "asyncpg/protocol/protocol.pyx":441 * if self.cancel_waiter is not None: * await self.cancel_waiter * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":442 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 442, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 442, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":443 * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter * self.cancel_sent_waiter = None # <<<<<<<<<<<<<< * * self._check_state() */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":441 * if self.cancel_waiter is not None: * await self.cancel_waiter * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ } /* "asyncpg/protocol/protocol.pyx":445 * self.cancel_sent_waiter = None * * self._check_state() # <<<<<<<<<<<<<< * * timeout = self._get_timeout_impl(timeout) */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_check_state(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":447 * self._check_state() * * timeout = self._get_timeout_impl(timeout) # <<<<<<<<<<<<<< * timer = Timer(timeout) * */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":448 * * timeout = self._get_timeout_impl(timeout) * timer = Timer(timeout) # <<<<<<<<<<<<<< * * waiter = self._new_waiter(timer.get_remaining_budget()) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Timer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_timeout}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_timer = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":450 * timer = Timer(timeout) * * waiter = self._new_waiter(timer.get_remaining_budget()) # <<<<<<<<<<<<<< * * # Initiate COPY IN. */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_get_remaining_budget); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_waiter = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":453 * * # Initiate COPY IN. * self._copy_in(copy_stmt) # <<<<<<<<<<<<<< * * try: */ if (!(likely(PyUnicode_CheckExact(__pyx_cur_scope->__pyx_v_copy_stmt))||((__pyx_cur_scope->__pyx_v_copy_stmt) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_cur_scope->__pyx_v_copy_stmt))) __PYX_ERR(0, 453, __pyx_L1_error) __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._copy_in(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject*)__pyx_cur_scope->__pyx_v_copy_stmt)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":455 * self._copy_in(copy_stmt) * * try: # <<<<<<<<<<<<<< * if record_stmt is not None: * # copy_in_records in binary mode */ { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":456 * * try: * if record_stmt is not None: # <<<<<<<<<<<<<< * # copy_in_records in binary mode * wbuf = WriteBuffer.new() */ __pyx_t_1 = (((PyObject *)__pyx_cur_scope->__pyx_v_record_stmt) != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":458 * if record_stmt is not None: * # copy_in_records in binary mode * wbuf = WriteBuffer.new() # <<<<<<<<<<<<<< * # Signature * wbuf.write_bytes(_COPY_SIGNATURE) */ __pyx_t_3 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_wbuf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":460 * wbuf = WriteBuffer.new() * # Signature * wbuf.write_bytes(_COPY_SIGNATURE) # <<<<<<<<<<<<<< * # Flags field * wbuf.write_int32(0) */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_wbuf->__pyx_vtab)->write_bytes(__pyx_cur_scope->__pyx_v_wbuf, __pyx_kp_b_PGCOPY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 460, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":462 * wbuf.write_bytes(_COPY_SIGNATURE) * # Flags field * wbuf.write_int32(0) # <<<<<<<<<<<<<< * # No header extension * wbuf.write_int32(0) */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_wbuf->__pyx_vtab)->write_int32(__pyx_cur_scope->__pyx_v_wbuf, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 462, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":464 * wbuf.write_int32(0) * # No header extension * wbuf.write_int32(0) # <<<<<<<<<<<<<< * * record_stmt._ensure_rows_decoder() */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_wbuf->__pyx_vtab)->write_int32(__pyx_cur_scope->__pyx_v_wbuf, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":466 * wbuf.write_int32(0) * * record_stmt._ensure_rows_decoder() # <<<<<<<<<<<<<< * codecs = record_stmt.rows_codecs * num_cols = len(codecs) */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_rows_decoder(__pyx_cur_scope->__pyx_v_record_stmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":467 * * record_stmt._ensure_rows_decoder() * codecs = record_stmt.rows_codecs # <<<<<<<<<<<<<< * num_cols = len(codecs) * settings = self.settings */ __pyx_t_3 = __pyx_cur_scope->__pyx_v_record_stmt->rows_codecs; __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_codecs = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":468 * record_stmt._ensure_rows_decoder() * codecs = record_stmt.rows_codecs * num_cols = len(codecs) # <<<<<<<<<<<<<< * settings = self.settings * */ if (unlikely(__pyx_cur_scope->__pyx_v_codecs == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 468, __pyx_L8_error) } __pyx_t_9 = __Pyx_PyTuple_GET_SIZE(__pyx_cur_scope->__pyx_v_codecs); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 468, __pyx_L8_error) __pyx_cur_scope->__pyx_v_num_cols = __pyx_t_9; /* "asyncpg/protocol/protocol.pyx":469 * codecs = record_stmt.rows_codecs * num_cols = len(codecs) * settings = self.settings # <<<<<<<<<<<<<< * * for codec in codecs: */ __pyx_t_3 = ((PyObject *)__pyx_cur_scope->__pyx_v_self->settings); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_settings = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":471 * settings = self.settings * * for codec in codecs: # <<<<<<<<<<<<<< * if (not codec.has_encoder() or * codec.format != PG_FORMAT_BINARY): */ if (unlikely(__pyx_cur_scope->__pyx_v_codecs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 471, __pyx_L8_error) } __pyx_t_3 = __pyx_cur_scope->__pyx_v_codecs; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 471, __pyx_L8_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 471, __pyx_L8_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); #endif if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(0, 471, __pyx_L8_error) __Pyx_XGOTREF((PyObject *)__pyx_cur_scope->__pyx_v_codec); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":472 * * for codec in codecs: * if (not codec.has_encoder() or # <<<<<<<<<<<<<< * codec.format != PG_FORMAT_BINARY): * raise apg_exc.InternalClientError( */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_encoder(__pyx_cur_scope->__pyx_v_codec); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 472, __pyx_L8_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = (!__pyx_t_10); if (!__pyx_t_11) { } else { __pyx_t_1 = __pyx_t_11; goto __pyx_L18_bool_binop_done; } /* "asyncpg/protocol/protocol.pyx":473 * for codec in codecs: * if (not codec.has_encoder() or * codec.format != PG_FORMAT_BINARY): # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * 'no binary format encoder for ' */ __pyx_t_11 = (__pyx_cur_scope->__pyx_v_codec->format != __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY); __pyx_t_1 = __pyx_t_11; __pyx_L18_bool_binop_done:; /* "asyncpg/protocol/protocol.pyx":472 * * for codec in codecs: * if (not codec.has_encoder() or # <<<<<<<<<<<<<< * codec.format != PG_FORMAT_BINARY): * raise apg_exc.InternalClientError( */ if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/protocol.pyx":474 * if (not codec.has_encoder() or * codec.format != PG_FORMAT_BINARY): * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * 'no binary format encoder for ' * 'type {} (OID {})'.format(codec.name, codec.oid)) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 474, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":476 * raise apg_exc.InternalClientError( * 'no binary format encoder for ' * 'type {} (OID {})'.format(codec.name, codec.oid)) # <<<<<<<<<<<<<< * * if isinstance(records, collections.abc.AsyncIterable): */ __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_no_binary_format_encoder_for_typ, __pyx_n_s_format); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 476, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = __Pyx_PyInt_From_uint32_t(__pyx_cur_scope->__pyx_v_codec->oid); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 476, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_15, __pyx_cur_scope->__pyx_v_codec->name, __pyx_t_14}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 476, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __pyx_t_13 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_12))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_4}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 474, __pyx_L8_error) /* "asyncpg/protocol/protocol.pyx":472 * * for codec in codecs: * if (not codec.has_encoder() or # <<<<<<<<<<<<<< * codec.format != PG_FORMAT_BINARY): * raise apg_exc.InternalClientError( */ } /* "asyncpg/protocol/protocol.pyx":471 * settings = self.settings * * for codec in codecs: # <<<<<<<<<<<<<< * if (not codec.has_encoder() or * codec.format != PG_FORMAT_BINARY): */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":478 * 'type {} (OID {})'.format(codec.name, codec.oid)) * * if isinstance(records, collections.abc.AsyncIterable): # <<<<<<<<<<<<<< * async for row in records: * # Tuple header */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_collections); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_abc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_AsyncIterable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = PyObject_IsInstance(__pyx_cur_scope->__pyx_v_records, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 478, __pyx_L8_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":479 * * if isinstance(records, collections.abc.AsyncIterable): * async for row in records: # <<<<<<<<<<<<<< * # Tuple header * wbuf.write_int16(num_cols) */ __pyx_t_3 = __Pyx_Coroutine_GetAsyncIter(__pyx_cur_scope->__pyx_v_records); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 479, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); for (;;) { __pyx_t_2 = __Pyx_Coroutine_AsyncIterNext(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_t_0 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_2 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L24_resume_from_await:; __pyx_t_3 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_3); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_sent_value)) { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type && (exc_type == __Pyx_PyExc_StopAsyncIteration || ( exc_type != PyExc_StopIteration && exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, __Pyx_PyExc_StopAsyncIteration))))) { PyErr_Clear(); break; } __PYX_ERR(0, 479, __pyx_L8_error) } __pyx_t_2 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_2); } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type && (exc_type == __Pyx_PyExc_StopAsyncIteration || ( exc_type != PyExc_StopIteration && exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, __Pyx_PyExc_StopAsyncIteration))))) { PyErr_Clear(); break; } __pyx_t_2 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_2) < 0) __PYX_ERR(0, 479, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_row); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_row, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":481 * async for row in records: * # Tuple header * wbuf.write_int16(num_cols) # <<<<<<<<<<<<<< * # Tuple data * for i in range(num_cols): */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_wbuf->__pyx_vtab)->write_int16(__pyx_cur_scope->__pyx_v_wbuf, ((int16_t)__pyx_cur_scope->__pyx_v_num_cols)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":483 * wbuf.write_int16(num_cols) * # Tuple data * for i in range(num_cols): # <<<<<<<<<<<<<< * item = row[i] * if item is None: */ __pyx_t_16 = __pyx_cur_scope->__pyx_v_num_cols; __pyx_t_17 = __pyx_t_16; for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { __pyx_cur_scope->__pyx_v_i = __pyx_t_18; /* "asyncpg/protocol/protocol.pyx":484 * # Tuple data * for i in range(num_cols): * item = row[i] # <<<<<<<<<<<<<< * if item is None: * wbuf.write_int32(-1) */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_row, __pyx_cur_scope->__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_item); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_item, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":485 * for i in range(num_cols): * item = row[i] * if item is None: # <<<<<<<<<<<<<< * wbuf.write_int32(-1) * else: */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_item == Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":486 * item = row[i] * if item is None: * wbuf.write_int32(-1) # <<<<<<<<<<<<<< * else: * codec = cpython.PyTuple_GET_ITEM( */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_wbuf->__pyx_vtab)->write_int32(__pyx_cur_scope->__pyx_v_wbuf, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":485 * for i in range(num_cols): * item = row[i] * if item is None: # <<<<<<<<<<<<<< * wbuf.write_int32(-1) * else: */ goto __pyx_L27; } /* "asyncpg/protocol/protocol.pyx":488 * wbuf.write_int32(-1) * else: * codec = cpython.PyTuple_GET_ITEM( # <<<<<<<<<<<<<< * codecs, i) * codec.encode(settings, wbuf, item) */ /*else*/ { /* "asyncpg/protocol/protocol.pyx":489 * else: * codec = cpython.PyTuple_GET_ITEM( * codecs, i) # <<<<<<<<<<<<<< * codec.encode(settings, wbuf, item) * */ __pyx_t_19 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_codecs, __pyx_cur_scope->__pyx_v_i); /* "asyncpg/protocol/protocol.pyx":488 * wbuf.write_int32(-1) * else: * codec = cpython.PyTuple_GET_ITEM( # <<<<<<<<<<<<<< * codecs, i) * codec.encode(settings, wbuf, item) */ __pyx_t_2 = ((PyObject *)__pyx_t_19); __Pyx_INCREF(__pyx_t_2); __Pyx_XGOTREF((PyObject *)__pyx_cur_scope->__pyx_v_codec); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":490 * codec = cpython.PyTuple_GET_ITEM( * codecs, i) * codec.encode(settings, wbuf, item) # <<<<<<<<<<<<<< * * if wbuf.len() >= _COPY_BUFFER_SIZE: */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode(__pyx_cur_scope->__pyx_v_codec, __pyx_cur_scope->__pyx_v_settings, __pyx_cur_scope->__pyx_v_wbuf, __pyx_cur_scope->__pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L27:; } /* "asyncpg/protocol/protocol.pyx":492 * codec.encode(settings, wbuf, item) * * if wbuf.len() >= _COPY_BUFFER_SIZE: # <<<<<<<<<<<<<< * with timer: * await self.writing_allowed.wait() */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_cur_scope->__pyx_v_wbuf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = PyObject_RichCompare(__pyx_t_2, __pyx_int_524288, Py_GE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 492, __pyx_L8_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 492, __pyx_L8_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":493 * * if wbuf.len() >= _COPY_BUFFER_SIZE: * with timer: # <<<<<<<<<<<<<< * await self.writing_allowed.wait() * self._write_copy_data_msg(wbuf) */ /*with:*/ { __pyx_t_20 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_exit); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 493, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 493, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":494 * if wbuf.len() >= _COPY_BUFFER_SIZE: * with timer: * await self.writing_allowed.wait() # <<<<<<<<<<<<<< * self._write_copy_data_msg(wbuf) * wbuf = WriteBuffer.new() */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_writing_allowed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_wait); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 494, __pyx_L35_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_t_0 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_2 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_20); __pyx_cur_scope->__pyx_t_4 = __pyx_t_20; __Pyx_XGIVEREF(__pyx_t_21); __pyx_cur_scope->__pyx_t_5 = __pyx_t_21; __Pyx_XGIVEREF(__pyx_t_22); __pyx_cur_scope->__pyx_t_6 = __pyx_t_22; __Pyx_XGIVEREF(__pyx_t_23); __pyx_cur_scope->__pyx_t_7 = __pyx_t_23; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 4; return __pyx_r; __pyx_L43_resume_from_await:; __pyx_t_3 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_3); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_20 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_20); __pyx_t_21 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_21); __pyx_t_22 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_22); __pyx_t_23 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_23); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 494, __pyx_L35_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 494, __pyx_L35_error) } } /* "asyncpg/protocol/protocol.pyx":493 * * if wbuf.len() >= _COPY_BUFFER_SIZE: * with timer: # <<<<<<<<<<<<<< * await self.writing_allowed.wait() * self._write_copy_data_msg(wbuf) */ } __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; goto __pyx_L42_try_end; __pyx_L35_error:; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /*except:*/ { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_4, &__pyx_t_2) < 0) __PYX_ERR(0, 493, __pyx_L37_except_error) __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __pyx_t_13 = PyTuple_Pack(3, __pyx_t_12, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 493, __pyx_L37_except_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_13, NULL); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 493, __pyx_L37_except_error) __Pyx_GOTREF(__pyx_t_24); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_24); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; if (__pyx_t_1 < 0) __PYX_ERR(0, 493, __pyx_L37_except_error) __pyx_t_11 = (!__pyx_t_1); if (unlikely(__pyx_t_11)) { __Pyx_GIVEREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_ErrRestoreWithState(__pyx_t_12, __pyx_t_4, __pyx_t_2); __pyx_t_12 = 0; __pyx_t_4 = 0; __pyx_t_2 = 0; __PYX_ERR(0, 493, __pyx_L37_except_error) } __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L36_exception_handled; } __pyx_L37_except_error:; __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23); goto __pyx_L8_error; __pyx_L36_exception_handled:; __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23); __pyx_L42_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_20) { __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_tuple__49, NULL); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 493, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; } goto __pyx_L34; } __pyx_L34:; } goto __pyx_L47; __pyx_L29_error:; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; goto __pyx_L8_error; __pyx_L47:; } /* "asyncpg/protocol/protocol.pyx":495 * with timer: * await self.writing_allowed.wait() * self._write_copy_data_msg(wbuf) # <<<<<<<<<<<<<< * wbuf = WriteBuffer.new() * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._write_copy_data_msg(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject *)__pyx_cur_scope->__pyx_v_wbuf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":496 * await self.writing_allowed.wait() * self._write_copy_data_msg(wbuf) * wbuf = WriteBuffer.new() # <<<<<<<<<<<<<< * else: * for row in records: */ __pyx_t_2 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_wbuf); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_wbuf, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":492 * codec.encode(settings, wbuf, item) * * if wbuf.len() >= _COPY_BUFFER_SIZE: # <<<<<<<<<<<<<< * with timer: * await self.writing_allowed.wait() */ } /* "asyncpg/protocol/protocol.pyx":479 * * if isinstance(records, collections.abc.AsyncIterable): * async for row in records: # <<<<<<<<<<<<<< * # Tuple header * wbuf.write_int16(num_cols) */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":478 * 'type {} (OID {})'.format(codec.name, codec.oid)) * * if isinstance(records, collections.abc.AsyncIterable): # <<<<<<<<<<<<<< * async for row in records: * # Tuple header */ goto __pyx_L21; } /* "asyncpg/protocol/protocol.pyx":498 * wbuf = WriteBuffer.new() * else: * for row in records: # <<<<<<<<<<<<<< * # Tuple header * wbuf.write_int16(num_cols) */ /*else*/ { if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_records)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_records)) { __pyx_t_3 = __pyx_cur_scope->__pyx_v_records; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0; __pyx_t_25 = NULL; } else { __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_records); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 498, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_25 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 498, __pyx_L8_error) } for (;;) { if (likely(!__pyx_t_25)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 498, __pyx_L8_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 498, __pyx_L8_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 498, __pyx_L8_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 498, __pyx_L8_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_25(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 498, __pyx_L8_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_row); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_row, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":500 * for row in records: * # Tuple header * wbuf.write_int16(num_cols) # <<<<<<<<<<<<<< * # Tuple data * for i in range(num_cols): */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_wbuf->__pyx_vtab)->write_int16(__pyx_cur_scope->__pyx_v_wbuf, ((int16_t)__pyx_cur_scope->__pyx_v_num_cols)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":502 * wbuf.write_int16(num_cols) * # Tuple data * for i in range(num_cols): # <<<<<<<<<<<<<< * item = row[i] * if item is None: */ __pyx_t_16 = __pyx_cur_scope->__pyx_v_num_cols; __pyx_t_17 = __pyx_t_16; for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { __pyx_cur_scope->__pyx_v_i = __pyx_t_18; /* "asyncpg/protocol/protocol.pyx":503 * # Tuple data * for i in range(num_cols): * item = row[i] # <<<<<<<<<<<<<< * if item is None: * wbuf.write_int32(-1) */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_row, __pyx_cur_scope->__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_item); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_item, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":504 * for i in range(num_cols): * item = row[i] * if item is None: # <<<<<<<<<<<<<< * wbuf.write_int32(-1) * else: */ __pyx_t_11 = (__pyx_cur_scope->__pyx_v_item == Py_None); if (__pyx_t_11) { /* "asyncpg/protocol/protocol.pyx":505 * item = row[i] * if item is None: * wbuf.write_int32(-1) # <<<<<<<<<<<<<< * else: * codec = cpython.PyTuple_GET_ITEM( */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_wbuf->__pyx_vtab)->write_int32(__pyx_cur_scope->__pyx_v_wbuf, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":504 * for i in range(num_cols): * item = row[i] * if item is None: # <<<<<<<<<<<<<< * wbuf.write_int32(-1) * else: */ goto __pyx_L53; } /* "asyncpg/protocol/protocol.pyx":507 * wbuf.write_int32(-1) * else: * codec = cpython.PyTuple_GET_ITEM( # <<<<<<<<<<<<<< * codecs, i) * codec.encode(settings, wbuf, item) */ /*else*/ { /* "asyncpg/protocol/protocol.pyx":508 * else: * codec = cpython.PyTuple_GET_ITEM( * codecs, i) # <<<<<<<<<<<<<< * codec.encode(settings, wbuf, item) * */ __pyx_t_19 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_codecs, __pyx_cur_scope->__pyx_v_i); /* "asyncpg/protocol/protocol.pyx":507 * wbuf.write_int32(-1) * else: * codec = cpython.PyTuple_GET_ITEM( # <<<<<<<<<<<<<< * codecs, i) * codec.encode(settings, wbuf, item) */ __pyx_t_2 = ((PyObject *)__pyx_t_19); __Pyx_INCREF(__pyx_t_2); __Pyx_XGOTREF((PyObject *)__pyx_cur_scope->__pyx_v_codec); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":509 * codec = cpython.PyTuple_GET_ITEM( * codecs, i) * codec.encode(settings, wbuf, item) # <<<<<<<<<<<<<< * * if wbuf.len() >= _COPY_BUFFER_SIZE: */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode(__pyx_cur_scope->__pyx_v_codec, __pyx_cur_scope->__pyx_v_settings, __pyx_cur_scope->__pyx_v_wbuf, __pyx_cur_scope->__pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L53:; } /* "asyncpg/protocol/protocol.pyx":511 * codec.encode(settings, wbuf, item) * * if wbuf.len() >= _COPY_BUFFER_SIZE: # <<<<<<<<<<<<<< * with timer: * await self.writing_allowed.wait() */ __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_cur_scope->__pyx_v_wbuf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 511, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_int_524288, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 511, __pyx_L8_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 511, __pyx_L8_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_11) { /* "asyncpg/protocol/protocol.pyx":512 * * if wbuf.len() >= _COPY_BUFFER_SIZE: * with timer: # <<<<<<<<<<<<<< * await self.writing_allowed.wait() * self._write_copy_data_msg(wbuf) */ /*with:*/ { __pyx_t_20 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_exit); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 512, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L55_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L55_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_21); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":513 * if wbuf.len() >= _COPY_BUFFER_SIZE: * with timer: * await self.writing_allowed.wait() # <<<<<<<<<<<<<< * self._write_copy_data_msg(wbuf) * wbuf = WriteBuffer.new() */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_writing_allowed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_wait); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 513, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 513, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_t_0 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_1 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_2 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_3 = __pyx_t_8; __pyx_cur_scope->__pyx_t_8 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_t_20); __pyx_cur_scope->__pyx_t_4 = __pyx_t_20; __Pyx_XGIVEREF(__pyx_t_21); __pyx_cur_scope->__pyx_t_5 = __pyx_t_21; __Pyx_XGIVEREF(__pyx_t_22); __pyx_cur_scope->__pyx_t_6 = __pyx_t_22; __Pyx_XGIVEREF(__pyx_t_23); __pyx_cur_scope->__pyx_t_7 = __pyx_t_23; __pyx_cur_scope->__pyx_t_9 = __pyx_t_25; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 5; return __pyx_r; __pyx_L69_resume_from_await:; __pyx_t_3 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_3); __pyx_t_6 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_9 = __pyx_cur_scope->__pyx_t_8; __pyx_t_20 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_20); __pyx_t_21 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_21); __pyx_t_22 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_22); __pyx_t_23 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_23); __pyx_t_25 = __pyx_cur_scope->__pyx_t_9; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 513, __pyx_L61_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 513, __pyx_L61_error) } } /* "asyncpg/protocol/protocol.pyx":512 * * if wbuf.len() >= _COPY_BUFFER_SIZE: * with timer: # <<<<<<<<<<<<<< * await self.writing_allowed.wait() * self._write_copy_data_msg(wbuf) */ } __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; goto __pyx_L68_try_end; __pyx_L61_error:; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /*except:*/ { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_12, &__pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L63_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_2); __pyx_t_13 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_12, __pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 512, __pyx_L63_except_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_13, NULL); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 512, __pyx_L63_except_error) __Pyx_GOTREF(__pyx_t_24); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_24); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; if (__pyx_t_11 < 0) __PYX_ERR(0, 512, __pyx_L63_except_error) __pyx_t_1 = (!__pyx_t_11); if (unlikely(__pyx_t_1)) { __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_12, __pyx_t_2); __pyx_t_4 = 0; __pyx_t_12 = 0; __pyx_t_2 = 0; __PYX_ERR(0, 512, __pyx_L63_except_error) } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L62_exception_handled; } __pyx_L63_except_error:; __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_22, __pyx_t_21); goto __pyx_L8_error; __pyx_L62_exception_handled:; __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_22, __pyx_t_21); __pyx_L68_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_20) { __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_tuple__49, NULL); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 512, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; } goto __pyx_L60; } __pyx_L60:; } goto __pyx_L73; __pyx_L55_error:; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; goto __pyx_L8_error; __pyx_L73:; } /* "asyncpg/protocol/protocol.pyx":514 * with timer: * await self.writing_allowed.wait() * self._write_copy_data_msg(wbuf) # <<<<<<<<<<<<<< * wbuf = WriteBuffer.new() * */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._write_copy_data_msg(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject *)__pyx_cur_scope->__pyx_v_wbuf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":515 * await self.writing_allowed.wait() * self._write_copy_data_msg(wbuf) * wbuf = WriteBuffer.new() # <<<<<<<<<<<<<< * * # End of binary copy. */ __pyx_t_2 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_wbuf); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_wbuf, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":511 * codec.encode(settings, wbuf, item) * * if wbuf.len() >= _COPY_BUFFER_SIZE: # <<<<<<<<<<<<<< * with timer: * await self.writing_allowed.wait() */ } /* "asyncpg/protocol/protocol.pyx":498 * wbuf = WriteBuffer.new() * else: * for row in records: # <<<<<<<<<<<<<< * # Tuple header * wbuf.write_int16(num_cols) */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L21:; /* "asyncpg/protocol/protocol.pyx":518 * * # End of binary copy. * wbuf.write_int16(-1) # <<<<<<<<<<<<<< * self._write_copy_data_msg(wbuf) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_wbuf->__pyx_vtab)->write_int16(__pyx_cur_scope->__pyx_v_wbuf, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 518, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":519 * # End of binary copy. * wbuf.write_int16(-1) * self._write_copy_data_msg(wbuf) # <<<<<<<<<<<<<< * * elif reader is not None: */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._write_copy_data_msg(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject *)__pyx_cur_scope->__pyx_v_wbuf)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 519, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":456 * * try: * if record_stmt is not None: # <<<<<<<<<<<<<< * # copy_in_records in binary mode * wbuf = WriteBuffer.new() */ goto __pyx_L14; } /* "asyncpg/protocol/protocol.pyx":521 * self._write_copy_data_msg(wbuf) * * elif reader is not None: # <<<<<<<<<<<<<< * try: * aiter = reader.__aiter__ */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_reader != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":522 * * elif reader is not None: * try: # <<<<<<<<<<<<<< * aiter = reader.__aiter__ * except AttributeError: */ { __Pyx_ExceptionSave(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":523 * elif reader is not None: * try: * aiter = reader.__aiter__ # <<<<<<<<<<<<<< * except AttributeError: * raise TypeError('reader is not an asynchronous iterable') */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_reader, __pyx_n_s_aiter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 523, __pyx_L75_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_aiter = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":522 * * elif reader is not None: * try: # <<<<<<<<<<<<<< * aiter = reader.__aiter__ * except AttributeError: */ } /* "asyncpg/protocol/protocol.pyx":527 * raise TypeError('reader is not an asynchronous iterable') * else: * iterator = aiter() # <<<<<<<<<<<<<< * * try: */ /*else:*/ { __Pyx_INCREF(__pyx_cur_scope->__pyx_v_aiter); __pyx_t_2 = __pyx_cur_scope->__pyx_v_aiter; __pyx_t_12 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L77_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_iterator = __pyx_t_3; __pyx_t_3 = 0; } __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; goto __pyx_L80_try_end; __pyx_L75_error:; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":524 * try: * aiter = reader.__aiter__ * except AttributeError: # <<<<<<<<<<<<<< * raise TypeError('reader is not an asynchronous iterable') * else: */ __pyx_t_26 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_26) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_12) < 0) __PYX_ERR(0, 524, __pyx_L77_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_12); /* "asyncpg/protocol/protocol.pyx":525 * aiter = reader.__aiter__ * except AttributeError: * raise TypeError('reader is not an asynchronous iterable') # <<<<<<<<<<<<<< * else: * iterator = aiter() */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L77_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(0, 525, __pyx_L77_except_error) } goto __pyx_L77_except_error; /* "asyncpg/protocol/protocol.pyx":522 * * elif reader is not None: * try: # <<<<<<<<<<<<<< * aiter = reader.__aiter__ * except AttributeError: */ __pyx_L77_except_error:; __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); goto __pyx_L8_error; __pyx_L80_try_end:; } /* "asyncpg/protocol/protocol.pyx":529 * iterator = aiter() * * try: # <<<<<<<<<<<<<< * while True: * # We rely on protocol flow control to moderate the */ { __Pyx_ExceptionSave(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_20); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":530 * * try: * while True: # <<<<<<<<<<<<<< * # We rely on protocol flow control to moderate the * # rate of data messages. */ while (1) { /* "asyncpg/protocol/protocol.pyx":533 * # We rely on protocol flow control to moderate the * # rate of data messages. * with timer: # <<<<<<<<<<<<<< * await self.writing_allowed.wait() * with timer: */ /*with:*/ { __pyx_t_23 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_exit); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 533, __pyx_L83_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L91_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 533, __pyx_L91_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_24, &__pyx_t_27, &__pyx_t_28); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_27); __Pyx_XGOTREF(__pyx_t_28); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":534 * # rate of data messages. * with timer: * await self.writing_allowed.wait() # <<<<<<<<<<<<<< * with timer: * chunk = await compat.wait_for( */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_writing_allowed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L97_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_wait); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 534, __pyx_L97_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 534, __pyx_L97_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_0 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_1 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_2 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_20); __pyx_cur_scope->__pyx_t_3 = __pyx_t_20; __Pyx_XGIVEREF(__pyx_t_21); __pyx_cur_scope->__pyx_t_4 = __pyx_t_21; __Pyx_XGIVEREF(__pyx_t_22); __pyx_cur_scope->__pyx_t_5 = __pyx_t_22; __Pyx_XGIVEREF(__pyx_t_23); __pyx_cur_scope->__pyx_t_6 = __pyx_t_23; __Pyx_XGIVEREF(__pyx_t_24); __pyx_cur_scope->__pyx_t_7 = __pyx_t_24; __Pyx_XGIVEREF(__pyx_t_27); __pyx_cur_scope->__pyx_t_10 = __pyx_t_27; __Pyx_XGIVEREF(__pyx_t_28); __pyx_cur_scope->__pyx_t_11 = __pyx_t_28; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 6; return __pyx_r; __pyx_L105_resume_from_await:; __pyx_t_6 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_20 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_20); __pyx_t_21 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_21); __pyx_t_22 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_22); __pyx_t_23 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_23); __pyx_t_24 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_24); __pyx_t_27 = __pyx_cur_scope->__pyx_t_10; __pyx_cur_scope->__pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_t_27); __pyx_t_28 = __pyx_cur_scope->__pyx_t_11; __pyx_cur_scope->__pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_t_28); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 534, __pyx_L97_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 534, __pyx_L97_error) } } /* "asyncpg/protocol/protocol.pyx":533 * # We rely on protocol flow control to moderate the * # rate of data messages. * with timer: # <<<<<<<<<<<<<< * await self.writing_allowed.wait() * with timer: */ } __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0; goto __pyx_L104_try_end; __pyx_L97_error:; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /*except:*/ { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 533, __pyx_L99_except_error) __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_Pack(3, __pyx_t_12, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 533, __pyx_L99_except_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_29 = __Pyx_PyObject_Call(__pyx_t_23, __pyx_t_4, NULL); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 533, __pyx_L99_except_error) __Pyx_GOTREF(__pyx_t_29); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_29); __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; if (__pyx_t_1 < 0) __PYX_ERR(0, 533, __pyx_L99_except_error) __pyx_t_11 = (!__pyx_t_1); if (unlikely(__pyx_t_11)) { __Pyx_GIVEREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_ErrRestoreWithState(__pyx_t_12, __pyx_t_3, __pyx_t_2); __pyx_t_12 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __PYX_ERR(0, 533, __pyx_L99_except_error) } __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L98_exception_handled; } __pyx_L99_except_error:; __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_27); __Pyx_XGIVEREF(__pyx_t_28); __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_27, __pyx_t_28); goto __pyx_L83_error; __pyx_L98_exception_handled:; __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_27); __Pyx_XGIVEREF(__pyx_t_28); __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_27, __pyx_t_28); __pyx_L104_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_23) { __pyx_t_28 = __Pyx_PyObject_Call(__pyx_t_23, __pyx_tuple__49, NULL); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 533, __pyx_L83_error) __Pyx_GOTREF(__pyx_t_28); __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; } goto __pyx_L96; } __pyx_L96:; } goto __pyx_L109; __pyx_L91_error:; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; goto __pyx_L83_error; __pyx_L109:; } /* "asyncpg/protocol/protocol.pyx":535 * with timer: * await self.writing_allowed.wait() * with timer: # <<<<<<<<<<<<<< * chunk = await compat.wait_for( * iterator.__anext__(), */ /*with:*/ { __pyx_t_23 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_exit); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 535, __pyx_L83_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L110_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_12 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L110_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_28, &__pyx_t_27, &__pyx_t_24); __Pyx_XGOTREF(__pyx_t_28); __Pyx_XGOTREF(__pyx_t_27); __Pyx_XGOTREF(__pyx_t_24); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":536 * await self.writing_allowed.wait() * with timer: * chunk = await compat.wait_for( # <<<<<<<<<<<<<< * iterator.__anext__(), * timeout=timer.get_remaining_budget()) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_compat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_wait_for); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 536, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":537 * with timer: * chunk = await compat.wait_for( * iterator.__anext__(), # <<<<<<<<<<<<<< * timeout=timer.get_remaining_budget()) * self._write_copy_data_msg(chunk) */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_iterator, __pyx_n_s_anext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 537, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } /* "asyncpg/protocol/protocol.pyx":536 * await self.writing_allowed.wait() * with timer: * chunk = await compat.wait_for( # <<<<<<<<<<<<<< * iterator.__anext__(), * timeout=timer.get_remaining_budget()) */ __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 536, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2)) __PYX_ERR(0, 536, __pyx_L116_error); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":538 * chunk = await compat.wait_for( * iterator.__anext__(), * timeout=timer.get_remaining_budget()) # <<<<<<<<<<<<<< * self._write_copy_data_msg(chunk) * except builtins.StopAsyncIteration: */ __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_timer, __pyx_n_s_get_remaining_budget); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 538, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_timeout, __pyx_t_4) < 0) __PYX_ERR(0, 538, __pyx_L116_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":536 * await self.writing_allowed.wait() * with timer: * chunk = await compat.wait_for( # <<<<<<<<<<<<<< * iterator.__anext__(), * timeout=timer.get_remaining_budget()) */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 536, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_0 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_1 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_2 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_20); __pyx_cur_scope->__pyx_t_3 = __pyx_t_20; __Pyx_XGIVEREF(__pyx_t_21); __pyx_cur_scope->__pyx_t_4 = __pyx_t_21; __Pyx_XGIVEREF(__pyx_t_22); __pyx_cur_scope->__pyx_t_5 = __pyx_t_22; __Pyx_XGIVEREF(__pyx_t_23); __pyx_cur_scope->__pyx_t_6 = __pyx_t_23; __Pyx_XGIVEREF(__pyx_t_24); __pyx_cur_scope->__pyx_t_7 = __pyx_t_24; __Pyx_XGIVEREF(__pyx_t_27); __pyx_cur_scope->__pyx_t_10 = __pyx_t_27; __Pyx_XGIVEREF(__pyx_t_28); __pyx_cur_scope->__pyx_t_11 = __pyx_t_28; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 7; return __pyx_r; __pyx_L124_resume_from_await:; __pyx_t_6 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_20 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_20); __pyx_t_21 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_21); __pyx_t_22 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_22); __pyx_t_23 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_23); __pyx_t_24 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_24); __pyx_t_27 = __pyx_cur_scope->__pyx_t_10; __pyx_cur_scope->__pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_t_27); __pyx_t_28 = __pyx_cur_scope->__pyx_t_11; __pyx_cur_scope->__pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_t_28); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 536, __pyx_L116_error) __pyx_t_4 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_4 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_4) < 0) __PYX_ERR(0, 536, __pyx_L116_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_chunk); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_chunk, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":535 * with timer: * await self.writing_allowed.wait() * with timer: # <<<<<<<<<<<<<< * chunk = await compat.wait_for( * iterator.__anext__(), */ } __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0; __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; goto __pyx_L123_try_end; __pyx_L116_error:; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /*except:*/ { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_12) < 0) __PYX_ERR(0, 535, __pyx_L118_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_12); __pyx_t_3 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_2, __pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L118_except_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_29 = __Pyx_PyObject_Call(__pyx_t_23, __pyx_t_3, NULL); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 535, __pyx_L118_except_error) __Pyx_GOTREF(__pyx_t_29); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_29); __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; if (__pyx_t_11 < 0) __PYX_ERR(0, 535, __pyx_L118_except_error) __pyx_t_1 = (!__pyx_t_11); if (unlikely(__pyx_t_1)) { __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_2, __pyx_t_12); __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_12 = 0; __PYX_ERR(0, 535, __pyx_L118_except_error) } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L117_exception_handled; } __pyx_L118_except_error:; __Pyx_XGIVEREF(__pyx_t_28); __Pyx_XGIVEREF(__pyx_t_27); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ExceptionReset(__pyx_t_28, __pyx_t_27, __pyx_t_24); goto __pyx_L83_error; __pyx_L117_exception_handled:; __Pyx_XGIVEREF(__pyx_t_28); __Pyx_XGIVEREF(__pyx_t_27); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ExceptionReset(__pyx_t_28, __pyx_t_27, __pyx_t_24); __pyx_L123_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_23) { __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_23, __pyx_tuple__49, NULL); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 535, __pyx_L83_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; } goto __pyx_L115; } __pyx_L115:; } goto __pyx_L128; __pyx_L110_error:; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; goto __pyx_L83_error; __pyx_L128:; } /* "asyncpg/protocol/protocol.pyx":539 * iterator.__anext__(), * timeout=timer.get_remaining_budget()) * self._write_copy_data_msg(chunk) # <<<<<<<<<<<<<< * except builtins.StopAsyncIteration: * pass */ if (unlikely(!__pyx_cur_scope->__pyx_v_chunk)) { __Pyx_RaiseUnboundLocalError("chunk"); __PYX_ERR(0, 539, __pyx_L83_error) } __pyx_t_12 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._write_copy_data_msg(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_chunk); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 539, __pyx_L83_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } /* "asyncpg/protocol/protocol.pyx":529 * iterator = aiter() * * try: # <<<<<<<<<<<<<< * while True: * # We rely on protocol flow control to moderate the */ } __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; goto __pyx_L88_try_end; __pyx_L83_error:; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":540 * timeout=timer.get_remaining_budget()) * self._write_copy_data_msg(chunk) * except builtins.StopAsyncIteration: # <<<<<<<<<<<<<< * pass * else: */ __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_2, &__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_builtins); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L85_except_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_StopAsyncIteration); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 540, __pyx_L85_except_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_26 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_12, __pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_ErrRestore(__pyx_t_12, __pyx_t_2, __pyx_t_4); __pyx_t_12 = 0; __pyx_t_2 = 0; __pyx_t_4 = 0; if (__pyx_t_26) { __Pyx_ErrRestore(0,0,0); goto __pyx_L84_exception_handled; } goto __pyx_L85_except_error; /* "asyncpg/protocol/protocol.pyx":529 * iterator = aiter() * * try: # <<<<<<<<<<<<<< * while True: * # We rely on protocol flow control to moderate the */ __pyx_L85_except_error:; __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_21, __pyx_t_20); goto __pyx_L8_error; __pyx_L84_exception_handled:; __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_21, __pyx_t_20); __pyx_L88_try_end:; } /* "asyncpg/protocol/protocol.pyx":521 * self._write_copy_data_msg(wbuf) * * elif reader is not None: # <<<<<<<<<<<<<< * try: * aiter = reader.__aiter__ */ goto __pyx_L14; } /* "asyncpg/protocol/protocol.pyx":544 * else: * # Buffer passed in directly. * await self.writing_allowed.wait() # <<<<<<<<<<<<<< * self._write_copy_data_msg(data) * */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_writing_allowed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_wait); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 544, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 544, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_0 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_1 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_2 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 8; return __pyx_r; __pyx_L129_resume_from_await:; __pyx_t_6 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 544, __pyx_L8_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 544, __pyx_L8_error) } } /* "asyncpg/protocol/protocol.pyx":545 * # Buffer passed in directly. * await self.writing_allowed.wait() * self._write_copy_data_msg(data) # <<<<<<<<<<<<<< * * except asyncio.TimeoutError: */ __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._write_copy_data_msg(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L14:; /* "asyncpg/protocol/protocol.pyx":455 * self._copy_in(copy_stmt) * * try: # <<<<<<<<<<<<<< * if record_stmt is not None: * # copy_in_records in binary mode */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L13_try_end; __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":547 * self._write_copy_data_msg(data) * * except asyncio.TimeoutError: # <<<<<<<<<<<<<< * self._write_copy_fail_msg('TimeoutError') * self._on_timeout(self.waiter) */ __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_12, &__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 547, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_TimeoutError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_26 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_ErrRestore(__pyx_t_4, __pyx_t_12, __pyx_t_2); __pyx_t_4 = 0; __pyx_t_12 = 0; __pyx_t_2 = 0; if (__pyx_t_26) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_12, &__pyx_t_4) < 0) __PYX_ERR(0, 547, __pyx_L10_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_4); /* "asyncpg/protocol/protocol.pyx":548 * * except asyncio.TimeoutError: * self._write_copy_fail_msg('TimeoutError') # <<<<<<<<<<<<<< * self._on_timeout(self.waiter) * try: */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._write_copy_fail_msg(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_n_u_TimeoutError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 548, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":549 * except asyncio.TimeoutError: * self._write_copy_fail_msg('TimeoutError') * self._on_timeout(self.waiter) # <<<<<<<<<<<<<< * try: * await waiter */ __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_on_timeout); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 549, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_13))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_cur_scope->__pyx_v_self->waiter}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 549, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":550 * self._write_copy_fail_msg('TimeoutError') * self._on_timeout(self.waiter) * try: # <<<<<<<<<<<<<< * await waiter * except TimeoutError: */ { __Pyx_ExceptionSave(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":551 * self._on_timeout(self.waiter) * try: * await waiter # <<<<<<<<<<<<<< * except TimeoutError: * raise */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; __Pyx_XGIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_t_1 = __pyx_t_4; __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_2 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_3 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_4 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_t_5 = __pyx_t_12; __Pyx_XGIVEREF(__pyx_t_20); __pyx_cur_scope->__pyx_t_6 = __pyx_t_20; __Pyx_XGIVEREF(__pyx_t_21); __pyx_cur_scope->__pyx_t_7 = __pyx_t_21; __Pyx_XGIVEREF(__pyx_t_22); __pyx_cur_scope->__pyx_t_10 = __pyx_t_22; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_SwapException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 9; return __pyx_r; __pyx_L140_resume_from_await:; __pyx_t_2 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_2); __pyx_t_4 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_4); __pyx_t_6 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_8); __pyx_t_12 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_12); __pyx_t_20 = __pyx_cur_scope->__pyx_t_6; __pyx_cur_scope->__pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_t_20); __pyx_t_21 = __pyx_cur_scope->__pyx_t_7; __pyx_cur_scope->__pyx_t_7 = 0; __Pyx_XGOTREF(__pyx_t_21); __pyx_t_22 = __pyx_cur_scope->__pyx_t_10; __pyx_cur_scope->__pyx_t_10 = 0; __Pyx_XGOTREF(__pyx_t_22); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 551, __pyx_L132_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 551, __pyx_L132_error) } } /* "asyncpg/protocol/protocol.pyx":550 * self._write_copy_fail_msg('TimeoutError') * self._on_timeout(self.waiter) * try: # <<<<<<<<<<<<<< * await waiter * except TimeoutError: */ } /* "asyncpg/protocol/protocol.pyx":555 * raise * else: * raise apg_exc.InternalClientError('TimoutError was not raised') # <<<<<<<<<<<<<< * * except (Exception, asyncio.CancelledError) as e: */ /*else:*/ { __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 555, __pyx_L134_except_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 555, __pyx_L134_except_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_14))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_kp_u_TimoutError_was_not_raised}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L134_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(0, 555, __pyx_L134_except_error) } __pyx_L132_error:; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":552 * try: * await waiter * except TimeoutError: # <<<<<<<<<<<<<< * raise * else: */ __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_14, &__pyx_t_13); __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_TimeoutError); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 552, __pyx_L134_except_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_26 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_3, __pyx_t_15); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_ErrRestore(__pyx_t_3, __pyx_t_14, __pyx_t_13); __pyx_t_3 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; if (__pyx_t_26) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_3) < 0) __PYX_ERR(0, 552, __pyx_L134_except_error) __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_3); /* "asyncpg/protocol/protocol.pyx":553 * await waiter * except TimeoutError: * raise # <<<<<<<<<<<<<< * else: * raise apg_exc.InternalClientError('TimoutError was not raised') */ __Pyx_GIVEREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ErrRestoreWithState(__pyx_t_13, __pyx_t_14, __pyx_t_3); __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_3 = 0; __PYX_ERR(0, 553, __pyx_L134_except_error) } goto __pyx_L134_except_error; /* "asyncpg/protocol/protocol.pyx":550 * self._write_copy_fail_msg('TimeoutError') * self._on_timeout(self.waiter) * try: # <<<<<<<<<<<<<< * await waiter * except TimeoutError: */ __pyx_L134_except_error:; __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); goto __pyx_L10_except_error; } } /* "asyncpg/protocol/protocol.pyx":557 * raise apg_exc.InternalClientError('TimoutError was not raised') * * except (Exception, asyncio.CancelledError) as e: # <<<<<<<<<<<<<< * self._write_copy_fail_msg(str(e)) * self._request_cancel() */ __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_12, &__pyx_t_2); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CancelledError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 557, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_26 = __Pyx_PyErr_GivenExceptionMatches2(__pyx_t_4, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_14); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_ErrRestore(__pyx_t_4, __pyx_t_12, __pyx_t_2); __pyx_t_4 = 0; __pyx_t_12 = 0; __pyx_t_2 = 0; if (__pyx_t_26) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_12, &__pyx_t_4) < 0) __PYX_ERR(0, 557, __pyx_L10_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_cur_scope->__pyx_v_e = __pyx_t_12; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":558 * * except (Exception, asyncio.CancelledError) as e: * self._write_copy_fail_msg(str(e)) # <<<<<<<<<<<<<< * self._request_cancel() * # Make asyncio shut up about unretrieved QueryCanceledError */ __pyx_t_14 = __Pyx_PyObject_Unicode(__pyx_cur_scope->__pyx_v_e); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 558, __pyx_L148_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._write_copy_fail_msg(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject*)__pyx_t_14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L148_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":559 * except (Exception, asyncio.CancelledError) as e: * self._write_copy_fail_msg(str(e)) * self._request_cancel() # <<<<<<<<<<<<<< * # Make asyncio shut up about unretrieved QueryCanceledError * waiter.add_done_callback(lambda f: f.exception()) */ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_request_cancel); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 559, __pyx_L148_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_13 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_14))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 559, __pyx_L148_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":561 * self._request_cancel() * # Make asyncio shut up about unretrieved QueryCanceledError * waiter.add_done_callback(lambda f: f.exception()) # <<<<<<<<<<<<<< * raise * */ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_waiter, __pyx_n_s_add_done_callback); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 561, __pyx_L148_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_7copy_in_lambda7, 0, __pyx_n_s_copy_in_locals_lambda, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 561, __pyx_L148_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_15 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_14))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_13}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 561, __pyx_L148_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":562 * # Make asyncio shut up about unretrieved QueryCanceledError * waiter.add_done_callback(lambda f: f.exception()) * raise # <<<<<<<<<<<<<< * * self._write_copy_done_msg() */ __Pyx_GIVEREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_12, __pyx_t_4); __pyx_t_2 = 0; __pyx_t_12 = 0; __pyx_t_4 = 0; __PYX_ERR(0, 562, __pyx_L148_error) } /* "asyncpg/protocol/protocol.pyx":557 * raise apg_exc.InternalClientError('TimoutError was not raised') * * except (Exception, asyncio.CancelledError) as e: # <<<<<<<<<<<<<< * self._write_copy_fail_msg(str(e)) * self._request_cancel() */ /*finally:*/ { __pyx_L148_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_27 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_23, &__pyx_t_24, &__pyx_t_27); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_27); __pyx_t_26 = __pyx_lineno; __pyx_t_30 = __pyx_clineno; __pyx_t_31 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_e); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_e); __pyx_cur_scope->__pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_27); __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_24, __pyx_t_27); } __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ErrRestore(__pyx_t_22, __pyx_t_21, __pyx_t_20); __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_27 = 0; __pyx_lineno = __pyx_t_26; __pyx_clineno = __pyx_t_30; __pyx_filename = __pyx_t_31; goto __pyx_L10_except_error; } } } goto __pyx_L10_except_error; /* "asyncpg/protocol/protocol.pyx":455 * self._copy_in(copy_stmt) * * try: # <<<<<<<<<<<<<< * if record_stmt is not None: * # copy_in_records in binary mode */ __pyx_L10_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L13_try_end:; } /* "asyncpg/protocol/protocol.pyx":564 * raise * * self._write_copy_done_msg() # <<<<<<<<<<<<<< * * status_msg = await waiter */ __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._write_copy_done_msg(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":566 * self._write_copy_done_msg() * * status_msg = await waiter # <<<<<<<<<<<<<< * * return status_msg */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 10; return __pyx_r; __pyx_L154_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 566, __pyx_L1_error) __pyx_t_4 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_4 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_4) < 0) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_GIVEREF(__pyx_t_4); __pyx_cur_scope->__pyx_v_status_msg = __pyx_t_4; __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":568 * status_msg = await waiter * * return status_msg # <<<<<<<<<<<<<< * * @cython.iterable_coroutine */ __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_status_msg); goto __pyx_L0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "asyncpg/protocol/protocol.pyx":431 * return status_msg * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def copy_in(self, copy_stmt, reader, data, * records, PreparedStatementState record_stmt, timeout): */ /* function exit code */ __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_39generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":570 * return status_msg * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def close_statement(self, PreparedStatementState state, timeout): * if self.cancel_waiter is not None: */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_38close_statement(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_38close_statement = {"close_statement", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_38close_statement, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_38close_statement(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state = 0; PyObject *__pyx_v_timeout = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close_statement (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,&__pyx_n_s_timeout,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 570, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 570, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("close_statement", 1, 2, 2, 1); __PYX_ERR(0, 570, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "close_statement") < 0)) __PYX_ERR(0, 570, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_state = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)values[0]); __pyx_v_timeout = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("close_statement", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 570, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.close_statement", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 1, "state", 0))) __PYX_ERR(0, 571, __pyx_L1_error) __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_37close_statement(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_state, __pyx_v_timeout); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_37close_statement(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_timeout) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("close_statement", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 570, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_state = __pyx_v_state; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_state); __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout); { __pyx_CoroutineObject *gen = __Pyx_IterableCoroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_39generator9, __pyx_codeobj__57, (PyObject *) __pyx_cur_scope, __pyx_n_s_close_statement, __pyx_n_s_BaseProtocol_close_statement, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.close_statement", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_39generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *)__pyx_generator->closure); PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_t_13; char const *__pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close_statement", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L5_resume_from_await; case 2: goto __pyx_L7_resume_from_await; case 3: goto __pyx_L29_resume_from_await; case 4: goto __pyx_L32_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 570, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":572 * @cython.iterable_coroutine * async def close_statement(self, PreparedStatementState state, timeout): * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":573 * async def close_statement(self, PreparedStatementState state, timeout): * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L5_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 573, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 573, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":572 * @cython.iterable_coroutine * async def close_statement(self, PreparedStatementState state, timeout): * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * if self.cancel_sent_waiter is not None: */ } /* "asyncpg/protocol/protocol.pyx":574 * if self.cancel_waiter is not None: * await self.cancel_waiter * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":575 * await self.cancel_waiter * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 575, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 575, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":576 * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter * self.cancel_sent_waiter = None # <<<<<<<<<<<<<< * * self._check_state() */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":574 * if self.cancel_waiter is not None: * await self.cancel_waiter * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ } /* "asyncpg/protocol/protocol.pyx":578 * self.cancel_sent_waiter = None * * self._check_state() # <<<<<<<<<<<<<< * * if state.refs != 0: */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_check_state(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":580 * self._check_state() * * if state.refs != 0: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * 'cannot close prepared statement; refs == {} != 0'.format( */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_state->refs != 0); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/protocol.pyx":581 * * if state.refs != 0: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * 'cannot close prepared statement; refs == {} != 0'.format( * state.refs)) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":582 * if state.refs != 0: * raise apg_exc.InternalClientError( * 'cannot close prepared statement; refs == {} != 0'.format( # <<<<<<<<<<<<<< * state.refs)) * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_cannot_close_prepared_statement, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "asyncpg/protocol/protocol.pyx":583 * raise apg_exc.InternalClientError( * 'cannot close prepared statement; refs == {} != 0'.format( * state.refs)) # <<<<<<<<<<<<<< * * timeout = self._get_timeout_impl(timeout) */ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_state->refs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 581, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":580 * self._check_state() * * if state.refs != 0: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * 'cannot close prepared statement; refs == {} != 0'.format( */ } /* "asyncpg/protocol/protocol.pyx":585 * state.refs)) * * timeout = self._get_timeout_impl(timeout) # <<<<<<<<<<<<<< * waiter = self._new_waiter(timeout) * try: */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":586 * * timeout = self._get_timeout_impl(timeout) * waiter = self._new_waiter(timeout) # <<<<<<<<<<<<<< * try: * self._close(state.name, False) # network op */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_waiter = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":587 * timeout = self._get_timeout_impl(timeout) * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._close(state.name, False) # network op * state.closed = True */ /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":588 * waiter = self._new_waiter(timeout) * try: * self._close(state.name, False) # network op # <<<<<<<<<<<<<< * state.closed = True * except Exception as ex: */ __pyx_t_2 = __pyx_cur_scope->__pyx_v_state->name; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._close(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject*)__pyx_t_2), 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":589 * try: * self._close(state.name, False) # network op * state.closed = True # <<<<<<<<<<<<<< * except Exception as ex: * waiter.set_exception(ex) */ __pyx_cur_scope->__pyx_v_state->closed = 1; /* "asyncpg/protocol/protocol.pyx":587 * timeout = self._get_timeout_impl(timeout) * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._close(state.name, False) # network op * state.closed = True */ } __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L17_try_end; __pyx_L12_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "asyncpg/protocol/protocol.pyx":590 * self._close(state.name, False) # network op * state.closed = True * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_12) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.close_statement", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 590, __pyx_L14_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_ex = __pyx_t_2; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":591 * state.closed = True * except Exception as ex: * waiter.set_exception(ex) # <<<<<<<<<<<<<< * self._coreproto_error() * finally: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 591, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_ex}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 591, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":592 * except Exception as ex: * waiter.set_exception(ex) * self._coreproto_error() # <<<<<<<<<<<<<< * finally: * return await waiter */ __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_coreproto_error(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 592, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* "asyncpg/protocol/protocol.pyx":590 * self._close(state.name, False) # network op * state.closed = True * except Exception as ex: # <<<<<<<<<<<<<< * waiter.set_exception(ex) * self._coreproto_error() */ /*finally:*/ { /*normal exit:*/{ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0; goto __pyx_L24; } __pyx_L23_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __pyx_t_12 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename; { __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); } __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17); __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; goto __pyx_L14_except_error; } __pyx_L24:; } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L13_exception_handled; } goto __pyx_L14_except_error; /* "asyncpg/protocol/protocol.pyx":587 * timeout = self._get_timeout_impl(timeout) * waiter = self._new_waiter(timeout) * try: # <<<<<<<<<<<<<< * self._close(state.name, False) # network op * state.closed = True */ __pyx_L14_except_error:; __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); goto __pyx_L10_error; __pyx_L13_exception_handled:; __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); __pyx_L17_try_end:; } } /* "asyncpg/protocol/protocol.pyx":594 * self._coreproto_error() * finally: * return await waiter # <<<<<<<<<<<<<< * * def is_closed(self): */ /*finally:*/ { /*normal exit:*/{ __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L29_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 594, __pyx_L1_error) __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_3 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_3) < 0) __PYX_ERR(0, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } __pyx_L10_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_18); { __Pyx_XDECREF(__pyx_r); __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_9); __pyx_cur_scope->__pyx_t_0 = __pyx_t_9; __Pyx_XGIVEREF(__pyx_t_10); __pyx_cur_scope->__pyx_t_1 = __pyx_t_10; __Pyx_XGIVEREF(__pyx_t_11); __pyx_cur_scope->__pyx_t_2 = __pyx_t_11; __Pyx_XGIVEREF(__pyx_t_18); __pyx_cur_scope->__pyx_t_3 = __pyx_t_18; __Pyx_XGIVEREF(__pyx_t_19); __pyx_cur_scope->__pyx_t_4 = __pyx_t_19; __Pyx_XGIVEREF(__pyx_t_20); __pyx_cur_scope->__pyx_t_5 = __pyx_t_20; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 4; return __pyx_r; __pyx_L32_resume_from_await:; __pyx_t_9 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_9); __pyx_t_10 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_10); __pyx_t_11 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_11); __pyx_t_18 = __pyx_cur_scope->__pyx_t_3; __pyx_cur_scope->__pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_t_18); __pyx_t_19 = __pyx_cur_scope->__pyx_t_4; __pyx_cur_scope->__pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_t_19); __pyx_t_20 = __pyx_cur_scope->__pyx_t_5; __pyx_cur_scope->__pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_t_20); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 594, __pyx_L31_error) __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_3 = NULL; if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_3) < 0) __PYX_ERR(0, 594, __pyx_L31_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L30_return; } __pyx_L30_return:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18); } __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; goto __pyx_L0; __pyx_L31_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18); } __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; goto __pyx_L1_error; } } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "asyncpg/protocol/protocol.pyx":570 * return status_msg * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def close_statement(self, PreparedStatementState state, timeout): * if self.cancel_waiter is not None: */ /* function exit code */ __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("close_statement", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":596 * return await waiter * * def is_closed(self): # <<<<<<<<<<<<<< * return self.closing * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_41is_closed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_41is_closed = {"is_closed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_41is_closed, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_41is_closed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_closed (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_closed", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_closed", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_40is_closed(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_40is_closed(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_closed", 1); /* "asyncpg/protocol/protocol.pyx":597 * * def is_closed(self): * return self.closing # <<<<<<<<<<<<<< * * def is_connected(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->closing); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":596 * return await waiter * * def is_closed(self): # <<<<<<<<<<<<<< * return self.closing * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.is_closed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":599 * return self.closing * * def is_connected(self): # <<<<<<<<<<<<<< * return not self.closing and self.con_status == CONNECTION_OK * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_43is_connected(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_43is_connected = {"is_connected", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_43is_connected, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_43is_connected(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_connected (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_connected", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_connected", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_42is_connected(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_42is_connected(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_connected", 1); /* "asyncpg/protocol/protocol.pyx":600 * * def is_connected(self): * return not self.closing and self.con_status == CONNECTION_OK # <<<<<<<<<<<<<< * * def abort(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = (!__pyx_v_self->closing); if (__pyx_t_2) { } else { __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L3_bool_binop_done; } __pyx_t_2 = (__pyx_v_self->__pyx_base.con_status == __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_OK); __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; __pyx_L3_bool_binop_done:; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":599 * return self.closing * * def is_connected(self): # <<<<<<<<<<<<<< * return not self.closing and self.con_status == CONNECTION_OK * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.is_connected", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":602 * return not self.closing and self.con_status == CONNECTION_OK * * def abort(self): # <<<<<<<<<<<<<< * if self.closing: * return */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_45abort(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_45abort = {"abort", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_45abort, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_45abort(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("abort (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("abort", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "abort", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_44abort(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_44abort(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("abort", 1); /* "asyncpg/protocol/protocol.pyx":603 * * def abort(self): * if self.closing: # <<<<<<<<<<<<<< * return * self.closing = True */ if (__pyx_v_self->closing) { /* "asyncpg/protocol/protocol.pyx":604 * def abort(self): * if self.closing: * return # <<<<<<<<<<<<<< * self.closing = True * self._handle_waiter_on_connection_lost(None) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":603 * * def abort(self): * if self.closing: # <<<<<<<<<<<<<< * return * self.closing = True */ } /* "asyncpg/protocol/protocol.pyx":605 * if self.closing: * return * self.closing = True # <<<<<<<<<<<<<< * self._handle_waiter_on_connection_lost(None) * self._terminate() */ __pyx_v_self->closing = 1; /* "asyncpg/protocol/protocol.pyx":606 * return * self.closing = True * self._handle_waiter_on_connection_lost(None) # <<<<<<<<<<<<<< * self._terminate() * self.transport.abort() */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_handle_waiter_on_connection_lost(__pyx_v_self, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":607 * self.closing = True * self._handle_waiter_on_connection_lost(None) * self._terminate() # <<<<<<<<<<<<<< * self.transport.abort() * self.transport = None */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._terminate(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":608 * self._handle_waiter_on_connection_lost(None) * self._terminate() * self.transport.abort() # <<<<<<<<<<<<<< * self.transport = None * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.transport, __pyx_n_s_abort); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":609 * self._terminate() * self.transport.abort() * self.transport = None # <<<<<<<<<<<<<< * * @cython.iterable_coroutine */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->__pyx_base.transport); __Pyx_DECREF(__pyx_v_self->__pyx_base.transport); __pyx_v_self->__pyx_base.transport = Py_None; /* "asyncpg/protocol/protocol.pyx":602 * return not self.closing and self.con_status == CONNECTION_OK * * def abort(self): # <<<<<<<<<<<<<< * if self.closing: * return */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.abort", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_48generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":611 * self.transport = None * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def close(self, timeout): * if self.closing: */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_47close(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_47close = {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_47close, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_47close(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_timeout = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 611, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "close") < 0)) __PYX_ERR(0, 611, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_timeout = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("close", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 611, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.close", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_46close(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_timeout); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_46close(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_timeout) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("close", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 611, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout); { __pyx_CoroutineObject *gen = __Pyx_IterableCoroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_48generator10, __pyx_codeobj__58, (PyObject *) __pyx_cur_scope, __pyx_n_s_close, __pyx_n_s_BaseProtocol_close, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 611, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.close", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_48generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *)__pyx_generator->closure); PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_t_11; char const *__pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L6_resume_from_await; case 2: goto __pyx_L8_resume_from_await; case 3: goto __pyx_L10_resume_from_await; case 4: goto __pyx_L12_resume_from_await; case 5: goto __pyx_L22_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 611, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":613 * @cython.iterable_coroutine * async def close(self, timeout): * if self.closing: # <<<<<<<<<<<<<< * return * */ if (__pyx_cur_scope->__pyx_v_self->closing) { /* "asyncpg/protocol/protocol.pyx":614 * async def close(self, timeout): * if self.closing: * return # <<<<<<<<<<<<<< * * self.closing = True */ __Pyx_XDECREF(__pyx_r); __pyx_r = NULL; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":613 * @cython.iterable_coroutine * async def close(self, timeout): * if self.closing: # <<<<<<<<<<<<<< * return * */ } /* "asyncpg/protocol/protocol.pyx":616 * return * * self.closing = True # <<<<<<<<<<<<<< * * if self.cancel_sent_waiter is not None: */ __pyx_cur_scope->__pyx_v_self->closing = 1; /* "asyncpg/protocol/protocol.pyx":618 * self.closing = True * * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":619 * * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L6_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 619, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 619, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":620 * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter * self.cancel_sent_waiter = None # <<<<<<<<<<<<<< * * if self.cancel_waiter is not None: */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":618 * self.closing = True * * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ } /* "asyncpg/protocol/protocol.pyx":622 * self.cancel_sent_waiter = None * * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":623 * * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * * if self.waiter is not None: */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L8_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 623, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 623, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":622 * self.cancel_sent_waiter = None * * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * */ } /* "asyncpg/protocol/protocol.pyx":625 * await self.cancel_waiter * * if self.waiter is not None: # <<<<<<<<<<<<<< * # If there is a query running, cancel it * self._request_cancel() */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":627 * if self.waiter is not None: * # If there is a query running, cancel it * self._request_cancel() # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_request_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":628 * # If there is a query running, cancel it * self._request_cancel() * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * if self.cancel_waiter is not None: */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 3; return __pyx_r; __pyx_L10_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 628, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 628, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":629 * self._request_cancel() * await self.cancel_sent_waiter * self.cancel_sent_waiter = None # <<<<<<<<<<<<<< * if self.cancel_waiter is not None: * await self.cancel_waiter */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":630 * await self.cancel_sent_waiter * self.cancel_sent_waiter = None * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":631 * self.cancel_sent_waiter = None * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * * assert self.waiter is None */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 4; return __pyx_r; __pyx_L12_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 631, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 631, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":630 * await self.cancel_sent_waiter * self.cancel_sent_waiter = None * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * */ } /* "asyncpg/protocol/protocol.pyx":625 * await self.cancel_waiter * * if self.waiter is not None: # <<<<<<<<<<<<<< * # If there is a query running, cancel it * self._request_cancel() */ } /* "asyncpg/protocol/protocol.pyx":633 * await self.cancel_waiter * * assert self.waiter is None # <<<<<<<<<<<<<< * * timeout = self._get_timeout_impl(timeout) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->waiter == Py_None); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 633, __pyx_L1_error) } } #else if ((1)); else __PYX_ERR(0, 633, __pyx_L1_error) #endif /* "asyncpg/protocol/protocol.pyx":635 * assert self.waiter is None * * timeout = self._get_timeout_impl(timeout) # <<<<<<<<<<<<<< * * # Ask the server to terminate the connection and wait for it */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":639 * # Ask the server to terminate the connection and wait for it * # to drop. * self.waiter = self._new_waiter(timeout) # <<<<<<<<<<<<<< * self._terminate() * try: */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->waiter); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->waiter); __pyx_cur_scope->__pyx_v_self->waiter = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":640 * # to drop. * self.waiter = self._new_waiter(timeout) * self._terminate() # <<<<<<<<<<<<<< * try: * await self.waiter */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._terminate(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":641 * self.waiter = self._new_waiter(timeout) * self._terminate() * try: # <<<<<<<<<<<<<< * await self.waiter * except ConnectionResetError: */ /*try:*/ { { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":642 * self._terminate() * try: * await self.waiter # <<<<<<<<<<<<<< * except ConnectionResetError: * # There appears to be a difference in behaviour of asyncio */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_t_6); __pyx_cur_scope->__pyx_t_0 = __pyx_t_6; __Pyx_XGIVEREF(__pyx_t_7); __pyx_cur_scope->__pyx_t_1 = __pyx_t_7; __Pyx_XGIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_t_2 = __pyx_t_8; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 5; return __pyx_r; __pyx_L22_resume_from_await:; __pyx_t_6 = __pyx_cur_scope->__pyx_t_0; __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_6); __pyx_t_7 = __pyx_cur_scope->__pyx_t_1; __pyx_cur_scope->__pyx_t_1 = 0; __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __pyx_cur_scope->__pyx_t_2; __pyx_cur_scope->__pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 642, __pyx_L16_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 642, __pyx_L16_error) } } /* "asyncpg/protocol/protocol.pyx":641 * self.waiter = self._new_waiter(timeout) * self._terminate() * try: # <<<<<<<<<<<<<< * await self.waiter * except ConnectionResetError: */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L21_try_end; __pyx_L16_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":643 * try: * await self.waiter * except ConnectionResetError: # <<<<<<<<<<<<<< * # There appears to be a difference in behaviour of asyncio * # in Windows, where, instead of calling protocol.connection_lost() */ __Pyx_ErrFetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_ConnectionResetError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 643, __pyx_L18_except_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_2, __pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_ErrRestore(__pyx_t_2, __pyx_t_3, __pyx_t_4); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; if (__pyx_t_10) { __Pyx_ErrRestore(0,0,0); goto __pyx_L17_exception_handled; } goto __pyx_L18_except_error; /* "asyncpg/protocol/protocol.pyx":641 * self.waiter = self._new_waiter(timeout) * self._terminate() * try: # <<<<<<<<<<<<<< * await self.waiter * except ConnectionResetError: */ __pyx_L18_except_error:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L14_error; __pyx_L17_exception_handled:; __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_L21_try_end:; } } /* "asyncpg/protocol/protocol.pyx":649 * pass * finally: * self.waiter = None # <<<<<<<<<<<<<< * self.transport.abort() * */ /*finally:*/ { /*normal exit:*/{ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->waiter); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->waiter); __pyx_cur_scope->__pyx_v_self->waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":650 * finally: * self.waiter = None * self.transport.abort() # <<<<<<<<<<<<<< * * def _request_cancel(self): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->__pyx_base.transport, __pyx_n_s_abort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L15; } __pyx_L14_error:; /*exception exit:*/{ __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; { /* "asyncpg/protocol/protocol.pyx":649 * pass * finally: * self.waiter = None # <<<<<<<<<<<<<< * self.transport.abort() * */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->waiter); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->waiter); __pyx_cur_scope->__pyx_v_self->waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":650 * finally: * self.waiter = None * self.transport.abort() # <<<<<<<<<<<<<< * * def _request_cancel(self): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->__pyx_base.transport, __pyx_n_s_abort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 650, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 650, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_7, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; goto __pyx_L1_error; __pyx_L24_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; goto __pyx_L1_error; } __pyx_L15:; } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "asyncpg/protocol/protocol.pyx":611 * self.transport = None * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def close(self, timeout): * if self.closing: */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("close", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":652 * self.transport.abort() * * def _request_cancel(self): # <<<<<<<<<<<<<< * self.cancel_waiter = self.create_future() * self.cancel_sent_waiter = self.create_future() */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_50_request_cancel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_50_request_cancel = {"_request_cancel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_50_request_cancel, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_50_request_cancel(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_request_cancel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_request_cancel", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_request_cancel", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_49_request_cancel(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_49_request_cancel(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_v_con = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_request_cancel", 1); /* "asyncpg/protocol/protocol.pyx":653 * * def _request_cancel(self): * self.cancel_waiter = self.create_future() # <<<<<<<<<<<<<< * self.cancel_sent_waiter = self.create_future() * */ __Pyx_INCREF(__pyx_v_self->create_future); __pyx_t_2 = __pyx_v_self->create_future; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->cancel_waiter); __Pyx_DECREF(__pyx_v_self->cancel_waiter); __pyx_v_self->cancel_waiter = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":654 * def _request_cancel(self): * self.cancel_waiter = self.create_future() * self.cancel_sent_waiter = self.create_future() # <<<<<<<<<<<<<< * * con = self.get_connection() */ __Pyx_INCREF(__pyx_v_self->create_future); __pyx_t_2 = __pyx_v_self->create_future; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->cancel_sent_waiter); __Pyx_DECREF(__pyx_v_self->cancel_sent_waiter); __pyx_v_self->cancel_sent_waiter = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":656 * self.cancel_sent_waiter = self.create_future() * * con = self.get_connection() # <<<<<<<<<<<<<< * if con is not None: * # if 'con' is None it means that the connection object has been */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_connection(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_con = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":657 * * con = self.get_connection() * if con is not None: # <<<<<<<<<<<<<< * # if 'con' is None it means that the connection object has been * # garbage collected and that the transport will soon be aborted. */ __pyx_t_5 = (__pyx_v_con != Py_None); if (__pyx_t_5) { /* "asyncpg/protocol/protocol.pyx":660 * # if 'con' is None it means that the connection object has been * # garbage collected and that the transport will soon be aborted. * con._cancel_current_command(self.cancel_sent_waiter) # <<<<<<<<<<<<<< * else: * self.loop.call_exception_handler({ */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_con, __pyx_n_s_cancel_current_command); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self->cancel_sent_waiter}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":657 * * con = self.get_connection() * if con is not None: # <<<<<<<<<<<<<< * # if 'con' is None it means that the connection object has been * # garbage collected and that the transport will soon be aborted. */ goto __pyx_L3; } /* "asyncpg/protocol/protocol.pyx":662 * con._cancel_current_command(self.cancel_sent_waiter) * else: * self.loop.call_exception_handler({ # <<<<<<<<<<<<<< * 'message': 'asyncpg.Protocol has no reference to its ' * 'Connection object and yet a cancellation ' */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->loop, __pyx_n_s_call_exception_handler); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/protocol.pyx":663 * else: * self.loop.call_exception_handler({ * 'message': 'asyncpg.Protocol has no reference to its ' # <<<<<<<<<<<<<< * 'Connection object and yet a cancellation ' * 'was requested. Please report this at ' */ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_message, __pyx_kp_u_asyncpg_Protocol_has_no_referenc) < 0) __PYX_ERR(0, 663, __pyx_L1_error) __pyx_t_6 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":668 * 'github.com/magicstack/asyncpg.' * }) * self.abort() # <<<<<<<<<<<<<< * * if self.state == PROTOCOL_PREPARE: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_abort); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "asyncpg/protocol/protocol.pyx":670 * self.abort() * * if self.state == PROTOCOL_PREPARE: # <<<<<<<<<<<<<< * # we need to send a SYNC to server if we cancel during the PREPARE phase * # because the PREPARE sequence does not send a SYNC itself. */ __pyx_t_5 = (__pyx_v_self->__pyx_base.state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_PREPARE); if (__pyx_t_5) { /* "asyncpg/protocol/protocol.pyx":676 * # because then we would issue two SYNCs and we would get two ReadyForQuery * # replies, which our current state machine implementation cannot handle * self._write(SYNC_MESSAGE) # <<<<<<<<<<<<<< * self._set_state(PROTOCOL_CANCELLED) * */ __pyx_t_1 = __pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._write(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 676, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":670 * self.abort() * * if self.state == PROTOCOL_PREPARE: # <<<<<<<<<<<<<< * # we need to send a SYNC to server if we cancel during the PREPARE phase * # because the PREPARE sequence does not send a SYNC itself. */ } /* "asyncpg/protocol/protocol.pyx":677 * # replies, which our current state machine implementation cannot handle * self._write(SYNC_MESSAGE) * self._set_state(PROTOCOL_CANCELLED) # <<<<<<<<<<<<<< * * def _on_timeout(self, fut): */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._set_state(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self), __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CANCELLED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":652 * self.transport.abort() * * def _request_cancel(self): # <<<<<<<<<<<<<< * self.cancel_waiter = self.create_future() * self.cancel_sent_waiter = self.create_future() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._request_cancel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_con); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":679 * self._set_state(PROTOCOL_CANCELLED) * * def _on_timeout(self, fut): # <<<<<<<<<<<<<< * if self.waiter is not fut or fut.done() or \ * self.cancel_waiter is not None or \ */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_52_on_timeout(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_52_on_timeout = {"_on_timeout", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_52_on_timeout, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_52_on_timeout(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fut = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_on_timeout (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fut,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fut)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 679, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_on_timeout") < 0)) __PYX_ERR(0, 679, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_fut = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_on_timeout", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 679, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_timeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_51_on_timeout(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_fut); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_51_on_timeout(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_fut) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_timeout", 1); /* "asyncpg/protocol/protocol.pyx":680 * * def _on_timeout(self, fut): * if self.waiter is not fut or fut.done() or \ # <<<<<<<<<<<<<< * self.cancel_waiter is not None or \ * self.timeout_handle is None: */ __pyx_t_2 = (__pyx_v_self->waiter != __pyx_v_fut); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_fut, __pyx_n_s_done); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } /* "asyncpg/protocol/protocol.pyx":681 * def _on_timeout(self, fut): * if self.waiter is not fut or fut.done() or \ * self.cancel_waiter is not None or \ # <<<<<<<<<<<<<< * self.timeout_handle is None: * return */ __pyx_t_2 = (__pyx_v_self->cancel_waiter != Py_None); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } /* "asyncpg/protocol/protocol.pyx":682 * if self.waiter is not fut or fut.done() or \ * self.cancel_waiter is not None or \ * self.timeout_handle is None: # <<<<<<<<<<<<<< * return * self._request_cancel() */ __pyx_t_2 = (__pyx_v_self->timeout_handle == Py_None); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; /* "asyncpg/protocol/protocol.pyx":680 * * def _on_timeout(self, fut): * if self.waiter is not fut or fut.done() or \ # <<<<<<<<<<<<<< * self.cancel_waiter is not None or \ * self.timeout_handle is None: */ if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":683 * self.cancel_waiter is not None or \ * self.timeout_handle is None: * return # <<<<<<<<<<<<<< * self._request_cancel() * self.waiter.set_exception(asyncio.TimeoutError()) */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":680 * * def _on_timeout(self, fut): * if self.waiter is not fut or fut.done() or \ # <<<<<<<<<<<<<< * self.cancel_waiter is not None or \ * self.timeout_handle is None: */ } /* "asyncpg/protocol/protocol.pyx":684 * self.timeout_handle is None: * return * self._request_cancel() # <<<<<<<<<<<<<< * self.waiter.set_exception(asyncio.TimeoutError()) * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_request_cancel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":685 * return * self._request_cancel() * self.waiter.set_exception(asyncio.TimeoutError()) # <<<<<<<<<<<<<< * * def _on_waiter_completed(self, fut): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_TimeoutError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_8 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":679 * self._set_state(PROTOCOL_CANCELLED) * * def _on_timeout(self, fut): # <<<<<<<<<<<<<< * if self.waiter is not fut or fut.done() or \ * self.cancel_waiter is not None or \ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_timeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":687 * self.waiter.set_exception(asyncio.TimeoutError()) * * def _on_waiter_completed(self, fut): # <<<<<<<<<<<<<< * if self.timeout_handle: * self.timeout_handle.cancel() */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_54_on_waiter_completed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_54_on_waiter_completed = {"_on_waiter_completed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_54_on_waiter_completed, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_54_on_waiter_completed(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_fut = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_on_waiter_completed (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fut,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fut)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 687, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_on_waiter_completed") < 0)) __PYX_ERR(0, 687, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_fut = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_on_waiter_completed", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 687, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_waiter_completed", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_53_on_waiter_completed(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_fut); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_53_on_waiter_completed(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_fut) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_waiter_completed", 1); /* "asyncpg/protocol/protocol.pyx":688 * * def _on_waiter_completed(self, fut): * if self.timeout_handle: # <<<<<<<<<<<<<< * self.timeout_handle.cancel() * self.timeout_handle = None */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->timeout_handle); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 688, __pyx_L1_error) if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":689 * def _on_waiter_completed(self, fut): * if self.timeout_handle: * self.timeout_handle.cancel() # <<<<<<<<<<<<<< * self.timeout_handle = None * if fut is not self.waiter or self.cancel_waiter is not None: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->timeout_handle, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":690 * if self.timeout_handle: * self.timeout_handle.cancel() * self.timeout_handle = None # <<<<<<<<<<<<<< * if fut is not self.waiter or self.cancel_waiter is not None: * return */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->timeout_handle); __Pyx_DECREF(__pyx_v_self->timeout_handle); __pyx_v_self->timeout_handle = Py_None; /* "asyncpg/protocol/protocol.pyx":688 * * def _on_waiter_completed(self, fut): * if self.timeout_handle: # <<<<<<<<<<<<<< * self.timeout_handle.cancel() * self.timeout_handle = None */ } /* "asyncpg/protocol/protocol.pyx":691 * self.timeout_handle.cancel() * self.timeout_handle = None * if fut is not self.waiter or self.cancel_waiter is not None: # <<<<<<<<<<<<<< * return * if fut.cancelled(): */ __pyx_t_6 = (__pyx_v_fut != __pyx_v_self->waiter); if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L5_bool_binop_done; } __pyx_t_6 = (__pyx_v_self->cancel_waiter != Py_None); __pyx_t_1 = __pyx_t_6; __pyx_L5_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":692 * self.timeout_handle = None * if fut is not self.waiter or self.cancel_waiter is not None: * return # <<<<<<<<<<<<<< * if fut.cancelled(): * self._request_cancel() */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":691 * self.timeout_handle.cancel() * self.timeout_handle = None * if fut is not self.waiter or self.cancel_waiter is not None: # <<<<<<<<<<<<<< * return * if fut.cancelled(): */ } /* "asyncpg/protocol/protocol.pyx":693 * if fut is not self.waiter or self.cancel_waiter is not None: * return * if fut.cancelled(): # <<<<<<<<<<<<<< * self._request_cancel() * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_fut, __pyx_n_s_cancelled); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":694 * return * if fut.cancelled(): * self._request_cancel() # <<<<<<<<<<<<<< * * def _create_future_fallback(self): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_request_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":693 * if fut is not self.waiter or self.cancel_waiter is not None: * return * if fut.cancelled(): # <<<<<<<<<<<<<< * self._request_cancel() * */ } /* "asyncpg/protocol/protocol.pyx":687 * self.waiter.set_exception(asyncio.TimeoutError()) * * def _on_waiter_completed(self, fut): # <<<<<<<<<<<<<< * if self.timeout_handle: * self.timeout_handle.cancel() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_waiter_completed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":696 * self._request_cancel() * * def _create_future_fallback(self): # <<<<<<<<<<<<<< * return asyncio.Future(loop=self.loop) * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_56_create_future_fallback(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_56_create_future_fallback = {"_create_future_fallback", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_56_create_future_fallback, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_56_create_future_fallback(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_create_future_fallback (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_create_future_fallback", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_create_future_fallback", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_55_create_future_fallback(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_55_create_future_fallback(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_create_future_fallback", 1); /* "asyncpg/protocol/protocol.pyx":697 * * def _create_future_fallback(self): * return asyncio.Future(loop=self.loop) # <<<<<<<<<<<<<< * * cdef _handle_waiter_on_connection_lost(self, cause): */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Future); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_loop, __pyx_v_self->loop) < 0) __PYX_ERR(0, 697, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":696 * self._request_cancel() * * def _create_future_fallback(self): # <<<<<<<<<<<<<< * return asyncio.Future(loop=self.loop) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._create_future_fallback", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":699 * return asyncio.Future(loop=self.loop) * * cdef _handle_waiter_on_connection_lost(self, cause): # <<<<<<<<<<<<<< * if self.waiter is not None and not self.waiter.done(): * exc = apg_exc.ConnectionDoesNotExistError( */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__handle_waiter_on_connection_lost(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_cause) { PyObject *__pyx_v_exc = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_handle_waiter_on_connection_lost", 1); /* "asyncpg/protocol/protocol.pyx":700 * * cdef _handle_waiter_on_connection_lost(self, cause): * if self.waiter is not None and not self.waiter.done(): # <<<<<<<<<<<<<< * exc = apg_exc.ConnectionDoesNotExistError( * 'connection was closed in the middle of ' */ __pyx_t_2 = (__pyx_v_self->waiter != Py_None); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->waiter, __pyx_n_s_done); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = (!__pyx_t_2); __pyx_t_1 = __pyx_t_7; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":701 * cdef _handle_waiter_on_connection_lost(self, cause): * if self.waiter is not None and not self.waiter.done(): * exc = apg_exc.ConnectionDoesNotExistError( # <<<<<<<<<<<<<< * 'connection was closed in the middle of ' * 'operation') */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ConnectionDoesNotExistError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_connection_was_closed_in_the_mid}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_exc = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":704 * 'connection was closed in the middle of ' * 'operation') * if cause is not None: # <<<<<<<<<<<<<< * exc.__cause__ = cause * self.waiter.set_exception(exc) */ __pyx_t_1 = (__pyx_v_cause != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":705 * 'operation') * if cause is not None: * exc.__cause__ = cause # <<<<<<<<<<<<<< * self.waiter.set_exception(exc) * self.waiter = None */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_exc, __pyx_n_s_cause, __pyx_v_cause) < 0) __PYX_ERR(0, 705, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":704 * 'connection was closed in the middle of ' * 'operation') * if cause is not None: # <<<<<<<<<<<<<< * exc.__cause__ = cause * self.waiter.set_exception(exc) */ } /* "asyncpg/protocol/protocol.pyx":706 * if cause is not None: * exc.__cause__ = cause * self.waiter.set_exception(exc) # <<<<<<<<<<<<<< * self.waiter = None * */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_exc}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":700 * * cdef _handle_waiter_on_connection_lost(self, cause): * if self.waiter is not None and not self.waiter.done(): # <<<<<<<<<<<<<< * exc = apg_exc.ConnectionDoesNotExistError( * 'connection was closed in the middle of ' */ } /* "asyncpg/protocol/protocol.pyx":707 * exc.__cause__ = cause * self.waiter.set_exception(exc) * self.waiter = None # <<<<<<<<<<<<<< * * cdef _set_server_parameter(self, name, val): */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->waiter); __Pyx_DECREF(__pyx_v_self->waiter); __pyx_v_self->waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":699 * return asyncio.Future(loop=self.loop) * * cdef _handle_waiter_on_connection_lost(self, cause): # <<<<<<<<<<<<<< * if self.waiter is not None and not self.waiter.done(): * exc = apg_exc.ConnectionDoesNotExistError( */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._handle_waiter_on_connection_lost", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_exc); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":709 * self.waiter = None * * cdef _set_server_parameter(self, name, val): # <<<<<<<<<<<<<< * self.settings.add_setting(name, val) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__set_server_parameter(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_val) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_set_server_parameter", 1); /* "asyncpg/protocol/protocol.pyx":710 * * cdef _set_server_parameter(self, name, val): * self.settings.add_setting(name, val) # <<<<<<<<<<<<<< * * def _get_timeout(self, timeout): */ if (!(likely(PyUnicode_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_name))) __PYX_ERR(0, 710, __pyx_L1_error) if (!(likely(PyUnicode_CheckExact(__pyx_v_val))||((__pyx_v_val) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_val))) __PYX_ERR(0, 710, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_add_setting(__pyx_v_self->settings, ((PyObject*)__pyx_v_name), ((PyObject*)__pyx_v_val)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":709 * self.waiter = None * * cdef _set_server_parameter(self, name, val): # <<<<<<<<<<<<<< * self.settings.add_setting(name, val) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._set_server_parameter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":712 * self.settings.add_setting(name, val) * * def _get_timeout(self, timeout): # <<<<<<<<<<<<<< * if timeout is not None: * try: */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_58_get_timeout(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_58_get_timeout = {"_get_timeout", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_58_get_timeout, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_58_get_timeout(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_timeout = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_timeout (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 712, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_timeout") < 0)) __PYX_ERR(0, 712, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_timeout = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_get_timeout", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 712, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._get_timeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_57_get_timeout(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_timeout); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_57_get_timeout(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_timeout) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; unsigned int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_timeout", 0); __Pyx_INCREF(__pyx_v_timeout); /* "asyncpg/protocol/protocol.pyx":713 * * def _get_timeout(self, timeout): * if timeout is not None: # <<<<<<<<<<<<<< * try: * if type(timeout) is bool: */ __pyx_t_1 = (__pyx_v_timeout != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":714 * def _get_timeout(self, timeout): * if timeout is not None: * try: # <<<<<<<<<<<<<< * if type(timeout) is bool: * raise ValueError */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":715 * if timeout is not None: * try: * if type(timeout) is bool: # <<<<<<<<<<<<<< * raise ValueError * timeout = float(timeout) */ __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_timeout)) == ((PyObject*)&PyBool_Type)); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/protocol.pyx":716 * try: * if type(timeout) is bool: * raise ValueError # <<<<<<<<<<<<<< * timeout = float(timeout) * except ValueError: */ __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0); __PYX_ERR(0, 716, __pyx_L4_error) /* "asyncpg/protocol/protocol.pyx":715 * if timeout is not None: * try: * if type(timeout) is bool: # <<<<<<<<<<<<<< * raise ValueError * timeout = float(timeout) */ } /* "asyncpg/protocol/protocol.pyx":717 * if type(timeout) is bool: * raise ValueError * timeout = float(timeout) # <<<<<<<<<<<<<< * except ValueError: * raise ValueError( */ __pyx_t_5 = __Pyx_PyNumber_Float(__pyx_v_timeout); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 717, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":714 * def _get_timeout(self, timeout): * if timeout is not None: * try: # <<<<<<<<<<<<<< * if type(timeout) is bool: * raise ValueError */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":718 * raise ValueError * timeout = float(timeout) * except ValueError: # <<<<<<<<<<<<<< * raise ValueError( * 'invalid timeout value: expected non-negative float ' */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_6) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._get_timeout", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 718, __pyx_L6_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /* "asyncpg/protocol/protocol.pyx":721 * raise ValueError( * 'invalid timeout value: expected non-negative float ' * '(got {!r})'.format(timeout)) from None # <<<<<<<<<<<<<< * * return self._get_timeout_impl(timeout) */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_timeout_value_expected_n, __pyx_n_s_format); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 721, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_timeout}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 721, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } /* "asyncpg/protocol/protocol.pyx":719 * timeout = float(timeout) * except ValueError: * raise ValueError( # <<<<<<<<<<<<<< * 'invalid timeout value: expected non-negative float ' * '(got {!r})'.format(timeout)) from None */ __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 719, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/protocol.pyx":721 * raise ValueError( * 'invalid timeout value: expected non-negative float ' * '(got {!r})'.format(timeout)) from None # <<<<<<<<<<<<<< * * return self._get_timeout_impl(timeout) */ __Pyx_Raise(__pyx_t_10, 0, 0, Py_None); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __PYX_ERR(0, 719, __pyx_L6_except_error) } goto __pyx_L6_except_error; /* "asyncpg/protocol/protocol.pyx":714 * def _get_timeout(self, timeout): * if timeout is not None: * try: # <<<<<<<<<<<<<< * if type(timeout) is bool: * raise ValueError */ __pyx_L6_except_error:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L9_try_end:; } /* "asyncpg/protocol/protocol.pyx":713 * * def _get_timeout(self, timeout): * if timeout is not None: # <<<<<<<<<<<<<< * try: * if type(timeout) is bool: */ } /* "asyncpg/protocol/protocol.pyx":723 * '(got {!r})'.format(timeout)) from None * * return self._get_timeout_impl(timeout) # <<<<<<<<<<<<<< * * cdef inline _get_timeout_impl(self, timeout): */ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_v_self, __pyx_v_timeout); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":712 * self.settings.add_setting(name, val) * * def _get_timeout(self, timeout): # <<<<<<<<<<<<<< * if timeout is not None: * try: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._get_timeout", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_timeout); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":725 * return self._get_timeout_impl(timeout) * * cdef inline _get_timeout_impl(self, timeout): # <<<<<<<<<<<<<< * if timeout is None: * timeout = self.get_connection()._config.command_timeout */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_timeout) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_timeout_impl", 0); __Pyx_INCREF(__pyx_v_timeout); /* "asyncpg/protocol/protocol.pyx":726 * * cdef inline _get_timeout_impl(self, timeout): * if timeout is None: # <<<<<<<<<<<<<< * timeout = self.get_connection()._config.command_timeout * elif timeout is NO_TIMEOUT: */ __pyx_t_1 = (__pyx_v_timeout == Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":727 * cdef inline _get_timeout_impl(self, timeout): * if timeout is None: * timeout = self.get_connection()._config.command_timeout # <<<<<<<<<<<<<< * elif timeout is NO_TIMEOUT: * timeout = None */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_connection(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_config); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_command_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":726 * * cdef inline _get_timeout_impl(self, timeout): * if timeout is None: # <<<<<<<<<<<<<< * timeout = self.get_connection()._config.command_timeout * elif timeout is NO_TIMEOUT: */ goto __pyx_L3; } /* "asyncpg/protocol/protocol.pyx":728 * if timeout is None: * timeout = self.get_connection()._config.command_timeout * elif timeout is NO_TIMEOUT: # <<<<<<<<<<<<<< * timeout = None * else: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NO_TIMEOUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = (__pyx_v_timeout == __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":729 * timeout = self.get_connection()._config.command_timeout * elif timeout is NO_TIMEOUT: * timeout = None # <<<<<<<<<<<<<< * else: * timeout = float(timeout) */ __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_timeout, Py_None); /* "asyncpg/protocol/protocol.pyx":728 * if timeout is None: * timeout = self.get_connection()._config.command_timeout * elif timeout is NO_TIMEOUT: # <<<<<<<<<<<<<< * timeout = None * else: */ goto __pyx_L3; } /* "asyncpg/protocol/protocol.pyx":731 * timeout = None * else: * timeout = float(timeout) # <<<<<<<<<<<<<< * * if timeout is not None and timeout <= 0: */ /*else*/ { __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_2); __pyx_t_2 = 0; } __pyx_L3:; /* "asyncpg/protocol/protocol.pyx":733 * timeout = float(timeout) * * if timeout is not None and timeout <= 0: # <<<<<<<<<<<<<< * raise asyncio.TimeoutError() * return timeout */ __pyx_t_4 = (__pyx_v_timeout != Py_None); if (__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L5_bool_binop_done; } __pyx_t_2 = PyObject_RichCompare(__pyx_v_timeout, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 733, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 733, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_4; __pyx_L5_bool_binop_done:; if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/protocol.pyx":734 * * if timeout is not None and timeout <= 0: * raise asyncio.TimeoutError() # <<<<<<<<<<<<<< * return timeout * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_TimeoutError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 734, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":733 * timeout = float(timeout) * * if timeout is not None and timeout <= 0: # <<<<<<<<<<<<<< * raise asyncio.TimeoutError() * return timeout */ } /* "asyncpg/protocol/protocol.pyx":735 * if timeout is not None and timeout <= 0: * raise asyncio.TimeoutError() * return timeout # <<<<<<<<<<<<<< * * cdef _check_state(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_timeout); __pyx_r = __pyx_v_timeout; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":725 * return self._get_timeout_impl(timeout) * * cdef inline _get_timeout_impl(self, timeout): # <<<<<<<<<<<<<< * if timeout is None: * timeout = self.get_connection()._config.command_timeout */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._get_timeout_impl", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_timeout); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":737 * return timeout * * cdef _check_state(self): # <<<<<<<<<<<<<< * if self.cancel_waiter is not None: * raise apg_exc.InterfaceError( */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__check_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_check_state", 1); /* "asyncpg/protocol/protocol.pyx":738 * * cdef _check_state(self): * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * raise apg_exc.InterfaceError( * 'cannot perform operation: another operation is cancelling') */ __pyx_t_1 = (__pyx_v_self->cancel_waiter != Py_None); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/protocol.pyx":739 * cdef _check_state(self): * if self.cancel_waiter is not None: * raise apg_exc.InterfaceError( # <<<<<<<<<<<<<< * 'cannot perform operation: another operation is cancelling') * if self.closing: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_cannot_perform_operation_another}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 739, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":738 * * cdef _check_state(self): * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * raise apg_exc.InterfaceError( * 'cannot perform operation: another operation is cancelling') */ } /* "asyncpg/protocol/protocol.pyx":741 * raise apg_exc.InterfaceError( * 'cannot perform operation: another operation is cancelling') * if self.closing: # <<<<<<<<<<<<<< * raise apg_exc.InterfaceError( * 'cannot perform operation: connection is closed') */ if (unlikely(__pyx_v_self->closing)) { /* "asyncpg/protocol/protocol.pyx":742 * 'cannot perform operation: another operation is cancelling') * if self.closing: * raise apg_exc.InterfaceError( # <<<<<<<<<<<<<< * 'cannot perform operation: connection is closed') * if self.waiter is not None or self.timeout_handle is not None: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_cannot_perform_operation_connect}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 742, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":741 * raise apg_exc.InterfaceError( * 'cannot perform operation: another operation is cancelling') * if self.closing: # <<<<<<<<<<<<<< * raise apg_exc.InterfaceError( * 'cannot perform operation: connection is closed') */ } /* "asyncpg/protocol/protocol.pyx":744 * raise apg_exc.InterfaceError( * 'cannot perform operation: connection is closed') * if self.waiter is not None or self.timeout_handle is not None: # <<<<<<<<<<<<<< * raise apg_exc.InterfaceError( * 'cannot perform operation: another operation is in progress') */ __pyx_t_6 = (__pyx_v_self->waiter != Py_None); if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L6_bool_binop_done; } __pyx_t_6 = (__pyx_v_self->timeout_handle != Py_None); __pyx_t_1 = __pyx_t_6; __pyx_L6_bool_binop_done:; if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/protocol.pyx":745 * 'cannot perform operation: connection is closed') * if self.waiter is not None or self.timeout_handle is not None: * raise apg_exc.InterfaceError( # <<<<<<<<<<<<<< * 'cannot perform operation: another operation is in progress') * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_cannot_perform_operation_another_2}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 745, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":744 * raise apg_exc.InterfaceError( * 'cannot perform operation: connection is closed') * if self.waiter is not None or self.timeout_handle is not None: # <<<<<<<<<<<<<< * raise apg_exc.InterfaceError( * 'cannot perform operation: another operation is in progress') */ } /* "asyncpg/protocol/protocol.pyx":737 * return timeout * * cdef _check_state(self): # <<<<<<<<<<<<<< * if self.cancel_waiter is not None: * raise apg_exc.InterfaceError( */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._check_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":748 * 'cannot perform operation: another operation is in progress') * * def _is_cancelling(self): # <<<<<<<<<<<<<< * return ( * self.cancel_waiter is not None or */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_60_is_cancelling(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_60_is_cancelling = {"_is_cancelling", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_60_is_cancelling, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_60_is_cancelling(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_is_cancelling (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_is_cancelling", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_is_cancelling", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_59_is_cancelling(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_59_is_cancelling(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_is_cancelling", 1); /* "asyncpg/protocol/protocol.pyx":749 * * def _is_cancelling(self): * return ( # <<<<<<<<<<<<<< * self.cancel_waiter is not None or * self.cancel_sent_waiter is not None */ __Pyx_XDECREF(__pyx_r); /* "asyncpg/protocol/protocol.pyx":750 * def _is_cancelling(self): * return ( * self.cancel_waiter is not None or # <<<<<<<<<<<<<< * self.cancel_sent_waiter is not None * ) */ __pyx_t_2 = (__pyx_v_self->cancel_waiter != Py_None); if (!__pyx_t_2) { } else { __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L3_bool_binop_done; } /* "asyncpg/protocol/protocol.pyx":751 * return ( * self.cancel_waiter is not None or * self.cancel_sent_waiter is not None # <<<<<<<<<<<<<< * ) * */ __pyx_t_2 = (__pyx_v_self->cancel_sent_waiter != Py_None); __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; __pyx_L3_bool_binop_done:; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":748 * 'cannot perform operation: another operation is in progress') * * def _is_cancelling(self): # <<<<<<<<<<<<<< * return ( * self.cancel_waiter is not None or */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._is_cancelling", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_63generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "asyncpg/protocol/protocol.pyx":754 * ) * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def _wait_for_cancellation(self): * if self.cancel_sent_waiter is not None: */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_62_wait_for_cancellation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_62_wait_for_cancellation = {"_wait_for_cancellation", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_62_wait_for_cancellation, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_62_wait_for_cancellation(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_wait_for_cancellation (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_wait_for_cancellation", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_wait_for_cancellation", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_61_wait_for_cancellation(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_61_wait_for_cancellation(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_wait_for_cancellation", 0); __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 754, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); { __pyx_CoroutineObject *gen = __Pyx_IterableCoroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_63generator11, __pyx_codeobj__59, (PyObject *) __pyx_cur_scope, __pyx_n_s_wait_for_cancellation, __pyx_n_s_BaseProtocol__wait_for_cancellat, __pyx_n_s_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._wait_for_cancellation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_63generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation *)__pyx_generator->closure); PyObject *__pyx_r = NULL; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_wait_for_cancellation", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; case 1: goto __pyx_L5_resume_from_await; case 2: goto __pyx_L7_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 754, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":756 * @cython.iterable_coroutine * async def _wait_for_cancellation(self): * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":757 * async def _wait_for_cancellation(self): * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter # <<<<<<<<<<<<<< * self.cancel_sent_waiter = None * if self.cancel_waiter is not None: */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 1; return __pyx_r; __pyx_L5_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 757, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 757, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":758 * if self.cancel_sent_waiter is not None: * await self.cancel_sent_waiter * self.cancel_sent_waiter = None # <<<<<<<<<<<<<< * if self.cancel_waiter is not None: * await self.cancel_waiter */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter); __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":756 * @cython.iterable_coroutine * async def _wait_for_cancellation(self): * if self.cancel_sent_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_sent_waiter * self.cancel_sent_waiter = None */ } /* "asyncpg/protocol/protocol.pyx":759 * await self.cancel_sent_waiter * self.cancel_sent_waiter = None * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * */ __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":760 * self.cancel_sent_waiter = None * if self.cancel_waiter is not None: * await self.cancel_waiter # <<<<<<<<<<<<<< * * cdef _coreproto_error(self): */ __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter); __Pyx_XGOTREF(__pyx_r); if (likely(__pyx_r)) { __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* return from generator, awaiting value */ __pyx_generator->resume_label = 2; return __pyx_r; __pyx_L7_resume_from_await:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 760, __pyx_L1_error) } else { PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear(); else __PYX_ERR(0, 760, __pyx_L1_error) } } /* "asyncpg/protocol/protocol.pyx":759 * await self.cancel_sent_waiter * self.cancel_sent_waiter = None * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * await self.cancel_waiter * */ } CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* "asyncpg/protocol/protocol.pyx":754 * ) * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def _wait_for_cancellation(self): * if self.cancel_sent_waiter is not None: */ /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("_wait_for_cancellation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":762 * await self.cancel_waiter * * cdef _coreproto_error(self): # <<<<<<<<<<<<<< * try: * if self.waiter is not None: */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__coreproto_error(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; char const *__pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_coreproto_error", 1); /* "asyncpg/protocol/protocol.pyx":763 * * cdef _coreproto_error(self): * try: # <<<<<<<<<<<<<< * if self.waiter is not None: * if not self.waiter.done(): */ /*try:*/ { /* "asyncpg/protocol/protocol.pyx":764 * cdef _coreproto_error(self): * try: * if self.waiter is not None: # <<<<<<<<<<<<<< * if not self.waiter.done(): * raise apg_exc.InternalClientError( */ __pyx_t_1 = (__pyx_v_self->waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":765 * try: * if self.waiter is not None: * if not self.waiter.done(): # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * 'waiter is not done while handling critical ' */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->waiter, __pyx_n_s_done); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 765, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 765, __pyx_L4_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = (!__pyx_t_1); if (unlikely(__pyx_t_6)) { /* "asyncpg/protocol/protocol.pyx":766 * if self.waiter is not None: * if not self.waiter.done(): * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * 'waiter is not done while handling critical ' * 'protocol error') */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 766, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 766, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_waiter_is_not_done_while_handlin}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 766, __pyx_L4_error) /* "asyncpg/protocol/protocol.pyx":765 * try: * if self.waiter is not None: * if not self.waiter.done(): # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * 'waiter is not done while handling critical ' */ } /* "asyncpg/protocol/protocol.pyx":769 * 'waiter is not done while handling critical ' * 'protocol error') * self.waiter = None # <<<<<<<<<<<<<< * finally: * self.abort() */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->waiter); __Pyx_DECREF(__pyx_v_self->waiter); __pyx_v_self->waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":764 * cdef _coreproto_error(self): * try: * if self.waiter is not None: # <<<<<<<<<<<<<< * if not self.waiter.done(): * raise apg_exc.InternalClientError( */ } } /* "asyncpg/protocol/protocol.pyx":771 * self.waiter = None * finally: * self.abort() # <<<<<<<<<<<<<< * * cdef _new_waiter(self, timeout): */ /*finally:*/ { /*normal exit:*/{ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_abort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __pyx_t_7 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename; { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_abort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 771, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 771, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); } __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12); __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9; goto __pyx_L1_error; __pyx_L9_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); } __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "asyncpg/protocol/protocol.pyx":762 * await self.cancel_waiter * * cdef _coreproto_error(self): # <<<<<<<<<<<<<< * try: * if self.waiter is not None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._coreproto_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":773 * self.abort() * * cdef _new_waiter(self, timeout): # <<<<<<<<<<<<<< * if self.waiter is not None: * raise apg_exc.InterfaceError( */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__new_waiter(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_timeout) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_new_waiter", 1); /* "asyncpg/protocol/protocol.pyx":774 * * cdef _new_waiter(self, timeout): * if self.waiter is not None: # <<<<<<<<<<<<<< * raise apg_exc.InterfaceError( * 'cannot perform operation: another operation is in progress') */ __pyx_t_1 = (__pyx_v_self->waiter != Py_None); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/protocol.pyx":775 * cdef _new_waiter(self, timeout): * if self.waiter is not None: * raise apg_exc.InterfaceError( # <<<<<<<<<<<<<< * 'cannot perform operation: another operation is in progress') * self.waiter = self.create_future() */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_cannot_perform_operation_another_2}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 775, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":774 * * cdef _new_waiter(self, timeout): * if self.waiter is not None: # <<<<<<<<<<<<<< * raise apg_exc.InterfaceError( * 'cannot perform operation: another operation is in progress') */ } /* "asyncpg/protocol/protocol.pyx":777 * raise apg_exc.InterfaceError( * 'cannot perform operation: another operation is in progress') * self.waiter = self.create_future() # <<<<<<<<<<<<<< * if timeout is not None: * self.timeout_handle = self.loop.call_later( */ __Pyx_INCREF(__pyx_v_self->create_future); __pyx_t_4 = __pyx_v_self->create_future; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->waiter); __Pyx_DECREF(__pyx_v_self->waiter); __pyx_v_self->waiter = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":778 * 'cannot perform operation: another operation is in progress') * self.waiter = self.create_future() * if timeout is not None: # <<<<<<<<<<<<<< * self.timeout_handle = self.loop.call_later( * timeout, self._on_timeout, self.waiter) */ __pyx_t_1 = (__pyx_v_timeout != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":779 * self.waiter = self.create_future() * if timeout is not None: * self.timeout_handle = self.loop.call_later( # <<<<<<<<<<<<<< * timeout, self._on_timeout, self.waiter) * self.waiter.add_done_callback(self._on_waiter_completed) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->loop, __pyx_n_s_call_later); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "asyncpg/protocol/protocol.pyx":780 * if timeout is not None: * self.timeout_handle = self.loop.call_later( * timeout, self._on_timeout, self.waiter) # <<<<<<<<<<<<<< * self.waiter.add_done_callback(self._on_waiter_completed) * return self.waiter */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_3, __pyx_v_self->waiter}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "asyncpg/protocol/protocol.pyx":779 * self.waiter = self.create_future() * if timeout is not None: * self.timeout_handle = self.loop.call_later( # <<<<<<<<<<<<<< * timeout, self._on_timeout, self.waiter) * self.waiter.add_done_callback(self._on_waiter_completed) */ __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->timeout_handle); __Pyx_DECREF(__pyx_v_self->timeout_handle); __pyx_v_self->timeout_handle = __pyx_t_2; __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":778 * 'cannot perform operation: another operation is in progress') * self.waiter = self.create_future() * if timeout is not None: # <<<<<<<<<<<<<< * self.timeout_handle = self.loop.call_later( * timeout, self._on_timeout, self.waiter) */ } /* "asyncpg/protocol/protocol.pyx":781 * self.timeout_handle = self.loop.call_later( * timeout, self._on_timeout, self.waiter) * self.waiter.add_done_callback(self._on_waiter_completed) # <<<<<<<<<<<<<< * return self.waiter * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->waiter, __pyx_n_s_add_done_callback); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_waiter_completed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":782 * timeout, self._on_timeout, self.waiter) * self.waiter.add_done_callback(self._on_waiter_completed) * return self.waiter # <<<<<<<<<<<<<< * * cdef _on_result__connect(self, object waiter): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->waiter); __pyx_r = __pyx_v_self->waiter; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":773 * self.abort() * * cdef _new_waiter(self, timeout): # <<<<<<<<<<<<<< * if self.waiter is not None: * raise apg_exc.InterfaceError( */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._new_waiter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":784 * return self.waiter * * cdef _on_result__connect(self, object waiter): # <<<<<<<<<<<<<< * waiter.set_result(True) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__connect(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_result__connect", 1); /* "asyncpg/protocol/protocol.pyx":785 * * cdef _on_result__connect(self, object waiter): * waiter.set_result(True) # <<<<<<<<<<<<<< * * cdef _on_result__prepare(self, object waiter): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, Py_True}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":784 * return self.waiter * * cdef _on_result__connect(self, object waiter): # <<<<<<<<<<<<<< * waiter.set_result(True) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_result__connect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":787 * waiter.set_result(True) * * cdef _on_result__prepare(self, object waiter): # <<<<<<<<<<<<<< * if PG_DEBUG: * if self.statement is None: */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__prepare(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_result__prepare", 1); /* "asyncpg/protocol/protocol.pyx":788 * * cdef _on_result__prepare(self, object waiter): * if PG_DEBUG: # <<<<<<<<<<<<<< * if self.statement is None: * raise apg_exc.InternalClientError( */ __pyx_t_1 = (PG_DEBUG != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":789 * cdef _on_result__prepare(self, object waiter): * if PG_DEBUG: * if self.statement is None: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * '_on_result__prepare: statement is None') */ __pyx_t_1 = (((PyObject *)__pyx_v_self->statement) == Py_None); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/protocol.pyx":790 * if PG_DEBUG: * if self.statement is None: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * '_on_result__prepare: statement is None') * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_on_result__prepare_statement_is}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 790, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":789 * cdef _on_result__prepare(self, object waiter): * if PG_DEBUG: * if self.statement is None: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * '_on_result__prepare: statement is None') */ } /* "asyncpg/protocol/protocol.pyx":788 * * cdef _on_result__prepare(self, object waiter): * if PG_DEBUG: # <<<<<<<<<<<<<< * if self.statement is None: * raise apg_exc.InternalClientError( */ } /* "asyncpg/protocol/protocol.pyx":793 * '_on_result__prepare: statement is None') * * if self.result_param_desc is not None: # <<<<<<<<<<<<<< * self.statement._set_args_desc(self.result_param_desc) * if self.result_row_desc is not None: */ __pyx_t_1 = (__pyx_v_self->__pyx_base.result_param_desc != ((PyObject*)Py_None)); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":794 * * if self.result_param_desc is not None: * self.statement._set_args_desc(self.result_param_desc) # <<<<<<<<<<<<<< * if self.result_row_desc is not None: * self.statement._set_row_desc(self.result_row_desc) */ __pyx_t_2 = __pyx_v_self->__pyx_base.result_param_desc; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_args_desc(__pyx_v_self->statement, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":793 * '_on_result__prepare: statement is None') * * if self.result_param_desc is not None: # <<<<<<<<<<<<<< * self.statement._set_args_desc(self.result_param_desc) * if self.result_row_desc is not None: */ } /* "asyncpg/protocol/protocol.pyx":795 * if self.result_param_desc is not None: * self.statement._set_args_desc(self.result_param_desc) * if self.result_row_desc is not None: # <<<<<<<<<<<<<< * self.statement._set_row_desc(self.result_row_desc) * waiter.set_result(self.statement) */ __pyx_t_1 = (__pyx_v_self->__pyx_base.result_row_desc != ((PyObject*)Py_None)); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":796 * self.statement._set_args_desc(self.result_param_desc) * if self.result_row_desc is not None: * self.statement._set_row_desc(self.result_row_desc) # <<<<<<<<<<<<<< * waiter.set_result(self.statement) * */ __pyx_t_4 = __pyx_v_self->__pyx_base.result_row_desc; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_row_desc(__pyx_v_self->statement, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":795 * if self.result_param_desc is not None: * self.statement._set_args_desc(self.result_param_desc) * if self.result_row_desc is not None: # <<<<<<<<<<<<<< * self.statement._set_row_desc(self.result_row_desc) * waiter.set_result(self.statement) */ } /* "asyncpg/protocol/protocol.pyx":797 * if self.result_row_desc is not None: * self.statement._set_row_desc(self.result_row_desc) * waiter.set_result(self.statement) # <<<<<<<<<<<<<< * * cdef _on_result__bind_and_exec(self, object waiter): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self->statement)}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":787 * waiter.set_result(True) * * cdef _on_result__prepare(self, object waiter): # <<<<<<<<<<<<<< * if PG_DEBUG: * if self.statement is None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_result__prepare", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":799 * waiter.set_result(self.statement) * * cdef _on_result__bind_and_exec(self, object waiter): # <<<<<<<<<<<<<< * if self.return_extra: * waiter.set_result(( */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__bind_and_exec(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_result__bind_and_exec", 1); /* "asyncpg/protocol/protocol.pyx":800 * * cdef _on_result__bind_and_exec(self, object waiter): * if self.return_extra: # <<<<<<<<<<<<<< * waiter.set_result(( * self.result, */ if (__pyx_v_self->return_extra) { /* "asyncpg/protocol/protocol.pyx":801 * cdef _on_result__bind_and_exec(self, object waiter): * if self.return_extra: * waiter.set_result(( # <<<<<<<<<<<<<< * self.result, * self.result_status_msg, */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/protocol.pyx":804 * self.result, * self.result_status_msg, * self.result_execute_completed)) # <<<<<<<<<<<<<< * else: * waiter.set_result(self.result) */ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base.result_execute_completed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "asyncpg/protocol/protocol.pyx":802 * if self.return_extra: * waiter.set_result(( * self.result, # <<<<<<<<<<<<<< * self.result_status_msg, * self.result_execute_completed)) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_self->__pyx_base.result); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->__pyx_base.result)) __PYX_ERR(0, 802, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->__pyx_base.result_status_msg); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result_status_msg); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->__pyx_base.result_status_msg)) __PYX_ERR(0, 802, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 802, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":800 * * cdef _on_result__bind_and_exec(self, object waiter): * if self.return_extra: # <<<<<<<<<<<<<< * waiter.set_result(( * self.result, */ goto __pyx_L3; } /* "asyncpg/protocol/protocol.pyx":806 * self.result_execute_completed)) * else: * waiter.set_result(self.result) # <<<<<<<<<<<<<< * * cdef _on_result__bind(self, object waiter): */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_self->__pyx_base.result}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "asyncpg/protocol/protocol.pyx":799 * waiter.set_result(self.statement) * * cdef _on_result__bind_and_exec(self, object waiter): # <<<<<<<<<<<<<< * if self.return_extra: * waiter.set_result(( */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_result__bind_and_exec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":808 * waiter.set_result(self.result) * * cdef _on_result__bind(self, object waiter): # <<<<<<<<<<<<<< * waiter.set_result(self.result) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__bind(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_result__bind", 1); /* "asyncpg/protocol/protocol.pyx":809 * * cdef _on_result__bind(self, object waiter): * waiter.set_result(self.result) # <<<<<<<<<<<<<< * * cdef _on_result__close_stmt_or_portal(self, object waiter): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self->__pyx_base.result}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":808 * waiter.set_result(self.result) * * cdef _on_result__bind(self, object waiter): # <<<<<<<<<<<<<< * waiter.set_result(self.result) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_result__bind", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":811 * waiter.set_result(self.result) * * cdef _on_result__close_stmt_or_portal(self, object waiter): # <<<<<<<<<<<<<< * waiter.set_result(self.result) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__close_stmt_or_portal(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_result__close_stmt_or_portal", 1); /* "asyncpg/protocol/protocol.pyx":812 * * cdef _on_result__close_stmt_or_portal(self, object waiter): * waiter.set_result(self.result) # <<<<<<<<<<<<<< * * cdef _on_result__simple_query(self, object waiter): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self->__pyx_base.result}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":811 * waiter.set_result(self.result) * * cdef _on_result__close_stmt_or_portal(self, object waiter): # <<<<<<<<<<<<<< * waiter.set_result(self.result) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_result__close_stmt_or_portal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":814 * waiter.set_result(self.result) * * cdef _on_result__simple_query(self, object waiter): # <<<<<<<<<<<<<< * waiter.set_result(self.result_status_msg.decode(self.encoding)) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__simple_query(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_result__simple_query", 1); /* "asyncpg/protocol/protocol.pyx":815 * * cdef _on_result__simple_query(self, object waiter): * waiter.set_result(self.result_status_msg.decode(self.encoding)) # <<<<<<<<<<<<<< * * cdef _on_result__copy_out(self, object waiter): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.result_status_msg, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_self->__pyx_base.encoding}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":814 * waiter.set_result(self.result) * * cdef _on_result__simple_query(self, object waiter): # <<<<<<<<<<<<<< * waiter.set_result(self.result_status_msg.decode(self.encoding)) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_result__simple_query", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":817 * waiter.set_result(self.result_status_msg.decode(self.encoding)) * * cdef _on_result__copy_out(self, object waiter): # <<<<<<<<<<<<<< * cdef bint copy_done = self.state == PROTOCOL_COPY_OUT_DONE * if copy_done: */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__copy_out(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter) { int __pyx_v_copy_done; PyObject *__pyx_v_status_msg = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_result__copy_out", 1); /* "asyncpg/protocol/protocol.pyx":818 * * cdef _on_result__copy_out(self, object waiter): * cdef bint copy_done = self.state == PROTOCOL_COPY_OUT_DONE # <<<<<<<<<<<<<< * if copy_done: * status_msg = self.result_status_msg.decode(self.encoding) */ __pyx_v_copy_done = (__pyx_v_self->__pyx_base.state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DONE); /* "asyncpg/protocol/protocol.pyx":819 * cdef _on_result__copy_out(self, object waiter): * cdef bint copy_done = self.state == PROTOCOL_COPY_OUT_DONE * if copy_done: # <<<<<<<<<<<<<< * status_msg = self.result_status_msg.decode(self.encoding) * else: */ if (__pyx_v_copy_done) { /* "asyncpg/protocol/protocol.pyx":820 * cdef bint copy_done = self.state == PROTOCOL_COPY_OUT_DONE * if copy_done: * status_msg = self.result_status_msg.decode(self.encoding) # <<<<<<<<<<<<<< * else: * status_msg = None */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.result_status_msg, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self->__pyx_base.encoding}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_status_msg = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":819 * cdef _on_result__copy_out(self, object waiter): * cdef bint copy_done = self.state == PROTOCOL_COPY_OUT_DONE * if copy_done: # <<<<<<<<<<<<<< * status_msg = self.result_status_msg.decode(self.encoding) * else: */ goto __pyx_L3; } /* "asyncpg/protocol/protocol.pyx":822 * status_msg = self.result_status_msg.decode(self.encoding) * else: * status_msg = None # <<<<<<<<<<<<<< * * # We need to put some backpressure on Postgres */ /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_status_msg = Py_None; } __pyx_L3:; /* "asyncpg/protocol/protocol.pyx":826 * # We need to put some backpressure on Postgres * # here in case the sink is slow to process the output. * self.pause_reading() # <<<<<<<<<<<<<< * * waiter.set_result((self.result, copy_done, status_msg)) */ __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_pause_reading(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":828 * self.pause_reading() * * waiter.set_result((self.result, copy_done, status_msg)) # <<<<<<<<<<<<<< * * cdef _on_result__copy_in(self, object waiter): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_copy_done); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_self->__pyx_base.result); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->__pyx_base.result)) __PYX_ERR(0, 828, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error); __Pyx_INCREF(__pyx_v_status_msg); __Pyx_GIVEREF(__pyx_v_status_msg); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_status_msg)) __PYX_ERR(0, 828, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":817 * waiter.set_result(self.result_status_msg.decode(self.encoding)) * * cdef _on_result__copy_out(self, object waiter): # <<<<<<<<<<<<<< * cdef bint copy_done = self.state == PROTOCOL_COPY_OUT_DONE * if copy_done: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_result__copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_status_msg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":830 * waiter.set_result((self.result, copy_done, status_msg)) * * cdef _on_result__copy_in(self, object waiter): # <<<<<<<<<<<<<< * status_msg = self.result_status_msg.decode(self.encoding) * waiter.set_result(status_msg) */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__copy_in(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter) { PyObject *__pyx_v_status_msg = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_result__copy_in", 1); /* "asyncpg/protocol/protocol.pyx":831 * * cdef _on_result__copy_in(self, object waiter): * status_msg = self.result_status_msg.decode(self.encoding) # <<<<<<<<<<<<<< * waiter.set_result(status_msg) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.result_status_msg, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self->__pyx_base.encoding}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_status_msg = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":832 * cdef _on_result__copy_in(self, object waiter): * status_msg = self.result_status_msg.decode(self.encoding) * waiter.set_result(status_msg) # <<<<<<<<<<<<<< * * cdef _decode_row(self, const char* buf, ssize_t buf_len): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_status_msg}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":830 * waiter.set_result((self.result, copy_done, status_msg)) * * cdef _on_result__copy_in(self, object waiter): # <<<<<<<<<<<<<< * status_msg = self.result_status_msg.decode(self.encoding) * waiter.set_result(status_msg) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_result__copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_status_msg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":834 * waiter.set_result(status_msg) * * cdef _decode_row(self, const char* buf, ssize_t buf_len): # <<<<<<<<<<<<<< * if PG_DEBUG: * if self.statement is None: */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__decode_row(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, char const *__pyx_v_buf, Py_ssize_t __pyx_v_buf_len) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_decode_row", 1); /* "asyncpg/protocol/protocol.pyx":835 * * cdef _decode_row(self, const char* buf, ssize_t buf_len): * if PG_DEBUG: # <<<<<<<<<<<<<< * if self.statement is None: * raise apg_exc.InternalClientError( */ __pyx_t_1 = (PG_DEBUG != 0); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":836 * cdef _decode_row(self, const char* buf, ssize_t buf_len): * if PG_DEBUG: * if self.statement is None: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * '_decode_row: statement is None') */ __pyx_t_1 = (((PyObject *)__pyx_v_self->statement) == Py_None); if (unlikely(__pyx_t_1)) { /* "asyncpg/protocol/protocol.pyx":837 * if PG_DEBUG: * if self.statement is None: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * '_decode_row: statement is None') * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_decode_row_statement_is_None}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 837, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":836 * cdef _decode_row(self, const char* buf, ssize_t buf_len): * if PG_DEBUG: * if self.statement is None: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError( * '_decode_row: statement is None') */ } /* "asyncpg/protocol/protocol.pyx":835 * * cdef _decode_row(self, const char* buf, ssize_t buf_len): * if PG_DEBUG: # <<<<<<<<<<<<<< * if self.statement is None: * raise apg_exc.InternalClientError( */ } /* "asyncpg/protocol/protocol.pyx":840 * '_decode_row: statement is None') * * return self.statement._decode_row(buf, buf_len) # <<<<<<<<<<<<<< * * cdef _dispatch_result(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__decode_row(__pyx_v_self->statement, __pyx_v_buf, __pyx_v_buf_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":834 * waiter.set_result(status_msg) * * cdef _decode_row(self, const char* buf, ssize_t buf_len): # <<<<<<<<<<<<<< * if PG_DEBUG: * if self.statement is None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._decode_row", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":842 * return self.statement._decode_row(buf, buf_len) * * cdef _dispatch_result(self): # <<<<<<<<<<<<<< * waiter = self.waiter * self.waiter = None */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__dispatch_result(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_v_waiter = NULL; PyObject *__pyx_v_exc = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_t_13; char const *__pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_dispatch_result", 1); /* "asyncpg/protocol/protocol.pyx":843 * * cdef _dispatch_result(self): * waiter = self.waiter # <<<<<<<<<<<<<< * self.waiter = None * */ __pyx_t_1 = __pyx_v_self->waiter; __Pyx_INCREF(__pyx_t_1); __pyx_v_waiter = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":844 * cdef _dispatch_result(self): * waiter = self.waiter * self.waiter = None # <<<<<<<<<<<<<< * * if PG_DEBUG: */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->waiter); __Pyx_DECREF(__pyx_v_self->waiter); __pyx_v_self->waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":846 * self.waiter = None * * if PG_DEBUG: # <<<<<<<<<<<<<< * if waiter is None: * raise apg_exc.InternalClientError('_on_result: waiter is None') */ __pyx_t_2 = (PG_DEBUG != 0); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":847 * * if PG_DEBUG: * if waiter is None: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError('_on_result: waiter is None') * */ __pyx_t_2 = (__pyx_v_waiter == Py_None); if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/protocol.pyx":848 * if PG_DEBUG: * if waiter is None: * raise apg_exc.InternalClientError('_on_result: waiter is None') # <<<<<<<<<<<<<< * * if waiter.cancelled(): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_on_result_waiter_is_None}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 848, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":847 * * if PG_DEBUG: * if waiter is None: # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError('_on_result: waiter is None') * */ } /* "asyncpg/protocol/protocol.pyx":846 * self.waiter = None * * if PG_DEBUG: # <<<<<<<<<<<<<< * if waiter is None: * raise apg_exc.InternalClientError('_on_result: waiter is None') */ } /* "asyncpg/protocol/protocol.pyx":850 * raise apg_exc.InternalClientError('_on_result: waiter is None') * * if waiter.cancelled(): # <<<<<<<<<<<<<< * return * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_cancelled); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":851 * * if waiter.cancelled(): * return # <<<<<<<<<<<<<< * * if waiter.done(): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":850 * raise apg_exc.InternalClientError('_on_result: waiter is None') * * if waiter.cancelled(): # <<<<<<<<<<<<<< * return * */ } /* "asyncpg/protocol/protocol.pyx":853 * return * * if waiter.done(): # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError('_on_result: waiter is done') * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_done); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_2)) { /* "asyncpg/protocol/protocol.pyx":854 * * if waiter.done(): * raise apg_exc.InternalClientError('_on_result: waiter is done') # <<<<<<<<<<<<<< * * if self.result_type == RESULT_FAILED: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_on_result_waiter_is_done}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 854, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":853 * return * * if waiter.done(): # <<<<<<<<<<<<<< * raise apg_exc.InternalClientError('_on_result: waiter is done') * */ } /* "asyncpg/protocol/protocol.pyx":856 * raise apg_exc.InternalClientError('_on_result: waiter is done') * * if self.result_type == RESULT_FAILED: # <<<<<<<<<<<<<< * if isinstance(self.result, dict): * exc = apg_exc_base.PostgresError.new( */ __pyx_t_2 = (__pyx_v_self->__pyx_base.result_type == __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":857 * * if self.result_type == RESULT_FAILED: * if isinstance(self.result, dict): # <<<<<<<<<<<<<< * exc = apg_exc_base.PostgresError.new( * self.result, query=self.last_query) */ __pyx_t_1 = __pyx_v_self->__pyx_base.result; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyDict_Check(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":858 * if self.result_type == RESULT_FAILED: * if isinstance(self.result, dict): * exc = apg_exc_base.PostgresError.new( # <<<<<<<<<<<<<< * self.result, query=self.last_query) * else: */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_apg_exc_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_PostgresError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":859 * if isinstance(self.result, dict): * exc = apg_exc_base.PostgresError.new( * self.result, query=self.last_query) # <<<<<<<<<<<<<< * else: * exc = self.result */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_self->__pyx_base.result); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->__pyx_base.result)) __PYX_ERR(0, 858, __pyx_L1_error); __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_query, __pyx_v_self->last_query) < 0) __PYX_ERR(0, 859, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":858 * if self.result_type == RESULT_FAILED: * if isinstance(self.result, dict): * exc = apg_exc_base.PostgresError.new( # <<<<<<<<<<<<<< * self.result, query=self.last_query) * else: */ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_exc = __pyx_t_6; __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":857 * * if self.result_type == RESULT_FAILED: * if isinstance(self.result, dict): # <<<<<<<<<<<<<< * exc = apg_exc_base.PostgresError.new( * self.result, query=self.last_query) */ goto __pyx_L8; } /* "asyncpg/protocol/protocol.pyx":861 * self.result, query=self.last_query) * else: * exc = self.result # <<<<<<<<<<<<<< * waiter.set_exception(exc) * return */ /*else*/ { __pyx_t_6 = __pyx_v_self->__pyx_base.result; __Pyx_INCREF(__pyx_t_6); __pyx_v_exc = __pyx_t_6; __pyx_t_6 = 0; } __pyx_L8:; /* "asyncpg/protocol/protocol.pyx":862 * else: * exc = self.result * waiter.set_exception(exc) # <<<<<<<<<<<<<< * return * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_exc}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":863 * exc = self.result * waiter.set_exception(exc) * return # <<<<<<<<<<<<<< * * try: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":856 * raise apg_exc.InternalClientError('_on_result: waiter is done') * * if self.result_type == RESULT_FAILED: # <<<<<<<<<<<<<< * if isinstance(self.result, dict): * exc = apg_exc_base.PostgresError.new( */ } /* "asyncpg/protocol/protocol.pyx":865 * return * * try: # <<<<<<<<<<<<<< * if self.state == PROTOCOL_AUTH: * self._on_result__connect(waiter) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":866 * * try: * if self.state == PROTOCOL_AUTH: # <<<<<<<<<<<<<< * self._on_result__connect(waiter) * */ switch (__pyx_v_self->__pyx_base.state) { case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_AUTH: /* "asyncpg/protocol/protocol.pyx":867 * try: * if self.state == PROTOCOL_AUTH: * self._on_result__connect(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_PREPARE: */ __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__connect(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 867, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":866 * * try: * if self.state == PROTOCOL_AUTH: # <<<<<<<<<<<<<< * self._on_result__connect(waiter) * */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_PREPARE: /* "asyncpg/protocol/protocol.pyx":870 * * elif self.state == PROTOCOL_PREPARE: * self._on_result__prepare(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_BIND_EXECUTE: */ __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__prepare(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 870, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":869 * self._on_result__connect(waiter) * * elif self.state == PROTOCOL_PREPARE: # <<<<<<<<<<<<<< * self._on_result__prepare(waiter) * */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND_EXECUTE: /* "asyncpg/protocol/protocol.pyx":873 * * elif self.state == PROTOCOL_BIND_EXECUTE: * self._on_result__bind_and_exec(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_BIND_EXECUTE_MANY: */ __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__bind_and_exec(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 873, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":872 * self._on_result__prepare(waiter) * * elif self.state == PROTOCOL_BIND_EXECUTE: # <<<<<<<<<<<<<< * self._on_result__bind_and_exec(waiter) * */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND_EXECUTE_MANY: /* "asyncpg/protocol/protocol.pyx":876 * * elif self.state == PROTOCOL_BIND_EXECUTE_MANY: * self._on_result__bind_and_exec(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_EXECUTE: */ __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__bind_and_exec(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 876, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":875 * self._on_result__bind_and_exec(waiter) * * elif self.state == PROTOCOL_BIND_EXECUTE_MANY: # <<<<<<<<<<<<<< * self._on_result__bind_and_exec(waiter) * */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_EXECUTE: /* "asyncpg/protocol/protocol.pyx":879 * * elif self.state == PROTOCOL_EXECUTE: * self._on_result__bind_and_exec(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_BIND: */ __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__bind_and_exec(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 879, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":878 * self._on_result__bind_and_exec(waiter) * * elif self.state == PROTOCOL_EXECUTE: # <<<<<<<<<<<<<< * self._on_result__bind_and_exec(waiter) * */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND: /* "asyncpg/protocol/protocol.pyx":882 * * elif self.state == PROTOCOL_BIND: * self._on_result__bind(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_CLOSE_STMT_PORTAL: */ __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__bind(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 882, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":881 * self._on_result__bind_and_exec(waiter) * * elif self.state == PROTOCOL_BIND: # <<<<<<<<<<<<<< * self._on_result__bind(waiter) * */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CLOSE_STMT_PORTAL: /* "asyncpg/protocol/protocol.pyx":885 * * elif self.state == PROTOCOL_CLOSE_STMT_PORTAL: * self._on_result__close_stmt_or_portal(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_SIMPLE_QUERY: */ __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__close_stmt_or_portal(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 885, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":884 * self._on_result__bind(waiter) * * elif self.state == PROTOCOL_CLOSE_STMT_PORTAL: # <<<<<<<<<<<<<< * self._on_result__close_stmt_or_portal(waiter) * */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_SIMPLE_QUERY: /* "asyncpg/protocol/protocol.pyx":888 * * elif self.state == PROTOCOL_SIMPLE_QUERY: * self._on_result__simple_query(waiter) # <<<<<<<<<<<<<< * * elif (self.state == PROTOCOL_COPY_OUT_DATA or */ __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__simple_query(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 888, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":887 * self._on_result__close_stmt_or_portal(waiter) * * elif self.state == PROTOCOL_SIMPLE_QUERY: # <<<<<<<<<<<<<< * self._on_result__simple_query(waiter) * */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DATA: /* "asyncpg/protocol/protocol.pyx":890 * self._on_result__simple_query(waiter) * * elif (self.state == PROTOCOL_COPY_OUT_DATA or # <<<<<<<<<<<<<< * self.state == PROTOCOL_COPY_OUT_DONE): * self._on_result__copy_out(waiter) */ case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DONE: /* "asyncpg/protocol/protocol.pyx":892 * elif (self.state == PROTOCOL_COPY_OUT_DATA or * self.state == PROTOCOL_COPY_OUT_DONE): * self._on_result__copy_out(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_COPY_IN_DATA: */ __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__copy_out(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 892, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":890 * self._on_result__simple_query(waiter) * * elif (self.state == PROTOCOL_COPY_OUT_DATA or # <<<<<<<<<<<<<< * self.state == PROTOCOL_COPY_OUT_DONE): * self._on_result__copy_out(waiter) */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN_DATA: /* "asyncpg/protocol/protocol.pyx":895 * * elif self.state == PROTOCOL_COPY_IN_DATA: * self._on_result__copy_in(waiter) # <<<<<<<<<<<<<< * * elif self.state == PROTOCOL_TERMINATING: */ __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__copy_in(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 895, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":894 * self._on_result__copy_out(waiter) * * elif self.state == PROTOCOL_COPY_IN_DATA: # <<<<<<<<<<<<<< * self._on_result__copy_in(waiter) * */ break; case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_TERMINATING: /* "asyncpg/protocol/protocol.pyx":897 * self._on_result__copy_in(waiter) * * elif self.state == PROTOCOL_TERMINATING: # <<<<<<<<<<<<<< * # We are waiting for the connection to drop, so * # ignore any stray results at this point. */ break; default: /* "asyncpg/protocol/protocol.pyx":903 * * else: * raise apg_exc.InternalClientError( # <<<<<<<<<<<<<< * 'got result for unknown protocol state {}'. * format(self.state)) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 903, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 903, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "asyncpg/protocol/protocol.pyx":904 * else: * raise apg_exc.InternalClientError( * 'got result for unknown protocol state {}'. # <<<<<<<<<<<<<< * format(self.state)) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_got_result_for_unknown_protocol, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 904, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_1); /* "asyncpg/protocol/protocol.pyx":905 * raise apg_exc.InternalClientError( * 'got result for unknown protocol state {}'. * format(self.state)) # <<<<<<<<<<<<<< * * except Exception as exc: */ __pyx_t_10 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_self->__pyx_base.state); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 905, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_10}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 905, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_t_1 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_4}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 903, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 903, __pyx_L9_error) break; } /* "asyncpg/protocol/protocol.pyx":865 * return * * try: # <<<<<<<<<<<<<< * if self.state == PROTOCOL_AUTH: * self._on_result__connect(waiter) */ } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L14_try_end; __pyx_L9_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "asyncpg/protocol/protocol.pyx":907 * format(self.state)) * * except Exception as exc: # <<<<<<<<<<<<<< * waiter.set_exception(exc) * */ __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_12) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._dispatch_result", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 907, __pyx_L11_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_v_exc = __pyx_t_3; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":908 * * except Exception as exc: * waiter.set_exception(exc) # <<<<<<<<<<<<<< * * cdef _on_result(self): */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 908, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_exc}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "asyncpg/protocol/protocol.pyx":907 * format(self.state)) * * except Exception as exc: # <<<<<<<<<<<<<< * waiter.set_exception(exc) * */ /*finally:*/ { /*normal exit:*/{ __Pyx_DECREF(__pyx_v_exc); __pyx_v_exc = 0; goto __pyx_L21; } __pyx_L20_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __pyx_t_12 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename; { __Pyx_DECREF(__pyx_v_exc); __pyx_v_exc = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); } __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17); __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; goto __pyx_L11_except_error; } __pyx_L21:; } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L10_exception_handled; } goto __pyx_L11_except_error; /* "asyncpg/protocol/protocol.pyx":865 * return * * try: # <<<<<<<<<<<<<< * if self.state == PROTOCOL_AUTH: * self._on_result__connect(waiter) */ __pyx_L11_except_error:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; __pyx_L10_exception_handled:; __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_L14_try_end:; } /* "asyncpg/protocol/protocol.pyx":842 * return self.statement._decode_row(buf, buf_len) * * cdef _dispatch_result(self): # <<<<<<<<<<<<<< * waiter = self.waiter * self.waiter = None */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._dispatch_result", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_waiter); __Pyx_XDECREF(__pyx_v_exc); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":910 * waiter.set_exception(exc) * * cdef _on_result(self): # <<<<<<<<<<<<<< * if self.timeout_handle is not None: * self.timeout_handle.cancel() */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; char const *__pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_result", 1); /* "asyncpg/protocol/protocol.pyx":911 * * cdef _on_result(self): * if self.timeout_handle is not None: # <<<<<<<<<<<<<< * self.timeout_handle.cancel() * self.timeout_handle = None */ __pyx_t_1 = (__pyx_v_self->timeout_handle != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":912 * cdef _on_result(self): * if self.timeout_handle is not None: * self.timeout_handle.cancel() # <<<<<<<<<<<<<< * self.timeout_handle = None * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->timeout_handle, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":913 * if self.timeout_handle is not None: * self.timeout_handle.cancel() * self.timeout_handle = None # <<<<<<<<<<<<<< * * if self.cancel_waiter is not None: */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->timeout_handle); __Pyx_DECREF(__pyx_v_self->timeout_handle); __pyx_v_self->timeout_handle = Py_None; /* "asyncpg/protocol/protocol.pyx":911 * * cdef _on_result(self): * if self.timeout_handle is not None: # <<<<<<<<<<<<<< * self.timeout_handle.cancel() * self.timeout_handle = None */ } /* "asyncpg/protocol/protocol.pyx":915 * self.timeout_handle = None * * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * # We have received the result of a cancelled command. * if not self.cancel_waiter.done(): */ __pyx_t_1 = (__pyx_v_self->cancel_waiter != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":917 * if self.cancel_waiter is not None: * # We have received the result of a cancelled command. * if not self.cancel_waiter.done(): # <<<<<<<<<<<<<< * # The cancellation future might have been cancelled * # by the cancellation of the entire task running the query. */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->cancel_waiter, __pyx_n_s_done); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 917, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = (!__pyx_t_1); if (__pyx_t_6) { /* "asyncpg/protocol/protocol.pyx":920 * # The cancellation future might have been cancelled * # by the cancellation of the entire task running the query. * self.cancel_waiter.set_result(None) # <<<<<<<<<<<<<< * self.cancel_waiter = None * if self.waiter is not None and self.waiter.done(): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->cancel_waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, Py_None}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":917 * if self.cancel_waiter is not None: * # We have received the result of a cancelled command. * if not self.cancel_waiter.done(): # <<<<<<<<<<<<<< * # The cancellation future might have been cancelled * # by the cancellation of the entire task running the query. */ } /* "asyncpg/protocol/protocol.pyx":921 * # by the cancellation of the entire task running the query. * self.cancel_waiter.set_result(None) * self.cancel_waiter = None # <<<<<<<<<<<<<< * if self.waiter is not None and self.waiter.done(): * self.waiter = None */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->cancel_waiter); __Pyx_DECREF(__pyx_v_self->cancel_waiter); __pyx_v_self->cancel_waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":922 * self.cancel_waiter.set_result(None) * self.cancel_waiter = None * if self.waiter is not None and self.waiter.done(): # <<<<<<<<<<<<<< * self.waiter = None * if self.waiter is None: */ __pyx_t_1 = (__pyx_v_self->waiter != Py_None); if (__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; goto __pyx_L7_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->waiter, __pyx_n_s_done); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 922, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __pyx_t_1; __pyx_L7_bool_binop_done:; if (__pyx_t_6) { /* "asyncpg/protocol/protocol.pyx":923 * self.cancel_waiter = None * if self.waiter is not None and self.waiter.done(): * self.waiter = None # <<<<<<<<<<<<<< * if self.waiter is None: * return */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->waiter); __Pyx_DECREF(__pyx_v_self->waiter); __pyx_v_self->waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":922 * self.cancel_waiter.set_result(None) * self.cancel_waiter = None * if self.waiter is not None and self.waiter.done(): # <<<<<<<<<<<<<< * self.waiter = None * if self.waiter is None: */ } /* "asyncpg/protocol/protocol.pyx":924 * if self.waiter is not None and self.waiter.done(): * self.waiter = None * if self.waiter is None: # <<<<<<<<<<<<<< * return * */ __pyx_t_6 = (__pyx_v_self->waiter == Py_None); if (__pyx_t_6) { /* "asyncpg/protocol/protocol.pyx":925 * self.waiter = None * if self.waiter is None: * return # <<<<<<<<<<<<<< * * try: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":924 * if self.waiter is not None and self.waiter.done(): * self.waiter = None * if self.waiter is None: # <<<<<<<<<<<<<< * return * */ } /* "asyncpg/protocol/protocol.pyx":915 * self.timeout_handle = None * * if self.cancel_waiter is not None: # <<<<<<<<<<<<<< * # We have received the result of a cancelled command. * if not self.cancel_waiter.done(): */ } /* "asyncpg/protocol/protocol.pyx":927 * return * * try: # <<<<<<<<<<<<<< * self._dispatch_result() * finally: */ /*try:*/ { /* "asyncpg/protocol/protocol.pyx":928 * * try: * self._dispatch_result() # <<<<<<<<<<<<<< * finally: * self.statement = None */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_dispatch_result(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 928, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "asyncpg/protocol/protocol.pyx":930 * self._dispatch_result() * finally: * self.statement = None # <<<<<<<<<<<<<< * self.last_query = None * self.return_extra = False */ /*finally:*/ { /*normal exit:*/{ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF((PyObject *)__pyx_v_self->statement); __Pyx_DECREF((PyObject *)__pyx_v_self->statement); __pyx_v_self->statement = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)Py_None); /* "asyncpg/protocol/protocol.pyx":931 * finally: * self.statement = None * self.last_query = None # <<<<<<<<<<<<<< * self.return_extra = False * */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->last_query); __Pyx_DECREF(__pyx_v_self->last_query); __pyx_v_self->last_query = ((PyObject*)Py_None); /* "asyncpg/protocol/protocol.pyx":932 * self.statement = None * self.last_query = None * self.return_extra = False # <<<<<<<<<<<<<< * * cdef _on_notice(self, parsed): */ __pyx_v_self->return_extra = 0; goto __pyx_L12; } __pyx_L11_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __pyx_t_7 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename; { /* "asyncpg/protocol/protocol.pyx":930 * self._dispatch_result() * finally: * self.statement = None # <<<<<<<<<<<<<< * self.last_query = None * self.return_extra = False */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF((PyObject *)__pyx_v_self->statement); __Pyx_DECREF((PyObject *)__pyx_v_self->statement); __pyx_v_self->statement = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)Py_None); /* "asyncpg/protocol/protocol.pyx":931 * finally: * self.statement = None * self.last_query = None # <<<<<<<<<<<<<< * self.return_extra = False * */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->last_query); __Pyx_DECREF(__pyx_v_self->last_query); __pyx_v_self->last_query = ((PyObject*)Py_None); /* "asyncpg/protocol/protocol.pyx":932 * self.statement = None * self.last_query = None * self.return_extra = False # <<<<<<<<<<<<<< * * cdef _on_notice(self, parsed): */ __pyx_v_self->return_extra = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); } __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12); __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9; goto __pyx_L1_error; } __pyx_L12:; } /* "asyncpg/protocol/protocol.pyx":910 * waiter.set_exception(exc) * * cdef _on_result(self): # <<<<<<<<<<<<<< * if self.timeout_handle is not None: * self.timeout_handle.cancel() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_result", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":934 * self.return_extra = False * * cdef _on_notice(self, parsed): # <<<<<<<<<<<<<< * con = self.get_connection() * if con is not None: */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_notice(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_parsed) { PyObject *__pyx_v_con = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_notice", 1); /* "asyncpg/protocol/protocol.pyx":935 * * cdef _on_notice(self, parsed): * con = self.get_connection() # <<<<<<<<<<<<<< * if con is not None: * con._process_log_message(parsed, self.last_query) */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_connection(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_con = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":936 * cdef _on_notice(self, parsed): * con = self.get_connection() * if con is not None: # <<<<<<<<<<<<<< * con._process_log_message(parsed, self.last_query) * */ __pyx_t_2 = (__pyx_v_con != Py_None); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":937 * con = self.get_connection() * if con is not None: * con._process_log_message(parsed, self.last_query) # <<<<<<<<<<<<<< * * cdef _on_notification(self, pid, channel, payload): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_con, __pyx_n_s_process_log_message); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_parsed, __pyx_v_self->last_query}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":936 * cdef _on_notice(self, parsed): * con = self.get_connection() * if con is not None: # <<<<<<<<<<<<<< * con._process_log_message(parsed, self.last_query) * */ } /* "asyncpg/protocol/protocol.pyx":934 * self.return_extra = False * * cdef _on_notice(self, parsed): # <<<<<<<<<<<<<< * con = self.get_connection() * if con is not None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_notice", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_con); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":939 * con._process_log_message(parsed, self.last_query) * * cdef _on_notification(self, pid, channel, payload): # <<<<<<<<<<<<<< * con = self.get_connection() * if con is not None: */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_notification(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_pid, PyObject *__pyx_v_channel, PyObject *__pyx_v_payload) { PyObject *__pyx_v_con = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_notification", 1); /* "asyncpg/protocol/protocol.pyx":940 * * cdef _on_notification(self, pid, channel, payload): * con = self.get_connection() # <<<<<<<<<<<<<< * if con is not None: * con._process_notification(pid, channel, payload) */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_connection(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_con = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":941 * cdef _on_notification(self, pid, channel, payload): * con = self.get_connection() * if con is not None: # <<<<<<<<<<<<<< * con._process_notification(pid, channel, payload) * */ __pyx_t_2 = (__pyx_v_con != Py_None); if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":942 * con = self.get_connection() * if con is not None: * con._process_notification(pid, channel, payload) # <<<<<<<<<<<<<< * * cdef _on_connection_lost(self, exc): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_con, __pyx_n_s_process_notification); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_pid, __pyx_v_channel, __pyx_v_payload}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":941 * cdef _on_notification(self, pid, channel, payload): * con = self.get_connection() * if con is not None: # <<<<<<<<<<<<<< * con._process_notification(pid, channel, payload) * */ } /* "asyncpg/protocol/protocol.pyx":939 * con._process_log_message(parsed, self.last_query) * * cdef _on_notification(self, pid, channel, payload): # <<<<<<<<<<<<<< * con = self.get_connection() * if con is not None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_notification", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_con); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":944 * con._process_notification(pid, channel, payload) * * cdef _on_connection_lost(self, exc): # <<<<<<<<<<<<<< * if self.closing: * # The connection was lost because */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_connection_lost(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_exc) { PyObject *__pyx_v_con = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_on_connection_lost", 1); /* "asyncpg/protocol/protocol.pyx":945 * * cdef _on_connection_lost(self, exc): * if self.closing: # <<<<<<<<<<<<<< * # The connection was lost because * # Protocol.close() was called */ if (__pyx_v_self->closing) { /* "asyncpg/protocol/protocol.pyx":948 * # The connection was lost because * # Protocol.close() was called * if self.waiter is not None and not self.waiter.done(): # <<<<<<<<<<<<<< * if exc is None: * self.waiter.set_result(None) */ __pyx_t_2 = (__pyx_v_self->waiter != Py_None); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L5_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->waiter, __pyx_n_s_done); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 948, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = (!__pyx_t_2); __pyx_t_1 = __pyx_t_7; __pyx_L5_bool_binop_done:; if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":949 * # Protocol.close() was called * if self.waiter is not None and not self.waiter.done(): * if exc is None: # <<<<<<<<<<<<<< * self.waiter.set_result(None) * else: */ __pyx_t_1 = (__pyx_v_exc == Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":950 * if self.waiter is not None and not self.waiter.done(): * if exc is None: * self.waiter.set_result(None) # <<<<<<<<<<<<<< * else: * self.waiter.set_exception(exc) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->waiter, __pyx_n_s_set_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, Py_None}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":949 * # Protocol.close() was called * if self.waiter is not None and not self.waiter.done(): * if exc is None: # <<<<<<<<<<<<<< * self.waiter.set_result(None) * else: */ goto __pyx_L7; } /* "asyncpg/protocol/protocol.pyx":952 * self.waiter.set_result(None) * else: * self.waiter.set_exception(exc) # <<<<<<<<<<<<<< * self.waiter = None * else: */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->waiter, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_exc}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L7:; /* "asyncpg/protocol/protocol.pyx":948 * # The connection was lost because * # Protocol.close() was called * if self.waiter is not None and not self.waiter.done(): # <<<<<<<<<<<<<< * if exc is None: * self.waiter.set_result(None) */ } /* "asyncpg/protocol/protocol.pyx":953 * else: * self.waiter.set_exception(exc) * self.waiter = None # <<<<<<<<<<<<<< * else: * # The connection was lost because it was */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->waiter); __Pyx_DECREF(__pyx_v_self->waiter); __pyx_v_self->waiter = Py_None; /* "asyncpg/protocol/protocol.pyx":945 * * cdef _on_connection_lost(self, exc): * if self.closing: # <<<<<<<<<<<<<< * # The connection was lost because * # Protocol.close() was called */ goto __pyx_L3; } /* "asyncpg/protocol/protocol.pyx":958 * # terminated or due to another error; * # Throw an error in any awaiting waiter. * self.closing = True # <<<<<<<<<<<<<< * # Cleanup the connection resources, including, possibly, * # releasing the pool holder. */ /*else*/ { __pyx_v_self->closing = 1; /* "asyncpg/protocol/protocol.pyx":961 * # Cleanup the connection resources, including, possibly, * # releasing the pool holder. * con = self.get_connection() # <<<<<<<<<<<<<< * if con is not None: * con._cleanup() */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_connection(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_con = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":962 * # releasing the pool holder. * con = self.get_connection() * if con is not None: # <<<<<<<<<<<<<< * con._cleanup() * self._handle_waiter_on_connection_lost(exc) */ __pyx_t_1 = (__pyx_v_con != Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":963 * con = self.get_connection() * if con is not None: * con._cleanup() # <<<<<<<<<<<<<< * self._handle_waiter_on_connection_lost(exc) * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_con, __pyx_n_s_cleanup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 963, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 963, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":962 * # releasing the pool holder. * con = self.get_connection() * if con is not None: # <<<<<<<<<<<<<< * con._cleanup() * self._handle_waiter_on_connection_lost(exc) */ } /* "asyncpg/protocol/protocol.pyx":964 * if con is not None: * con._cleanup() * self._handle_waiter_on_connection_lost(exc) # <<<<<<<<<<<<<< * * cdef _write(self, buf): */ __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_handle_waiter_on_connection_lost(__pyx_v_self, __pyx_v_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; /* "asyncpg/protocol/protocol.pyx":944 * con._process_notification(pid, channel, payload) * * cdef _on_connection_lost(self, exc): # <<<<<<<<<<<<<< * if self.closing: * # The connection was lost because */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_connection_lost", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_con); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":966 * self._handle_waiter_on_connection_lost(exc) * * cdef _write(self, buf): # <<<<<<<<<<<<<< * self.transport.write(memoryview(buf)) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__write(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_buf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_write", 1); /* "asyncpg/protocol/protocol.pyx":967 * * cdef _write(self, buf): * self.transport.write(memoryview(buf)) # <<<<<<<<<<<<<< * * cdef _writelines(self, list buffers): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.transport, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyMemoryView_FromObject(__pyx_v_buf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":966 * self._handle_waiter_on_connection_lost(exc) * * cdef _write(self, buf): # <<<<<<<<<<<<<< * self.transport.write(memoryview(buf)) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._write", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":969 * self.transport.write(memoryview(buf)) * * cdef _writelines(self, list buffers): # <<<<<<<<<<<<<< * self.transport.writelines(buffers) * */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__writelines(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_buffers) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_writelines", 1); /* "asyncpg/protocol/protocol.pyx":970 * * cdef _writelines(self, list buffers): * self.transport.writelines(buffers) # <<<<<<<<<<<<<< * * # asyncio callbacks: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.transport, __pyx_n_s_writelines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_buffers}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":969 * self.transport.write(memoryview(buf)) * * cdef _writelines(self, list buffers): # <<<<<<<<<<<<<< * self.transport.writelines(buffers) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._writelines", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":974 * # asyncio callbacks: * * def data_received(self, data): # <<<<<<<<<<<<<< * self.buffer.feed_data(data) * self._read_server_messages() */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_65data_received(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_65data_received = {"data_received", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_65data_received, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_65data_received(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_data = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("data_received (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 974, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "data_received") < 0)) __PYX_ERR(0, 974, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_data = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("data_received", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 974, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.data_received", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_64data_received(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_data); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_64data_received(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("data_received", 1); /* "asyncpg/protocol/protocol.pyx":975 * * def data_received(self, data): * self.buffer.feed_data(data) # <<<<<<<<<<<<<< * self._read_server_messages() * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->feed_data(__pyx_v_self->__pyx_base.buffer, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":976 * def data_received(self, data): * self.buffer.feed_data(data) * self._read_server_messages() # <<<<<<<<<<<<<< * * def connection_made(self, transport): */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._read_server_messages(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":974 * # asyncio callbacks: * * def data_received(self, data): # <<<<<<<<<<<<<< * self.buffer.feed_data(data) * self._read_server_messages() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.data_received", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":978 * self._read_server_messages() * * def connection_made(self, transport): # <<<<<<<<<<<<<< * self.transport = transport * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_67connection_made(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_67connection_made = {"connection_made", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_67connection_made, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_67connection_made(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_transport = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("connection_made (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transport,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_transport)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 978, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "connection_made") < 0)) __PYX_ERR(0, 978, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_transport = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("connection_made", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 978, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.connection_made", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_66connection_made(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_transport); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_66connection_made(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_transport) { PyObject *__pyx_v_sock = NULL; PyObject *__pyx_v_ex = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; PyObject *__pyx_t_14 = NULL; int __pyx_t_15; char const *__pyx_t_16; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("connection_made", 1); /* "asyncpg/protocol/protocol.pyx":979 * * def connection_made(self, transport): * self.transport = transport # <<<<<<<<<<<<<< * * sock = transport.get_extra_info('socket') */ __Pyx_INCREF(__pyx_v_transport); __Pyx_GIVEREF(__pyx_v_transport); __Pyx_GOTREF(__pyx_v_self->__pyx_base.transport); __Pyx_DECREF(__pyx_v_self->__pyx_base.transport); __pyx_v_self->__pyx_base.transport = __pyx_v_transport; /* "asyncpg/protocol/protocol.pyx":981 * self.transport = transport * * sock = transport.get_extra_info('socket') # <<<<<<<<<<<<<< * if (sock is not None and * (not hasattr(socket, 'AF_UNIX') */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_transport, __pyx_n_s_get_extra_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_u_socket}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_sock = __pyx_t_1; __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":982 * * sock = transport.get_extra_info('socket') * if (sock is not None and # <<<<<<<<<<<<<< * (not hasattr(socket, 'AF_UNIX') * or sock.family != socket.AF_UNIX)): */ __pyx_t_6 = (__pyx_v_sock != Py_None); if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L4_bool_binop_done; } /* "asyncpg/protocol/protocol.pyx":983 * sock = transport.get_extra_info('socket') * if (sock is not None and * (not hasattr(socket, 'AF_UNIX') # <<<<<<<<<<<<<< * or sock.family != socket.AF_UNIX)): * sock.setsockopt(socket.IPPROTO_TCP, */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_u_AF_UNIX); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 983, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (!__pyx_t_6); if (!__pyx_t_7) { } else { __pyx_t_5 = __pyx_t_7; goto __pyx_L4_bool_binop_done; } /* "asyncpg/protocol/protocol.pyx":984 * if (sock is not None and * (not hasattr(socket, 'AF_UNIX') * or sock.family != socket.AF_UNIX)): # <<<<<<<<<<<<<< * sock.setsockopt(socket.IPPROTO_TCP, * socket.TCP_NODELAY, 1) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sock, __pyx_n_s_family); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_AF_UNIX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __pyx_t_7; __pyx_L4_bool_binop_done:; /* "asyncpg/protocol/protocol.pyx":982 * * sock = transport.get_extra_info('socket') * if (sock is not None and # <<<<<<<<<<<<<< * (not hasattr(socket, 'AF_UNIX') * or sock.family != socket.AF_UNIX)): */ if (__pyx_t_5) { /* "asyncpg/protocol/protocol.pyx":985 * (not hasattr(socket, 'AF_UNIX') * or sock.family != socket.AF_UNIX)): * sock.setsockopt(socket.IPPROTO_TCP, # <<<<<<<<<<<<<< * socket.TCP_NODELAY, 1) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sock, __pyx_n_s_setsockopt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_IPPROTO_TCP); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":986 * or sock.family != socket.AF_UNIX)): * sock.setsockopt(socket.IPPROTO_TCP, * socket.TCP_NODELAY, 1) # <<<<<<<<<<<<<< * * try: */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_TCP_NODELAY); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_8, __pyx_t_9, __pyx_int_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":982 * * sock = transport.get_extra_info('socket') * if (sock is not None and # <<<<<<<<<<<<<< * (not hasattr(socket, 'AF_UNIX') * or sock.family != socket.AF_UNIX)): */ } /* "asyncpg/protocol/protocol.pyx":988 * socket.TCP_NODELAY, 1) * * try: # <<<<<<<<<<<<<< * self._connect() * except Exception as ex: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); /*try:*/ { /* "asyncpg/protocol/protocol.pyx":989 * * try: * self._connect() # <<<<<<<<<<<<<< * except Exception as ex: * transport.abort() */ __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._connect(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 989, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":988 * socket.TCP_NODELAY, 1) * * try: # <<<<<<<<<<<<<< * self._connect() * except Exception as ex: */ } __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L12_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "asyncpg/protocol/protocol.pyx":990 * try: * self._connect() * except Exception as ex: # <<<<<<<<<<<<<< * transport.abort() * self.con_status = CONNECTION_BAD */ __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_13) { __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.connection_made", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_9) < 0) __PYX_ERR(0, 990, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_v_ex = __pyx_t_3; /*try:*/ { /* "asyncpg/protocol/protocol.pyx":991 * self._connect() * except Exception as ex: * transport.abort() # <<<<<<<<<<<<<< * self.con_status = CONNECTION_BAD * self._set_state(PROTOCOL_FAILED) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_transport, __pyx_n_s_abort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 991, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/protocol.pyx":992 * except Exception as ex: * transport.abort() * self.con_status = CONNECTION_BAD # <<<<<<<<<<<<<< * self._set_state(PROTOCOL_FAILED) * self._on_error(ex) */ __pyx_v_self->__pyx_base.con_status = __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_BAD; /* "asyncpg/protocol/protocol.pyx":993 * transport.abort() * self.con_status = CONNECTION_BAD * self._set_state(PROTOCOL_FAILED) # <<<<<<<<<<<<<< * self._on_error(ex) * */ __pyx_t_8 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._set_state(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self), __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_FAILED); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 993, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "asyncpg/protocol/protocol.pyx":994 * self.con_status = CONNECTION_BAD * self._set_state(PROTOCOL_FAILED) * self._on_error(ex) # <<<<<<<<<<<<<< * * def connection_lost(self, exc): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 994, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_14 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_14)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_ex}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 994, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } /* "asyncpg/protocol/protocol.pyx":990 * try: * self._connect() * except Exception as ex: # <<<<<<<<<<<<<< * transport.abort() * self.con_status = CONNECTION_BAD */ /*finally:*/ { /*normal exit:*/{ __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = 0; goto __pyx_L19; } __pyx_L18_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __pyx_t_13 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; { __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); } __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19); __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; goto __pyx_L9_except_error; } __pyx_L19:; } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_exception_handled; } goto __pyx_L9_except_error; /* "asyncpg/protocol/protocol.pyx":988 * socket.TCP_NODELAY, 1) * * try: # <<<<<<<<<<<<<< * self._connect() * except Exception as ex: */ __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); __pyx_L12_try_end:; } /* "asyncpg/protocol/protocol.pyx":978 * self._read_server_messages() * * def connection_made(self, transport): # <<<<<<<<<<<<<< * self.transport = transport * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.connection_made", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_sock); __Pyx_XDECREF(__pyx_v_ex); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":996 * self._on_error(ex) * * def connection_lost(self, exc): # <<<<<<<<<<<<<< * self.con_status = CONNECTION_BAD * self._set_state(PROTOCOL_FAILED) */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_69connection_lost(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_69connection_lost = {"connection_lost", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_69connection_lost, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_69connection_lost(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_exc = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("connection_lost (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exc)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 996, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "connection_lost") < 0)) __PYX_ERR(0, 996, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_exc = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("connection_lost", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 996, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.connection_lost", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_68connection_lost(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_exc); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_68connection_lost(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_exc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("connection_lost", 1); /* "asyncpg/protocol/protocol.pyx":997 * * def connection_lost(self, exc): * self.con_status = CONNECTION_BAD # <<<<<<<<<<<<<< * self._set_state(PROTOCOL_FAILED) * self._on_connection_lost(exc) */ __pyx_v_self->__pyx_base.con_status = __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_BAD; /* "asyncpg/protocol/protocol.pyx":998 * def connection_lost(self, exc): * self.con_status = CONNECTION_BAD * self._set_state(PROTOCOL_FAILED) # <<<<<<<<<<<<<< * self._on_connection_lost(exc) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._set_state(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self), __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_FAILED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":999 * self.con_status = CONNECTION_BAD * self._set_state(PROTOCOL_FAILED) * self._on_connection_lost(exc) # <<<<<<<<<<<<<< * * def pause_writing(self): */ __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._on_connection_lost(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self), __pyx_v_exc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":996 * self._on_error(ex) * * def connection_lost(self, exc): # <<<<<<<<<<<<<< * self.con_status = CONNECTION_BAD * self._set_state(PROTOCOL_FAILED) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.connection_lost", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":1001 * self._on_connection_lost(exc) * * def pause_writing(self): # <<<<<<<<<<<<<< * self.writing_allowed.clear() * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_71pause_writing(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_71pause_writing = {"pause_writing", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_71pause_writing, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_71pause_writing(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pause_writing (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("pause_writing", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "pause_writing", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_70pause_writing(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_70pause_writing(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pause_writing", 1); /* "asyncpg/protocol/protocol.pyx":1002 * * def pause_writing(self): * self.writing_allowed.clear() # <<<<<<<<<<<<<< * * def resume_writing(self): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_writing_allowed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":1001 * self._on_connection_lost(exc) * * def pause_writing(self): # <<<<<<<<<<<<<< * self.writing_allowed.clear() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.pause_writing", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":1004 * self.writing_allowed.clear() * * def resume_writing(self): # <<<<<<<<<<<<<< * self.writing_allowed.set() * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_73resume_writing(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_73resume_writing = {"resume_writing", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_73resume_writing, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_73resume_writing(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("resume_writing (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("resume_writing", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "resume_writing", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_72resume_writing(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_72resume_writing(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("resume_writing", 1); /* "asyncpg/protocol/protocol.pyx":1005 * * def resume_writing(self): * self.writing_allowed.set() # <<<<<<<<<<<<<< * * @property */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_writing_allowed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":1004 * self.writing_allowed.clear() * * def resume_writing(self): # <<<<<<<<<<<<<< * self.writing_allowed.set() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.resume_writing", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":1007 * self.writing_allowed.set() * * @property # <<<<<<<<<<<<<< * def is_ssl(self): * return self._is_ssl */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); /* "asyncpg/protocol/protocol.pyx":1009 * @property * def is_ssl(self): * return self._is_ssl # <<<<<<<<<<<<<< * * @is_ssl.setter */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_is_ssl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":1007 * self.writing_allowed.set() * * @property # <<<<<<<<<<<<<< * def is_ssl(self): * return self._is_ssl */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.is_ssl.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":1011 * return self._is_ssl * * @is_ssl.setter # <<<<<<<<<<<<<< * def is_ssl(self, value): * self._is_ssl = value */ /* Python wrapper */ static int __pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl_2__set__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl_2__set__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "asyncpg/protocol/protocol.pyx":1013 * @is_ssl.setter * def is_ssl(self, value): * self._is_ssl = value # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1013, __pyx_L1_error) __pyx_v_self->_is_ssl = __pyx_t_1; /* "asyncpg/protocol/protocol.pyx":1011 * return self._is_ssl * * @is_ssl.setter # <<<<<<<<<<<<<< * def is_ssl(self, value): * self._is_ssl = value */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.is_ssl.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "asyncpg/protocol/protocol.pxd":50 * bint closing * * readonly uint64_t queries_count # <<<<<<<<<<<<<< * * bint _is_ssl */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_13queries_count_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_13queries_count_1__get__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_13queries_count___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_13queries_count___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->queries_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.queries_count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_75__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_75__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_75__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_75__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_74__reduce_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_74__reduce_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; int __pyx_t_17; int __pyx_t_18; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = (self._discard_data, self._execute_iter, self._execute_portal_name, self._execute_stmt_name, self._is_ssl, self._skip_discard, self.address, self.backend_pid, self.backend_secret, self.buffer, self.cancel_sent_waiter, self.cancel_waiter, self.closing, self.con_params, self.con_status, self.conref, self.create_future, self.encoding, self.gss_ctx, self.is_reading, self.last_query, self.loop, self.queries_count, self.record_class, self.result, self.result_execute_completed, self.result_param_desc, self.result_row_desc, self.result_status_msg, self.result_type, self.return_extra, self.scram, self.settings, self.state, self.statement, self.timeout_handle, self.transport, self.waiter, self.writing_paused, self.xact_status) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base._discard_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_is_ssl); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base._skip_discard); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_self->__pyx_base.backend_pid); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int32_t(__pyx_v_self->__pyx_base.backend_secret); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_self->closing); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(__pyx_v_self->__pyx_base.con_status); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_self->is_reading); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->queries_count); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base.result_execute_completed); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(__pyx_v_self->__pyx_base.result_type); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_self->return_extra); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_self->__pyx_base.state); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = __Pyx_PyBool_FromLong(__pyx_v_self->writing_paused); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(__pyx_v_self->__pyx_base.xact_status); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = PyTuple_New(40); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->__pyx_base._execute_iter); __Pyx_GIVEREF(__pyx_v_self->__pyx_base._execute_iter); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_v_self->__pyx_base._execute_iter)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->__pyx_base._execute_portal_name); __Pyx_GIVEREF(__pyx_v_self->__pyx_base._execute_portal_name); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_v_self->__pyx_base._execute_portal_name)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->__pyx_base._execute_stmt_name); __Pyx_GIVEREF(__pyx_v_self->__pyx_base._execute_stmt_name); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_v_self->__pyx_base._execute_stmt_name)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->__pyx_base.address); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.address); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_v_self->__pyx_base.address)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 8, __pyx_t_5)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.buffer); __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.buffer); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 9, ((PyObject *)__pyx_v_self->__pyx_base.buffer))) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->cancel_sent_waiter); __Pyx_GIVEREF(__pyx_v_self->cancel_sent_waiter); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 10, __pyx_v_self->cancel_sent_waiter)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->cancel_waiter); __Pyx_GIVEREF(__pyx_v_self->cancel_waiter); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 11, __pyx_v_self->cancel_waiter)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 12, __pyx_t_6)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->__pyx_base.con_params); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.con_params); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 13, __pyx_v_self->__pyx_base.con_params)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 14, __pyx_t_7)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->conref); __Pyx_GIVEREF(__pyx_v_self->conref); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 15, __pyx_v_self->conref)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->create_future); __Pyx_GIVEREF(__pyx_v_self->create_future); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 16, __pyx_v_self->create_future)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->__pyx_base.encoding); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.encoding); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 17, __pyx_v_self->__pyx_base.encoding)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->__pyx_base.gss_ctx); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.gss_ctx); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 18, __pyx_v_self->__pyx_base.gss_ctx)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 19, __pyx_t_8)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->last_query); __Pyx_GIVEREF(__pyx_v_self->last_query); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 20, __pyx_v_self->last_query)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->loop); __Pyx_GIVEREF(__pyx_v_self->loop); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 21, __pyx_v_self->loop)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 22, __pyx_t_9)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_self->record_class); __Pyx_GIVEREF((PyObject *)__pyx_v_self->record_class); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 23, ((PyObject *)__pyx_v_self->record_class))) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->__pyx_base.result); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 24, __pyx_v_self->__pyx_base.result)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 25, __pyx_t_10)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->__pyx_base.result_param_desc); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result_param_desc); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 26, __pyx_v_self->__pyx_base.result_param_desc)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->__pyx_base.result_row_desc); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result_row_desc); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 27, __pyx_v_self->__pyx_base.result_row_desc)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->__pyx_base.result_status_msg); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result_status_msg); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 28, __pyx_v_self->__pyx_base.result_status_msg)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 29, __pyx_t_11)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_12); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 30, __pyx_t_12)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.scram); __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.scram); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 31, ((PyObject *)__pyx_v_self->__pyx_base.scram))) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_self->settings); __Pyx_GIVEREF((PyObject *)__pyx_v_self->settings); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 32, ((PyObject *)__pyx_v_self->settings))) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_13); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 33, __pyx_t_13)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_self->statement); __Pyx_GIVEREF((PyObject *)__pyx_v_self->statement); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 34, ((PyObject *)__pyx_v_self->statement))) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->timeout_handle); __Pyx_GIVEREF(__pyx_v_self->timeout_handle); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 35, __pyx_v_self->timeout_handle)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->__pyx_base.transport); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.transport); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 36, __pyx_v_self->__pyx_base.transport)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self->waiter); __Pyx_GIVEREF(__pyx_v_self->waiter); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 37, __pyx_v_self->waiter)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_14); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 38, __pyx_t_14)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_15); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 39, __pyx_t_15)) __PYX_ERR(2, 5, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_v_state = ((PyObject*)__pyx_t_16); __pyx_t_16 = 0; /* "(tree fragment)":6 * cdef bint use_setstate * state = (self._discard_data, self._execute_iter, self._execute_portal_name, self._execute_stmt_name, self._is_ssl, self._skip_discard, self.address, self.backend_pid, self.backend_secret, self.buffer, self.cancel_sent_waiter, self.cancel_waiter, self.closing, self.con_params, self.con_status, self.conref, self.create_future, self.encoding, self.gss_ctx, self.is_reading, self.last_query, self.loop, self.queries_count, self.record_class, self.result, self.result_execute_completed, self.result_param_desc, self.result_row_desc, self.result_status_msg, self.result_type, self.return_extra, self.scram, self.settings, self.state, self.statement, self.timeout_handle, self.transport, self.waiter, self.writing_paused, self.xact_status) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_16 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_v__dict = __pyx_t_16; __pyx_t_16 = 0; /* "(tree fragment)":7 * state = (self._discard_data, self._execute_iter, self._execute_portal_name, self._execute_stmt_name, self._is_ssl, self._skip_discard, self.address, self.backend_pid, self.backend_secret, self.buffer, self.cancel_sent_waiter, self.cancel_waiter, self.closing, self.con_params, self.con_status, self.conref, self.create_future, self.encoding, self.gss_ctx, self.is_reading, self.last_query, self.loop, self.queries_count, self.record_class, self.result, self.result_execute_completed, self.result_param_desc, self.result_row_desc, self.result_status_msg, self.result_type, self.return_extra, self.scram, self.settings, self.state, self.statement, self.timeout_handle, self.transport, self.waiter, self.writing_paused, self.xact_status) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_17 = (__pyx_v__dict != Py_None); if (__pyx_t_17) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v__dict)) __PYX_ERR(2, 8, __pyx_L1_error); __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_16); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_15)); __pyx_t_15 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = self._execute_iter is not None or self._execute_portal_name is not None or self._execute_stmt_name is not None or self.address is not None or self.buffer is not None or self.cancel_sent_waiter is not None or self.cancel_waiter is not None or self.con_params is not None or self.conref is not None or self.create_future is not None or self.encoding is not None or self.gss_ctx is not None or self.last_query is not None or self.loop is not None or self.record_class is not None or self.result is not None or self.result_param_desc is not None or self.result_row_desc is not None or self.result_status_msg is not None or self.scram is not None or self.settings is not None or self.statement is not None or self.timeout_handle is not None or self.transport is not None or self.waiter is not None */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = (self._discard_data, self._execute_iter, self._execute_portal_name, self._execute_stmt_name, self._is_ssl, self._skip_discard, self.address, self.backend_pid, self.backend_secret, self.buffer, self.cancel_sent_waiter, self.cancel_waiter, self.closing, self.con_params, self.con_status, self.conref, self.create_future, self.encoding, self.gss_ctx, self.is_reading, self.last_query, self.loop, self.queries_count, self.record_class, self.result, self.result_execute_completed, self.result_param_desc, self.result_row_desc, self.result_status_msg, self.result_type, self.return_extra, self.scram, self.settings, self.state, self.statement, self.timeout_handle, self.transport, self.waiter, self.writing_paused, self.xact_status) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = self._execute_iter is not None or self._execute_portal_name is not None or self._execute_stmt_name is not None or self.address is not None or self.buffer is not None or self.cancel_sent_waiter is not None or self.cancel_waiter is not None or self.con_params is not None or self.conref is not None or self.create_future is not None or self.encoding is not None or self.gss_ctx is not None or self.last_query is not None or self.loop is not None or self.record_class is not None or self.result is not None or self.result_param_desc is not None or self.result_row_desc is not None or self.result_status_msg is not None or self.scram is not None or self.settings is not None or self.statement is not None or self.timeout_handle is not None or self.transport is not None or self.waiter is not None # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, None), state */ /*else*/ { __pyx_t_18 = (__pyx_v_self->__pyx_base._execute_iter != Py_None); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->__pyx_base._execute_portal_name != ((PyObject*)Py_None)); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->__pyx_base._execute_stmt_name != ((PyObject*)Py_None)); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->__pyx_base.address != Py_None); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (((PyObject *)__pyx_v_self->__pyx_base.buffer) != Py_None); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->cancel_sent_waiter != Py_None); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->cancel_waiter != Py_None); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->__pyx_base.con_params != Py_None); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->conref != Py_None); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->create_future != Py_None); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->__pyx_base.encoding != ((PyObject*)Py_None)); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->__pyx_base.gss_ctx != Py_None); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->last_query != ((PyObject*)Py_None)); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->loop != Py_None); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->record_class != ((PyTypeObject*)Py_None)); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->__pyx_base.result != Py_None); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->__pyx_base.result_param_desc != ((PyObject*)Py_None)); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->__pyx_base.result_row_desc != ((PyObject*)Py_None)); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->__pyx_base.result_status_msg != ((PyObject*)Py_None)); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (((PyObject *)__pyx_v_self->__pyx_base.scram) != Py_None); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (((PyObject *)__pyx_v_self->settings) != Py_None); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (((PyObject *)__pyx_v_self->statement) != Py_None); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->timeout_handle != Py_None); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->__pyx_base.transport != Py_None); if (!__pyx_t_18) { } else { __pyx_t_17 = __pyx_t_18; goto __pyx_L4_bool_binop_done; } __pyx_t_18 = (__pyx_v_self->waiter != Py_None); __pyx_t_17 = __pyx_t_18; __pyx_L4_bool_binop_done:; __pyx_v_use_setstate = __pyx_t_17; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = self._execute_iter is not None or self._execute_portal_name is not None or self._execute_stmt_name is not None or self.address is not None or self.buffer is not None or self.cancel_sent_waiter is not None or self.cancel_waiter is not None or self.con_params is not None or self.conref is not None or self.create_future is not None or self.encoding is not None or self.gss_ctx is not None or self.last_query is not None or self.loop is not None or self.record_class is not None or self.result is not None or self.result_param_desc is not None or self.result_row_desc is not None or self.result_status_msg is not None or self.scram is not None or self.settings is not None or self.statement is not None or self.timeout_handle is not None or self.transport is not None or self.waiter is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, None), state * else: */ if (__pyx_v_use_setstate) { /* "(tree fragment)":13 * use_setstate = self._execute_iter is not None or self._execute_portal_name is not None or self._execute_stmt_name is not None or self.address is not None or self.buffer is not None or self.cancel_sent_waiter is not None or self.cancel_waiter is not None or self.con_params is not None or self.conref is not None or self.create_future is not None or self.encoding is not None or self.gss_ctx is not None or self.last_query is not None or self.loop is not None or self.record_class is not None or self.result is not None or self.result_param_desc is not None or self.result_row_desc is not None or self.result_status_msg is not None or self.scram is not None or self.settings is not None or self.statement is not None or self.timeout_handle is not None or self.transport is not None or self.waiter is not None * if use_setstate: * return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_pyx_unpickle_BaseProtocol); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_int_134522893); __Pyx_GIVEREF(__pyx_int_134522893); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_int_134522893)) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 2, Py_None)) __PYX_ERR(2, 13, __pyx_L1_error); __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_15); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_15)) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_16); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_16)) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_v_state)) __PYX_ERR(2, 13, __pyx_L1_error); __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_r = __pyx_t_14; __pyx_t_14 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = self._execute_iter is not None or self._execute_portal_name is not None or self._execute_stmt_name is not None or self.address is not None or self.buffer is not None or self.cancel_sent_waiter is not None or self.cancel_waiter is not None or self.con_params is not None or self.conref is not None or self.create_future is not None or self.encoding is not None or self.gss_ctx is not None or self.last_query is not None or self.loop is not None or self.record_class is not None or self.result is not None or self.result_param_desc is not None or self.result_row_desc is not None or self.result_status_msg is not None or self.scram is not None or self.settings is not None or self.statement is not None or self.timeout_handle is not None or self.transport is not None or self.waiter is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, None), state * else: * return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_BaseProtocol__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_pyx_unpickle_BaseProtocol); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_int_134522893); __Pyx_GIVEREF(__pyx_int_134522893); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_int_134522893)) __PYX_ERR(2, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_v_state)) __PYX_ERR(2, 15, __pyx_L1_error); __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_14); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14)) __PYX_ERR(2, 15, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_16); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_16)) __PYX_ERR(2, 15, __pyx_L1_error); __pyx_t_14 = 0; __pyx_t_16 = 0; __pyx_r = __pyx_t_15; __pyx_t_15 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_BaseProtocol__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_77__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_77__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_77__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_77__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 16, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 16, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 16, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_76__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_76__setstate_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":17 * return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_BaseProtocol__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 17, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_BaseProtocol__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_BaseProtocol__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":1017 * * class Timer: * def __init__(self, budget): # <<<<<<<<<<<<<< * self._budget = budget * self._started = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_budget = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_budget,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1017, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_budget)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1017, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1017, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 1017, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_budget = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1017, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.Timer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_5Timer___init__(__pyx_self, __pyx_v_self, __pyx_v_budget); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Timer___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_budget) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "asyncpg/protocol/protocol.pyx":1018 * class Timer: * def __init__(self, budget): * self._budget = budget # <<<<<<<<<<<<<< * self._started = 0 * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_budget_2, __pyx_v_budget) < 0) __PYX_ERR(0, 1018, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":1019 * def __init__(self, budget): * self._budget = budget * self._started = 0 # <<<<<<<<<<<<<< * * def __enter__(self): */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_started, __pyx_int_0) < 0) __PYX_ERR(0, 1019, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":1017 * * class Timer: * def __init__(self, budget): # <<<<<<<<<<<<<< * self._budget = budget * self._started = 0 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("asyncpg.protocol.protocol.Timer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":1021 * self._started = 0 * * def __enter__(self): # <<<<<<<<<<<<<< * if self._budget is not None: * self._started = time.monotonic() */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_3__enter__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_3__enter__ = {"__enter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_3__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_3__enter__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1021, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__enter__") < 0)) __PYX_ERR(0, 1021, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__enter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1021, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.Timer.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_5Timer_2__enter__(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Timer_2__enter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__enter__", 1); /* "asyncpg/protocol/protocol.pyx":1022 * * def __enter__(self): * if self._budget is not None: # <<<<<<<<<<<<<< * self._started = time.monotonic() * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_budget_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1022, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_t_1 != Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":1023 * def __enter__(self): * if self._budget is not None: * self._started = time.monotonic() # <<<<<<<<<<<<<< * * def __exit__(self, et, e, tb): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1023, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_monotonic); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1023, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1023, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_started, __pyx_t_1) < 0) __PYX_ERR(0, 1023, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "asyncpg/protocol/protocol.pyx":1022 * * def __enter__(self): * if self._budget is not None: # <<<<<<<<<<<<<< * self._started = time.monotonic() * */ } /* "asyncpg/protocol/protocol.pyx":1021 * self._started = 0 * * def __enter__(self): # <<<<<<<<<<<<<< * if self._budget is not None: * self._started = time.monotonic() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.Timer.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":1025 * self._started = time.monotonic() * * def __exit__(self, et, e, tb): # <<<<<<<<<<<<<< * if self._budget is not None: * self._budget -= time.monotonic() - self._started */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_5__exit__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_5__exit__ = {"__exit__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_5__exit__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_5__exit__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; CYTHON_UNUSED PyObject *__pyx_v_et = 0; CYTHON_UNUSED PyObject *__pyx_v_e = 0; CYTHON_UNUSED PyObject *__pyx_v_tb = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_et,&__pyx_n_s_e,&__pyx_n_s_tb,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1025, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_et)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1025, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, 1); __PYX_ERR(0, 1025, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_e)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1025, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, 2); __PYX_ERR(0, 1025, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tb)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1025, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, 3); __PYX_ERR(0, 1025, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__exit__") < 0)) __PYX_ERR(0, 1025, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); } __pyx_v_self = values[0]; __pyx_v_et = values[1]; __pyx_v_e = values[2]; __pyx_v_tb = values[3]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 1025, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.Timer.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_5Timer_4__exit__(__pyx_self, __pyx_v_self, __pyx_v_et, __pyx_v_e, __pyx_v_tb); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Timer_4__exit__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_et, CYTHON_UNUSED PyObject *__pyx_v_e, CYTHON_UNUSED PyObject *__pyx_v_tb) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 1); /* "asyncpg/protocol/protocol.pyx":1026 * * def __exit__(self, et, e, tb): * if self._budget is not None: # <<<<<<<<<<<<<< * self._budget -= time.monotonic() - self._started * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_budget_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_t_1 != Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":1027 * def __exit__(self, et, e, tb): * if self._budget is not None: * self._budget -= time.monotonic() - self._started # <<<<<<<<<<<<<< * * def get_remaining_budget(self): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_budget_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_monotonic); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_started); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_budget_2, __pyx_t_5) < 0) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "asyncpg/protocol/protocol.pyx":1026 * * def __exit__(self, et, e, tb): * if self._budget is not None: # <<<<<<<<<<<<<< * self._budget -= time.monotonic() - self._started * */ } /* "asyncpg/protocol/protocol.pyx":1025 * self._started = time.monotonic() * * def __exit__(self, et, e, tb): # <<<<<<<<<<<<<< * if self._budget is not None: * self._budget -= time.monotonic() - self._started */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("asyncpg.protocol.protocol.Timer.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":1029 * self._budget -= time.monotonic() - self._started * * def get_remaining_budget(self): # <<<<<<<<<<<<<< * return self._budget * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_7get_remaining_budget(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_7get_remaining_budget = {"get_remaining_budget", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_7get_remaining_budget, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_7get_remaining_budget(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_remaining_budget (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1029, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_remaining_budget") < 0)) __PYX_ERR(0, 1029, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_remaining_budget", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1029, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.Timer.get_remaining_budget", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_5Timer_6get_remaining_budget(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Timer_6get_remaining_budget(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_remaining_budget", 1); /* "asyncpg/protocol/protocol.pyx":1030 * * def get_remaining_budget(self): * return self._budget # <<<<<<<<<<<<<< * * def has_budget_greater_than(self, amount): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_budget_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1030, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":1029 * self._budget -= time.monotonic() - self._started * * def get_remaining_budget(self): # <<<<<<<<<<<<<< * return self._budget * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("asyncpg.protocol.protocol.Timer.get_remaining_budget", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":1032 * return self._budget * * def has_budget_greater_than(self, amount): # <<<<<<<<<<<<<< * if self._budget is None: * # Unlimited budget. */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_9has_budget_greater_than(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_9has_budget_greater_than = {"has_budget_greater_than", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_9has_budget_greater_than, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_9has_budget_greater_than(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_amount = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("has_budget_greater_than (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_amount,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1032, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_amount)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1032, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("has_budget_greater_than", 1, 2, 2, 1); __PYX_ERR(0, 1032, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "has_budget_greater_than") < 0)) __PYX_ERR(0, 1032, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_amount = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("has_budget_greater_than", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1032, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.Timer.has_budget_greater_than", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_5Timer_8has_budget_greater_than(__pyx_self, __pyx_v_self, __pyx_v_amount); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Timer_8has_budget_greater_than(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_amount) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("has_budget_greater_than", 1); /* "asyncpg/protocol/protocol.pyx":1033 * * def has_budget_greater_than(self, amount): * if self._budget is None: # <<<<<<<<<<<<<< * # Unlimited budget. * return True */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_budget_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_t_1 == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "asyncpg/protocol/protocol.pyx":1035 * if self._budget is None: * # Unlimited budget. * return True # <<<<<<<<<<<<<< * else: * return self._budget > amount */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":1033 * * def has_budget_greater_than(self, amount): * if self._budget is None: # <<<<<<<<<<<<<< * # Unlimited budget. * return True */ } /* "asyncpg/protocol/protocol.pyx":1037 * return True * else: * return self._budget > amount # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_budget_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_v_amount, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1037, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "asyncpg/protocol/protocol.pyx":1032 * return self._budget * * def has_budget_greater_than(self, amount): # <<<<<<<<<<<<<< * if self._budget is None: * # Unlimited budget. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol.Timer.has_budget_greater_than", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "asyncpg/protocol/protocol.pyx":1044 * * * def _create_record(object mapping, tuple elems): # <<<<<<<<<<<<<< * # Exposed only for testing purposes. * */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_1_create_record(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_1_create_record = {"_create_record", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_1_create_record, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_1_create_record(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_mapping = 0; PyObject *__pyx_v_elems = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_create_record (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mapping,&__pyx_n_s_elems,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mapping)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1044, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_elems)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1044, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("_create_record", 1, 2, 2, 1); __PYX_ERR(0, 1044, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_create_record") < 0)) __PYX_ERR(0, 1044, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_mapping = values[0]; __pyx_v_elems = ((PyObject*)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_create_record", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1044, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol._create_record", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elems), (&PyTuple_Type), 1, "elems", 1))) __PYX_ERR(0, 1044, __pyx_L1_error) __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol__create_record(__pyx_self, __pyx_v_mapping, __pyx_v_elems); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol__create_record(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping, PyObject *__pyx_v_elems) { PyObject *__pyx_v_rec = 0; int32_t __pyx_v_i; PyObject *__pyx_v_desc = NULL; PyObject *__pyx_v_elem = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; Py_ssize_t __pyx_t_5; int32_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_create_record", 1); /* "asyncpg/protocol/protocol.pyx":1051 * int32_t i * * if mapping is None: # <<<<<<<<<<<<<< * desc = record.ApgRecordDesc_New({}, ()) * else: */ __pyx_t_1 = (__pyx_v_mapping == Py_None); if (__pyx_t_1) { /* "asyncpg/protocol/protocol.pyx":1052 * * if mapping is None: * desc = record.ApgRecordDesc_New({}, ()) # <<<<<<<<<<<<<< * else: * desc = record.ApgRecordDesc_New( */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ApgRecordDesc_New(__pyx_t_2, __pyx_empty_tuple); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_desc = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":1051 * int32_t i * * if mapping is None: # <<<<<<<<<<<<<< * desc = record.ApgRecordDesc_New({}, ()) * else: */ goto __pyx_L3; } /* "asyncpg/protocol/protocol.pyx":1054 * desc = record.ApgRecordDesc_New({}, ()) * else: * desc = record.ApgRecordDesc_New( # <<<<<<<<<<<<<< * mapping, tuple(mapping) if mapping else ()) * */ /*else*/ { /* "asyncpg/protocol/protocol.pyx":1055 * else: * desc = record.ApgRecordDesc_New( * mapping, tuple(mapping) if mapping else ()) # <<<<<<<<<<<<<< * * rec = record.ApgRecord_New(Record, desc, len(elems)) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_mapping); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1055, __pyx_L1_error) if (__pyx_t_1) { __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_mapping); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1055, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_t_2; __pyx_t_2 = 0; } else { __Pyx_INCREF(__pyx_empty_tuple); __pyx_t_3 = __pyx_empty_tuple; } /* "asyncpg/protocol/protocol.pyx":1054 * desc = record.ApgRecordDesc_New({}, ()) * else: * desc = record.ApgRecordDesc_New( # <<<<<<<<<<<<<< * mapping, tuple(mapping) if mapping else ()) * */ __pyx_t_2 = ApgRecordDesc_New(__pyx_v_mapping, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_desc = __pyx_t_2; __pyx_t_2 = 0; } __pyx_L3:; /* "asyncpg/protocol/protocol.pyx":1057 * mapping, tuple(mapping) if mapping else ()) * * rec = record.ApgRecord_New(Record, desc, len(elems)) # <<<<<<<<<<<<<< * for i in range(len(elems)): * elem = elems[i] */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Record); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(PyType_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("type", __pyx_t_2))) __PYX_ERR(0, 1057, __pyx_L1_error) if (unlikely(__pyx_v_elems == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 1057, __pyx_L1_error) } __pyx_t_4 = __Pyx_PyTuple_GET_SIZE(__pyx_v_elems); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1057, __pyx_L1_error) __pyx_t_3 = ApgRecord_New(((PyTypeObject*)__pyx_t_2), __pyx_v_desc, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_rec = __pyx_t_3; __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":1058 * * rec = record.ApgRecord_New(Record, desc, len(elems)) * for i in range(len(elems)): # <<<<<<<<<<<<<< * elem = elems[i] * cpython.Py_INCREF(elem) */ if (unlikely(__pyx_v_elems == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 1058, __pyx_L1_error) } __pyx_t_4 = __Pyx_PyTuple_GET_SIZE(__pyx_v_elems); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1058, __pyx_L1_error) __pyx_t_5 = __pyx_t_4; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; /* "asyncpg/protocol/protocol.pyx":1059 * rec = record.ApgRecord_New(Record, desc, len(elems)) * for i in range(len(elems)): * elem = elems[i] # <<<<<<<<<<<<<< * cpython.Py_INCREF(elem) * record.ApgRecord_SET_ITEM(rec, i, elem) */ if (unlikely(__pyx_v_elems == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 1059, __pyx_L1_error) } __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_elems, __pyx_v_i, int32_t, 1, __Pyx_PyInt_From_int32_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":1060 * for i in range(len(elems)): * elem = elems[i] * cpython.Py_INCREF(elem) # <<<<<<<<<<<<<< * record.ApgRecord_SET_ITEM(rec, i, elem) * return rec */ Py_INCREF(__pyx_v_elem); /* "asyncpg/protocol/protocol.pyx":1061 * elem = elems[i] * cpython.Py_INCREF(elem) * record.ApgRecord_SET_ITEM(rec, i, elem) # <<<<<<<<<<<<<< * return rec * */ ApgRecord_SET_ITEM(__pyx_v_rec, __pyx_v_i, __pyx_v_elem); } /* "asyncpg/protocol/protocol.pyx":1062 * cpython.Py_INCREF(elem) * record.ApgRecord_SET_ITEM(rec, i, elem) * return rec # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rec); __pyx_r = __pyx_v_rec; goto __pyx_L0; /* "asyncpg/protocol/protocol.pyx":1044 * * * def _create_record(object mapping, tuple elems): # <<<<<<<<<<<<<< * # Exposed only for testing purposes. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("asyncpg.protocol.protocol._create_record", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rec); __Pyx_XDECREF(__pyx_v_desc); __Pyx_XDECREF(__pyx_v_elem); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_DataCodecConfig(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_3__pyx_unpickle_DataCodecConfig(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_3__pyx_unpickle_DataCodecConfig = {"__pyx_unpickle_DataCodecConfig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_3__pyx_unpickle_DataCodecConfig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_3__pyx_unpickle_DataCodecConfig(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_DataCodecConfig (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DataCodecConfig", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DataCodecConfig", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_DataCodecConfig") < 0)) __PYX_ERR(2, 1, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DataCodecConfig", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 1, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_DataCodecConfig", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_2__pyx_unpickle_DataCodecConfig(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_2__pyx_unpickle_DataCodecConfig(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_DataCodecConfig", 1); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0xd9a8555, 0xea6089f, 0x7336a95): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xd9a8555, 0xea6089f, 0x7336a95) = (_custom_type_codecs, _derived_type_codecs))" % __pyx_checksum */ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__60, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "(tree fragment)":5 * cdef object __pyx_result * if __pyx_checksum not in (0xd9a8555, 0xea6089f, 0x7336a95): * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xd9a8555, 0xea6089f, 0x7336a95) = (_custom_type_codecs, _derived_type_codecs))" % __pyx_checksum * __pyx_result = DataCodecConfig.__new__(__pyx_type) */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(2, 5, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v___pyx_PickleError = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * if __pyx_checksum not in (0xd9a8555, 0xea6089f, 0x7336a95): * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xd9a8555, 0xea6089f, 0x7336a95) = (_custom_type_codecs, _derived_type_codecs))" % __pyx_checksum # <<<<<<<<<<<<<< * __pyx_result = DataCodecConfig.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(2, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0xd9a8555, 0xea6089f, 0x7336a95): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xd9a8555, 0xea6089f, 0x7336a95) = (_custom_type_codecs, _derived_type_codecs))" % __pyx_checksum */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xd9a8555, 0xea6089f, 0x7336a95) = (_custom_type_codecs, _derived_type_codecs))" % __pyx_checksum * __pyx_result = DataCodecConfig.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_DataCodecConfig__set_state( __pyx_result, __pyx_state) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig), __pyx_n_s_new_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v___pyx_result = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xd9a8555, 0xea6089f, 0x7336a95) = (_custom_type_codecs, _derived_type_codecs))" % __pyx_checksum * __pyx_result = DataCodecConfig.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_DataCodecConfig__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_2 = (__pyx_v___pyx_state != Py_None); if (__pyx_t_2) { /* "(tree fragment)":9 * __pyx_result = DataCodecConfig.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_DataCodecConfig__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 9, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_DataCodecConfig__set_state(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xd9a8555, 0xea6089f, 0x7336a95) = (_custom_type_codecs, _derived_type_codecs))" % __pyx_checksum * __pyx_result = DataCodecConfig.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_DataCodecConfig__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: * __pyx_unpickle_DataCodecConfig__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, tuple __pyx_state): * __pyx_result._custom_type_codecs = __pyx_state[0]; __pyx_result._derived_type_codecs = __pyx_state[1] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_DataCodecConfig(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_DataCodecConfig", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":11 * __pyx_unpickle_DataCodecConfig__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._custom_type_codecs = __pyx_state[0]; __pyx_result._derived_type_codecs = __pyx_state[1] * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_DataCodecConfig__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_DataCodecConfig__set_state", 1); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, tuple __pyx_state): * __pyx_result._custom_type_codecs = __pyx_state[0]; __pyx_result._derived_type_codecs = __pyx_state[1] # <<<<<<<<<<<<<< * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[2]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_custom_type_codecs); __Pyx_DECREF(__pyx_v___pyx_result->_custom_type_codecs); __pyx_v___pyx_result->_custom_type_codecs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_derived_type_codecs); __Pyx_DECREF(__pyx_v___pyx_result->_derived_type_codecs); __pyx_v___pyx_result->_derived_type_codecs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, tuple __pyx_state): * __pyx_result._custom_type_codecs = __pyx_state[0]; __pyx_result._derived_type_codecs = __pyx_state[1] * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[2]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(2, 13, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error) __pyx_t_4 = (__pyx_t_3 > 2); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error) __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "(tree fragment)":14 * __pyx_result._custom_type_codecs = __pyx_state[0]; __pyx_result._derived_type_codecs = __pyx_state[1] * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[2]) # <<<<<<<<<<<<<< */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 14, __pyx_L1_error) } __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, tuple __pyx_state): * __pyx_result._custom_type_codecs = __pyx_state[0]; __pyx_result._derived_type_codecs = __pyx_state[1] * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[2]) */ } /* "(tree fragment)":11 * __pyx_unpickle_DataCodecConfig__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._custom_type_codecs = __pyx_state[0]; __pyx_result._derived_type_codecs = __pyx_state[1] * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_DataCodecConfig__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_CoreProtocol(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5__pyx_unpickle_CoreProtocol(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_5__pyx_unpickle_CoreProtocol = {"__pyx_unpickle_CoreProtocol", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_5__pyx_unpickle_CoreProtocol, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5__pyx_unpickle_CoreProtocol(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_CoreProtocol (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CoreProtocol", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CoreProtocol", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_CoreProtocol") < 0)) __PYX_ERR(2, 1, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CoreProtocol", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 1, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_CoreProtocol", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_4__pyx_unpickle_CoreProtocol(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_4__pyx_unpickle_CoreProtocol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_CoreProtocol", 1); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0xa7a9ac8, 0xf0eeb4b, 0x55a24b7): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xa7a9ac8, 0xf0eeb4b, 0x55a24b7) = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, con_params, con_status, encoding, gss_ctx, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, scram, state, transport, xact_status))" % __pyx_checksum */ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__61, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "(tree fragment)":5 * cdef object __pyx_result * if __pyx_checksum not in (0xa7a9ac8, 0xf0eeb4b, 0x55a24b7): * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xa7a9ac8, 0xf0eeb4b, 0x55a24b7) = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, con_params, con_status, encoding, gss_ctx, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, scram, state, transport, xact_status))" % __pyx_checksum * __pyx_result = CoreProtocol.__new__(__pyx_type) */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(2, 5, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v___pyx_PickleError = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * if __pyx_checksum not in (0xa7a9ac8, 0xf0eeb4b, 0x55a24b7): * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xa7a9ac8, 0xf0eeb4b, 0x55a24b7) = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, con_params, con_status, encoding, gss_ctx, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, scram, state, transport, xact_status))" % __pyx_checksum # <<<<<<<<<<<<<< * __pyx_result = CoreProtocol.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(2, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0xa7a9ac8, 0xf0eeb4b, 0x55a24b7): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xa7a9ac8, 0xf0eeb4b, 0x55a24b7) = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, con_params, con_status, encoding, gss_ctx, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, scram, state, transport, xact_status))" % __pyx_checksum */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xa7a9ac8, 0xf0eeb4b, 0x55a24b7) = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, con_params, con_status, encoding, gss_ctx, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, scram, state, transport, xact_status))" % __pyx_checksum * __pyx_result = CoreProtocol.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_CoreProtocol__set_state( __pyx_result, __pyx_state) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol), __pyx_n_s_new_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v___pyx_result = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xa7a9ac8, 0xf0eeb4b, 0x55a24b7) = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, con_params, con_status, encoding, gss_ctx, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, scram, state, transport, xact_status))" % __pyx_checksum * __pyx_result = CoreProtocol.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_CoreProtocol__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_2 = (__pyx_v___pyx_state != Py_None); if (__pyx_t_2) { /* "(tree fragment)":9 * __pyx_result = CoreProtocol.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_CoreProtocol__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 9, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_CoreProtocol__set_state(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xa7a9ac8, 0xf0eeb4b, 0x55a24b7) = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, con_params, con_status, encoding, gss_ctx, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, scram, state, transport, xact_status))" % __pyx_checksum * __pyx_result = CoreProtocol.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_CoreProtocol__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: * __pyx_unpickle_CoreProtocol__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, tuple __pyx_state): * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._skip_discard = __pyx_state[4]; __pyx_result.address = __pyx_state[5]; __pyx_result.backend_pid = __pyx_state[6]; __pyx_result.backend_secret = __pyx_state[7]; __pyx_result.buffer = __pyx_state[8]; __pyx_result.con_params = __pyx_state[9]; __pyx_result.con_status = __pyx_state[10]; __pyx_result.encoding = __pyx_state[11]; __pyx_result.gss_ctx = __pyx_state[12]; __pyx_result.result = __pyx_state[13]; __pyx_result.result_execute_completed = __pyx_state[14]; __pyx_result.result_param_desc = __pyx_state[15]; __pyx_result.result_row_desc = __pyx_state[16]; __pyx_result.result_status_msg = __pyx_state[17]; __pyx_result.result_type = __pyx_state[18]; __pyx_result.scram = __pyx_state[19]; __pyx_result.state = __pyx_state[20]; __pyx_result.transport = __pyx_state[21]; __pyx_result.xact_status = __pyx_state[22] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_CoreProtocol(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_CoreProtocol", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":11 * __pyx_unpickle_CoreProtocol__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._skip_discard = __pyx_state[4]; __pyx_result.address = __pyx_state[5]; __pyx_result.backend_pid = __pyx_state[6]; __pyx_result.backend_secret = __pyx_state[7]; __pyx_result.buffer = __pyx_state[8]; __pyx_result.con_params = __pyx_state[9]; __pyx_result.con_status = __pyx_state[10]; __pyx_result.encoding = __pyx_state[11]; __pyx_result.gss_ctx = __pyx_state[12]; __pyx_result.result = __pyx_state[13]; __pyx_result.result_execute_completed = __pyx_state[14]; __pyx_result.result_param_desc = __pyx_state[15]; __pyx_result.result_row_desc = __pyx_state[16]; __pyx_result.result_status_msg = __pyx_state[17]; __pyx_result.result_type = __pyx_state[18]; __pyx_result.scram = __pyx_state[19]; __pyx_result.state = __pyx_state[20]; __pyx_result.transport = __pyx_state[21]; __pyx_result.xact_status = __pyx_state[22] * if len(__pyx_state) > 23 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_CoreProtocol__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int32_t __pyx_t_3; enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus __pyx_t_4; enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType __pyx_t_5; enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState __pyx_t_6; enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus __pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; unsigned int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_CoreProtocol__set_state", 1); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, tuple __pyx_state): * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._skip_discard = __pyx_state[4]; __pyx_result.address = __pyx_state[5]; __pyx_result.backend_pid = __pyx_state[6]; __pyx_result.backend_secret = __pyx_state[7]; __pyx_result.buffer = __pyx_state[8]; __pyx_result.con_params = __pyx_state[9]; __pyx_result.con_status = __pyx_state[10]; __pyx_result.encoding = __pyx_state[11]; __pyx_result.gss_ctx = __pyx_state[12]; __pyx_result.result = __pyx_state[13]; __pyx_result.result_execute_completed = __pyx_state[14]; __pyx_result.result_param_desc = __pyx_state[15]; __pyx_result.result_row_desc = __pyx_state[16]; __pyx_result.result_status_msg = __pyx_state[17]; __pyx_result.result_type = __pyx_state[18]; __pyx_result.scram = __pyx_state[19]; __pyx_result.state = __pyx_state[20]; __pyx_result.transport = __pyx_state[21]; __pyx_result.xact_status = __pyx_state[22] # <<<<<<<<<<<<<< * if len(__pyx_state) > 23 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[23]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_discard_data = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_execute_iter); __Pyx_DECREF(__pyx_v___pyx_result->_execute_iter); __pyx_v___pyx_result->_execute_iter = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_execute_portal_name); __Pyx_DECREF(__pyx_v___pyx_result->_execute_portal_name); __pyx_v___pyx_result->_execute_portal_name = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_execute_stmt_name); __Pyx_DECREF(__pyx_v___pyx_result->_execute_stmt_name); __pyx_v___pyx_result->_execute_stmt_name = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_skip_discard = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->address); __Pyx_DECREF(__pyx_v___pyx_result->address); __pyx_v___pyx_result->address = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->backend_pid = __pyx_t_3; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->backend_secret = __pyx_t_3; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer))))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->buffer); __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->buffer); __pyx_v___pyx_result->buffer = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->con_params); __Pyx_DECREF(__pyx_v___pyx_result->con_params); __pyx_v___pyx_result->con_params = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->con_status = __pyx_t_4; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->encoding); __Pyx_DECREF(__pyx_v___pyx_result->encoding); __pyx_v___pyx_result->encoding = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->gss_ctx); __Pyx_DECREF(__pyx_v___pyx_result->gss_ctx); __pyx_v___pyx_result->gss_ctx = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->result); __Pyx_DECREF(__pyx_v___pyx_result->result); __pyx_v___pyx_result->result = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->result_execute_completed = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->result_param_desc); __Pyx_DECREF(__pyx_v___pyx_result->result_param_desc); __pyx_v___pyx_result->result_param_desc = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->result_row_desc); __Pyx_DECREF(__pyx_v___pyx_result->result_row_desc); __pyx_v___pyx_result->result_row_desc = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->result_status_msg); __Pyx_DECREF(__pyx_v___pyx_result->result_status_msg); __pyx_v___pyx_result->result_status_msg = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 18, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->result_type = __pyx_t_5; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 19, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication))))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->scram); __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->scram); __pyx_v___pyx_result->scram = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 20, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->state = __pyx_t_6; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 21, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->transport); __Pyx_DECREF(__pyx_v___pyx_result->transport); __pyx_v___pyx_result->transport = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 22, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->xact_status = __pyx_t_7; /* "(tree fragment)":13 * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, tuple __pyx_state): * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._skip_discard = __pyx_state[4]; __pyx_result.address = __pyx_state[5]; __pyx_result.backend_pid = __pyx_state[6]; __pyx_result.backend_secret = __pyx_state[7]; __pyx_result.buffer = __pyx_state[8]; __pyx_result.con_params = __pyx_state[9]; __pyx_result.con_status = __pyx_state[10]; __pyx_result.encoding = __pyx_state[11]; __pyx_result.gss_ctx = __pyx_state[12]; __pyx_result.result = __pyx_state[13]; __pyx_result.result_execute_completed = __pyx_state[14]; __pyx_result.result_param_desc = __pyx_state[15]; __pyx_result.result_row_desc = __pyx_state[16]; __pyx_result.result_status_msg = __pyx_state[17]; __pyx_result.result_type = __pyx_state[18]; __pyx_result.scram = __pyx_state[19]; __pyx_result.state = __pyx_state[20]; __pyx_result.transport = __pyx_state[21]; __pyx_result.xact_status = __pyx_state[22] * if len(__pyx_state) > 23 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[23]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(2, 13, __pyx_L1_error) } __pyx_t_8 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error) __pyx_t_9 = (__pyx_t_8 > 23); if (__pyx_t_9) { } else { __pyx_t_2 = __pyx_t_9; goto __pyx_L4_bool_binop_done; } __pyx_t_9 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error) __pyx_t_2 = __pyx_t_9; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "(tree fragment)":14 * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._skip_discard = __pyx_state[4]; __pyx_result.address = __pyx_state[5]; __pyx_result.backend_pid = __pyx_state[6]; __pyx_result.backend_secret = __pyx_state[7]; __pyx_result.buffer = __pyx_state[8]; __pyx_result.con_params = __pyx_state[9]; __pyx_result.con_status = __pyx_state[10]; __pyx_result.encoding = __pyx_state[11]; __pyx_result.gss_ctx = __pyx_state[12]; __pyx_result.result = __pyx_state[13]; __pyx_result.result_execute_completed = __pyx_state[14]; __pyx_result.result_param_desc = __pyx_state[15]; __pyx_result.result_row_desc = __pyx_state[16]; __pyx_result.result_status_msg = __pyx_state[17]; __pyx_result.result_type = __pyx_state[18]; __pyx_result.scram = __pyx_state[19]; __pyx_result.state = __pyx_state[20]; __pyx_result.transport = __pyx_state[21]; __pyx_result.xact_status = __pyx_state[22] * if len(__pyx_state) > 23 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[23]) # <<<<<<<<<<<<<< */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_update); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 14, __pyx_L1_error) } __pyx_t_10 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 23, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = NULL; __pyx_t_13 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_13 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_10}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, tuple __pyx_state): * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._skip_discard = __pyx_state[4]; __pyx_result.address = __pyx_state[5]; __pyx_result.backend_pid = __pyx_state[6]; __pyx_result.backend_secret = __pyx_state[7]; __pyx_result.buffer = __pyx_state[8]; __pyx_result.con_params = __pyx_state[9]; __pyx_result.con_status = __pyx_state[10]; __pyx_result.encoding = __pyx_state[11]; __pyx_result.gss_ctx = __pyx_state[12]; __pyx_result.result = __pyx_state[13]; __pyx_result.result_execute_completed = __pyx_state[14]; __pyx_result.result_param_desc = __pyx_state[15]; __pyx_result.result_row_desc = __pyx_state[16]; __pyx_result.result_status_msg = __pyx_state[17]; __pyx_result.result_type = __pyx_state[18]; __pyx_result.scram = __pyx_state[19]; __pyx_result.state = __pyx_state[20]; __pyx_result.transport = __pyx_state[21]; __pyx_result.xact_status = __pyx_state[22] * if len(__pyx_state) > 23 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[23]) */ } /* "(tree fragment)":11 * __pyx_unpickle_CoreProtocol__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._skip_discard = __pyx_state[4]; __pyx_result.address = __pyx_state[5]; __pyx_result.backend_pid = __pyx_state[6]; __pyx_result.backend_secret = __pyx_state[7]; __pyx_result.buffer = __pyx_state[8]; __pyx_result.con_params = __pyx_state[9]; __pyx_result.con_status = __pyx_state[10]; __pyx_result.encoding = __pyx_state[11]; __pyx_result.gss_ctx = __pyx_state[12]; __pyx_result.result = __pyx_state[13]; __pyx_result.result_execute_completed = __pyx_state[14]; __pyx_result.result_param_desc = __pyx_state[15]; __pyx_result.result_row_desc = __pyx_state[16]; __pyx_result.result_status_msg = __pyx_state[17]; __pyx_result.result_type = __pyx_state[18]; __pyx_result.scram = __pyx_state[19]; __pyx_result.state = __pyx_state[20]; __pyx_result.transport = __pyx_state[21]; __pyx_result.xact_status = __pyx_state[22] * if len(__pyx_state) > 23 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_CoreProtocol__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_BaseProtocol(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_7__pyx_unpickle_BaseProtocol(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_7__pyx_unpickle_BaseProtocol = {"__pyx_unpickle_BaseProtocol", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_7__pyx_unpickle_BaseProtocol, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_7__pyx_unpickle_BaseProtocol(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_BaseProtocol (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BaseProtocol", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BaseProtocol", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_BaseProtocol") < 0)) __PYX_ERR(2, 1, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BaseProtocol", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 1, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_BaseProtocol", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_6__pyx_unpickle_BaseProtocol(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_6__pyx_unpickle_BaseProtocol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_BaseProtocol", 1); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0x804a80d, 0x270b831, 0xdd78461): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x804a80d, 0x270b831, 0xdd78461) = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _is_ssl, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, con_params, con_status, conref, create_future, encoding, gss_ctx, is_reading, last_query, loop, queries_count, record_class, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, scram, settings, state, statement, timeout_handle, transport, waiter, writing_paused, xact_status))" % __pyx_checksum */ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__62, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "(tree fragment)":5 * cdef object __pyx_result * if __pyx_checksum not in (0x804a80d, 0x270b831, 0xdd78461): * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x804a80d, 0x270b831, 0xdd78461) = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _is_ssl, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, con_params, con_status, conref, create_future, encoding, gss_ctx, is_reading, last_query, loop, queries_count, record_class, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, scram, settings, state, statement, timeout_handle, transport, waiter, writing_paused, xact_status))" % __pyx_checksum * __pyx_result = BaseProtocol.__new__(__pyx_type) */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(2, 5, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v___pyx_PickleError = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * if __pyx_checksum not in (0x804a80d, 0x270b831, 0xdd78461): * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x804a80d, 0x270b831, 0xdd78461) = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _is_ssl, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, con_params, con_status, conref, create_future, encoding, gss_ctx, is_reading, last_query, loop, queries_count, record_class, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, scram, settings, state, statement, timeout_handle, transport, waiter, writing_paused, xact_status))" % __pyx_checksum # <<<<<<<<<<<<<< * __pyx_result = BaseProtocol.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_3, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(2, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0x804a80d, 0x270b831, 0xdd78461): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x804a80d, 0x270b831, 0xdd78461) = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _is_ssl, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, con_params, con_status, conref, create_future, encoding, gss_ctx, is_reading, last_query, loop, queries_count, record_class, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, scram, settings, state, statement, timeout_handle, transport, waiter, writing_paused, xact_status))" % __pyx_checksum */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x804a80d, 0x270b831, 0xdd78461) = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _is_ssl, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, con_params, con_status, conref, create_future, encoding, gss_ctx, is_reading, last_query, loop, queries_count, record_class, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, scram, settings, state, statement, timeout_handle, transport, waiter, writing_paused, xact_status))" % __pyx_checksum * __pyx_result = BaseProtocol.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_BaseProtocol__set_state( __pyx_result, __pyx_state) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol), __pyx_n_s_new_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v___pyx_result = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x804a80d, 0x270b831, 0xdd78461) = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _is_ssl, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, con_params, con_status, conref, create_future, encoding, gss_ctx, is_reading, last_query, loop, queries_count, record_class, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, scram, settings, state, statement, timeout_handle, transport, waiter, writing_paused, xact_status))" % __pyx_checksum * __pyx_result = BaseProtocol.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_BaseProtocol__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_2 = (__pyx_v___pyx_state != Py_None); if (__pyx_t_2) { /* "(tree fragment)":9 * __pyx_result = BaseProtocol.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_BaseProtocol__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 9, __pyx_L1_error) __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_BaseProtocol__set_state(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x804a80d, 0x270b831, 0xdd78461) = (_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _is_ssl, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, con_params, con_status, conref, create_future, encoding, gss_ctx, is_reading, last_query, loop, queries_count, record_class, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, scram, settings, state, statement, timeout_handle, transport, waiter, writing_paused, xact_status))" % __pyx_checksum * __pyx_result = BaseProtocol.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_BaseProtocol__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: * __pyx_unpickle_BaseProtocol__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, tuple __pyx_state): * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._is_ssl = __pyx_state[4]; __pyx_result._skip_discard = __pyx_state[5]; __pyx_result.address = __pyx_state[6]; __pyx_result.backend_pid = __pyx_state[7]; __pyx_result.backend_secret = __pyx_state[8]; __pyx_result.buffer = __pyx_state[9]; __pyx_result.cancel_sent_waiter = __pyx_state[10]; __pyx_result.cancel_waiter = __pyx_state[11]; __pyx_result.closing = __pyx_state[12]; __pyx_result.con_params = __pyx_state[13]; __pyx_result.con_status = __pyx_state[14]; __pyx_result.conref = __pyx_state[15]; __pyx_result.create_future = __pyx_state[16]; __pyx_result.encoding = __pyx_state[17]; __pyx_result.gss_ctx = __pyx_state[18]; __pyx_result.is_reading = __pyx_state[19]; __pyx_result.last_query = __pyx_state[20]; __pyx_result.loop = __pyx_state[21]; __pyx_result.queries_count = __pyx_state[22]; __pyx_result.record_class = __pyx_state[23]; __pyx_result.result = __pyx_state[24]; __pyx_result.result_execute_completed = __pyx_state[25]; __pyx_result.result_param_desc = __pyx_state[26]; __pyx_result.result_row_desc = __pyx_state[27]; __pyx_result.result_status_msg = __pyx_state[28]; __pyx_result.result_type = __pyx_state[29]; __pyx_result.return_extra = __pyx_state[30]; __pyx_result.scram = __pyx_state[31]; __pyx_result.settings = __pyx_state[32]; __pyx_result.state = __pyx_state[33]; __pyx_result.statement = __pyx_state[34]; __pyx_result.timeout_handle = __pyx_state[35]; __pyx_result.transport = __pyx_state[36]; __pyx_result.waiter = __pyx_state[37]; __pyx_result.writing_paused = __pyx_state[38]; __pyx_result.xact_status = __pyx_state[39] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_BaseProtocol(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_BaseProtocol", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":11 * __pyx_unpickle_BaseProtocol__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._is_ssl = __pyx_state[4]; __pyx_result._skip_discard = __pyx_state[5]; __pyx_result.address = __pyx_state[6]; __pyx_result.backend_pid = __pyx_state[7]; __pyx_result.backend_secret = __pyx_state[8]; __pyx_result.buffer = __pyx_state[9]; __pyx_result.cancel_sent_waiter = __pyx_state[10]; __pyx_result.cancel_waiter = __pyx_state[11]; __pyx_result.closing = __pyx_state[12]; __pyx_result.con_params = __pyx_state[13]; __pyx_result.con_status = __pyx_state[14]; __pyx_result.conref = __pyx_state[15]; __pyx_result.create_future = __pyx_state[16]; __pyx_result.encoding = __pyx_state[17]; __pyx_result.gss_ctx = __pyx_state[18]; __pyx_result.is_reading = __pyx_state[19]; __pyx_result.last_query = __pyx_state[20]; __pyx_result.loop = __pyx_state[21]; __pyx_result.queries_count = __pyx_state[22]; __pyx_result.record_class = __pyx_state[23]; __pyx_result.result = __pyx_state[24]; __pyx_result.result_execute_completed = __pyx_state[25]; __pyx_result.result_param_desc = __pyx_state[26]; __pyx_result.result_row_desc = __pyx_state[27]; __pyx_result.result_status_msg = __pyx_state[28]; __pyx_result.result_type = __pyx_state[29]; __pyx_result.return_extra = __pyx_state[30]; __pyx_result.scram = __pyx_state[31]; __pyx_result.settings = __pyx_state[32]; __pyx_result.state = __pyx_state[33]; __pyx_result.statement = __pyx_state[34]; __pyx_result.timeout_handle = __pyx_state[35]; __pyx_result.transport = __pyx_state[36]; __pyx_result.waiter = __pyx_state[37]; __pyx_result.writing_paused = __pyx_state[38]; __pyx_result.xact_status = __pyx_state[39] * if len(__pyx_state) > 40 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_BaseProtocol__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int32_t __pyx_t_3; enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus __pyx_t_4; uint64_t __pyx_t_5; enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType __pyx_t_6; enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState __pyx_t_7; enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; unsigned int __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_BaseProtocol__set_state", 1); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, tuple __pyx_state): * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._is_ssl = __pyx_state[4]; __pyx_result._skip_discard = __pyx_state[5]; __pyx_result.address = __pyx_state[6]; __pyx_result.backend_pid = __pyx_state[7]; __pyx_result.backend_secret = __pyx_state[8]; __pyx_result.buffer = __pyx_state[9]; __pyx_result.cancel_sent_waiter = __pyx_state[10]; __pyx_result.cancel_waiter = __pyx_state[11]; __pyx_result.closing = __pyx_state[12]; __pyx_result.con_params = __pyx_state[13]; __pyx_result.con_status = __pyx_state[14]; __pyx_result.conref = __pyx_state[15]; __pyx_result.create_future = __pyx_state[16]; __pyx_result.encoding = __pyx_state[17]; __pyx_result.gss_ctx = __pyx_state[18]; __pyx_result.is_reading = __pyx_state[19]; __pyx_result.last_query = __pyx_state[20]; __pyx_result.loop = __pyx_state[21]; __pyx_result.queries_count = __pyx_state[22]; __pyx_result.record_class = __pyx_state[23]; __pyx_result.result = __pyx_state[24]; __pyx_result.result_execute_completed = __pyx_state[25]; __pyx_result.result_param_desc = __pyx_state[26]; __pyx_result.result_row_desc = __pyx_state[27]; __pyx_result.result_status_msg = __pyx_state[28]; __pyx_result.result_type = __pyx_state[29]; __pyx_result.return_extra = __pyx_state[30]; __pyx_result.scram = __pyx_state[31]; __pyx_result.settings = __pyx_state[32]; __pyx_result.state = __pyx_state[33]; __pyx_result.statement = __pyx_state[34]; __pyx_result.timeout_handle = __pyx_state[35]; __pyx_result.transport = __pyx_state[36]; __pyx_result.waiter = __pyx_state[37]; __pyx_result.writing_paused = __pyx_state[38]; __pyx_result.xact_status = __pyx_state[39] # <<<<<<<<<<<<<< * if len(__pyx_state) > 40 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[40]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base._discard_data = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base._execute_iter); __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base._execute_iter); __pyx_v___pyx_result->__pyx_base._execute_iter = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base._execute_portal_name); __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base._execute_portal_name); __pyx_v___pyx_result->__pyx_base._execute_portal_name = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base._execute_stmt_name); __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base._execute_stmt_name); __pyx_v___pyx_result->__pyx_base._execute_stmt_name = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->_is_ssl = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base._skip_discard = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.address); __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.address); __pyx_v___pyx_result->__pyx_base.address = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base.backend_pid = __pyx_t_3; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base.backend_secret = __pyx_t_3; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer))))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.buffer); __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.buffer); __pyx_v___pyx_result->__pyx_base.buffer = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->cancel_sent_waiter); __Pyx_DECREF(__pyx_v___pyx_result->cancel_sent_waiter); __pyx_v___pyx_result->cancel_sent_waiter = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->cancel_waiter); __Pyx_DECREF(__pyx_v___pyx_result->cancel_waiter); __pyx_v___pyx_result->cancel_waiter = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->closing = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.con_params); __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.con_params); __pyx_v___pyx_result->__pyx_base.con_params = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base.con_status = __pyx_t_4; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->conref); __Pyx_DECREF(__pyx_v___pyx_result->conref); __pyx_v___pyx_result->conref = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->create_future); __Pyx_DECREF(__pyx_v___pyx_result->create_future); __pyx_v___pyx_result->create_future = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.encoding); __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.encoding); __pyx_v___pyx_result->__pyx_base.encoding = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 18, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.gss_ctx); __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.gss_ctx); __pyx_v___pyx_result->__pyx_base.gss_ctx = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 19, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->is_reading = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 20, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->last_query); __Pyx_DECREF(__pyx_v___pyx_result->last_query); __pyx_v___pyx_result->last_query = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 21, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->loop); __Pyx_DECREF(__pyx_v___pyx_result->loop); __pyx_v___pyx_result->loop = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 22, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_5 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->queries_count = __pyx_t_5; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 23, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("type", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->record_class); __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->record_class); __pyx_v___pyx_result->record_class = ((PyTypeObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 24, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.result); __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.result); __pyx_v___pyx_result->__pyx_base.result = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 25, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base.result_execute_completed = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 26, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.result_param_desc); __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.result_param_desc); __pyx_v___pyx_result->__pyx_base.result_param_desc = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 27, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.result_row_desc); __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.result_row_desc); __pyx_v___pyx_result->__pyx_base.result_row_desc = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 28, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.result_status_msg); __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.result_status_msg); __pyx_v___pyx_result->__pyx_base.result_status_msg = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 29, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base.result_type = __pyx_t_6; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 30, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->return_extra = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 31, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication))))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.scram); __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.scram); __pyx_v___pyx_result->__pyx_base.scram = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 32, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings))))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->settings); __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->settings); __pyx_v___pyx_result->settings = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 33, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base.state = __pyx_t_7; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 34, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState))))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->statement); __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->statement); __pyx_v___pyx_result->statement = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 35, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->timeout_handle); __Pyx_DECREF(__pyx_v___pyx_result->timeout_handle); __pyx_v___pyx_result->timeout_handle = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 36, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.transport); __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.transport); __pyx_v___pyx_result->__pyx_base.transport = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 37, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->waiter); __Pyx_DECREF(__pyx_v___pyx_result->waiter); __pyx_v___pyx_result->waiter = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 38, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->writing_paused = __pyx_t_2; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 39, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)__Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->__pyx_base.xact_status = __pyx_t_8; /* "(tree fragment)":13 * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, tuple __pyx_state): * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._is_ssl = __pyx_state[4]; __pyx_result._skip_discard = __pyx_state[5]; __pyx_result.address = __pyx_state[6]; __pyx_result.backend_pid = __pyx_state[7]; __pyx_result.backend_secret = __pyx_state[8]; __pyx_result.buffer = __pyx_state[9]; __pyx_result.cancel_sent_waiter = __pyx_state[10]; __pyx_result.cancel_waiter = __pyx_state[11]; __pyx_result.closing = __pyx_state[12]; __pyx_result.con_params = __pyx_state[13]; __pyx_result.con_status = __pyx_state[14]; __pyx_result.conref = __pyx_state[15]; __pyx_result.create_future = __pyx_state[16]; __pyx_result.encoding = __pyx_state[17]; __pyx_result.gss_ctx = __pyx_state[18]; __pyx_result.is_reading = __pyx_state[19]; __pyx_result.last_query = __pyx_state[20]; __pyx_result.loop = __pyx_state[21]; __pyx_result.queries_count = __pyx_state[22]; __pyx_result.record_class = __pyx_state[23]; __pyx_result.result = __pyx_state[24]; __pyx_result.result_execute_completed = __pyx_state[25]; __pyx_result.result_param_desc = __pyx_state[26]; __pyx_result.result_row_desc = __pyx_state[27]; __pyx_result.result_status_msg = __pyx_state[28]; __pyx_result.result_type = __pyx_state[29]; __pyx_result.return_extra = __pyx_state[30]; __pyx_result.scram = __pyx_state[31]; __pyx_result.settings = __pyx_state[32]; __pyx_result.state = __pyx_state[33]; __pyx_result.statement = __pyx_state[34]; __pyx_result.timeout_handle = __pyx_state[35]; __pyx_result.transport = __pyx_state[36]; __pyx_result.waiter = __pyx_state[37]; __pyx_result.writing_paused = __pyx_state[38]; __pyx_result.xact_status = __pyx_state[39] * if len(__pyx_state) > 40 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[40]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(2, 13, __pyx_L1_error) } __pyx_t_9 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error) __pyx_t_10 = (__pyx_t_9 > 40); if (__pyx_t_10) { } else { __pyx_t_2 = __pyx_t_10; goto __pyx_L4_bool_binop_done; } __pyx_t_10 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error) __pyx_t_2 = __pyx_t_10; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "(tree fragment)":14 * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._is_ssl = __pyx_state[4]; __pyx_result._skip_discard = __pyx_state[5]; __pyx_result.address = __pyx_state[6]; __pyx_result.backend_pid = __pyx_state[7]; __pyx_result.backend_secret = __pyx_state[8]; __pyx_result.buffer = __pyx_state[9]; __pyx_result.cancel_sent_waiter = __pyx_state[10]; __pyx_result.cancel_waiter = __pyx_state[11]; __pyx_result.closing = __pyx_state[12]; __pyx_result.con_params = __pyx_state[13]; __pyx_result.con_status = __pyx_state[14]; __pyx_result.conref = __pyx_state[15]; __pyx_result.create_future = __pyx_state[16]; __pyx_result.encoding = __pyx_state[17]; __pyx_result.gss_ctx = __pyx_state[18]; __pyx_result.is_reading = __pyx_state[19]; __pyx_result.last_query = __pyx_state[20]; __pyx_result.loop = __pyx_state[21]; __pyx_result.queries_count = __pyx_state[22]; __pyx_result.record_class = __pyx_state[23]; __pyx_result.result = __pyx_state[24]; __pyx_result.result_execute_completed = __pyx_state[25]; __pyx_result.result_param_desc = __pyx_state[26]; __pyx_result.result_row_desc = __pyx_state[27]; __pyx_result.result_status_msg = __pyx_state[28]; __pyx_result.result_type = __pyx_state[29]; __pyx_result.return_extra = __pyx_state[30]; __pyx_result.scram = __pyx_state[31]; __pyx_result.settings = __pyx_state[32]; __pyx_result.state = __pyx_state[33]; __pyx_result.statement = __pyx_state[34]; __pyx_result.timeout_handle = __pyx_state[35]; __pyx_result.transport = __pyx_state[36]; __pyx_result.waiter = __pyx_state[37]; __pyx_result.writing_paused = __pyx_state[38]; __pyx_result.xact_status = __pyx_state[39] * if len(__pyx_state) > 40 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[40]) # <<<<<<<<<<<<<< */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_update); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 14, __pyx_L1_error) } __pyx_t_11 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 40, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_13 = NULL; __pyx_t_14 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_14 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_11}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, tuple __pyx_state): * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._is_ssl = __pyx_state[4]; __pyx_result._skip_discard = __pyx_state[5]; __pyx_result.address = __pyx_state[6]; __pyx_result.backend_pid = __pyx_state[7]; __pyx_result.backend_secret = __pyx_state[8]; __pyx_result.buffer = __pyx_state[9]; __pyx_result.cancel_sent_waiter = __pyx_state[10]; __pyx_result.cancel_waiter = __pyx_state[11]; __pyx_result.closing = __pyx_state[12]; __pyx_result.con_params = __pyx_state[13]; __pyx_result.con_status = __pyx_state[14]; __pyx_result.conref = __pyx_state[15]; __pyx_result.create_future = __pyx_state[16]; __pyx_result.encoding = __pyx_state[17]; __pyx_result.gss_ctx = __pyx_state[18]; __pyx_result.is_reading = __pyx_state[19]; __pyx_result.last_query = __pyx_state[20]; __pyx_result.loop = __pyx_state[21]; __pyx_result.queries_count = __pyx_state[22]; __pyx_result.record_class = __pyx_state[23]; __pyx_result.result = __pyx_state[24]; __pyx_result.result_execute_completed = __pyx_state[25]; __pyx_result.result_param_desc = __pyx_state[26]; __pyx_result.result_row_desc = __pyx_state[27]; __pyx_result.result_status_msg = __pyx_state[28]; __pyx_result.result_type = __pyx_state[29]; __pyx_result.return_extra = __pyx_state[30]; __pyx_result.scram = __pyx_state[31]; __pyx_result.settings = __pyx_state[32]; __pyx_result.state = __pyx_state[33]; __pyx_result.statement = __pyx_state[34]; __pyx_result.timeout_handle = __pyx_state[35]; __pyx_result.transport = __pyx_state[36]; __pyx_result.waiter = __pyx_state[37]; __pyx_result.writing_paused = __pyx_state[38]; __pyx_result.xact_status = __pyx_state[39] * if len(__pyx_state) > 40 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[40]) */ } /* "(tree fragment)":11 * __pyx_unpickle_BaseProtocol__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._is_ssl = __pyx_state[4]; __pyx_result._skip_discard = __pyx_state[5]; __pyx_result.address = __pyx_state[6]; __pyx_result.backend_pid = __pyx_state[7]; __pyx_result.backend_secret = __pyx_state[8]; __pyx_result.buffer = __pyx_state[9]; __pyx_result.cancel_sent_waiter = __pyx_state[10]; __pyx_result.cancel_waiter = __pyx_state[11]; __pyx_result.closing = __pyx_state[12]; __pyx_result.con_params = __pyx_state[13]; __pyx_result.con_status = __pyx_state[14]; __pyx_result.conref = __pyx_state[15]; __pyx_result.create_future = __pyx_state[16]; __pyx_result.encoding = __pyx_state[17]; __pyx_result.gss_ctx = __pyx_state[18]; __pyx_result.is_reading = __pyx_state[19]; __pyx_result.last_query = __pyx_state[20]; __pyx_result.loop = __pyx_state[21]; __pyx_result.queries_count = __pyx_state[22]; __pyx_result.record_class = __pyx_state[23]; __pyx_result.result = __pyx_state[24]; __pyx_result.result_execute_completed = __pyx_state[25]; __pyx_result.result_param_desc = __pyx_state[26]; __pyx_result.result_row_desc = __pyx_state[27]; __pyx_result.result_status_msg = __pyx_state[28]; __pyx_result.result_type = __pyx_state[29]; __pyx_result.return_extra = __pyx_state[30]; __pyx_result.scram = __pyx_state[31]; __pyx_result.settings = __pyx_state[32]; __pyx_result.state = __pyx_state[33]; __pyx_result.statement = __pyx_state[34]; __pyx_result.timeout_handle = __pyx_state[35]; __pyx_result.transport = __pyx_state[36]; __pyx_result.waiter = __pyx_state[37]; __pyx_result.writing_paused = __pyx_state[38]; __pyx_result.xact_status = __pyx_state[39] * if len(__pyx_state) > 40 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_BaseProtocol__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_Codec __pyx_vtable_7asyncpg_8protocol_8protocol_Codec; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_Codec(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)o); p->__pyx_vtab = __pyx_vtabptr_7asyncpg_8protocol_8protocol_Codec; p->name = ((PyObject*)Py_None); Py_INCREF(Py_None); p->schema = ((PyObject*)Py_None); Py_INCREF(Py_None); p->kind = ((PyObject*)Py_None); Py_INCREF(Py_None); p->base_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None); Py_INCREF(Py_None); p->py_encoder = Py_None; Py_INCREF(Py_None); p->py_decoder = Py_None; Py_INCREF(Py_None); p->element_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None); Py_INCREF(Py_None); p->element_type_oids = ((PyObject*)Py_None); Py_INCREF(Py_None); p->element_names = Py_None; Py_INCREF(Py_None); p->record_desc = Py_None; Py_INCREF(Py_None); p->element_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_Codec(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->name); Py_CLEAR(p->schema); Py_CLEAR(p->kind); Py_CLEAR(p->base_codec); Py_CLEAR(p->py_encoder); Py_CLEAR(p->py_decoder); Py_CLEAR(p->element_codec); Py_CLEAR(p->element_type_oids); Py_CLEAR(p->element_names); Py_CLEAR(p->record_desc); Py_CLEAR(p->element_codecs); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol_Codec(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)o; if (p->base_codec) { e = (*v)(((PyObject *)p->base_codec), a); if (e) return e; } if (p->py_encoder) { e = (*v)(p->py_encoder, a); if (e) return e; } if (p->py_decoder) { e = (*v)(p->py_decoder, a); if (e) return e; } if (p->element_codec) { e = (*v)(((PyObject *)p->element_codec), a); if (e) return e; } if (p->element_type_oids) { e = (*v)(p->element_type_oids, a); if (e) return e; } if (p->element_names) { e = (*v)(p->element_names, a); if (e) return e; } if (p->record_desc) { e = (*v)(p->record_desc, a); if (e) return e; } if (p->element_codecs) { e = (*v)(p->element_codecs, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7asyncpg_8protocol_8protocol_Codec(PyObject *o) { PyObject* tmp; struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)o; tmp = ((PyObject*)p->base_codec); p->base_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->py_encoder); p->py_encoder = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->py_decoder); p->py_decoder = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->element_codec); p->element_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->element_type_oids); p->element_type_oids = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->element_names); p->element_names = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->record_desc); p->record_desc = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->element_codecs); p->element_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_7asyncpg_8protocol_8protocol_5Codec_3__repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) { return __pyx_pw_7asyncpg_8protocol_8protocol_5Codec_3__repr__(self); } static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_Codec[] = { {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_pw_7asyncpg_8protocol_8protocol_5Codec_3__repr__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol_Codec_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol_Codec}, {Py_tp_repr, (void *)__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_3__repr__}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol_Codec}, {Py_tp_clear, (void *)__pyx_tp_clear_7asyncpg_8protocol_8protocol_Codec}, {Py_tp_methods, (void *)__pyx_methods_7asyncpg_8protocol_8protocol_Codec}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol_Codec}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol_Codec_spec = { "asyncpg.protocol.protocol.Codec", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_7asyncpg_8protocol_8protocol_Codec_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol_Codec = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""Codec", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_Codec, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_7asyncpg_8protocol_8protocol_5Codec_3__repr__, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol_Codec, /*tp_traverse*/ __pyx_tp_clear_7asyncpg_8protocol_8protocol_Codec, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7asyncpg_8protocol_8protocol_Codec, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol_Codec, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_DataCodecConfig __pyx_vtable_7asyncpg_8protocol_8protocol_DataCodecConfig; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_DataCodecConfig(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)o); p->__pyx_vtab = __pyx_vtabptr_7asyncpg_8protocol_8protocol_DataCodecConfig; p->_derived_type_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_custom_type_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_DataCodecConfig(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_DataCodecConfig) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->_derived_type_codecs); Py_CLEAR(p->_custom_type_codecs); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol_DataCodecConfig(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)o; if (p->_derived_type_codecs) { e = (*v)(p->_derived_type_codecs, a); if (e) return e; } if (p->_custom_type_codecs) { e = (*v)(p->_custom_type_codecs, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7asyncpg_8protocol_8protocol_DataCodecConfig(PyObject *o) { PyObject* tmp; struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)o; tmp = ((PyObject*)p->_derived_type_codecs); p->_derived_type_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_custom_type_codecs); p->_custom_type_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_DataCodecConfig[] = { {"add_types", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_3add_types, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"add_python_codec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_5add_python_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"remove_python_codec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_7remove_python_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"_set_builtin_type_codec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_9_set_builtin_type_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"set_builtin_type_codec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_11set_builtin_type_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"clear_type_cache", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_13clear_type_cache, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"declare_fallback_codec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_15declare_fallback_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol_DataCodecConfig}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol_DataCodecConfig}, {Py_tp_clear, (void *)__pyx_tp_clear_7asyncpg_8protocol_8protocol_DataCodecConfig}, {Py_tp_methods, (void *)__pyx_methods_7asyncpg_8protocol_8protocol_DataCodecConfig}, {Py_tp_init, (void *)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol_DataCodecConfig}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig_spec = { "asyncpg.protocol.protocol.DataCodecConfig", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""DataCodecConfig", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_DataCodecConfig, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol_DataCodecConfig, /*tp_traverse*/ __pyx_tp_clear_7asyncpg_8protocol_8protocol_DataCodecConfig, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7asyncpg_8protocol_8protocol_DataCodecConfig, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol_DataCodecConfig, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_ConnectionSettings __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_ConnectionSettings(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *p; PyObject *o = __Pyx_PyType_GetSlot(__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext, tp_new, newfunc)(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext*)__pyx_vtabptr_7asyncpg_8protocol_8protocol_ConnectionSettings; p->_encoding = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_codec = Py_None; Py_INCREF(Py_None); p->_settings = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_data_codecs = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_ConnectionSettings(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_ConnectionSettings) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->_encoding); Py_CLEAR(p->_codec); Py_CLEAR(p->_settings); Py_CLEAR(p->_data_codecs); #if PY_MAJOR_VERSION < 3 if (!(__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext) || PyType_IS_GC(__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext)) PyObject_GC_Track(o); #else if (PyType_IS_GC(__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext)) PyObject_GC_Track(o); #endif if (likely(__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext)) __Pyx_PyType_GetSlot(__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext, tp_dealloc, destructor)(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_ConnectionSettings); } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol_ConnectionSettings(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)o; e = ((likely(__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext)) ? ((__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext->tp_traverse) ? __pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7asyncpg_8protocol_8protocol_ConnectionSettings)); if (e) return e; if (p->_codec) { e = (*v)(p->_codec, a); if (e) return e; } if (p->_settings) { e = (*v)(p->_settings, a); if (e) return e; } if (p->_data_codecs) { e = (*v)(((PyObject *)p->_data_codecs), a); if (e) return e; } return 0; } static int __pyx_tp_clear_7asyncpg_8protocol_8protocol_ConnectionSettings(PyObject *o) { PyObject* tmp; struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)o; if (likely(__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext)) { if (__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext->tp_clear) __pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7asyncpg_8protocol_8protocol_ConnectionSettings); tmp = ((PyObject*)p->_codec); p->_codec = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_settings); p->_settings = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_data_codecs); p->_data_codecs = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_tp_getattro_7asyncpg_8protocol_8protocol_ConnectionSettings(PyObject *o, PyObject *n) { PyObject *v = __Pyx_PyObject_GenericGetAttrNoDict(o, n); if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); v = __pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_17__getattr__(o, n); } return v; } static PyObject *__pyx_specialmethod___pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_19__repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) { return __pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_19__repr__(self); } static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_ConnectionSettings[] = { {"__getattr__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_17__getattr__, METH_O|METH_COEXIST, 0}, {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_19__repr__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_21__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_23__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol_ConnectionSettings}, {Py_tp_repr, (void *)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_19__repr__}, {Py_tp_getattro, (void *)__pyx_tp_getattro_7asyncpg_8protocol_8protocol_ConnectionSettings}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol_ConnectionSettings}, {Py_tp_clear, (void *)__pyx_tp_clear_7asyncpg_8protocol_8protocol_ConnectionSettings}, {Py_tp_methods, (void *)__pyx_methods_7asyncpg_8protocol_8protocol_ConnectionSettings}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol_ConnectionSettings}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings_spec = { "asyncpg.protocol.protocol.ConnectionSettings", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""ConnectionSettings", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_ConnectionSettings, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_19__repr__, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ __pyx_tp_getattro_7asyncpg_8protocol_8protocol_ConnectionSettings, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol_ConnectionSettings, /*tp_traverse*/ __pyx_tp_clear_7asyncpg_8protocol_8protocol_ConnectionSettings, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7asyncpg_8protocol_8protocol_ConnectionSettings, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol_ConnectionSettings, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_SCRAMAuthentication __pyx_vtable_7asyncpg_8protocol_8protocol_SCRAMAuthentication; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_SCRAMAuthentication(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)o); p->__pyx_vtab = __pyx_vtabptr_7asyncpg_8protocol_8protocol_SCRAMAuthentication; p->authentication_method = ((PyObject*)Py_None); Py_INCREF(Py_None); p->authorization_message = ((PyObject*)Py_None); Py_INCREF(Py_None); p->client_channel_binding = ((PyObject*)Py_None); Py_INCREF(Py_None); p->client_first_message_bare = ((PyObject*)Py_None); Py_INCREF(Py_None); p->client_nonce = ((PyObject*)Py_None); Py_INCREF(Py_None); p->client_proof = ((PyObject*)Py_None); Py_INCREF(Py_None); p->password_salt = ((PyObject*)Py_None); Py_INCREF(Py_None); p->server_first_message = ((PyObject*)Py_None); Py_INCREF(Py_None); p->server_key = Py_None; Py_INCREF(Py_None); p->server_nonce = ((PyObject*)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_SCRAMAuthentication(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->authentication_method); Py_CLEAR(p->authorization_message); Py_CLEAR(p->client_channel_binding); Py_CLEAR(p->client_first_message_bare); Py_CLEAR(p->client_nonce); Py_CLEAR(p->client_proof); Py_CLEAR(p->password_salt); Py_CLEAR(p->server_first_message); Py_CLEAR(p->server_key); Py_CLEAR(p->server_nonce); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol_SCRAMAuthentication(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)o; if (p->server_key) { e = (*v)(p->server_key, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7asyncpg_8protocol_8protocol_SCRAMAuthentication(PyObject *o) { PyObject* tmp; struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)o; tmp = ((PyObject*)p->server_key); p->server_key = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_authentication_method(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authentication_method_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_authorization_message(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authorization_message_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_client_channel_binding(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_22client_channel_binding_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_client_first_message_bare(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_25client_first_message_bare_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_client_nonce(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_nonce_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_client_proof(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_proof_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_password_salt(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_13password_salt_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_password_iterations(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19password_iterations_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_server_first_message(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_20server_first_message_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_server_key(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10server_key_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_server_nonce(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12server_nonce_1__get__(o); } static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_SCRAMAuthentication[] = { {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_7asyncpg_8protocol_8protocol_SCRAMAuthentication[] = { {(char *)"authentication_method", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_authentication_method, 0, (char *)0, 0}, {(char *)"authorization_message", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_authorization_message, 0, (char *)0, 0}, {(char *)"client_channel_binding", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_client_channel_binding, 0, (char *)0, 0}, {(char *)"client_first_message_bare", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_client_first_message_bare, 0, (char *)0, 0}, {(char *)"client_nonce", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_client_nonce, 0, (char *)0, 0}, {(char *)"client_proof", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_client_proof, 0, (char *)0, 0}, {(char *)"password_salt", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_password_salt, 0, (char *)0, 0}, {(char *)"password_iterations", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_password_iterations, 0, (char *)0, 0}, {(char *)"server_first_message", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_server_first_message, 0, (char *)0, 0}, {(char *)"server_key", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_server_key, 0, (char *)0, 0}, {(char *)"server_nonce", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_server_nonce, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol_SCRAMAuthentication}, {Py_tp_doc, (void *)PyDoc_STR("Contains the protocol for generating and a SCRAM hashed password.\n\n Since PostgreSQL 10, the option to hash passwords using the SCRAM-SHA-256\n method was added. This module follows the defined protocol, which can be\n referenced from here:\n\n https://www.postgresql.org/docs/current/sasl-authentication.html#SASL-SCRAM-SHA-256\n\n libpq references the following RFCs that it uses for implementation:\n\n * RFC 5802\n * RFC 5803\n * RFC 7677\n\n The protocol works as such:\n\n - A client connets to the server. The server requests the client to begin\n SASL authentication using SCRAM and presents a client with the methods it\n supports. At present, those are SCRAM-SHA-256, and, on servers that are\n built with OpenSSL and\n are PG11+, SCRAM-SHA-256-PLUS (which supports channel binding, more on that\n below)\n\n - The client sends a \"first message\" to the server, where it chooses which\n method to authenticate with, and sends, along with the method, an indication\n of channel binding (we disable for now), a nonce, and the username.\n (Technically, PostgreSQL ignores the username as it already has it from the\n initical connection, but we add it for completeness)\n\n - The server responds with a \"first message\" in which it extends the nonce,\n as well as a password salt and the number of iterations to hash the password\n with. The client validates that the new nonce contains the first part of the\n client's original nonce\n\n - The client generates a salted password, but does not sent this up to the\n server. Instead, the client follows the SCRAM algorithm (RFC5802) to\n generate a proof. This proof is sent aspart of a client \"final message\" to\n the server for it to validate.\n\n - The server validates the proof. If it is valid, the server sends a\n verification code for the client to verify that the server came to the same\n proof the client did. PostgreSQL i""mmediately sends an AuthenticationOK\n response right after a valid negotiation. If the password the client\n provided was invalid, then authentication fails.\n\n (The beauty of this is that the salted password is never transmitted over\n the wire!)\n\n PostgreSQL 11 added support for the channel binding (i.e.\n SCRAM-SHA-256-PLUS) but to do some ongoing discussion, there is a conscious\n decision by several driver authors to not support it as of yet. As such, the\n channel binding parameter is hard-coded to \"n\" for now, but can be updated\n to support other channel binding methos in the future\n ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol_SCRAMAuthentication}, {Py_tp_clear, (void *)__pyx_tp_clear_7asyncpg_8protocol_8protocol_SCRAMAuthentication}, {Py_tp_methods, (void *)__pyx_methods_7asyncpg_8protocol_8protocol_SCRAMAuthentication}, {Py_tp_getset, (void *)__pyx_getsets_7asyncpg_8protocol_8protocol_SCRAMAuthentication}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol_SCRAMAuthentication}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication_spec = { "asyncpg.protocol.protocol.SCRAMAuthentication", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""SCRAMAuthentication", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_SCRAMAuthentication, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("Contains the protocol for generating and a SCRAM hashed password.\n\n Since PostgreSQL 10, the option to hash passwords using the SCRAM-SHA-256\n method was added. This module follows the defined protocol, which can be\n referenced from here:\n\n https://www.postgresql.org/docs/current/sasl-authentication.html#SASL-SCRAM-SHA-256\n\n libpq references the following RFCs that it uses for implementation:\n\n * RFC 5802\n * RFC 5803\n * RFC 7677\n\n The protocol works as such:\n\n - A client connets to the server. The server requests the client to begin\n SASL authentication using SCRAM and presents a client with the methods it\n supports. At present, those are SCRAM-SHA-256, and, on servers that are\n built with OpenSSL and\n are PG11+, SCRAM-SHA-256-PLUS (which supports channel binding, more on that\n below)\n\n - The client sends a \"first message\" to the server, where it chooses which\n method to authenticate with, and sends, along with the method, an indication\n of channel binding (we disable for now), a nonce, and the username.\n (Technically, PostgreSQL ignores the username as it already has it from the\n initical connection, but we add it for completeness)\n\n - The server responds with a \"first message\" in which it extends the nonce,\n as well as a password salt and the number of iterations to hash the password\n with. The client validates that the new nonce contains the first part of the\n client's original nonce\n\n - The client generates a salted password, but does not sent this up to the\n server. Instead, the client follows the SCRAM algorithm (RFC5802) to\n generate a proof. This proof is sent aspart of a client \"final message\" to\n the server for it to validate.\n\n - The server validates the proof. If it is valid, the server sends a\n verification code for the client to verify that the server came to the same\n proof the client did. PostgreSQL i""mmediately sends an AuthenticationOK\n response right after a valid negotiation. If the password the client\n provided was invalid, then authentication fails.\n\n (The beauty of this is that the salted password is never transmitted over\n the wire!)\n\n PostgreSQL 11 added support for the channel binding (i.e.\n SCRAM-SHA-256-PLUS) but to do some ongoing discussion, there is a conscious\n decision by several driver authors to not support it as of yet. As such, the\n channel binding parameter is hard-coded to \"n\" for now, but can be updated\n to support other channel binding methos in the future\n "), /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol_SCRAMAuthentication, /*tp_traverse*/ __pyx_tp_clear_7asyncpg_8protocol_8protocol_SCRAMAuthentication, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7asyncpg_8protocol_8protocol_SCRAMAuthentication, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_7asyncpg_8protocol_8protocol_SCRAMAuthentication, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol_SCRAMAuthentication, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_CoreProtocol(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)o); p->__pyx_vtab = __pyx_vtabptr_7asyncpg_8protocol_8protocol_CoreProtocol; p->buffer = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)Py_None); Py_INCREF(Py_None); p->_execute_iter = Py_None; Py_INCREF(Py_None); p->_execute_portal_name = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_execute_stmt_name = ((PyObject*)Py_None); Py_INCREF(Py_None); p->encoding = ((PyObject*)Py_None); Py_INCREF(Py_None); p->transport = Py_None; Py_INCREF(Py_None); p->address = Py_None; Py_INCREF(Py_None); p->con_params = Py_None; Py_INCREF(Py_None); p->scram = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)Py_None); Py_INCREF(Py_None); p->gss_ctx = Py_None; Py_INCREF(Py_None); p->result = Py_None; Py_INCREF(Py_None); p->result_param_desc = ((PyObject*)Py_None); Py_INCREF(Py_None); p->result_row_desc = ((PyObject*)Py_None); Py_INCREF(Py_None); p->result_status_msg = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_CoreProtocol(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_CoreProtocol) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->buffer); Py_CLEAR(p->_execute_iter); Py_CLEAR(p->_execute_portal_name); Py_CLEAR(p->_execute_stmt_name); Py_CLEAR(p->encoding); Py_CLEAR(p->transport); Py_CLEAR(p->address); Py_CLEAR(p->con_params); Py_CLEAR(p->scram); Py_CLEAR(p->gss_ctx); Py_CLEAR(p->result); Py_CLEAR(p->result_param_desc); Py_CLEAR(p->result_row_desc); Py_CLEAR(p->result_status_msg); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol_CoreProtocol(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)o; if (p->buffer) { e = (*v)(((PyObject *)p->buffer), a); if (e) return e; } if (p->_execute_iter) { e = (*v)(p->_execute_iter, a); if (e) return e; } if (p->transport) { e = (*v)(p->transport, a); if (e) return e; } if (p->address) { e = (*v)(p->address, a); if (e) return e; } if (p->con_params) { e = (*v)(p->con_params, a); if (e) return e; } if (p->scram) { e = (*v)(((PyObject *)p->scram), a); if (e) return e; } if (p->gss_ctx) { e = (*v)(p->gss_ctx, a); if (e) return e; } if (p->result) { e = (*v)(p->result, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7asyncpg_8protocol_8protocol_CoreProtocol(PyObject *o) { PyObject* tmp; struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)o; tmp = ((PyObject*)p->buffer); p->buffer = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_execute_iter); p->_execute_iter = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->transport); p->transport = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->address); p->address = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->con_params); p->con_params = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->scram); p->scram = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->gss_ctx); p->gss_ctx = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->result); p->result = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_12CoreProtocol_backend_pid(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_11backend_pid_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_12CoreProtocol_backend_secret(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_14backend_secret_1__get__(o); } static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_CoreProtocol[] = { {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_7asyncpg_8protocol_8protocol_CoreProtocol[] = { {(char *)"backend_pid", __pyx_getprop_7asyncpg_8protocol_8protocol_12CoreProtocol_backend_pid, 0, (char *)0, 0}, {(char *)"backend_secret", __pyx_getprop_7asyncpg_8protocol_8protocol_12CoreProtocol_backend_secret, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol_CoreProtocol}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol_CoreProtocol}, {Py_tp_clear, (void *)__pyx_tp_clear_7asyncpg_8protocol_8protocol_CoreProtocol}, {Py_tp_methods, (void *)__pyx_methods_7asyncpg_8protocol_8protocol_CoreProtocol}, {Py_tp_getset, (void *)__pyx_getsets_7asyncpg_8protocol_8protocol_CoreProtocol}, {Py_tp_init, (void *)__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol_CoreProtocol}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol_spec = { "asyncpg.protocol.protocol.CoreProtocol", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""CoreProtocol", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_CoreProtocol, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol_CoreProtocol, /*tp_traverse*/ __pyx_tp_clear_7asyncpg_8protocol_8protocol_CoreProtocol, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7asyncpg_8protocol_8protocol_CoreProtocol, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_7asyncpg_8protocol_8protocol_CoreProtocol, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol_CoreProtocol, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_PreparedStatementState __pyx_vtable_7asyncpg_8protocol_8protocol_PreparedStatementState; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_PreparedStatementState(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)o); p->__pyx_vtab = __pyx_vtabptr_7asyncpg_8protocol_8protocol_PreparedStatementState; p->name = ((PyObject*)Py_None); Py_INCREF(Py_None); p->query = ((PyObject*)Py_None); Py_INCREF(Py_None); p->record_class = ((PyTypeObject*)Py_None); Py_INCREF(Py_None); p->row_desc = ((PyObject*)Py_None); Py_INCREF(Py_None); p->parameters_desc = ((PyObject*)Py_None); Py_INCREF(Py_None); p->settings = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)Py_None); Py_INCREF(Py_None); p->args_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None); p->cols_desc = Py_None; Py_INCREF(Py_None); p->rows_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_PreparedStatementState(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->name); Py_CLEAR(p->query); Py_CLEAR(p->record_class); Py_CLEAR(p->row_desc); Py_CLEAR(p->parameters_desc); Py_CLEAR(p->settings); Py_CLEAR(p->args_codecs); Py_CLEAR(p->cols_desc); Py_CLEAR(p->rows_codecs); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol_PreparedStatementState(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)o; if (p->record_class) { e = (*v)(((PyObject *)p->record_class), a); if (e) return e; } if (p->row_desc) { e = (*v)(p->row_desc, a); if (e) return e; } if (p->parameters_desc) { e = (*v)(p->parameters_desc, a); if (e) return e; } if (p->settings) { e = (*v)(((PyObject *)p->settings), a); if (e) return e; } if (p->args_codecs) { e = (*v)(p->args_codecs, a); if (e) return e; } if (p->cols_desc) { e = (*v)(p->cols_desc, a); if (e) return e; } if (p->rows_codecs) { e = (*v)(p->rows_codecs, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7asyncpg_8protocol_8protocol_PreparedStatementState(PyObject *o) { PyObject* tmp; struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)o; tmp = ((PyObject*)p->record_class); p->record_class = ((PyTypeObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->row_desc); p->row_desc = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->parameters_desc); p->parameters_desc = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->settings); p->settings = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->args_codecs); p->args_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->cols_desc); p->cols_desc = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->rows_codecs); p->rows_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_name(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_4name_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_query(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_5query_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_closed(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_6closed_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_prepared(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_8prepared_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_refs(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_4refs_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_record_class(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_12record_class_1__get__(o); } static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_ignore_custom_codec(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_19ignore_custom_codec_1__get__(o); } static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_PreparedStatementState[] = { {"_get_parameters", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_3_get_parameters, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"_get_attributes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_5_get_attributes, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"_init_types", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_7_init_types, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"attach", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_11attach, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"detach", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_13detach, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"mark_closed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_15mark_closed, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"mark_unprepared", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_17mark_unprepared, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_19__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_21__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_7asyncpg_8protocol_8protocol_PreparedStatementState[] = { {(char *)"name", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_name, 0, (char *)0, 0}, {(char *)"query", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_query, 0, (char *)0, 0}, {(char *)"closed", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_closed, 0, (char *)0, 0}, {(char *)"prepared", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_prepared, 0, (char *)0, 0}, {(char *)"refs", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_refs, 0, (char *)0, 0}, {(char *)"record_class", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_record_class, 0, (char *)0, 0}, {(char *)"ignore_custom_codec", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_ignore_custom_codec, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol_PreparedStatementState}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol_PreparedStatementState}, {Py_tp_clear, (void *)__pyx_tp_clear_7asyncpg_8protocol_8protocol_PreparedStatementState}, {Py_tp_methods, (void *)__pyx_methods_7asyncpg_8protocol_8protocol_PreparedStatementState}, {Py_tp_getset, (void *)__pyx_getsets_7asyncpg_8protocol_8protocol_PreparedStatementState}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol_PreparedStatementState}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState_spec = { "asyncpg.protocol.protocol.PreparedStatementState", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""PreparedStatementState", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_PreparedStatementState, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol_PreparedStatementState, /*tp_traverse*/ __pyx_tp_clear_7asyncpg_8protocol_8protocol_PreparedStatementState, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7asyncpg_8protocol_8protocol_PreparedStatementState, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_7asyncpg_8protocol_8protocol_PreparedStatementState, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol_PreparedStatementState, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol; static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_BaseProtocol(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *p; PyObject *o = __pyx_tp_new_7asyncpg_8protocol_8protocol_CoreProtocol(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol*)__pyx_vtabptr_7asyncpg_8protocol_8protocol_BaseProtocol; p->loop = Py_None; Py_INCREF(Py_None); p->settings = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)Py_None); Py_INCREF(Py_None); p->cancel_sent_waiter = Py_None; Py_INCREF(Py_None); p->cancel_waiter = Py_None; Py_INCREF(Py_None); p->waiter = Py_None; Py_INCREF(Py_None); p->create_future = Py_None; Py_INCREF(Py_None); p->timeout_handle = Py_None; Py_INCREF(Py_None); p->conref = Py_None; Py_INCREF(Py_None); p->record_class = ((PyTypeObject*)Py_None); Py_INCREF(Py_None); p->last_query = ((PyObject*)Py_None); Py_INCREF(Py_None); p->statement = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_BaseProtocol(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_BaseProtocol) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->loop); Py_CLEAR(p->settings); Py_CLEAR(p->cancel_sent_waiter); Py_CLEAR(p->cancel_waiter); Py_CLEAR(p->waiter); Py_CLEAR(p->create_future); Py_CLEAR(p->timeout_handle); Py_CLEAR(p->conref); Py_CLEAR(p->record_class); Py_CLEAR(p->last_query); Py_CLEAR(p->statement); PyObject_GC_Track(o); __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_CoreProtocol(o); } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol_BaseProtocol(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)o; e = __pyx_tp_traverse_7asyncpg_8protocol_8protocol_CoreProtocol(o, v, a); if (e) return e; if (p->loop) { e = (*v)(p->loop, a); if (e) return e; } if (p->settings) { e = (*v)(((PyObject *)p->settings), a); if (e) return e; } if (p->cancel_sent_waiter) { e = (*v)(p->cancel_sent_waiter, a); if (e) return e; } if (p->cancel_waiter) { e = (*v)(p->cancel_waiter, a); if (e) return e; } if (p->waiter) { e = (*v)(p->waiter, a); if (e) return e; } if (p->create_future) { e = (*v)(p->create_future, a); if (e) return e; } if (p->timeout_handle) { e = (*v)(p->timeout_handle, a); if (e) return e; } if (p->conref) { e = (*v)(p->conref, a); if (e) return e; } if (p->record_class) { e = (*v)(((PyObject *)p->record_class), a); if (e) return e; } if (p->statement) { e = (*v)(((PyObject *)p->statement), a); if (e) return e; } return 0; } static int __pyx_tp_clear_7asyncpg_8protocol_8protocol_BaseProtocol(PyObject *o) { PyObject* tmp; struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)o; __pyx_tp_clear_7asyncpg_8protocol_8protocol_CoreProtocol(o); tmp = ((PyObject*)p->loop); p->loop = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->settings); p->settings = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->cancel_sent_waiter); p->cancel_sent_waiter = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->cancel_waiter); p->cancel_waiter = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->waiter); p->waiter = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->create_future); p->create_future = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->timeout_handle); p->timeout_handle = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->conref); p->conref = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->record_class); p->record_class = ((PyTypeObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->statement); p->statement = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_12BaseProtocol_is_ssl(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl_1__get__(o); } static int __pyx_setprop_7asyncpg_8protocol_8protocol_12BaseProtocol_is_ssl(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_12BaseProtocol_queries_count(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_13queries_count_1__get__(o); } static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_BaseProtocol[] = { {"set_connection", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_3set_connection, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"get_server_pid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_5get_server_pid, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"get_settings", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_7get_settings, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"get_record_class", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_9get_record_class, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"prepare", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_11prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"bind_execute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_14bind_execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"bind_execute_many", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"bind", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_20bind, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"execute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_23execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"close_portal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_26close_portal, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"query", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_29query, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"copy_out", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_32copy_out, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"copy_in", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_35copy_in, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"close_statement", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_38close_statement, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"is_closed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_41is_closed, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"is_connected", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_43is_connected, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"abort", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_45abort, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_47close, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"_request_cancel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_50_request_cancel, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"_on_timeout", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_52_on_timeout, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"_on_waiter_completed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_54_on_waiter_completed, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"_create_future_fallback", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_56_create_future_fallback, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"_get_timeout", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_58_get_timeout, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"_is_cancelling", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_60_is_cancelling, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"_wait_for_cancellation", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_62_wait_for_cancellation, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"data_received", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_65data_received, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"connection_made", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_67connection_made, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"connection_lost", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_69connection_lost, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"pause_writing", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_71pause_writing, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"resume_writing", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_73resume_writing, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_75__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_77__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_7asyncpg_8protocol_8protocol_BaseProtocol[] = { {(char *)"is_ssl", __pyx_getprop_7asyncpg_8protocol_8protocol_12BaseProtocol_is_ssl, __pyx_setprop_7asyncpg_8protocol_8protocol_12BaseProtocol_is_ssl, (char *)0, 0}, {(char *)"queries_count", __pyx_getprop_7asyncpg_8protocol_8protocol_12BaseProtocol_queries_count, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol_BaseProtocol}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol_BaseProtocol}, {Py_tp_clear, (void *)__pyx_tp_clear_7asyncpg_8protocol_8protocol_BaseProtocol}, {Py_tp_methods, (void *)__pyx_methods_7asyncpg_8protocol_8protocol_BaseProtocol}, {Py_tp_getset, (void *)__pyx_getsets_7asyncpg_8protocol_8protocol_BaseProtocol}, {Py_tp_init, (void *)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol_BaseProtocol}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol_spec = { "asyncpg.protocol.protocol.BaseProtocol", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""BaseProtocol", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_BaseProtocol, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol_BaseProtocol, /*tp_traverse*/ __pyx_tp_clear_7asyncpg_8protocol_8protocol_BaseProtocol, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7asyncpg_8protocol_8protocol_BaseProtocol, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_7asyncpg_8protocol_8protocol_BaseProtocol, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol_BaseProtocol, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr = 0; #endif static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_a_i); Py_CLEAR(p->__pyx_v_b_i); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *)o; if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } if (p->__pyx_v_a_i) { e = (*v)(p->__pyx_v_a_i, a); if (e) return e; } if (p->__pyx_v_b_i) { e = (*v)(p->__pyx_v_b_i, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr_spec = { "asyncpg.protocol.protocol.__pyx_scope_struct__genexpr", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""__pyx_scope_struct__genexpr", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password = 0; #endif static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_c); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *)o; if (p->__pyx_v_c) { e = (*v)(p->__pyx_v_c, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password(PyObject *o) { PyObject* tmp; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *)o; tmp = ((PyObject*)p->__pyx_v_c); p->__pyx_v_c = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password}, {Py_tp_clear, (void *)__pyx_tp_clear_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password_spec = { "asyncpg.protocol.protocol.__pyx_scope_struct_1__normalize_password", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""__pyx_scope_struct_1__normalize_password", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password, /*tp_traverse*/ __pyx_tp_clear_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr = 0; #endif static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_c); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr *)o; if (p->__pyx_v_c) { e = (*v)(p->__pyx_v_c, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr_spec = { "asyncpg.protocol.protocol.__pyx_scope_struct_2_genexpr", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""__pyx_scope_struct_2_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr = 0; #endif static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_in_prohibited_table); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } if (p->__pyx_v_in_prohibited_table) { e = (*v)(p->__pyx_v_in_prohibited_table, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr_spec = { "asyncpg.protocol.protocol.__pyx_scope_struct_3_genexpr", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""__pyx_scope_struct_3_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr = 0; #endif static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_c); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *)o; if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } if (p->__pyx_v_c) { e = (*v)(p->__pyx_v_c, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr_spec = { "asyncpg.protocol.protocol.__pyx_scope_struct_4_genexpr", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""__pyx_scope_struct_4_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr = 0; #endif static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_c); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *)o; if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } if (p->__pyx_v_c) { e = (*v)(p->__pyx_v_c, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr_spec = { "asyncpg.protocol.protocol.__pyx_scope_struct_5_genexpr", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""__pyx_scope_struct_5_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare = 0; #endif static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_ex); Py_CLEAR(p->__pyx_v_ignore_custom_codec); Py_CLEAR(p->__pyx_v_query); Py_CLEAR(p->__pyx_v_record_class); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_state); Py_CLEAR(p->__pyx_v_stmt_name); Py_CLEAR(p->__pyx_v_timeout); Py_CLEAR(p->__pyx_v_waiter); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); Py_CLEAR(p->__pyx_t_2); Py_CLEAR(p->__pyx_t_3); Py_CLEAR(p->__pyx_t_4); Py_CLEAR(p->__pyx_t_5); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *)o; if (p->__pyx_v_ex) { e = (*v)(p->__pyx_v_ex, a); if (e) return e; } if (p->__pyx_v_ignore_custom_codec) { e = (*v)(p->__pyx_v_ignore_custom_codec, a); if (e) return e; } if (p->__pyx_v_query) { e = (*v)(p->__pyx_v_query, a); if (e) return e; } if (p->__pyx_v_record_class) { e = (*v)(p->__pyx_v_record_class, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } if (p->__pyx_v_state) { e = (*v)(((PyObject *)p->__pyx_v_state), a); if (e) return e; } if (p->__pyx_v_stmt_name) { e = (*v)(p->__pyx_v_stmt_name, a); if (e) return e; } if (p->__pyx_v_timeout) { e = (*v)(p->__pyx_v_timeout, a); if (e) return e; } if (p->__pyx_v_waiter) { e = (*v)(p->__pyx_v_waiter, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare_spec = { "asyncpg.protocol.protocol.__pyx_scope_struct_6_prepare", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""__pyx_scope_struct_6_prepare", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute = 0; #endif static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_args); Py_CLEAR(p->__pyx_v_args_buf); Py_CLEAR(p->__pyx_v_ex); Py_CLEAR(p->__pyx_v_limit); Py_CLEAR(p->__pyx_v_portal_name); Py_CLEAR(p->__pyx_v_return_extra); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_state); Py_CLEAR(p->__pyx_v_timeout); Py_CLEAR(p->__pyx_v_waiter); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); Py_CLEAR(p->__pyx_t_2); Py_CLEAR(p->__pyx_t_3); Py_CLEAR(p->__pyx_t_4); Py_CLEAR(p->__pyx_t_5); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *)o; if (p->__pyx_v_args) { e = (*v)(p->__pyx_v_args, a); if (e) return e; } if (p->__pyx_v_args_buf) { e = (*v)(p->__pyx_v_args_buf, a); if (e) return e; } if (p->__pyx_v_ex) { e = (*v)(p->__pyx_v_ex, a); if (e) return e; } if (p->__pyx_v_return_extra) { e = (*v)(p->__pyx_v_return_extra, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } if (p->__pyx_v_state) { e = (*v)(((PyObject *)p->__pyx_v_state), a); if (e) return e; } if (p->__pyx_v_timeout) { e = (*v)(p->__pyx_v_timeout, a); if (e) return e; } if (p->__pyx_v_waiter) { e = (*v)(p->__pyx_v_waiter, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute_spec = { "asyncpg.protocol.protocol.__pyx_scope_struct_7_bind_execute", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""__pyx_scope_struct_7_bind_execute", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many = 0; #endif static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_arg_bufs); Py_CLEAR(p->__pyx_v_args); Py_CLEAR(p->__pyx_v_data_gen); Py_CLEAR(p->__pyx_v_e); Py_CLEAR(p->__pyx_v_ex); Py_CLEAR(p->__pyx_v_genexpr); Py_CLEAR(p->__pyx_v_portal_name); Py_CLEAR(p->__pyx_v_return_rows); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_state); Py_CLEAR(p->__pyx_v_timeout); Py_CLEAR(p->__pyx_v_timer); Py_CLEAR(p->__pyx_v_waiter); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); Py_CLEAR(p->__pyx_t_2); Py_CLEAR(p->__pyx_t_3); Py_CLEAR(p->__pyx_t_4); Py_CLEAR(p->__pyx_t_5); Py_CLEAR(p->__pyx_t_6); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *)o; if (p->__pyx_v_arg_bufs) { e = (*v)(p->__pyx_v_arg_bufs, a); if (e) return e; } if (p->__pyx_v_args) { e = (*v)(p->__pyx_v_args, a); if (e) return e; } if (p->__pyx_v_data_gen) { e = (*v)(p->__pyx_v_data_gen, a); if (e) return e; } if (p->__pyx_v_e) { e = (*v)(p->__pyx_v_e, a); if (e) return e; } if (p->__pyx_v_ex) { e = (*v)(p->__pyx_v_ex, a); if (e) return e; } if (p->__pyx_v_genexpr) { e = (*v)(p->__pyx_v_genexpr, a); if (e) return e; } if (p->__pyx_v_return_rows) { e = (*v)(p->__pyx_v_return_rows, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } if (p->__pyx_v_state) { e = (*v)(((PyObject *)p->__pyx_v_state), a); if (e) return e; } if (p->__pyx_v_timeout) { e = (*v)(p->__pyx_v_timeout, a); if (e) return e; } if (p->__pyx_v_timer) { e = (*v)(p->__pyx_v_timer, a); if (e) return e; } if (p->__pyx_v_waiter) { e = (*v)(p->__pyx_v_waiter, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } if (p->__pyx_t_6) { e = (*v)(p->__pyx_t_6, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many_spec = { "asyncpg.protocol.protocol.__pyx_scope_struct_8_bind_execute_many", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""__pyx_scope_struct_8_bind_execute_many", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr = 0; #endif static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_b); Py_CLEAR(p->__pyx_v_i); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } if (p->__pyx_v_b) { e = (*v)(p->__pyx_v_b, a); if (e) return e; } if (p->__pyx_v_i) { e = (*v)(p->__pyx_v_i, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr_spec = { "asyncpg.protocol.protocol.__pyx_scope_struct_9_genexpr", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""__pyx_scope_struct_9_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind = 0; #endif static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_args); Py_CLEAR(p->__pyx_v_args_buf); Py_CLEAR(p->__pyx_v_ex); Py_CLEAR(p->__pyx_v_portal_name); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_state); Py_CLEAR(p->__pyx_v_timeout); Py_CLEAR(p->__pyx_v_waiter); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); Py_CLEAR(p->__pyx_t_2); Py_CLEAR(p->__pyx_t_3); Py_CLEAR(p->__pyx_t_4); Py_CLEAR(p->__pyx_t_5); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *)o; if (p->__pyx_v_args) { e = (*v)(p->__pyx_v_args, a); if (e) return e; } if (p->__pyx_v_args_buf) { e = (*v)(p->__pyx_v_args_buf, a); if (e) return e; } if (p->__pyx_v_ex) { e = (*v)(p->__pyx_v_ex, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } if (p->__pyx_v_state) { e = (*v)(((PyObject *)p->__pyx_v_state), a); if (e) return e; } if (p->__pyx_v_timeout) { e = (*v)(p->__pyx_v_timeout, a); if (e) return e; } if (p->__pyx_v_waiter) { e = (*v)(p->__pyx_v_waiter, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind_spec = { "asyncpg.protocol.protocol.__pyx_scope_struct_10_bind", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""__pyx_scope_struct_10_bind", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute = 0; #endif static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_ex); Py_CLEAR(p->__pyx_v_portal_name); Py_CLEAR(p->__pyx_v_return_extra); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_state); Py_CLEAR(p->__pyx_v_timeout); Py_CLEAR(p->__pyx_v_waiter); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); Py_CLEAR(p->__pyx_t_2); Py_CLEAR(p->__pyx_t_3); Py_CLEAR(p->__pyx_t_4); Py_CLEAR(p->__pyx_t_5); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *)o; if (p->__pyx_v_ex) { e = (*v)(p->__pyx_v_ex, a); if (e) return e; } if (p->__pyx_v_return_extra) { e = (*v)(p->__pyx_v_return_extra, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } if (p->__pyx_v_state) { e = (*v)(((PyObject *)p->__pyx_v_state), a); if (e) return e; } if (p->__pyx_v_timeout) { e = (*v)(p->__pyx_v_timeout, a); if (e) return e; } if (p->__pyx_v_waiter) { e = (*v)(p->__pyx_v_waiter, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute_spec = { "asyncpg.protocol.protocol.__pyx_scope_struct_11_execute", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""__pyx_scope_struct_11_execute", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal = 0; #endif static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_ex); Py_CLEAR(p->__pyx_v_portal_name); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_timeout); Py_CLEAR(p->__pyx_v_waiter); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); Py_CLEAR(p->__pyx_t_2); Py_CLEAR(p->__pyx_t_3); Py_CLEAR(p->__pyx_t_4); Py_CLEAR(p->__pyx_t_5); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *)o; if (p->__pyx_v_ex) { e = (*v)(p->__pyx_v_ex, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } if (p->__pyx_v_timeout) { e = (*v)(p->__pyx_v_timeout, a); if (e) return e; } if (p->__pyx_v_waiter) { e = (*v)(p->__pyx_v_waiter, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal_spec = { "asyncpg.protocol.protocol.__pyx_scope_struct_12_close_portal", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""__pyx_scope_struct_12_close_portal", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query = 0; #endif static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_ex); Py_CLEAR(p->__pyx_v_query); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_timeout); Py_CLEAR(p->__pyx_v_waiter); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); Py_CLEAR(p->__pyx_t_2); Py_CLEAR(p->__pyx_t_3); Py_CLEAR(p->__pyx_t_4); Py_CLEAR(p->__pyx_t_5); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *)o; if (p->__pyx_v_ex) { e = (*v)(p->__pyx_v_ex, a); if (e) return e; } if (p->__pyx_v_query) { e = (*v)(p->__pyx_v_query, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } if (p->__pyx_v_timeout) { e = (*v)(p->__pyx_v_timeout, a); if (e) return e; } if (p->__pyx_v_waiter) { e = (*v)(p->__pyx_v_waiter, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query_spec = { "asyncpg.protocol.protocol.__pyx_scope_struct_13_query", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""__pyx_scope_struct_13_query", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out = 0; #endif static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_buffer); Py_CLEAR(p->__pyx_v_copy_stmt); Py_CLEAR(p->__pyx_v_done); Py_CLEAR(p->__pyx_v_ex); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_sink); Py_CLEAR(p->__pyx_v_status_msg); Py_CLEAR(p->__pyx_v_timeout); Py_CLEAR(p->__pyx_v_timer); Py_CLEAR(p->__pyx_v_waiter); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); Py_CLEAR(p->__pyx_t_2); Py_CLEAR(p->__pyx_t_3); Py_CLEAR(p->__pyx_t_4); Py_CLEAR(p->__pyx_t_5); Py_CLEAR(p->__pyx_t_6); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *)o; if (p->__pyx_v_buffer) { e = (*v)(p->__pyx_v_buffer, a); if (e) return e; } if (p->__pyx_v_copy_stmt) { e = (*v)(p->__pyx_v_copy_stmt, a); if (e) return e; } if (p->__pyx_v_done) { e = (*v)(p->__pyx_v_done, a); if (e) return e; } if (p->__pyx_v_ex) { e = (*v)(p->__pyx_v_ex, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } if (p->__pyx_v_sink) { e = (*v)(p->__pyx_v_sink, a); if (e) return e; } if (p->__pyx_v_status_msg) { e = (*v)(p->__pyx_v_status_msg, a); if (e) return e; } if (p->__pyx_v_timeout) { e = (*v)(p->__pyx_v_timeout, a); if (e) return e; } if (p->__pyx_v_timer) { e = (*v)(p->__pyx_v_timer, a); if (e) return e; } if (p->__pyx_v_waiter) { e = (*v)(p->__pyx_v_waiter, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } if (p->__pyx_t_6) { e = (*v)(p->__pyx_t_6, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out_spec = { "asyncpg.protocol.protocol.__pyx_scope_struct_14_copy_out", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""__pyx_scope_struct_14_copy_out", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in = 0; #endif static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_aiter); Py_CLEAR(p->__pyx_v_chunk); Py_CLEAR(p->__pyx_v_codec); Py_CLEAR(p->__pyx_v_codecs); Py_CLEAR(p->__pyx_v_copy_stmt); Py_CLEAR(p->__pyx_v_data); Py_CLEAR(p->__pyx_v_e); Py_CLEAR(p->__pyx_v_item); Py_CLEAR(p->__pyx_v_iterator); Py_CLEAR(p->__pyx_v_reader); Py_CLEAR(p->__pyx_v_record_stmt); Py_CLEAR(p->__pyx_v_records); Py_CLEAR(p->__pyx_v_row); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_settings); Py_CLEAR(p->__pyx_v_status_msg); Py_CLEAR(p->__pyx_v_timeout); Py_CLEAR(p->__pyx_v_timer); Py_CLEAR(p->__pyx_v_waiter); Py_CLEAR(p->__pyx_v_wbuf); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); Py_CLEAR(p->__pyx_t_2); Py_CLEAR(p->__pyx_t_3); Py_CLEAR(p->__pyx_t_4); Py_CLEAR(p->__pyx_t_5); Py_CLEAR(p->__pyx_t_6); Py_CLEAR(p->__pyx_t_7); Py_CLEAR(p->__pyx_t_10); Py_CLEAR(p->__pyx_t_11); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *)o; if (p->__pyx_v_aiter) { e = (*v)(p->__pyx_v_aiter, a); if (e) return e; } if (p->__pyx_v_chunk) { e = (*v)(p->__pyx_v_chunk, a); if (e) return e; } if (p->__pyx_v_codec) { e = (*v)(((PyObject *)p->__pyx_v_codec), a); if (e) return e; } if (p->__pyx_v_codecs) { e = (*v)(p->__pyx_v_codecs, a); if (e) return e; } if (p->__pyx_v_copy_stmt) { e = (*v)(p->__pyx_v_copy_stmt, a); if (e) return e; } if (p->__pyx_v_data) { e = (*v)(p->__pyx_v_data, a); if (e) return e; } if (p->__pyx_v_e) { e = (*v)(p->__pyx_v_e, a); if (e) return e; } if (p->__pyx_v_item) { e = (*v)(p->__pyx_v_item, a); if (e) return e; } if (p->__pyx_v_iterator) { e = (*v)(p->__pyx_v_iterator, a); if (e) return e; } if (p->__pyx_v_reader) { e = (*v)(p->__pyx_v_reader, a); if (e) return e; } if (p->__pyx_v_record_stmt) { e = (*v)(((PyObject *)p->__pyx_v_record_stmt), a); if (e) return e; } if (p->__pyx_v_records) { e = (*v)(p->__pyx_v_records, a); if (e) return e; } if (p->__pyx_v_row) { e = (*v)(p->__pyx_v_row, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } if (p->__pyx_v_settings) { e = (*v)(((PyObject *)p->__pyx_v_settings), a); if (e) return e; } if (p->__pyx_v_status_msg) { e = (*v)(p->__pyx_v_status_msg, a); if (e) return e; } if (p->__pyx_v_timeout) { e = (*v)(p->__pyx_v_timeout, a); if (e) return e; } if (p->__pyx_v_timer) { e = (*v)(p->__pyx_v_timer, a); if (e) return e; } if (p->__pyx_v_waiter) { e = (*v)(p->__pyx_v_waiter, a); if (e) return e; } if (p->__pyx_v_wbuf) { e = (*v)(((PyObject *)p->__pyx_v_wbuf), a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } if (p->__pyx_t_6) { e = (*v)(p->__pyx_t_6, a); if (e) return e; } if (p->__pyx_t_7) { e = (*v)(p->__pyx_t_7, a); if (e) return e; } if (p->__pyx_t_10) { e = (*v)(p->__pyx_t_10, a); if (e) return e; } if (p->__pyx_t_11) { e = (*v)(p->__pyx_t_11, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in_spec = { "asyncpg.protocol.protocol.__pyx_scope_struct_15_copy_in", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""__pyx_scope_struct_15_copy_in", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement = 0; #endif static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_ex); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_state); Py_CLEAR(p->__pyx_v_timeout); Py_CLEAR(p->__pyx_v_waiter); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); Py_CLEAR(p->__pyx_t_2); Py_CLEAR(p->__pyx_t_3); Py_CLEAR(p->__pyx_t_4); Py_CLEAR(p->__pyx_t_5); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *)o; if (p->__pyx_v_ex) { e = (*v)(p->__pyx_v_ex, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } if (p->__pyx_v_state) { e = (*v)(((PyObject *)p->__pyx_v_state), a); if (e) return e; } if (p->__pyx_v_timeout) { e = (*v)(p->__pyx_v_timeout, a); if (e) return e; } if (p->__pyx_v_waiter) { e = (*v)(p->__pyx_v_waiter, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } if (p->__pyx_t_3) { e = (*v)(p->__pyx_t_3, a); if (e) return e; } if (p->__pyx_t_4) { e = (*v)(p->__pyx_t_4, a); if (e) return e; } if (p->__pyx_t_5) { e = (*v)(p->__pyx_t_5, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement_spec = { "asyncpg.protocol.protocol.__pyx_scope_struct_16_close_statement", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""__pyx_scope_struct_16_close_statement", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close = 0; #endif static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_self); Py_CLEAR(p->__pyx_v_timeout); Py_CLEAR(p->__pyx_t_0); Py_CLEAR(p->__pyx_t_1); Py_CLEAR(p->__pyx_t_2); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *)o; if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } if (p->__pyx_v_timeout) { e = (*v)(p->__pyx_v_timeout, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } if (p->__pyx_t_1) { e = (*v)(p->__pyx_t_1, a); if (e) return e; } if (p->__pyx_t_2) { e = (*v)(p->__pyx_t_2, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close_spec = { "asyncpg.protocol.protocol.__pyx_scope_struct_17_close", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""__pyx_scope_struct_17_close", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif #if CYTHON_USE_FREELISTS static struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation[8]; static int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation = 0; #endif static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS if (likely((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation)))) { o = (PyObject*)__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation[--__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation]; memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else #endif { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } #endif return o; } static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation(PyObject *o) { struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_self); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation)))) { __pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation[__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation *)o); } else #endif { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } } static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation *)o; if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation}, {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation}, {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation}, {0, 0}, }; static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation_spec = { "asyncpg.protocol.protocol.__pyx_scope_struct_18__wait_for_cancellation", sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation_slots, }; #else static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation = { PyVarObject_HEAD_INIT(0, 0) "asyncpg.protocol.protocol.""__pyx_scope_struct_18__wait_for_cancellation", /*tp_name*/ sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_AF_UNIX, __pyx_k_AF_UNIX, sizeof(__pyx_k_AF_UNIX), 0, 0, 1, 1}, {&__pyx_n_u_AF_UNIX, __pyx_k_AF_UNIX, sizeof(__pyx_k_AF_UNIX), 0, 1, 0, 1}, {&__pyx_n_s_ARRAY_TYPES, __pyx_k_ARRAY_TYPES, sizeof(__pyx_k_ARRAY_TYPES), 0, 0, 1, 1}, {&__pyx_n_s_AUTHENTICATION_METHODS, __pyx_k_AUTHENTICATION_METHODS, sizeof(__pyx_k_AUTHENTICATION_METHODS), 0, 0, 1, 1}, {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, {&__pyx_n_s_AsyncIterable, __pyx_k_AsyncIterable, sizeof(__pyx_k_AsyncIterable), 0, 0, 1, 1}, {&__pyx_n_s_Attribute, __pyx_k_Attribute, sizeof(__pyx_k_Attribute), 0, 0, 1, 1}, {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, {&__pyx_n_s_BUILTIN_TYPE_NAME_MAP, __pyx_k_BUILTIN_TYPE_NAME_MAP, sizeof(__pyx_k_BUILTIN_TYPE_NAME_MAP), 0, 0, 1, 1}, {&__pyx_n_s_BUILTIN_TYPE_OID_MAP, __pyx_k_BUILTIN_TYPE_OID_MAP, sizeof(__pyx_k_BUILTIN_TYPE_OID_MAP), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol, __pyx_k_BaseProtocol, sizeof(__pyx_k_BaseProtocol), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol___reduce_cython, __pyx_k_BaseProtocol___reduce_cython, sizeof(__pyx_k_BaseProtocol___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol___setstate_cython, __pyx_k_BaseProtocol___setstate_cython, sizeof(__pyx_k_BaseProtocol___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol__create_future_fall, __pyx_k_BaseProtocol__create_future_fall, sizeof(__pyx_k_BaseProtocol__create_future_fall), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol__get_timeout, __pyx_k_BaseProtocol__get_timeout, sizeof(__pyx_k_BaseProtocol__get_timeout), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol__is_cancelling, __pyx_k_BaseProtocol__is_cancelling, sizeof(__pyx_k_BaseProtocol__is_cancelling), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol__on_timeout, __pyx_k_BaseProtocol__on_timeout, sizeof(__pyx_k_BaseProtocol__on_timeout), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol__on_waiter_complete, __pyx_k_BaseProtocol__on_waiter_complete, sizeof(__pyx_k_BaseProtocol__on_waiter_complete), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol__request_cancel, __pyx_k_BaseProtocol__request_cancel, sizeof(__pyx_k_BaseProtocol__request_cancel), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol__wait_for_cancellat, __pyx_k_BaseProtocol__wait_for_cancellat, sizeof(__pyx_k_BaseProtocol__wait_for_cancellat), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_abort, __pyx_k_BaseProtocol_abort, sizeof(__pyx_k_BaseProtocol_abort), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_bind, __pyx_k_BaseProtocol_bind, sizeof(__pyx_k_BaseProtocol_bind), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_bind_execute, __pyx_k_BaseProtocol_bind_execute, sizeof(__pyx_k_BaseProtocol_bind_execute), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_bind_execute_many, __pyx_k_BaseProtocol_bind_execute_many, sizeof(__pyx_k_BaseProtocol_bind_execute_many), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_close, __pyx_k_BaseProtocol_close, sizeof(__pyx_k_BaseProtocol_close), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_close_portal, __pyx_k_BaseProtocol_close_portal, sizeof(__pyx_k_BaseProtocol_close_portal), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_close_statement, __pyx_k_BaseProtocol_close_statement, sizeof(__pyx_k_BaseProtocol_close_statement), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_connection_lost, __pyx_k_BaseProtocol_connection_lost, sizeof(__pyx_k_BaseProtocol_connection_lost), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_connection_made, __pyx_k_BaseProtocol_connection_made, sizeof(__pyx_k_BaseProtocol_connection_made), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_copy_in, __pyx_k_BaseProtocol_copy_in, sizeof(__pyx_k_BaseProtocol_copy_in), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_copy_out, __pyx_k_BaseProtocol_copy_out, sizeof(__pyx_k_BaseProtocol_copy_out), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_data_received, __pyx_k_BaseProtocol_data_received, sizeof(__pyx_k_BaseProtocol_data_received), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_execute, __pyx_k_BaseProtocol_execute, sizeof(__pyx_k_BaseProtocol_execute), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_get_record_class, __pyx_k_BaseProtocol_get_record_class, sizeof(__pyx_k_BaseProtocol_get_record_class), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_get_server_pid, __pyx_k_BaseProtocol_get_server_pid, sizeof(__pyx_k_BaseProtocol_get_server_pid), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_get_settings, __pyx_k_BaseProtocol_get_settings, sizeof(__pyx_k_BaseProtocol_get_settings), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_is_closed, __pyx_k_BaseProtocol_is_closed, sizeof(__pyx_k_BaseProtocol_is_closed), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_is_connected, __pyx_k_BaseProtocol_is_connected, sizeof(__pyx_k_BaseProtocol_is_connected), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_pause_writing, __pyx_k_BaseProtocol_pause_writing, sizeof(__pyx_k_BaseProtocol_pause_writing), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_prepare, __pyx_k_BaseProtocol_prepare, sizeof(__pyx_k_BaseProtocol_prepare), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_query, __pyx_k_BaseProtocol_query, sizeof(__pyx_k_BaseProtocol_query), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_resume_writing, __pyx_k_BaseProtocol_resume_writing, sizeof(__pyx_k_BaseProtocol_resume_writing), 0, 0, 1, 1}, {&__pyx_n_s_BaseProtocol_set_connection, __pyx_k_BaseProtocol_set_connection, sizeof(__pyx_k_BaseProtocol_set_connection), 0, 0, 1, 1}, {&__pyx_kp_u_Bind_expected_a_sequence_got, __pyx_k_Bind_expected_a_sequence_got, sizeof(__pyx_k_Bind_expected_a_sequence_got), 0, 1, 0, 0}, {&__pyx_n_s_BufferError, __pyx_k_BufferError, sizeof(__pyx_k_BufferError), 0, 0, 1, 1}, {&__pyx_n_s_CancelledError, __pyx_k_CancelledError, sizeof(__pyx_k_CancelledError), 0, 0, 1, 1}, {&__pyx_kp_u_Check_the_query_against_the_pass, __pyx_k_Check_the_query_against_the_pass, sizeof(__pyx_k_Check_the_query_against_the_pass), 0, 1, 0, 0}, {&__pyx_n_s_ClientSecurityContext, __pyx_k_ClientSecurityContext, sizeof(__pyx_k_ClientSecurityContext), 0, 0, 1, 1}, {&__pyx_kp_b_Client_Key, __pyx_k_Client_Key, sizeof(__pyx_k_Client_Key), 0, 0, 0, 0}, {&__pyx_n_s_Codec, __pyx_k_Codec, sizeof(__pyx_k_Codec), 0, 0, 1, 1}, {&__pyx_n_s_Codec___reduce_cython, __pyx_k_Codec___reduce_cython, sizeof(__pyx_k_Codec___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Codec___setstate_cython, __pyx_k_Codec___setstate_cython, sizeof(__pyx_k_Codec___setstate_cython), 0, 0, 1, 1}, {&__pyx_kp_u_Codec_oid_elem_oid_core, __pyx_k_Codec_oid_elem_oid_core, sizeof(__pyx_k_Codec_oid_elem_oid_core), 0, 1, 0, 0}, {&__pyx_n_s_ConnectionDoesNotExistError, __pyx_k_ConnectionDoesNotExistError, sizeof(__pyx_k_ConnectionDoesNotExistError), 0, 0, 1, 1}, {&__pyx_n_s_ConnectionResetError, __pyx_k_ConnectionResetError, sizeof(__pyx_k_ConnectionResetError), 0, 0, 1, 1}, {&__pyx_n_s_ConnectionSettings, __pyx_k_ConnectionSettings, sizeof(__pyx_k_ConnectionSettings), 0, 0, 1, 1}, {&__pyx_n_s_ConnectionSettings___reduce_cyth, __pyx_k_ConnectionSettings___reduce_cyth, sizeof(__pyx_k_ConnectionSettings___reduce_cyth), 0, 0, 1, 1}, {&__pyx_n_s_ConnectionSettings___setstate_cy, __pyx_k_ConnectionSettings___setstate_cy, sizeof(__pyx_k_ConnectionSettings___setstate_cy), 0, 0, 1, 1}, {&__pyx_n_s_ConnectionSettings_add_python_co, __pyx_k_ConnectionSettings_add_python_co, sizeof(__pyx_k_ConnectionSettings_add_python_co), 0, 0, 1, 1}, {&__pyx_n_s_ConnectionSettings_clear_type_ca, __pyx_k_ConnectionSettings_clear_type_ca, sizeof(__pyx_k_ConnectionSettings_clear_type_ca), 0, 0, 1, 1}, {&__pyx_n_s_ConnectionSettings_get_data_code, __pyx_k_ConnectionSettings_get_data_code, sizeof(__pyx_k_ConnectionSettings_get_data_code), 0, 0, 1, 1}, {&__pyx_n_s_ConnectionSettings_get_text_code, __pyx_k_ConnectionSettings_get_text_code, sizeof(__pyx_k_ConnectionSettings_get_text_code), 0, 0, 1, 1}, {&__pyx_kp_u_ConnectionSettings_r, __pyx_k_ConnectionSettings_r, sizeof(__pyx_k_ConnectionSettings_r), 0, 1, 0, 0}, {&__pyx_n_s_ConnectionSettings_register_data, __pyx_k_ConnectionSettings_register_data, sizeof(__pyx_k_ConnectionSettings_register_data), 0, 0, 1, 1}, {&__pyx_n_s_ConnectionSettings_remove_python, __pyx_k_ConnectionSettings_remove_python, sizeof(__pyx_k_ConnectionSettings_remove_python), 0, 0, 1, 1}, {&__pyx_n_s_ConnectionSettings_set_builtin_t, __pyx_k_ConnectionSettings_set_builtin_t, sizeof(__pyx_k_ConnectionSettings_set_builtin_t), 0, 0, 1, 1}, {&__pyx_kp_u_Consider_declaring_an_explicit_c, __pyx_k_Consider_declaring_an_explicit_c, sizeof(__pyx_k_Consider_declaring_an_explicit_c), 0, 1, 0, 0}, {&__pyx_n_s_CoreProtocol, __pyx_k_CoreProtocol, sizeof(__pyx_k_CoreProtocol), 0, 0, 1, 1}, {&__pyx_n_s_CoreProtocol___reduce_cython, __pyx_k_CoreProtocol___reduce_cython, sizeof(__pyx_k_CoreProtocol___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_CoreProtocol___setstate_cython, __pyx_k_CoreProtocol___setstate_cython, sizeof(__pyx_k_CoreProtocol___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_CoreProtocol_is_in_transaction, __pyx_k_CoreProtocol_is_in_transaction, sizeof(__pyx_k_CoreProtocol_is_in_transaction), 0, 0, 1, 1}, {&__pyx_n_s_DEFAULT_CLIENT_NONCE_BYTES, __pyx_k_DEFAULT_CLIENT_NONCE_BYTES, sizeof(__pyx_k_DEFAULT_CLIENT_NONCE_BYTES), 0, 0, 1, 1}, {&__pyx_n_s_DIGEST, __pyx_k_DIGEST, sizeof(__pyx_k_DIGEST), 0, 0, 1, 1}, {&__pyx_n_s_DataCodecConfig, __pyx_k_DataCodecConfig, sizeof(__pyx_k_DataCodecConfig), 0, 0, 1, 1}, {&__pyx_n_s_DataCodecConfig___reduce_cython, __pyx_k_DataCodecConfig___reduce_cython, sizeof(__pyx_k_DataCodecConfig___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_DataCodecConfig___setstate_cytho, __pyx_k_DataCodecConfig___setstate_cytho, sizeof(__pyx_k_DataCodecConfig___setstate_cytho), 0, 0, 1, 1}, {&__pyx_n_s_DataCodecConfig__set_builtin_typ, __pyx_k_DataCodecConfig__set_builtin_typ, sizeof(__pyx_k_DataCodecConfig__set_builtin_typ), 0, 0, 1, 1}, {&__pyx_n_s_DataCodecConfig_add_python_codec, __pyx_k_DataCodecConfig_add_python_codec, sizeof(__pyx_k_DataCodecConfig_add_python_codec), 0, 0, 1, 1}, {&__pyx_n_s_DataCodecConfig_add_types, __pyx_k_DataCodecConfig_add_types, sizeof(__pyx_k_DataCodecConfig_add_types), 0, 0, 1, 1}, {&__pyx_n_s_DataCodecConfig_clear_type_cache, __pyx_k_DataCodecConfig_clear_type_cache, sizeof(__pyx_k_DataCodecConfig_clear_type_cache), 0, 0, 1, 1}, {&__pyx_n_s_DataCodecConfig_declare_fallback, __pyx_k_DataCodecConfig_declare_fallback, sizeof(__pyx_k_DataCodecConfig_declare_fallback), 0, 0, 1, 1}, {&__pyx_n_s_DataCodecConfig_remove_python_co, __pyx_k_DataCodecConfig_remove_python_co, sizeof(__pyx_k_DataCodecConfig_remove_python_co), 0, 0, 1, 1}, {&__pyx_n_s_DataCodecConfig_set_builtin_type, __pyx_k_DataCodecConfig_set_builtin_type, sizeof(__pyx_k_DataCodecConfig_set_builtin_type), 0, 0, 1, 1}, {&__pyx_n_s_DataError, __pyx_k_DataError, sizeof(__pyx_k_DataError), 0, 0, 1, 1}, {&__pyx_n_s_Event, __pyx_k_Event, sizeof(__pyx_k_Event), 0, 0, 1, 1}, {&__pyx_n_s_Future, __pyx_k_Future, sizeof(__pyx_k_Future), 0, 0, 1, 1}, {&__pyx_kp_u_GSSAPI_SSPI_authentication_is_on, __pyx_k_GSSAPI_SSPI_authentication_is_on, sizeof(__pyx_k_GSSAPI_SSPI_authentication_is_on), 0, 1, 0, 0}, {&__pyx_n_s_IPPROTO_TCP, __pyx_k_IPPROTO_TCP, sizeof(__pyx_k_IPPROTO_TCP), 0, 0, 1, 1}, {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0}, {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2, __pyx_k_Incompatible_checksums_0x_x_vs_0_2, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0_2), 0, 0, 1, 0}, {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_3, __pyx_k_Incompatible_checksums_0x_x_vs_0_3, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0_3), 0, 0, 1, 0}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_n_s_InterfaceError, __pyx_k_InterfaceError, sizeof(__pyx_k_InterfaceError), 0, 0, 1, 1}, {&__pyx_n_s_InternalClientError, __pyx_k_InternalClientError, sizeof(__pyx_k_InternalClientError), 0, 0, 1, 1}, {&__pyx_n_s_Iterable, __pyx_k_Iterable, sizeof(__pyx_k_Iterable), 0, 0, 1, 1}, {&__pyx_n_s_IterableABC, __pyx_k_IterableABC, sizeof(__pyx_k_IterableABC), 0, 0, 1, 1}, {&__pyx_n_u_Kerberos, __pyx_k_Kerberos, sizeof(__pyx_k_Kerberos), 0, 1, 0, 1}, {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, {&__pyx_n_s_Mapping, __pyx_k_Mapping, sizeof(__pyx_k_Mapping), 0, 0, 1, 1}, {&__pyx_n_s_MappingABC, __pyx_k_MappingABC, sizeof(__pyx_k_MappingABC), 0, 0, 1, 1}, {&__pyx_n_s_ModuleNotFoundError, __pyx_k_ModuleNotFoundError, sizeof(__pyx_k_ModuleNotFoundError), 0, 0, 1, 1}, {&__pyx_n_u_NA, __pyx_k_NA, sizeof(__pyx_k_NA), 0, 1, 0, 1}, {&__pyx_n_u_NFKC, __pyx_k_NFKC, sizeof(__pyx_k_NFKC), 0, 1, 0, 1}, {&__pyx_n_s_NO_TIMEOUT, __pyx_k_NO_TIMEOUT, sizeof(__pyx_k_NO_TIMEOUT), 0, 0, 1, 1}, {&__pyx_n_b_NULL, __pyx_k_NULL, sizeof(__pyx_k_NULL), 0, 0, 0, 1}, {&__pyx_n_s_Name, __pyx_k_Name, sizeof(__pyx_k_Name), 0, 0, 1, 1}, {&__pyx_n_s_NameType, __pyx_k_NameType, sizeof(__pyx_k_NameType), 0, 0, 1, 1}, {&__pyx_n_u_Negotiate, __pyx_k_Negotiate, sizeof(__pyx_k_Negotiate), 0, 1, 0, 1}, {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, {&__pyx_kp_u_Note_that_parameters_are_suppor, __pyx_k_Note_that_parameters_are_suppor, sizeof(__pyx_k_Note_that_parameters_are_suppor), 0, 1, 0, 0}, {&__pyx_kp_u_OID, __pyx_k_OID, sizeof(__pyx_k_OID), 0, 1, 0, 0}, {&__pyx_kp_u_OID_value_too_large_r, __pyx_k_OID_value_too_large_r, sizeof(__pyx_k_OID_value_too_large_r), 0, 1, 0, 0}, {&__pyx_n_s_OrderedDict, __pyx_k_OrderedDict, sizeof(__pyx_k_OrderedDict), 0, 0, 1, 1}, {&__pyx_n_s_OutdatedSchemaCacheError, __pyx_k_OutdatedSchemaCacheError, sizeof(__pyx_k_OutdatedSchemaCacheError), 0, 0, 1, 1}, {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1}, {&__pyx_kp_b_PGCOPY, __pyx_k_PGCOPY, sizeof(__pyx_k_PGCOPY), 0, 0, 0, 0}, {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, {&__pyx_kp_u_PostgreSQL_does_not_implement_an, __pyx_k_PostgreSQL_does_not_implement_an, sizeof(__pyx_k_PostgreSQL_does_not_implement_an), 0, 1, 0, 0}, {&__pyx_n_s_PostgresError, __pyx_k_PostgresError, sizeof(__pyx_k_PostgresError), 0, 0, 1, 1}, {&__pyx_n_s_PreparedStatementState, __pyx_k_PreparedStatementState, sizeof(__pyx_k_PreparedStatementState), 0, 0, 1, 1}, {&__pyx_n_s_PreparedStatementState___reduce, __pyx_k_PreparedStatementState___reduce, sizeof(__pyx_k_PreparedStatementState___reduce), 0, 0, 1, 1}, {&__pyx_n_s_PreparedStatementState___setstat, __pyx_k_PreparedStatementState___setstat, sizeof(__pyx_k_PreparedStatementState___setstat), 0, 0, 1, 1}, {&__pyx_n_s_PreparedStatementState__get_attr, __pyx_k_PreparedStatementState__get_attr, sizeof(__pyx_k_PreparedStatementState__get_attr), 0, 0, 1, 1}, {&__pyx_n_s_PreparedStatementState__get_para, __pyx_k_PreparedStatementState__get_para, sizeof(__pyx_k_PreparedStatementState__get_para), 0, 0, 1, 1}, {&__pyx_n_s_PreparedStatementState__init_cod, __pyx_k_PreparedStatementState__init_cod, sizeof(__pyx_k_PreparedStatementState__init_cod), 0, 0, 1, 1}, {&__pyx_n_s_PreparedStatementState__init_typ, __pyx_k_PreparedStatementState__init_typ, sizeof(__pyx_k_PreparedStatementState__init_typ), 0, 0, 1, 1}, {&__pyx_n_s_PreparedStatementState_attach, __pyx_k_PreparedStatementState_attach, sizeof(__pyx_k_PreparedStatementState_attach), 0, 0, 1, 1}, {&__pyx_n_s_PreparedStatementState_detach, __pyx_k_PreparedStatementState_detach, sizeof(__pyx_k_PreparedStatementState_detach), 0, 0, 1, 1}, {&__pyx_n_s_PreparedStatementState_mark_clos, __pyx_k_PreparedStatementState_mark_clos, sizeof(__pyx_k_PreparedStatementState_mark_clos), 0, 0, 1, 1}, {&__pyx_n_s_PreparedStatementState_mark_unpr, __pyx_k_PreparedStatementState_mark_unpr, sizeof(__pyx_k_PreparedStatementState_mark_unpr), 0, 0, 1, 1}, {&__pyx_n_s_Protocol, __pyx_k_Protocol, sizeof(__pyx_k_Protocol), 0, 0, 1, 1}, {&__pyx_n_s_ProtocolError, __pyx_k_ProtocolError, sizeof(__pyx_k_ProtocolError), 0, 0, 1, 1}, {&__pyx_n_s_REQUIREMENTS_CLIENT_FINAL_MESSAG, __pyx_k_REQUIREMENTS_CLIENT_FINAL_MESSAG, sizeof(__pyx_k_REQUIREMENTS_CLIENT_FINAL_MESSAG), 0, 0, 1, 1}, {&__pyx_n_s_REQUIREMENTS_CLIENT_PROOF, __pyx_k_REQUIREMENTS_CLIENT_PROOF, sizeof(__pyx_k_REQUIREMENTS_CLIENT_PROOF), 0, 0, 1, 1}, {&__pyx_n_u_ROLLBACK, __pyx_k_ROLLBACK, sizeof(__pyx_k_ROLLBACK), 0, 1, 0, 1}, {&__pyx_n_s_Range, __pyx_k_Range, sizeof(__pyx_k_Range), 0, 0, 1, 1}, {&__pyx_n_s_Record, __pyx_k_Record, sizeof(__pyx_k_Record), 0, 0, 1, 1}, {&__pyx_n_s_SASLPREP_PROHIBITED, __pyx_k_SASLPREP_PROHIBITED, sizeof(__pyx_k_SASLPREP_PROHIBITED), 0, 0, 1, 1}, {&__pyx_n_s_SCRAMAuthentication, __pyx_k_SCRAMAuthentication, sizeof(__pyx_k_SCRAMAuthentication), 0, 0, 1, 1}, {&__pyx_n_s_SCRAMAuthentication___reduce_cyt, __pyx_k_SCRAMAuthentication___reduce_cyt, sizeof(__pyx_k_SCRAMAuthentication___reduce_cyt), 0, 0, 1, 1}, {&__pyx_n_s_SCRAMAuthentication___setstate_c, __pyx_k_SCRAMAuthentication___setstate_c, sizeof(__pyx_k_SCRAMAuthentication___setstate_c), 0, 0, 1, 1}, {&__pyx_n_s_SCRAMAuthentication__bytes_xor_l, __pyx_k_SCRAMAuthentication__bytes_xor_l, sizeof(__pyx_k_SCRAMAuthentication__bytes_xor_l), 0, 0, 1, 1}, {&__pyx_n_s_SCRAMAuthentication__normalize_p, __pyx_k_SCRAMAuthentication__normalize_p, sizeof(__pyx_k_SCRAMAuthentication__normalize_p), 0, 0, 1, 1}, {&__pyx_kp_b_SCRAM_SHA_256, __pyx_k_SCRAM_SHA_256, sizeof(__pyx_k_SCRAM_SHA_256), 0, 0, 0, 0}, {&__pyx_n_s_SecurityContext, __pyx_k_SecurityContext, sizeof(__pyx_k_SecurityContext), 0, 0, 1, 1}, {&__pyx_n_s_Sequence, __pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 0, 1, 1}, {&__pyx_n_s_SequenceABC, __pyx_k_SequenceABC, sizeof(__pyx_k_SequenceABC), 0, 0, 1, 1}, {&__pyx_kp_b_Server_Key, __pyx_k_Server_Key, sizeof(__pyx_k_Server_Key), 0, 0, 0, 0}, {&__pyx_n_s_Sized, __pyx_k_Sized, sizeof(__pyx_k_Sized), 0, 0, 1, 1}, {&__pyx_n_s_SizedABC, __pyx_k_SizedABC, sizeof(__pyx_k_SizedABC), 0, 0, 1, 1}, {&__pyx_n_s_StopAsyncIteration, __pyx_k_StopAsyncIteration, sizeof(__pyx_k_StopAsyncIteration), 0, 0, 1, 1}, {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, {&__pyx_n_s_TCP_NODELAY, __pyx_k_TCP_NODELAY, sizeof(__pyx_k_TCP_NODELAY), 0, 0, 1, 1}, {&__pyx_n_s_TimeoutError, __pyx_k_TimeoutError, sizeof(__pyx_k_TimeoutError), 0, 0, 1, 1}, {&__pyx_n_u_TimeoutError, __pyx_k_TimeoutError, sizeof(__pyx_k_TimeoutError), 0, 1, 0, 1}, {&__pyx_n_s_Timer, __pyx_k_Timer, sizeof(__pyx_k_Timer), 0, 0, 1, 1}, {&__pyx_n_s_Timer___enter, __pyx_k_Timer___enter, sizeof(__pyx_k_Timer___enter), 0, 0, 1, 1}, {&__pyx_n_s_Timer___exit, __pyx_k_Timer___exit, sizeof(__pyx_k_Timer___exit), 0, 0, 1, 1}, {&__pyx_n_s_Timer___init, __pyx_k_Timer___init, sizeof(__pyx_k_Timer___init), 0, 0, 1, 1}, {&__pyx_n_s_Timer_get_remaining_budget, __pyx_k_Timer_get_remaining_budget, sizeof(__pyx_k_Timer_get_remaining_budget), 0, 0, 1, 1}, {&__pyx_n_s_Timer_has_budget_greater_than, __pyx_k_Timer_has_budget_greater_than, sizeof(__pyx_k_Timer_has_budget_greater_than), 0, 0, 1, 1}, {&__pyx_kp_u_TimoutError_was_not_raised, __pyx_k_TimoutError_was_not_raised, sizeof(__pyx_k_TimoutError_was_not_raised), 0, 1, 0, 0}, {&__pyx_n_s_Type, __pyx_k_Type, sizeof(__pyx_k_Type), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_UnicodeEncodeError, __pyx_k_UnicodeEncodeError, sizeof(__pyx_k_UnicodeEncodeError), 0, 0, 1, 1}, {&__pyx_n_s_UnsupportedClientFeatureError, __pyx_k_UnsupportedClientFeatureError, sizeof(__pyx_k_UnsupportedClientFeatureError), 0, 0, 1, 1}, {&__pyx_n_s_UserCredential, __pyx_k_UserCredential, sizeof(__pyx_k_UserCredential), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_kp_b__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 0, 0, 0}, {&__pyx_n_s__167, __pyx_k__167, sizeof(__pyx_k__167), 0, 0, 1, 1}, {&__pyx_n_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 1}, {&__pyx_kp_b__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 0, 0}, {&__pyx_kp_b__31, __pyx_k__31, sizeof(__pyx_k__31), 0, 0, 0, 0}, {&__pyx_kp_b__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 0, 0, 0}, {&__pyx_kp_u__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 1, 0, 0}, {&__pyx_kp_b__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 0, 0, 0}, {&__pyx_kp_u__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 1, 0, 0}, {&__pyx_kp_u__35, __pyx_k__35, sizeof(__pyx_k__35), 0, 1, 0, 0}, {&__pyx_kp_u__36, __pyx_k__36, sizeof(__pyx_k__36), 0, 1, 0, 0}, {&__pyx_n_s__37, __pyx_k__37, sizeof(__pyx_k__37), 0, 0, 1, 1}, {&__pyx_kp_u__38, __pyx_k__38, sizeof(__pyx_k__38), 0, 1, 0, 0}, {&__pyx_kp_u__39, __pyx_k__39, sizeof(__pyx_k__39), 0, 1, 0, 0}, {&__pyx_kp_u__40, __pyx_k__40, sizeof(__pyx_k__40), 0, 1, 0, 0}, {&__pyx_kp_u__41, __pyx_k__41, sizeof(__pyx_k__41), 0, 1, 0, 0}, {&__pyx_kp_u__42, __pyx_k__42, sizeof(__pyx_k__42), 0, 1, 0, 0}, {&__pyx_kp_u__44, __pyx_k__44, sizeof(__pyx_k__44), 0, 1, 0, 0}, {&__pyx_kp_u__45, __pyx_k__45, sizeof(__pyx_k__45), 0, 1, 0, 0}, {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0}, {&__pyx_kp_u_a_sized_iterable_container_expec, __pyx_k_a_sized_iterable_container_expec, sizeof(__pyx_k_a_sized_iterable_container_expec), 0, 1, 0, 0}, {&__pyx_n_s_abc, __pyx_k_abc, sizeof(__pyx_k_abc), 0, 0, 1, 1}, {&__pyx_n_u_abc, __pyx_k_abc, sizeof(__pyx_k_abc), 0, 1, 0, 1}, {&__pyx_n_s_abort, __pyx_k_abort, sizeof(__pyx_k_abort), 0, 0, 1, 1}, {&__pyx_n_u_abstime, __pyx_k_abstime, sizeof(__pyx_k_abstime), 0, 1, 0, 1}, {&__pyx_n_u_aclitem, __pyx_k_aclitem, sizeof(__pyx_k_aclitem), 0, 1, 0, 1}, {&__pyx_n_s_add_done_callback, __pyx_k_add_done_callback, sizeof(__pyx_k_add_done_callback), 0, 0, 1, 1}, {&__pyx_n_s_add_python_codec, __pyx_k_add_python_codec, sizeof(__pyx_k_add_python_codec), 0, 0, 1, 1}, {&__pyx_n_s_add_types, __pyx_k_add_types, sizeof(__pyx_k_add_types), 0, 0, 1, 1}, {&__pyx_n_s_addr, __pyx_k_addr, sizeof(__pyx_k_addr), 0, 0, 1, 1}, {&__pyx_n_s_aiter, __pyx_k_aiter, sizeof(__pyx_k_aiter), 0, 0, 1, 1}, {&__pyx_n_s_aiter_2, __pyx_k_aiter_2, sizeof(__pyx_k_aiter_2), 0, 0, 1, 1}, {&__pyx_n_s_alias_oid, __pyx_k_alias_oid, sizeof(__pyx_k_alias_oid), 0, 0, 1, 1}, {&__pyx_n_s_alias_to, __pyx_k_alias_to, sizeof(__pyx_k_alias_to), 0, 0, 1, 1}, {&__pyx_kp_u_already_connected, __pyx_k_already_connected, sizeof(__pyx_k_already_connected), 0, 1, 0, 0}, {&__pyx_n_u_alt, __pyx_k_alt, sizeof(__pyx_k_alt), 0, 1, 0, 1}, {&__pyx_n_s_amount, __pyx_k_amount, sizeof(__pyx_k_amount), 0, 0, 1, 1}, {&__pyx_n_s_anext, __pyx_k_anext, sizeof(__pyx_k_anext), 0, 0, 1, 1}, {&__pyx_n_s_any, __pyx_k_any, sizeof(__pyx_k_any), 0, 0, 1, 1}, {&__pyx_n_u_any, __pyx_k_any, sizeof(__pyx_k_any), 0, 1, 0, 1}, {&__pyx_n_u_anyarray, __pyx_k_anyarray, sizeof(__pyx_k_anyarray), 0, 1, 0, 1}, {&__pyx_n_u_anycompatible, __pyx_k_anycompatible, sizeof(__pyx_k_anycompatible), 0, 1, 0, 1}, {&__pyx_n_u_anycompatiblearray, __pyx_k_anycompatiblearray, sizeof(__pyx_k_anycompatiblearray), 0, 1, 0, 1}, {&__pyx_n_u_anycompatiblemultirange, __pyx_k_anycompatiblemultirange, sizeof(__pyx_k_anycompatiblemultirange), 0, 1, 0, 1}, {&__pyx_n_u_anycompatiblenonarray, __pyx_k_anycompatiblenonarray, sizeof(__pyx_k_anycompatiblenonarray), 0, 1, 0, 1}, {&__pyx_n_u_anycompatiblerange, __pyx_k_anycompatiblerange, sizeof(__pyx_k_anycompatiblerange), 0, 1, 0, 1}, {&__pyx_n_u_anyelement, __pyx_k_anyelement, sizeof(__pyx_k_anyelement), 0, 1, 0, 1}, {&__pyx_n_u_anyenum, __pyx_k_anyenum, sizeof(__pyx_k_anyenum), 0, 1, 0, 1}, {&__pyx_n_u_anymultirange, __pyx_k_anymultirange, sizeof(__pyx_k_anymultirange), 0, 1, 0, 1}, {&__pyx_n_u_anynonarray, __pyx_k_anynonarray, sizeof(__pyx_k_anynonarray), 0, 1, 0, 1}, {&__pyx_n_u_anyrange, __pyx_k_anyrange, sizeof(__pyx_k_anyrange), 0, 1, 0, 1}, {&__pyx_n_s_apg_exc, __pyx_k_apg_exc, sizeof(__pyx_k_apg_exc), 0, 0, 1, 1}, {&__pyx_n_s_apg_exc_base, __pyx_k_apg_exc_base, sizeof(__pyx_k_apg_exc_base), 0, 0, 1, 1}, {&__pyx_n_s_apg_types, __pyx_k_apg_types, sizeof(__pyx_k_apg_types), 0, 0, 1, 1}, {&__pyx_n_s_arg_bufs, __pyx_k_arg_bufs, sizeof(__pyx_k_arg_bufs), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_args_buf, __pyx_k_args_buf, sizeof(__pyx_k_args_buf), 0, 0, 1, 1}, {&__pyx_n_u_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 1, 0, 1}, {&__pyx_n_s_array_element_oid, __pyx_k_array_element_oid, sizeof(__pyx_k_array_element_oid), 0, 0, 1, 1}, {&__pyx_kp_u_array_length_overflow, __pyx_k_array_length_overflow, sizeof(__pyx_k_array_length_overflow), 0, 1, 0, 0}, {&__pyx_n_u_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 1, 0, 1}, {&__pyx_n_s_asyncio, __pyx_k_asyncio, sizeof(__pyx_k_asyncio), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_tasks, __pyx_k_asyncio_tasks, sizeof(__pyx_k_asyncio_tasks), 0, 0, 1, 1}, {&__pyx_n_s_asyncpg, __pyx_k_asyncpg, sizeof(__pyx_k_asyncpg), 0, 0, 1, 1}, {&__pyx_kp_u_asyncpg_Protocol_has_no_referenc, __pyx_k_asyncpg_Protocol_has_no_referenc, sizeof(__pyx_k_asyncpg_Protocol_has_no_referenc), 0, 1, 0, 0}, {&__pyx_n_s_asyncpg_exceptions, __pyx_k_asyncpg_exceptions, sizeof(__pyx_k_asyncpg_exceptions), 0, 0, 1, 1}, {&__pyx_kp_s_asyncpg_protocol_codecs_base_pyx, __pyx_k_asyncpg_protocol_codecs_base_pyx, sizeof(__pyx_k_asyncpg_protocol_codecs_base_pyx), 0, 0, 1, 0}, {&__pyx_kp_s_asyncpg_protocol_coreproto_pyx, __pyx_k_asyncpg_protocol_coreproto_pyx, sizeof(__pyx_k_asyncpg_protocol_coreproto_pyx), 0, 0, 1, 0}, {&__pyx_kp_s_asyncpg_protocol_prepared_stmt_p, __pyx_k_asyncpg_protocol_prepared_stmt_p, sizeof(__pyx_k_asyncpg_protocol_prepared_stmt_p), 0, 0, 1, 0}, {&__pyx_n_s_asyncpg_protocol_protocol, __pyx_k_asyncpg_protocol_protocol, sizeof(__pyx_k_asyncpg_protocol_protocol), 0, 0, 1, 1}, {&__pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_k_asyncpg_protocol_protocol_pyx, sizeof(__pyx_k_asyncpg_protocol_protocol_pyx), 0, 0, 1, 0}, {&__pyx_kp_s_asyncpg_protocol_settings_pyx, __pyx_k_asyncpg_protocol_settings_pyx, sizeof(__pyx_k_asyncpg_protocol_settings_pyx), 0, 0, 1, 0}, {&__pyx_n_s_attach, __pyx_k_attach, sizeof(__pyx_k_attach), 0, 0, 1, 1}, {&__pyx_n_s_attrname, __pyx_k_attrname, sizeof(__pyx_k_attrname), 0, 0, 1, 1}, {&__pyx_n_u_attrnames, __pyx_k_attrnames, sizeof(__pyx_k_attrnames), 0, 1, 0, 1}, {&__pyx_n_u_attrtypoids, __pyx_k_attrtypoids, sizeof(__pyx_k_attrtypoids), 0, 1, 0, 1}, {&__pyx_n_s_auth_msg, __pyx_k_auth_msg, sizeof(__pyx_k_auth_msg), 0, 0, 1, 1}, {&__pyx_n_s_authentication_method, __pyx_k_authentication_method, sizeof(__pyx_k_authentication_method), 0, 0, 1, 1}, {&__pyx_n_s_await, __pyx_k_await, sizeof(__pyx_k_await), 0, 0, 1, 1}, {&__pyx_n_s_b64decode, __pyx_k_b64decode, sizeof(__pyx_k_b64decode), 0, 0, 1, 1}, {&__pyx_n_s_b64encode, __pyx_k_b64encode, sizeof(__pyx_k_b64encode), 0, 0, 1, 1}, {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, {&__pyx_n_s_base64, __pyx_k_base64, sizeof(__pyx_k_base64), 0, 0, 1, 1}, {&__pyx_n_s_base_codec, __pyx_k_base_codec, sizeof(__pyx_k_base_codec), 0, 0, 1, 1}, {&__pyx_kp_u_base_codec_is_mutually_exclusive, __pyx_k_base_codec_is_mutually_exclusive, sizeof(__pyx_k_base_codec_is_mutually_exclusive), 0, 1, 0, 0}, {&__pyx_n_s_base_type, __pyx_k_base_type, sizeof(__pyx_k_base_type), 0, 0, 1, 1}, {&__pyx_n_u_basetype, __pyx_k_basetype, sizeof(__pyx_k_basetype), 0, 1, 0, 1}, {&__pyx_n_u_basetype_name, __pyx_k_basetype_name, sizeof(__pyx_k_basetype_name), 0, 1, 0, 1}, {&__pyx_n_u_big, __pyx_k_big, sizeof(__pyx_k_big), 0, 1, 0, 1}, {&__pyx_n_u_bigint, __pyx_k_bigint, sizeof(__pyx_k_bigint), 0, 1, 0, 1}, {&__pyx_n_u_binary, __pyx_k_binary, sizeof(__pyx_k_binary), 0, 1, 0, 1}, {&__pyx_n_s_bind, __pyx_k_bind, sizeof(__pyx_k_bind), 0, 0, 1, 1}, {&__pyx_n_s_bind_execute, __pyx_k_bind_execute, sizeof(__pyx_k_bind_execute), 0, 0, 1, 1}, {&__pyx_n_s_bind_execute_many, __pyx_k_bind_execute_many, sizeof(__pyx_k_bind_execute_many), 0, 0, 1, 1}, {&__pyx_n_s_bind_execute_many_locals_genexpr, __pyx_k_bind_execute_many_locals_genexpr, sizeof(__pyx_k_bind_execute_many_locals_genexpr), 0, 0, 1, 1}, {&__pyx_n_u_bit, __pyx_k_bit, sizeof(__pyx_k_bit), 0, 1, 0, 1}, {&__pyx_kp_u_bit_varying, __pyx_k_bit_varying, sizeof(__pyx_k_bit_varying), 0, 1, 0, 0}, {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, {&__pyx_n_u_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 1, 0, 1}, {&__pyx_n_u_box, __pyx_k_box, sizeof(__pyx_k_box), 0, 1, 0, 1}, {&__pyx_n_u_bpchar, __pyx_k_bpchar, sizeof(__pyx_k_bpchar), 0, 1, 0, 1}, {&__pyx_n_s_budget, __pyx_k_budget, sizeof(__pyx_k_budget), 0, 0, 1, 1}, {&__pyx_n_s_budget_2, __pyx_k_budget_2, sizeof(__pyx_k_budget_2), 0, 0, 1, 1}, {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1}, {&__pyx_n_s_builtins, __pyx_k_builtins, sizeof(__pyx_k_builtins), 0, 0, 1, 1}, {&__pyx_n_u_bytea, __pyx_k_bytea, sizeof(__pyx_k_bytea), 0, 1, 0, 1}, {&__pyx_n_s_byteorder, __pyx_k_byteorder, sizeof(__pyx_k_byteorder), 0, 0, 1, 1}, {&__pyx_kp_u_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 1, 0, 0}, {&__pyx_n_b_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 0, 1}, {&__pyx_kp_b_c_2, __pyx_k_c_2, sizeof(__pyx_k_c_2), 0, 0, 0, 0}, {&__pyx_kp_b_c_3, __pyx_k_c_3, sizeof(__pyx_k_c_3), 0, 0, 0, 0}, {&__pyx_n_s_c_decoder, __pyx_k_c_decoder, sizeof(__pyx_k_c_decoder), 0, 0, 1, 1}, {&__pyx_n_s_c_encoder, __pyx_k_c_encoder, sizeof(__pyx_k_c_encoder), 0, 0, 1, 1}, {&__pyx_n_s_call_exception_handler, __pyx_k_call_exception_handler, sizeof(__pyx_k_call_exception_handler), 0, 0, 1, 1}, {&__pyx_n_s_call_later, __pyx_k_call_later, sizeof(__pyx_k_call_later), 0, 0, 1, 1}, {&__pyx_n_s_cancel, __pyx_k_cancel, sizeof(__pyx_k_cancel), 0, 0, 1, 1}, {&__pyx_n_s_cancel_current_command, __pyx_k_cancel_current_command, sizeof(__pyx_k_cancel_current_command), 0, 0, 1, 1}, {&__pyx_n_s_cancelled, __pyx_k_cancelled, sizeof(__pyx_k_cancelled), 0, 0, 1, 1}, {&__pyx_kp_u_cannot_alias, __pyx_k_cannot_alias, sizeof(__pyx_k_cannot_alias), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_close_prepared_statement, __pyx_k_cannot_close_prepared_statement, sizeof(__pyx_k_cannot_close_prepared_statement), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_decode_type_text_encoding, __pyx_k_cannot_decode_type_text_encoding, sizeof(__pyx_k_cannot_decode_type_text_encoding), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_decode_type_text_encoding_2, __pyx_k_cannot_decode_type_text_encoding_2, sizeof(__pyx_k_cannot_decode_type_text_encoding_2), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_perform_operation_another, __pyx_k_cannot_perform_operation_another, sizeof(__pyx_k_cannot_perform_operation_another), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_perform_operation_another_2, __pyx_k_cannot_perform_operation_another_2, sizeof(__pyx_k_cannot_perform_operation_another_2), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_perform_operation_connect, __pyx_k_cannot_perform_operation_connect, sizeof(__pyx_k_cannot_perform_operation_connect), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_process_message, __pyx_k_cannot_process_message, sizeof(__pyx_k_cannot_process_message), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_register_core_codec_for_O, __pyx_k_cannot_register_core_codec_for_O, sizeof(__pyx_k_cannot_register_core_codec_for_O), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_switch_to_idle_state_prot, __pyx_k_cannot_switch_to_idle_state_prot, sizeof(__pyx_k_cannot_switch_to_idle_state_prot), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_switch_to_state_another_o, __pyx_k_cannot_switch_to_state_another_o, sizeof(__pyx_k_cannot_switch_to_state_another_o), 0, 1, 0, 0}, {&__pyx_kp_u_cannot_switch_to_state_protocol, __pyx_k_cannot_switch_to_state_protocol, sizeof(__pyx_k_cannot_switch_to_state_protocol), 0, 1, 0, 0}, {&__pyx_n_s_cause, __pyx_k_cause, sizeof(__pyx_k_cause), 0, 0, 1, 1}, {&__pyx_n_u_char, __pyx_k_char, sizeof(__pyx_k_char), 0, 1, 0, 1}, {&__pyx_n_u_character, __pyx_k_character, sizeof(__pyx_k_character), 0, 1, 0, 1}, {&__pyx_kp_u_character_varying, __pyx_k_character_varying, sizeof(__pyx_k_character_varying), 0, 1, 0, 0}, {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1}, {&__pyx_n_s_chunk, __pyx_k_chunk, sizeof(__pyx_k_chunk), 0, 0, 1, 1}, {&__pyx_n_u_cid, __pyx_k_cid, sizeof(__pyx_k_cid), 0, 1, 0, 1}, {&__pyx_n_u_cidr, __pyx_k_cidr, sizeof(__pyx_k_cidr), 0, 1, 0, 1}, {&__pyx_n_u_circle, __pyx_k_circle, sizeof(__pyx_k_circle), 0, 1, 0, 1}, {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, {&__pyx_n_s_cleanup, __pyx_k_cleanup, sizeof(__pyx_k_cleanup), 0, 0, 1, 1}, {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, {&__pyx_n_s_clear_type_cache, __pyx_k_clear_type_cache, sizeof(__pyx_k_clear_type_cache), 0, 0, 1, 1}, {&__pyx_n_u_client_channel_binding, __pyx_k_client_channel_binding, sizeof(__pyx_k_client_channel_binding), 0, 1, 0, 1}, {&__pyx_n_b_client_encoding, __pyx_k_client_encoding, sizeof(__pyx_k_client_encoding), 0, 0, 0, 1}, {&__pyx_n_u_client_encoding, __pyx_k_client_encoding, sizeof(__pyx_k_client_encoding), 0, 1, 0, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, {&__pyx_n_s_close_portal, __pyx_k_close_portal, sizeof(__pyx_k_close_portal), 0, 0, 1, 1}, {&__pyx_n_s_close_statement, __pyx_k_close_statement, sizeof(__pyx_k_close_statement), 0, 0, 1, 1}, {&__pyx_n_s_codec, __pyx_k_codec, sizeof(__pyx_k_codec), 0, 0, 1, 1}, {&__pyx_kp_u_codec_for, __pyx_k_codec_for, sizeof(__pyx_k_codec_for), 0, 1, 0, 0}, {&__pyx_n_s_codec_set, __pyx_k_codec_set, sizeof(__pyx_k_codec_set), 0, 0, 1, 1}, {&__pyx_n_s_codec_str, __pyx_k_codec_str, sizeof(__pyx_k_codec_str), 0, 0, 1, 1}, {&__pyx_n_s_codecs, __pyx_k_codecs, sizeof(__pyx_k_codecs), 0, 0, 1, 1}, {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, {&__pyx_n_s_collections_abc, __pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 0, 1, 1}, {&__pyx_n_s_command_timeout, __pyx_k_command_timeout, sizeof(__pyx_k_command_timeout), 0, 0, 1, 1}, {&__pyx_n_s_comp_elem_codecs, __pyx_k_comp_elem_codecs, sizeof(__pyx_k_comp_elem_codecs), 0, 0, 1, 1}, {&__pyx_n_s_comp_type_attrs, __pyx_k_comp_type_attrs, sizeof(__pyx_k_comp_type_attrs), 0, 0, 1, 1}, {&__pyx_n_s_compat, __pyx_k_compat, sizeof(__pyx_k_compat), 0, 0, 1, 1}, {&__pyx_n_u_composite, __pyx_k_composite, sizeof(__pyx_k_composite), 0, 1, 0, 1}, {&__pyx_n_s_con, __pyx_k_con, sizeof(__pyx_k_con), 0, 0, 1, 1}, {&__pyx_n_s_con_params, __pyx_k_con_params, sizeof(__pyx_k_con_params), 0, 0, 1, 1}, {&__pyx_n_s_config, __pyx_k_config, sizeof(__pyx_k_config), 0, 0, 1, 1}, {&__pyx_n_s_connected_fut, __pyx_k_connected_fut, sizeof(__pyx_k_connected_fut), 0, 0, 1, 1}, {&__pyx_n_s_connection, __pyx_k_connection, sizeof(__pyx_k_connection), 0, 0, 1, 1}, {&__pyx_n_s_connection_lost, __pyx_k_connection_lost, sizeof(__pyx_k_connection_lost), 0, 0, 1, 1}, {&__pyx_n_s_connection_made, __pyx_k_connection_made, sizeof(__pyx_k_connection_made), 0, 0, 1, 1}, {&__pyx_kp_u_connection_was_closed_in_the_mid, __pyx_k_connection_was_closed_in_the_mid, sizeof(__pyx_k_connection_was_closed_in_the_mid), 0, 1, 0, 0}, {&__pyx_n_s_copy_in, __pyx_k_copy_in, sizeof(__pyx_k_copy_in), 0, 0, 1, 1}, {&__pyx_n_s_copy_in_locals_lambda, __pyx_k_copy_in_locals_lambda, sizeof(__pyx_k_copy_in_locals_lambda), 0, 0, 1, 1}, {&__pyx_n_s_copy_out, __pyx_k_copy_out, sizeof(__pyx_k_copy_out), 0, 0, 1, 1}, {&__pyx_n_s_copy_out_locals_lambda, __pyx_k_copy_out_locals_lambda, sizeof(__pyx_k_copy_out_locals_lambda), 0, 0, 1, 1}, {&__pyx_n_s_copy_stmt, __pyx_k_copy_stmt, sizeof(__pyx_k_copy_stmt), 0, 0, 1, 1}, {&__pyx_n_s_core_codec, __pyx_k_core_codec, sizeof(__pyx_k_core_codec), 0, 0, 1, 1}, {&__pyx_kp_u_could_not_get_iterations, __pyx_k_could_not_get_iterations, sizeof(__pyx_k_could_not_get_iterations), 0, 1, 0, 0}, {&__pyx_kp_u_could_not_get_nonce, __pyx_k_could_not_get_nonce, sizeof(__pyx_k_could_not_get_nonce), 0, 1, 0, 0}, {&__pyx_kp_u_could_not_get_salt, __pyx_k_could_not_get_salt, sizeof(__pyx_k_could_not_get_salt), 0, 1, 0, 0}, {&__pyx_kp_u_could_not_get_server_signature, __pyx_k_could_not_get_server_signature, sizeof(__pyx_k_could_not_get_server_signature), 0, 1, 0, 0}, {&__pyx_kp_u_could_not_verify_server_signatur, __pyx_k_could_not_verify_server_signatur, sizeof(__pyx_k_could_not_verify_server_signatur), 0, 1, 0, 0}, {&__pyx_n_u_cp1250, __pyx_k_cp1250, sizeof(__pyx_k_cp1250), 0, 1, 0, 1}, {&__pyx_n_u_cp1251, __pyx_k_cp1251, sizeof(__pyx_k_cp1251), 0, 1, 0, 1}, {&__pyx_n_u_cp1252, __pyx_k_cp1252, sizeof(__pyx_k_cp1252), 0, 1, 0, 1}, {&__pyx_n_u_cp1253, __pyx_k_cp1253, sizeof(__pyx_k_cp1253), 0, 1, 0, 1}, {&__pyx_n_u_cp1254, __pyx_k_cp1254, sizeof(__pyx_k_cp1254), 0, 1, 0, 1}, {&__pyx_n_u_cp1255, __pyx_k_cp1255, sizeof(__pyx_k_cp1255), 0, 1, 0, 1}, {&__pyx_n_u_cp1256, __pyx_k_cp1256, sizeof(__pyx_k_cp1256), 0, 1, 0, 1}, {&__pyx_n_u_cp1257, __pyx_k_cp1257, sizeof(__pyx_k_cp1257), 0, 1, 0, 1}, {&__pyx_n_u_cp1258, __pyx_k_cp1258, sizeof(__pyx_k_cp1258), 0, 1, 0, 1}, {&__pyx_n_u_cp1521, __pyx_k_cp1521, sizeof(__pyx_k_cp1521), 0, 1, 0, 1}, {&__pyx_n_u_cp866, __pyx_k_cp866, sizeof(__pyx_k_cp866), 0, 1, 0, 1}, {&__pyx_n_u_cp874, __pyx_k_cp874, sizeof(__pyx_k_cp874), 0, 1, 0, 1}, {&__pyx_n_u_cp932, __pyx_k_cp932, sizeof(__pyx_k_cp932), 0, 1, 0, 1}, {&__pyx_n_u_cp936, __pyx_k_cp936, sizeof(__pyx_k_cp936), 0, 1, 0, 1}, {&__pyx_n_u_cp949, __pyx_k_cp949, sizeof(__pyx_k_cp949), 0, 1, 0, 1}, {&__pyx_n_u_cp950, __pyx_k_cp950, sizeof(__pyx_k_cp950), 0, 1, 0, 1}, {&__pyx_n_s_create_future, __pyx_k_create_future, sizeof(__pyx_k_create_future), 0, 0, 1, 1}, {&__pyx_n_s_create_future_fallback, __pyx_k_create_future_fallback, sizeof(__pyx_k_create_future_fallback), 0, 0, 1, 1}, {&__pyx_n_s_create_record, __pyx_k_create_record, sizeof(__pyx_k_create_record), 0, 0, 1, 1}, {&__pyx_n_s_credential, __pyx_k_credential, sizeof(__pyx_k_credential), 0, 0, 1, 1}, {&__pyx_n_u_cstring, __pyx_k_cstring, sizeof(__pyx_k_cstring), 0, 1, 0, 1}, {&__pyx_n_b_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 0, 1}, {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_data_gen, __pyx_k_data_gen, sizeof(__pyx_k_data_gen), 0, 0, 1, 1}, {&__pyx_n_s_data_received, __pyx_k_data_received, sizeof(__pyx_k_data_received), 0, 0, 1, 1}, {&__pyx_n_s_data_type, __pyx_k_data_type, sizeof(__pyx_k_data_type), 0, 0, 1, 1}, {&__pyx_n_s_database, __pyx_k_database, sizeof(__pyx_k_database), 0, 0, 1, 1}, {&__pyx_n_u_database, __pyx_k_database, sizeof(__pyx_k_database), 0, 1, 0, 1}, {&__pyx_n_u_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 1, 0, 1}, {&__pyx_n_u_decimal, __pyx_k_decimal, sizeof(__pyx_k_decimal), 0, 1, 0, 1}, {&__pyx_n_s_declare_fallback_codec, __pyx_k_declare_fallback_codec, sizeof(__pyx_k_declare_fallback_codec), 0, 0, 1, 1}, {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, {&__pyx_kp_u_decode_row_statement_is_None, __pyx_k_decode_row_statement_is_None, sizeof(__pyx_k_decode_row_statement_is_None), 0, 1, 0, 0}, {&__pyx_n_s_decoder, __pyx_k_decoder, sizeof(__pyx_k_decoder), 0, 0, 1, 1}, {&__pyx_n_s_desc, __pyx_k_desc, sizeof(__pyx_k_desc), 0, 0, 1, 1}, {&__pyx_n_s_detach, __pyx_k_detach, sizeof(__pyx_k_detach), 0, 0, 1, 1}, {&__pyx_n_s_detail, __pyx_k_detail, sizeof(__pyx_k_detail), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, {&__pyx_n_s_digest, __pyx_k_digest, sizeof(__pyx_k_digest), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_done, __pyx_k_done, sizeof(__pyx_k_done), 0, 0, 1, 1}, {&__pyx_kp_u_double_precision, __pyx_k_double_precision, sizeof(__pyx_k_double_precision), 0, 1, 0, 0}, {&__pyx_kp_u_duplicate_GSSAPI_SSPI_authentica, __pyx_k_duplicate_GSSAPI_SSPI_authentica, sizeof(__pyx_k_duplicate_GSSAPI_SSPI_authentica), 0, 1, 0, 0}, {&__pyx_n_b_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 0, 1}, {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, {&__pyx_n_s_elem, __pyx_k_elem, sizeof(__pyx_k_elem), 0, 0, 1, 1}, {&__pyx_n_s_elem_codec, __pyx_k_elem_codec, sizeof(__pyx_k_elem_codec), 0, 0, 1, 1}, {&__pyx_n_s_elem_delim, __pyx_k_elem_delim, sizeof(__pyx_k_elem_delim), 0, 0, 1, 1}, {&__pyx_n_s_elem_format, __pyx_k_elem_format, sizeof(__pyx_k_elem_format), 0, 0, 1, 1}, {&__pyx_n_u_elemdelim, __pyx_k_elemdelim, sizeof(__pyx_k_elemdelim), 0, 1, 0, 1}, {&__pyx_n_s_element_names, __pyx_k_element_names, sizeof(__pyx_k_element_names), 0, 0, 1, 1}, {&__pyx_n_s_elems, __pyx_k_elems, sizeof(__pyx_k_elems), 0, 0, 1, 1}, {&__pyx_n_u_elemtype, __pyx_k_elemtype, sizeof(__pyx_k_elemtype), 0, 1, 0, 1}, {&__pyx_n_u_elemtype_name, __pyx_k_elemtype_name, sizeof(__pyx_k_elemtype_name), 0, 1, 0, 1}, {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_encoder, __pyx_k_encoder, sizeof(__pyx_k_encoder), 0, 0, 1, 1}, {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, {&__pyx_n_s_et, __pyx_k_et, sizeof(__pyx_k_et), 0, 0, 1, 1}, {&__pyx_n_u_euc_cn, __pyx_k_euc_cn, sizeof(__pyx_k_euc_cn), 0, 1, 0, 1}, {&__pyx_n_u_euc_jis_2004, __pyx_k_euc_jis_2004, sizeof(__pyx_k_euc_jis_2004), 0, 1, 0, 1}, {&__pyx_n_u_euc_jp, __pyx_k_euc_jp, sizeof(__pyx_k_euc_jp), 0, 1, 0, 1}, {&__pyx_n_u_euc_kr, __pyx_k_euc_kr, sizeof(__pyx_k_euc_kr), 0, 1, 0, 1}, {&__pyx_n_u_euccn, __pyx_k_euccn, sizeof(__pyx_k_euccn), 0, 1, 0, 1}, {&__pyx_n_u_eucjp, __pyx_k_eucjp, sizeof(__pyx_k_eucjp), 0, 1, 0, 1}, {&__pyx_n_u_euckr, __pyx_k_euckr, sizeof(__pyx_k_euckr), 0, 1, 0, 1}, {&__pyx_n_u_event_trigger, __pyx_k_event_trigger, sizeof(__pyx_k_event_trigger), 0, 1, 0, 1}, {&__pyx_n_s_ex, __pyx_k_ex, sizeof(__pyx_k_ex), 0, 0, 1, 1}, {&__pyx_n_s_exc, __pyx_k_exc, sizeof(__pyx_k_exc), 0, 0, 1, 1}, {&__pyx_n_s_exception, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 0, 1, 1}, {&__pyx_n_s_exceptions, __pyx_k_exceptions, sizeof(__pyx_k_exceptions), 0, 0, 1, 1}, {&__pyx_n_s_execute, __pyx_k_execute, sizeof(__pyx_k_execute), 0, 0, 1, 1}, {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, {&__pyx_kp_u_expected_0_1_or_2_elements_in_ra, __pyx_k_expected_0_1_or_2_elements_in_ra, sizeof(__pyx_k_expected_0_1_or_2_elements_in_ra), 0, 1, 0, 0}, {&__pyx_kp_u_expected_a_sequence_got, __pyx_k_expected_a_sequence_got, sizeof(__pyx_k_expected_a_sequence_got), 0, 1, 0, 0}, {&__pyx_kp_u_expected_a_sequence_got_type_r, __pyx_k_expected_a_sequence_got_type_r, sizeof(__pyx_k_expected_a_sequence_got_type_r), 0, 1, 0, 0}, {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, {&__pyx_n_s_family, __pyx_k_family, sizeof(__pyx_k_family), 0, 0, 1, 1}, {&__pyx_n_u_fdw_handler, __pyx_k_fdw_handler, sizeof(__pyx_k_fdw_handler), 0, 1, 0, 1}, {&__pyx_n_u_float4, __pyx_k_float4, sizeof(__pyx_k_float4), 0, 1, 0, 1}, {&__pyx_n_u_float8, __pyx_k_float8, sizeof(__pyx_k_float8), 0, 1, 0, 1}, {&__pyx_n_s_fmt, __pyx_k_fmt, sizeof(__pyx_k_fmt), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_formats, __pyx_k_formats, sizeof(__pyx_k_formats), 0, 0, 1, 1}, {&__pyx_n_s_fut, __pyx_k_fut, sizeof(__pyx_k_fut), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_attributes, __pyx_k_get_attributes, sizeof(__pyx_k_get_attributes), 0, 0, 1, 1}, {&__pyx_n_s_get_data_codec, __pyx_k_get_data_codec, sizeof(__pyx_k_get_data_codec), 0, 0, 1, 1}, {&__pyx_n_s_get_extra_info, __pyx_k_get_extra_info, sizeof(__pyx_k_get_extra_info), 0, 0, 1, 1}, {&__pyx_n_s_get_parameters, __pyx_k_get_parameters, sizeof(__pyx_k_get_parameters), 0, 0, 1, 1}, {&__pyx_n_s_get_record_class, __pyx_k_get_record_class, sizeof(__pyx_k_get_record_class), 0, 0, 1, 1}, {&__pyx_n_s_get_remaining_budget, __pyx_k_get_remaining_budget, sizeof(__pyx_k_get_remaining_budget), 0, 0, 1, 1}, {&__pyx_n_s_get_server_pid, __pyx_k_get_server_pid, sizeof(__pyx_k_get_server_pid), 0, 0, 1, 1}, {&__pyx_n_s_get_settings, __pyx_k_get_settings, sizeof(__pyx_k_get_settings), 0, 0, 1, 1}, {&__pyx_n_s_get_text_codec, __pyx_k_get_text_codec, sizeof(__pyx_k_get_text_codec), 0, 0, 1, 1}, {&__pyx_n_s_get_timeout, __pyx_k_get_timeout, sizeof(__pyx_k_get_timeout), 0, 0, 1, 1}, {&__pyx_n_s_getattribute, __pyx_k_getattribute, sizeof(__pyx_k_getattribute), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_kp_u_got_result_for_unknown_protocol, __pyx_k_got_result_for_unknown_protocol, sizeof(__pyx_k_got_result_for_unknown_protocol), 0, 1, 0, 0}, {&__pyx_n_s_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 0, 1, 1}, {&__pyx_n_u_gss, __pyx_k_gss, sizeof(__pyx_k_gss), 0, 1, 0, 1}, {&__pyx_n_s_gssapi, __pyx_k_gssapi, sizeof(__pyx_k_gssapi), 0, 0, 1, 1}, {&__pyx_n_u_gssapi, __pyx_k_gssapi, sizeof(__pyx_k_gssapi), 0, 1, 0, 1}, {&__pyx_kp_u_gssapi_module_not_found_please_i, __pyx_k_gssapi_module_not_found_please_i, sizeof(__pyx_k_gssapi_module_not_found_please_i), 0, 1, 0, 0}, {&__pyx_n_s_gsslib, __pyx_k_gsslib, sizeof(__pyx_k_gsslib), 0, 0, 1, 1}, {&__pyx_n_u_gtsvector, __pyx_k_gtsvector, sizeof(__pyx_k_gtsvector), 0, 1, 0, 1}, {&__pyx_n_s_has_budget_greater_than, __pyx_k_has_budget_greater_than, sizeof(__pyx_k_has_budget_greater_than), 0, 0, 1, 1}, {&__pyx_n_s_has_text_elements, __pyx_k_has_text_elements, sizeof(__pyx_k_has_text_elements), 0, 0, 1, 1}, {&__pyx_n_s_hashlib, __pyx_k_hashlib, sizeof(__pyx_k_hashlib), 0, 0, 1, 1}, {&__pyx_n_s_hexdigest, __pyx_k_hexdigest, sizeof(__pyx_k_hexdigest), 0, 0, 1, 1}, {&__pyx_n_s_hint, __pyx_k_hint, sizeof(__pyx_k_hint), 0, 0, 1, 1}, {&__pyx_n_s_hmac, __pyx_k_hmac, sizeof(__pyx_k_hmac), 0, 0, 1, 1}, {&__pyx_n_s_hostbased_service, __pyx_k_hostbased_service, sizeof(__pyx_k_hostbased_service), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_kp_b_i_d, __pyx_k_i_d, sizeof(__pyx_k_i_d), 0, 0, 0, 0}, {&__pyx_n_s_ignore_custom_codec, __pyx_k_ignore_custom_codec, sizeof(__pyx_k_ignore_custom_codec), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_kp_u_in_element, __pyx_k_in_element, sizeof(__pyx_k_in_element), 0, 1, 0, 0}, {&__pyx_n_s_in_table_a1, __pyx_k_in_table_a1, sizeof(__pyx_k_in_table_a1), 0, 0, 1, 1}, {&__pyx_n_s_in_table_b1, __pyx_k_in_table_b1, sizeof(__pyx_k_in_table_b1), 0, 0, 1, 1}, {&__pyx_n_s_in_table_c12, __pyx_k_in_table_c12, sizeof(__pyx_k_in_table_c12), 0, 0, 1, 1}, {&__pyx_n_s_in_table_c21_c22, __pyx_k_in_table_c21_c22, sizeof(__pyx_k_in_table_c21_c22), 0, 0, 1, 1}, {&__pyx_n_s_in_table_c3, __pyx_k_in_table_c3, sizeof(__pyx_k_in_table_c3), 0, 0, 1, 1}, {&__pyx_n_s_in_table_c4, __pyx_k_in_table_c4, sizeof(__pyx_k_in_table_c4), 0, 0, 1, 1}, {&__pyx_n_s_in_table_c5, __pyx_k_in_table_c5, sizeof(__pyx_k_in_table_c5), 0, 0, 1, 1}, {&__pyx_n_s_in_table_c6, __pyx_k_in_table_c6, sizeof(__pyx_k_in_table_c6), 0, 0, 1, 1}, {&__pyx_n_s_in_table_c7, __pyx_k_in_table_c7, sizeof(__pyx_k_in_table_c7), 0, 0, 1, 1}, {&__pyx_n_s_in_table_c8, __pyx_k_in_table_c8, sizeof(__pyx_k_in_table_c8), 0, 0, 1, 1}, {&__pyx_n_s_in_table_c9, __pyx_k_in_table_c9, sizeof(__pyx_k_in_table_c9), 0, 0, 1, 1}, {&__pyx_n_s_in_table_d1, __pyx_k_in_table_d1, sizeof(__pyx_k_in_table_d1), 0, 0, 1, 1}, {&__pyx_n_s_in_table_d2, __pyx_k_in_table_d2, sizeof(__pyx_k_in_table_d2), 0, 0, 1, 1}, {&__pyx_kp_u_inconsistent_sub_array_dimension, __pyx_k_inconsistent_sub_array_dimension, sizeof(__pyx_k_inconsistent_sub_array_dimension), 0, 1, 0, 0}, {&__pyx_n_u_index_am_handler, __pyx_k_index_am_handler, sizeof(__pyx_k_index_am_handler), 0, 1, 0, 1}, {&__pyx_n_u_inet, __pyx_k_inet, sizeof(__pyx_k_inet), 0, 1, 0, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_codecs, __pyx_k_init_codecs, sizeof(__pyx_k_init_codecs), 0, 0, 1, 1}, {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, {&__pyx_n_s_init_types, __pyx_k_init_types, sizeof(__pyx_k_init_types), 0, 0, 1, 1}, {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, {&__pyx_n_u_initiate, __pyx_k_initiate, sizeof(__pyx_k_initiate), 0, 1, 0, 1}, {&__pyx_kp_u_input_of_anonymous_composite_typ, __pyx_k_input_of_anonymous_composite_typ, sizeof(__pyx_k_input_of_anonymous_composite_typ), 0, 1, 0, 0}, {&__pyx_n_s_inspect, __pyx_k_inspect, sizeof(__pyx_k_inspect), 0, 0, 1, 1}, {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1}, {&__pyx_n_u_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 1, 0, 1}, {&__pyx_n_u_int2, __pyx_k_int2, sizeof(__pyx_k_int2), 0, 1, 0, 1}, {&__pyx_n_u_int4, __pyx_k_int4, sizeof(__pyx_k_int4), 0, 1, 0, 1}, {&__pyx_n_u_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 1, 0, 1}, {&__pyx_n_u_integer, __pyx_k_integer, sizeof(__pyx_k_integer), 0, 1, 0, 1}, {&__pyx_n_u_internal, __pyx_k_internal, sizeof(__pyx_k_internal), 0, 1, 0, 1}, {&__pyx_n_u_interval, __pyx_k_interval, sizeof(__pyx_k_interval), 0, 1, 0, 1}, {&__pyx_kp_u_invalid_array_element, __pyx_k_invalid_array_element, sizeof(__pyx_k_invalid_array_element), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_array_element_at_index, __pyx_k_invalid_array_element_at_index, sizeof(__pyx_k_invalid_array_element_at_index), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_data_format, __pyx_k_invalid_data_format, sizeof(__pyx_k_invalid_data_format), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_format_argument_expected, __pyx_k_invalid_format_argument_expected, sizeof(__pyx_k_invalid_format_argument_expected), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_input_for_query_argument, __pyx_k_invalid_input_for_query_argument, sizeof(__pyx_k_invalid_input_for_query_argument), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_input_in_executemany_arg, __pyx_k_invalid_input_in_executemany_arg, sizeof(__pyx_k_invalid_input_in_executemany_arg), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_nonce, __pyx_k_invalid_nonce, sizeof(__pyx_k_invalid_nonce), 0, 1, 0, 0}, {&__pyx_kp_u_invalid_timeout_value_expected_n, __pyx_k_invalid_timeout_value_expected_n, sizeof(__pyx_k_invalid_timeout_value_expected_n), 0, 1, 0, 0}, {&__pyx_n_s_is_cancelling, __pyx_k_is_cancelling, sizeof(__pyx_k_is_cancelling), 0, 0, 1, 1}, {&__pyx_n_s_is_closed, __pyx_k_is_closed, sizeof(__pyx_k_is_closed), 0, 0, 1, 1}, {&__pyx_n_s_is_connected, __pyx_k_is_connected, sizeof(__pyx_k_is_connected), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_n_s_is_in_transaction, __pyx_k_is_in_transaction, sizeof(__pyx_k_is_in_transaction), 0, 0, 1, 1}, {&__pyx_n_s_isempty, __pyx_k_isempty, sizeof(__pyx_k_isempty), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1}, {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, {&__pyx_n_s_iterator, __pyx_k_iterator, sizeof(__pyx_k_iterator), 0, 0, 1, 1}, {&__pyx_n_u_json, __pyx_k_json, sizeof(__pyx_k_json), 0, 1, 0, 1}, {&__pyx_n_u_jsonb, __pyx_k_jsonb, sizeof(__pyx_k_jsonb), 0, 1, 0, 1}, {&__pyx_n_u_jsonpath, __pyx_k_jsonpath, sizeof(__pyx_k_jsonpath), 0, 1, 0, 1}, {&__pyx_n_u_kerberosv5, __pyx_k_kerberosv5, sizeof(__pyx_k_kerberosv5), 0, 1, 0, 1}, {&__pyx_n_u_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 1, 0, 1}, {&__pyx_n_u_koi8_r, __pyx_k_koi8_r, sizeof(__pyx_k_koi8_r), 0, 1, 0, 1}, {&__pyx_n_u_koi8_u, __pyx_k_koi8_u, sizeof(__pyx_k_koi8_u), 0, 1, 0, 1}, {&__pyx_n_u_koi8r, __pyx_k_koi8r, sizeof(__pyx_k_koi8r), 0, 1, 0, 1}, {&__pyx_n_u_koi8u, __pyx_k_koi8u, sizeof(__pyx_k_koi8u), 0, 1, 0, 1}, {&__pyx_n_s_krbsrvname, __pyx_k_krbsrvname, sizeof(__pyx_k_krbsrvname), 0, 0, 1, 1}, {&__pyx_n_u_language_handler, __pyx_k_language_handler, sizeof(__pyx_k_language_handler), 0, 1, 0, 1}, {&__pyx_n_s_limit, __pyx_k_limit, sizeof(__pyx_k_limit), 0, 0, 1, 1}, {&__pyx_n_u_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 1, 0, 1}, {&__pyx_kp_u_list_tuple_or_Range_object_expec, __pyx_k_list_tuple_or_Range_object_expec, sizeof(__pyx_k_list_tuple_or_Range_object_expec), 0, 1, 0, 0}, {&__pyx_n_s_lookup, __pyx_k_lookup, sizeof(__pyx_k_lookup), 0, 0, 1, 1}, {&__pyx_n_s_loop, __pyx_k_loop, sizeof(__pyx_k_loop), 0, 0, 1, 1}, {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, {&__pyx_n_s_lower_inc, __pyx_k_lower_inc, sizeof(__pyx_k_lower_inc), 0, 0, 1, 1}, {&__pyx_n_u_lseg, __pyx_k_lseg, sizeof(__pyx_k_lseg), 0, 1, 0, 1}, {&__pyx_n_b_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 0, 1}, {&__pyx_n_u_macaddr, __pyx_k_macaddr, sizeof(__pyx_k_macaddr), 0, 1, 0, 1}, {&__pyx_n_u_macaddr8, __pyx_k_macaddr8, sizeof(__pyx_k_macaddr8), 0, 1, 0, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_kp_u_malformed_array_literal_r, __pyx_k_malformed_array_literal_r, sizeof(__pyx_k_malformed_array_literal_r), 0, 1, 0, 0}, {&__pyx_n_s_mapping, __pyx_k_mapping, sizeof(__pyx_k_mapping), 0, 0, 1, 1}, {&__pyx_n_s_mark_closed, __pyx_k_mark_closed, sizeof(__pyx_k_mark_closed), 0, 0, 1, 1}, {&__pyx_n_s_mark_unprepared, __pyx_k_mark_unprepared, sizeof(__pyx_k_mark_unprepared), 0, 0, 1, 1}, {&__pyx_n_b_md5, __pyx_k_md5, sizeof(__pyx_k_md5), 0, 0, 0, 1}, {&__pyx_n_s_md5, __pyx_k_md5, sizeof(__pyx_k_md5), 0, 0, 1, 1}, {&__pyx_n_u_md5, __pyx_k_md5, sizeof(__pyx_k_md5), 0, 1, 0, 1}, {&__pyx_n_u_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 1, 0, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_missing, __pyx_k_missing, sizeof(__pyx_k_missing), 0, 0, 1, 1}, {&__pyx_kp_u_missing_after_array_dimensions, __pyx_k_missing_after_array_dimensions, sizeof(__pyx_k_missing_after_array_dimensions), 0, 1, 0, 0}, {&__pyx_kp_u_missing_after_array_dimensions_2, __pyx_k_missing_after_array_dimensions_2, sizeof(__pyx_k_missing_after_array_dimensions_2), 0, 1, 0, 0}, {&__pyx_kp_u_missing_array_dimension_value, __pyx_k_missing_array_dimension_value, sizeof(__pyx_k_missing_array_dimension_value), 0, 1, 0, 0}, {&__pyx_kp_u_missing_codec_information_for_OI, __pyx_k_missing_codec_information_for_OI, sizeof(__pyx_k_missing_codec_information_for_OI), 0, 1, 0, 0}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_u_money, __pyx_k_money, sizeof(__pyx_k_money), 0, 1, 0, 1}, {&__pyx_n_s_monotonic, __pyx_k_monotonic, sizeof(__pyx_k_monotonic), 0, 0, 1, 1}, {&__pyx_n_s_more, __pyx_k_more, sizeof(__pyx_k_more), 0, 0, 1, 1}, {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, {&__pyx_n_u_multirange, __pyx_k_multirange, sizeof(__pyx_k_multirange), 0, 1, 0, 1}, {&__pyx_kp_b_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 0, 0}, {&__pyx_kp_b_n_2, __pyx_k_n_2, sizeof(__pyx_k_n_2), 0, 0, 0, 0}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_u_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 1, 0, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, {&__pyx_kp_u_named_prepared_statements_cannot, __pyx_k_named_prepared_statements_cannot, sizeof(__pyx_k_named_prepared_statements_cannot), 0, 1, 0, 0}, {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, {&__pyx_n_s_new_2, __pyx_k_new_2, sizeof(__pyx_k_new_2), 0, 0, 1, 1}, {&__pyx_kp_u_no_binary_format_encoder_for_typ, __pyx_k_no_binary_format_encoder_for_typ, sizeof(__pyx_k_no_binary_format_encoder_for_typ), 0, 1, 0, 0}, {&__pyx_kp_u_no_codec_for_composite_attribute, __pyx_k_no_codec_for_composite_attribute, sizeof(__pyx_k_no_codec_for_composite_attribute), 0, 1, 0, 0}, {&__pyx_kp_u_no_decoder_for_OID, __pyx_k_no_decoder_for_OID, sizeof(__pyx_k_no_decoder_for_OID), 0, 1, 0, 0}, {&__pyx_kp_u_no_decoder_for_composite_type_el, __pyx_k_no_decoder_for_composite_type_el, sizeof(__pyx_k_no_decoder_for_composite_type_el), 0, 1, 0, 0}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_kp_u_no_encoder_for_OID, __pyx_k_no_encoder_for_OID, sizeof(__pyx_k_no_encoder_for_OID), 0, 1, 0, 0}, {&__pyx_kp_u_non_homogeneous_array, __pyx_k_non_homogeneous_array, sizeof(__pyx_k_non_homogeneous_array), 0, 1, 0, 0}, {&__pyx_n_s_normalize, __pyx_k_normalize, sizeof(__pyx_k_normalize), 0, 0, 1, 1}, {&__pyx_kp_u_not_connected, __pyx_k_not_connected, sizeof(__pyx_k_not_connected), 0, 1, 0, 0}, {&__pyx_n_u_ns, __pyx_k_ns, sizeof(__pyx_k_ns), 0, 1, 0, 1}, {&__pyx_n_s_num_cols, __pyx_k_num_cols, sizeof(__pyx_k_num_cols), 0, 0, 1, 1}, {&__pyx_kp_u_number_of_array_dimensions_excee, __pyx_k_number_of_array_dimensions_excee, sizeof(__pyx_k_number_of_array_dimensions_excee), 0, 1, 0, 0}, {&__pyx_n_u_numeric, __pyx_k_numeric, sizeof(__pyx_k_numeric), 0, 1, 0, 1}, {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, {&__pyx_kp_u_of_executemany_sequence, __pyx_k_of_executemany_sequence, sizeof(__pyx_k_of_executemany_sequence), 0, 1, 0, 0}, {&__pyx_n_s_oid, __pyx_k_oid, sizeof(__pyx_k_oid), 0, 0, 1, 1}, {&__pyx_n_u_oid, __pyx_k_oid, sizeof(__pyx_k_oid), 0, 1, 0, 1}, {&__pyx_kp_u_oid_2, __pyx_k_oid_2, sizeof(__pyx_k_oid_2), 0, 1, 0, 0}, {&__pyx_n_s_on_error, __pyx_k_on_error, sizeof(__pyx_k_on_error), 0, 0, 1, 1}, {&__pyx_kp_u_on_result__prepare_statement_is, __pyx_k_on_result__prepare_statement_is, sizeof(__pyx_k_on_result__prepare_statement_is), 0, 1, 0, 0}, {&__pyx_kp_u_on_result_waiter_is_None, __pyx_k_on_result_waiter_is_None, sizeof(__pyx_k_on_result_waiter_is_None), 0, 1, 0, 0}, {&__pyx_kp_u_on_result_waiter_is_done, __pyx_k_on_result_waiter_is_done, sizeof(__pyx_k_on_result_waiter_is_done), 0, 1, 0, 0}, {&__pyx_n_s_on_timeout, __pyx_k_on_timeout, sizeof(__pyx_k_on_timeout), 0, 0, 1, 1}, {&__pyx_n_s_on_waiter_completed, __pyx_k_on_waiter_completed, sizeof(__pyx_k_on_waiter_completed), 0, 0, 1, 1}, {&__pyx_n_u_opaque, __pyx_k_opaque, sizeof(__pyx_k_opaque), 0, 1, 0, 1}, {&__pyx_kp_b_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 0, 0}, {&__pyx_n_s_p_oid, __pyx_k_p_oid, sizeof(__pyx_k_p_oid), 0, 0, 1, 1}, {&__pyx_kp_u_parse_data_msgs_first_message_i, __pyx_k_parse_data_msgs_first_message_i, sizeof(__pyx_k_parse_data_msgs_first_message_i), 0, 1, 0, 0}, {&__pyx_kp_u_parse_data_msgs_result_is_not_a, __pyx_k_parse_data_msgs_result_is_not_a, sizeof(__pyx_k_parse_data_msgs_result_is_not_a), 0, 1, 0, 0}, {&__pyx_n_s_password, __pyx_k_password, sizeof(__pyx_k_password), 0, 0, 1, 1}, {&__pyx_n_u_password, __pyx_k_password, sizeof(__pyx_k_password), 0, 1, 0, 1}, {&__pyx_n_u_password_iterations, __pyx_k_password_iterations, sizeof(__pyx_k_password_iterations), 0, 1, 0, 1}, {&__pyx_n_u_password_salt, __pyx_k_password_salt, sizeof(__pyx_k_password_salt), 0, 1, 0, 1}, {&__pyx_n_u_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 1, 0, 1}, {&__pyx_n_s_pause_reading, __pyx_k_pause_reading, sizeof(__pyx_k_pause_reading), 0, 0, 1, 1}, {&__pyx_n_s_pause_writing, __pyx_k_pause_writing, sizeof(__pyx_k_pause_writing), 0, 0, 1, 1}, {&__pyx_n_u_pg_brin_bloom_summary, __pyx_k_pg_brin_bloom_summary, sizeof(__pyx_k_pg_brin_bloom_summary), 0, 1, 0, 1}, {&__pyx_n_u_pg_brin_minmax_multi_summary, __pyx_k_pg_brin_minmax_multi_summary, sizeof(__pyx_k_pg_brin_minmax_multi_summary), 0, 1, 0, 1}, {&__pyx_n_u_pg_catalog, __pyx_k_pg_catalog, sizeof(__pyx_k_pg_catalog), 0, 1, 0, 1}, {&__pyx_kp_u_pg_contrib_hstore, __pyx_k_pg_contrib_hstore, sizeof(__pyx_k_pg_contrib_hstore), 0, 1, 0, 0}, {&__pyx_n_u_pg_ddl_command, __pyx_k_pg_ddl_command, sizeof(__pyx_k_pg_ddl_command), 0, 1, 0, 1}, {&__pyx_n_u_pg_dependencies, __pyx_k_pg_dependencies, sizeof(__pyx_k_pg_dependencies), 0, 1, 0, 1}, {&__pyx_n_u_pg_lsn, __pyx_k_pg_lsn, sizeof(__pyx_k_pg_lsn), 0, 1, 0, 1}, {&__pyx_n_u_pg_mcv_list, __pyx_k_pg_mcv_list, sizeof(__pyx_k_pg_mcv_list), 0, 1, 0, 1}, {&__pyx_n_u_pg_ndistinct, __pyx_k_pg_ndistinct, sizeof(__pyx_k_pg_ndistinct), 0, 1, 0, 1}, {&__pyx_n_u_pg_node_tree, __pyx_k_pg_node_tree, sizeof(__pyx_k_pg_node_tree), 0, 1, 0, 1}, {&__pyx_n_u_pg_snapshot, __pyx_k_pg_snapshot, sizeof(__pyx_k_pg_snapshot), 0, 1, 0, 1}, {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_n_u_point, __pyx_k_point, sizeof(__pyx_k_point), 0, 1, 0, 1}, {&__pyx_n_u_polygon, __pyx_k_polygon, sizeof(__pyx_k_polygon), 0, 1, 0, 1}, {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, {&__pyx_n_s_portal_name, __pyx_k_portal_name, sizeof(__pyx_k_portal_name), 0, 0, 1, 1}, {&__pyx_n_s_position, __pyx_k_position, sizeof(__pyx_k_position), 0, 0, 1, 1}, {&__pyx_n_u_postgres, __pyx_k_postgres, sizeof(__pyx_k_postgres), 0, 1, 0, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_prepare_2, __pyx_k_prepare_2, sizeof(__pyx_k_prepare_2), 0, 0, 1, 1}, {&__pyx_n_s_process_log_message, __pyx_k_process_log_message, sizeof(__pyx_k_process_log_message), 0, 0, 1, 1}, {&__pyx_n_s_process_notification, __pyx_k_process_notification, sizeof(__pyx_k_process_notification), 0, 0, 1, 1}, {&__pyx_n_s_protocol, __pyx_k_protocol, sizeof(__pyx_k_protocol), 0, 0, 1, 1}, {&__pyx_kp_u_protocol_is_in_an_unexpected_st, __pyx_k_protocol_is_in_an_unexpected_st, sizeof(__pyx_k_protocol_is_in_an_unexpected_st), 0, 1, 0, 0}, {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_BaseProtocol, __pyx_k_pyx_unpickle_BaseProtocol, sizeof(__pyx_k_pyx_unpickle_BaseProtocol), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_CoreProtocol, __pyx_k_pyx_unpickle_CoreProtocol, sizeof(__pyx_k_pyx_unpickle_CoreProtocol), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_DataCodecConfig, __pyx_k_pyx_unpickle_DataCodecConfig, sizeof(__pyx_k_pyx_unpickle_DataCodecConfig), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_query, __pyx_k_query, sizeof(__pyx_k_query), 0, 0, 1, 1}, {&__pyx_kp_u_query_argument, __pyx_k_query_argument, sizeof(__pyx_k_query_argument), 0, 1, 0, 0}, {&__pyx_n_b_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 0, 1}, {&__pyx_kp_b_r_2, __pyx_k_r_2, sizeof(__pyx_k_r_2), 0, 0, 0, 0}, {&__pyx_kp_b_r_3, __pyx_k_r_3, sizeof(__pyx_k_r_3), 0, 0, 0, 0}, {&__pyx_kp_u_r_is_not_a_valid_element_of_com, __pyx_k_r_is_not_a_valid_element_of_com, sizeof(__pyx_k_r_is_not_a_valid_element_of_com), 0, 1, 0, 0}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_u_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 1, 0, 1}, {&__pyx_n_u_range_subtype, __pyx_k_range_subtype, sizeof(__pyx_k_range_subtype), 0, 1, 0, 1}, {&__pyx_n_u_range_subtype_name, __pyx_k_range_subtype_name, sizeof(__pyx_k_range_subtype_name), 0, 1, 0, 1}, {&__pyx_n_s_range_subtype_oid, __pyx_k_range_subtype_oid, sizeof(__pyx_k_range_subtype_oid), 0, 0, 1, 1}, {&__pyx_n_s_rdesc, __pyx_k_rdesc, sizeof(__pyx_k_rdesc), 0, 0, 1, 1}, {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1}, {&__pyx_n_s_reader, __pyx_k_reader, sizeof(__pyx_k_reader), 0, 0, 1, 1}, {&__pyx_kp_u_reader_is_not_an_asynchronous_it, __pyx_k_reader_is_not_an_asynchronous_it, sizeof(__pyx_k_reader_is_not_an_asynchronous_it), 0, 1, 0, 0}, {&__pyx_n_u_real, __pyx_k_real, sizeof(__pyx_k_real), 0, 1, 0, 1}, {&__pyx_n_s_rec, __pyx_k_rec, sizeof(__pyx_k_rec), 0, 0, 1, 1}, {&__pyx_n_u_record, __pyx_k_record, sizeof(__pyx_k_record), 0, 1, 0, 1}, {&__pyx_n_s_record_class, __pyx_k_record_class, sizeof(__pyx_k_record_class), 0, 0, 1, 1}, {&__pyx_n_s_record_stmt, __pyx_k_record_stmt, sizeof(__pyx_k_record_stmt), 0, 0, 1, 1}, {&__pyx_n_s_records, __pyx_k_records, sizeof(__pyx_k_records), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1}, {&__pyx_n_u_refcursor, __pyx_k_refcursor, sizeof(__pyx_k_refcursor), 0, 1, 0, 1}, {&__pyx_n_u_regclass, __pyx_k_regclass, sizeof(__pyx_k_regclass), 0, 1, 0, 1}, {&__pyx_n_u_regcollation, __pyx_k_regcollation, sizeof(__pyx_k_regcollation), 0, 1, 0, 1}, {&__pyx_n_u_regconfig, __pyx_k_regconfig, sizeof(__pyx_k_regconfig), 0, 1, 0, 1}, {&__pyx_n_u_regdictionary, __pyx_k_regdictionary, sizeof(__pyx_k_regdictionary), 0, 1, 0, 1}, {&__pyx_n_s_register_data_types, __pyx_k_register_data_types, sizeof(__pyx_k_register_data_types), 0, 0, 1, 1}, {&__pyx_n_u_regnamespace, __pyx_k_regnamespace, sizeof(__pyx_k_regnamespace), 0, 1, 0, 1}, {&__pyx_n_u_regoper, __pyx_k_regoper, sizeof(__pyx_k_regoper), 0, 1, 0, 1}, {&__pyx_n_u_regoperator, __pyx_k_regoperator, sizeof(__pyx_k_regoperator), 0, 1, 0, 1}, {&__pyx_n_u_regproc, __pyx_k_regproc, sizeof(__pyx_k_regproc), 0, 1, 0, 1}, {&__pyx_n_u_regprocedure, __pyx_k_regprocedure, sizeof(__pyx_k_regprocedure), 0, 1, 0, 1}, {&__pyx_n_u_regrole, __pyx_k_regrole, sizeof(__pyx_k_regrole), 0, 1, 0, 1}, {&__pyx_n_u_regtype, __pyx_k_regtype, sizeof(__pyx_k_regtype), 0, 1, 0, 1}, {&__pyx_n_s_release, __pyx_k_release, sizeof(__pyx_k_release), 0, 0, 1, 1}, {&__pyx_n_u_reltime, __pyx_k_reltime, sizeof(__pyx_k_reltime), 0, 1, 0, 1}, {&__pyx_n_s_remove_python_codec, __pyx_k_remove_python_codec, sizeof(__pyx_k_remove_python_codec), 0, 0, 1, 1}, {&__pyx_n_s_request_cancel, __pyx_k_request_cancel, sizeof(__pyx_k_request_cancel), 0, 0, 1, 1}, {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, {&__pyx_n_s_resume_reading, __pyx_k_resume_reading, sizeof(__pyx_k_resume_reading), 0, 0, 1, 1}, {&__pyx_n_s_resume_writing, __pyx_k_resume_writing, sizeof(__pyx_k_resume_writing), 0, 0, 1, 1}, {&__pyx_n_s_return_extra, __pyx_k_return_extra, sizeof(__pyx_k_return_extra), 0, 0, 1, 1}, {&__pyx_n_s_return_rows, __pyx_k_return_rows, sizeof(__pyx_k_return_rows), 0, 0, 1, 1}, {&__pyx_n_s_reversed, __pyx_k_reversed, sizeof(__pyx_k_reversed), 0, 0, 1, 1}, {&__pyx_n_s_row, __pyx_k_row, sizeof(__pyx_k_row), 0, 0, 1, 1}, {&__pyx_kp_b_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 0, 0}, {&__pyx_n_s_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 0, 1, 1}, {&__pyx_n_u_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 1, 0, 1}, {&__pyx_n_u_scalar, __pyx_k_scalar, sizeof(__pyx_k_scalar), 0, 1, 0, 1}, {&__pyx_n_s_schema, __pyx_k_schema, sizeof(__pyx_k_schema), 0, 0, 1, 1}, {&__pyx_kp_u_scram_sha_256, __pyx_k_scram_sha_256, sizeof(__pyx_k_scram_sha_256), 0, 1, 0, 0}, {&__pyx_n_s_search, __pyx_k_search, sizeof(__pyx_k_search), 0, 0, 1, 1}, {&__pyx_n_s_secrets, __pyx_k_secrets, sizeof(__pyx_k_secrets), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, {&__pyx_n_u_server_first_message, __pyx_k_server_first_message, sizeof(__pyx_k_server_first_message), 0, 1, 0, 1}, {&__pyx_n_u_server_nonce, __pyx_k_server_nonce, sizeof(__pyx_k_server_nonce), 0, 1, 0, 1}, {&__pyx_n_s_server_settings, __pyx_k_server_settings, sizeof(__pyx_k_server_settings), 0, 0, 1, 1}, {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1}, {&__pyx_n_s_set_builtin_type_codec, __pyx_k_set_builtin_type_codec, sizeof(__pyx_k_set_builtin_type_codec), 0, 0, 1, 1}, {&__pyx_n_s_set_builtin_type_codec_2, __pyx_k_set_builtin_type_codec_2, sizeof(__pyx_k_set_builtin_type_codec_2), 0, 0, 1, 1}, {&__pyx_n_s_set_connection, __pyx_k_set_connection, sizeof(__pyx_k_set_connection), 0, 0, 1, 1}, {&__pyx_n_s_set_exception, __pyx_k_set_exception, sizeof(__pyx_k_set_exception), 0, 0, 1, 1}, {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, {&__pyx_n_s_set_result, __pyx_k_set_result, sizeof(__pyx_k_set_result), 0, 0, 1, 1}, {&__pyx_n_s_setsockopt, __pyx_k_setsockopt, sizeof(__pyx_k_setsockopt), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_settings, __pyx_k_settings, sizeof(__pyx_k_settings), 0, 0, 1, 1}, {&__pyx_n_s_sha256, __pyx_k_sha256, sizeof(__pyx_k_sha256), 0, 0, 1, 1}, {&__pyx_n_u_shift_jis, __pyx_k_shift_jis, sizeof(__pyx_k_shift_jis), 0, 1, 0, 1}, {&__pyx_n_u_shift_jis_2004, __pyx_k_shift_jis_2004, sizeof(__pyx_k_shift_jis_2004), 0, 1, 0, 1}, {&__pyx_n_s_sink, __pyx_k_sink, sizeof(__pyx_k_sink), 0, 0, 1, 1}, {&__pyx_kp_u_size_of_encoded_multirange_datum, __pyx_k_size_of_encoded_multirange_datum, sizeof(__pyx_k_size_of_encoded_multirange_datum), 0, 1, 0, 0}, {&__pyx_n_u_sjis, __pyx_k_sjis, sizeof(__pyx_k_sjis), 0, 1, 0, 1}, {&__pyx_n_s_sleep, __pyx_k_sleep, sizeof(__pyx_k_sleep), 0, 0, 1, 1}, {&__pyx_n_u_smallint, __pyx_k_smallint, sizeof(__pyx_k_smallint), 0, 1, 0, 1}, {&__pyx_n_u_smgr, __pyx_k_smgr, sizeof(__pyx_k_smgr), 0, 1, 0, 1}, {&__pyx_n_s_sock, __pyx_k_sock, sizeof(__pyx_k_sock), 0, 0, 1, 1}, {&__pyx_n_s_socket, __pyx_k_socket, sizeof(__pyx_k_socket), 0, 0, 1, 1}, {&__pyx_n_u_socket, __pyx_k_socket, sizeof(__pyx_k_socket), 0, 1, 0, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, {&__pyx_kp_u_specified_array_dimensions_do_no, __pyx_k_specified_array_dimensions_do_no, sizeof(__pyx_k_specified_array_dimensions_do_no), 0, 1, 0, 0}, {&__pyx_n_u_sql_ascii, __pyx_k_sql_ascii, sizeof(__pyx_k_sql_ascii), 0, 1, 0, 1}, {&__pyx_n_u_sspi, __pyx_k_sspi, sizeof(__pyx_k_sspi), 0, 1, 0, 1}, {&__pyx_n_s_sspilib, __pyx_k_sspilib, sizeof(__pyx_k_sspilib), 0, 0, 1, 1}, {&__pyx_kp_u_sspilib_module_not_found_please, __pyx_k_sspilib_module_not_found_please, sizeof(__pyx_k_sspilib_module_not_found_please), 0, 1, 0, 0}, {&__pyx_n_s_started, __pyx_k_started, sizeof(__pyx_k_started), 0, 0, 1, 1}, {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_status_msg, __pyx_k_status_msg, sizeof(__pyx_k_status_msg), 0, 0, 1, 1}, {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1}, {&__pyx_n_s_stmt_name, __pyx_k_stmt_name, sizeof(__pyx_k_stmt_name), 0, 0, 1, 1}, {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, {&__pyx_n_s_stringprep, __pyx_k_stringprep, sizeof(__pyx_k_stringprep), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_u_table_am_handler, __pyx_k_table_am_handler, sizeof(__pyx_k_table_am_handler), 0, 1, 0, 1}, {&__pyx_n_s_target_codec, __pyx_k_target_codec, sizeof(__pyx_k_target_codec), 0, 0, 1, 1}, {&__pyx_n_s_target_name, __pyx_k_target_name, sizeof(__pyx_k_target_name), 0, 0, 1, 1}, {&__pyx_n_s_tb, __pyx_k_tb, sizeof(__pyx_k_tb), 0, 0, 1, 1}, {&__pyx_n_u_tcvn, __pyx_k_tcvn, sizeof(__pyx_k_tcvn), 0, 1, 0, 1}, {&__pyx_n_u_tcvn5712, __pyx_k_tcvn5712, sizeof(__pyx_k_tcvn5712), 0, 1, 0, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_u_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 1, 0, 1}, {&__pyx_kp_u_text_2, __pyx_k_text_2, sizeof(__pyx_k_text_2), 0, 1, 0, 0}, {&__pyx_kp_u_text_binary_or_tuple, __pyx_k_text_binary_or_tuple, sizeof(__pyx_k_text_binary_or_tuple), 0, 1, 0, 0}, {&__pyx_kp_u_text_or_binary, __pyx_k_text_or_binary, sizeof(__pyx_k_text_or_binary), 0, 1, 0, 0}, {&__pyx_kp_u_text_or_binary_2, __pyx_k_text_or_binary_2, sizeof(__pyx_k_text_or_binary_2), 0, 1, 0, 0}, {&__pyx_kp_u_the_number_of_columns_in_the_res, __pyx_k_the_number_of_columns_in_the_res, sizeof(__pyx_k_the_number_of_columns_in_the_res), 0, 1, 0, 0}, {&__pyx_kp_u_the_number_of_query_arguments_ca, __pyx_k_the_number_of_query_arguments_ca, sizeof(__pyx_k_the_number_of_query_arguments_ca), 0, 1, 0, 0}, {&__pyx_kp_u_the_server_expects_x_argument_s, __pyx_k_the_server_expects_x_argument_s, sizeof(__pyx_k_the_server_expects_x_argument_s), 0, 1, 0, 0}, {&__pyx_kp_u_there_is_no, __pyx_k_there_is_no, sizeof(__pyx_k_there_is_no), 0, 1, 0, 0}, {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, {&__pyx_n_s_ti, __pyx_k_ti, sizeof(__pyx_k_ti), 0, 0, 1, 1}, {&__pyx_n_u_tid, __pyx_k_tid, sizeof(__pyx_k_tid), 0, 1, 0, 1}, {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, {&__pyx_n_u_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 1, 0, 1}, {&__pyx_kp_u_time_with_timezone, __pyx_k_time_with_timezone, sizeof(__pyx_k_time_with_timezone), 0, 1, 0, 0}, {&__pyx_kp_u_time_without_timezone, __pyx_k_time_without_timezone, sizeof(__pyx_k_time_without_timezone), 0, 1, 0, 0}, {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1}, {&__pyx_n_s_timer, __pyx_k_timer, sizeof(__pyx_k_timer), 0, 0, 1, 1}, {&__pyx_n_u_timestamp, __pyx_k_timestamp, sizeof(__pyx_k_timestamp), 0, 1, 0, 1}, {&__pyx_kp_u_timestamp_with_timezone, __pyx_k_timestamp_with_timezone, sizeof(__pyx_k_timestamp_with_timezone), 0, 1, 0, 0}, {&__pyx_kp_u_timestamp_without_timezone, __pyx_k_timestamp_without_timezone, sizeof(__pyx_k_timestamp_without_timezone), 0, 1, 0, 0}, {&__pyx_n_u_timestamptz, __pyx_k_timestamptz, sizeof(__pyx_k_timestamptz), 0, 1, 0, 1}, {&__pyx_n_u_timetz, __pyx_k_timetz, sizeof(__pyx_k_timetz), 0, 1, 0, 1}, {&__pyx_n_u_tinterval, __pyx_k_tinterval, sizeof(__pyx_k_tinterval), 0, 1, 0, 1}, {&__pyx_kp_u_to, __pyx_k_to, sizeof(__pyx_k_to), 0, 1, 0, 0}, {&__pyx_n_s_to_bytes, __pyx_k_to_bytes, sizeof(__pyx_k_to_bytes), 0, 0, 1, 1}, {&__pyx_n_s_token_bytes, __pyx_k_token_bytes, sizeof(__pyx_k_token_bytes), 0, 0, 1, 1}, {&__pyx_kp_u_too_many_elements_in_array_value, __pyx_k_too_many_elements_in_array_value, sizeof(__pyx_k_too_many_elements_in_array_value), 0, 1, 0, 0}, {&__pyx_kp_u_too_many_elements_in_composite_t, __pyx_k_too_many_elements_in_composite_t, sizeof(__pyx_k_too_many_elements_in_composite_t), 0, 1, 0, 0}, {&__pyx_kp_u_too_many_elements_in_multirange, __pyx_k_too_many_elements_in_multirange, sizeof(__pyx_k_too_many_elements_in_multirange), 0, 1, 0, 0}, {&__pyx_n_s_transport, __pyx_k_transport, sizeof(__pyx_k_transport), 0, 0, 1, 1}, {&__pyx_n_u_trigger, __pyx_k_trigger, sizeof(__pyx_k_trigger), 0, 1, 0, 1}, {&__pyx_n_u_tsm_handler, __pyx_k_tsm_handler, sizeof(__pyx_k_tsm_handler), 0, 1, 0, 1}, {&__pyx_n_u_tsquery, __pyx_k_tsquery, sizeof(__pyx_k_tsquery), 0, 1, 0, 1}, {&__pyx_n_u_tsvector, __pyx_k_tsvector, sizeof(__pyx_k_tsvector), 0, 1, 0, 1}, {&__pyx_n_u_tuple, __pyx_k_tuple, sizeof(__pyx_k_tuple), 0, 1, 0, 1}, {&__pyx_n_u_txid_snapshot, __pyx_k_txid_snapshot, sizeof(__pyx_k_txid_snapshot), 0, 1, 0, 1}, {&__pyx_kp_u_type_does_not_support_the_tuple, __pyx_k_type_does_not_support_the_tuple, sizeof(__pyx_k_type_does_not_support_the_tuple), 0, 1, 0, 0}, {&__pyx_kp_u_type_record_missing_base_type_fo, __pyx_k_type_record_missing_base_type_fo, sizeof(__pyx_k_type_record_missing_base_type_fo), 0, 1, 0, 0}, {&__pyx_kp_u_type_record_missing_base_type_fo_2, __pyx_k_type_record_missing_base_type_fo_2, sizeof(__pyx_k_type_record_missing_base_type_fo_2), 0, 1, 0, 0}, {&__pyx_kp_u_type_record_missing_base_type_fo_3, __pyx_k_type_record_missing_base_type_fo_3, sizeof(__pyx_k_type_record_missing_base_type_fo_3), 0, 1, 0, 0}, {&__pyx_kp_u_type_record_missing_field_types, __pyx_k_type_record_missing_field_types, sizeof(__pyx_k_type_record_missing_field_types), 0, 1, 0, 0}, {&__pyx_n_s_typeinfos, __pyx_k_typeinfos, sizeof(__pyx_k_typeinfos), 0, 0, 1, 1}, {&__pyx_n_s_typekind, __pyx_k_typekind, sizeof(__pyx_k_typekind), 0, 0, 1, 1}, {&__pyx_n_s_typename, __pyx_k_typename, sizeof(__pyx_k_typename), 0, 0, 1, 1}, {&__pyx_n_s_typeoid, __pyx_k_typeoid, sizeof(__pyx_k_typeoid), 0, 0, 1, 1}, {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1}, {&__pyx_n_s_typeschema, __pyx_k_typeschema, sizeof(__pyx_k_typeschema), 0, 0, 1, 1}, {&__pyx_n_s_typoid, __pyx_k_typoid, sizeof(__pyx_k_typoid), 0, 0, 1, 1}, {&__pyx_kp_u_unexpected_NULL_element_in_multi, __pyx_k_unexpected_NULL_element_in_multi, sizeof(__pyx_k_unexpected_NULL_element_in_multi), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_array_dimension_size, __pyx_k_unexpected_array_dimension_size, sizeof(__pyx_k_unexpected_array_dimension_size), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_array_dimensions_valu, __pyx_k_unexpected_array_dimensions_valu, sizeof(__pyx_k_unexpected_array_dimensions_valu), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_character_r_at_positi, __pyx_k_unexpected_character_r_at_positi, sizeof(__pyx_k_unexpected_character_r_at_positi), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_codec_type, __pyx_k_unexpected_codec_type, sizeof(__pyx_k_unexpected_codec_type), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_data_format, __pyx_k_unexpected_data_format, sizeof(__pyx_k_unexpected_data_format), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_data_type_of_composit, __pyx_k_unexpected_data_type_of_composit, sizeof(__pyx_k_unexpected_data_type_of_composit), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_end_of_string, __pyx_k_unexpected_end_of_string, sizeof(__pyx_k_unexpected_end_of_string), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_error_while_performin, __pyx_k_unexpected_error_while_performin, sizeof(__pyx_k_unexpected_error_while_performin), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_exchange_format, __pyx_k_unexpected_exchange_format, sizeof(__pyx_k_unexpected_exchange_format), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_multirange_size_value, __pyx_k_unexpected_multirange_size_value, sizeof(__pyx_k_unexpected_multirange_size_value), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_number_of_attributes, __pyx_k_unexpected_number_of_attributes, sizeof(__pyx_k_unexpected_number_of_attributes), 0, 1, 0, 0}, {&__pyx_kp_u_unexpected_trailing_bytes_in_buf, __pyx_k_unexpected_trailing_bytes_in_buf, sizeof(__pyx_k_unexpected_trailing_bytes_in_buf), 0, 1, 0, 0}, {&__pyx_kp_u_unhandled_standard_data_type, __pyx_k_unhandled_standard_data_type, sizeof(__pyx_k_unhandled_standard_data_type), 0, 1, 0, 0}, {&__pyx_n_u_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 1, 0, 1}, {&__pyx_n_s_unicodedata, __pyx_k_unicodedata, sizeof(__pyx_k_unicodedata), 0, 0, 1, 1}, {&__pyx_n_u_unknown, __pyx_k_unknown, sizeof(__pyx_k_unknown), 0, 1, 0, 1}, {&__pyx_kp_u_unknown_error_in_protocol_implem, __pyx_k_unknown_error_in_protocol_implem, sizeof(__pyx_k_unknown_error_in_protocol_implem), 0, 1, 0, 0}, {&__pyx_kp_u_unsupported_SASL_Authentication, __pyx_k_unsupported_SASL_Authentication, sizeof(__pyx_k_unsupported_SASL_Authentication), 0, 1, 0, 0}, {&__pyx_kp_u_unsupported_authentication_metho, __pyx_k_unsupported_authentication_metho, sizeof(__pyx_k_unsupported_authentication_metho), 0, 1, 0, 0}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1}, {&__pyx_n_s_upper_inc, __pyx_k_upper_inc, sizeof(__pyx_k_upper_inc), 0, 0, 1, 1}, {&__pyx_n_s_usage, __pyx_k_usage, sizeof(__pyx_k_usage), 0, 0, 1, 1}, {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1}, {&__pyx_n_s_user, __pyx_k_user, sizeof(__pyx_k_user), 0, 0, 1, 1}, {&__pyx_n_u_user, __pyx_k_user, sizeof(__pyx_k_user), 0, 1, 0, 1}, {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0}, {&__pyx_n_u_utf_8_2, __pyx_k_utf_8_2, sizeof(__pyx_k_utf_8_2), 0, 1, 0, 1}, {&__pyx_n_u_uuid, __pyx_k_uuid, sizeof(__pyx_k_uuid), 0, 1, 0, 1}, {&__pyx_kp_b_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 0, 0}, {&__pyx_n_u_varbit, __pyx_k_varbit, sizeof(__pyx_k_varbit), 0, 1, 0, 1}, {&__pyx_n_u_varchar, __pyx_k_varchar, sizeof(__pyx_k_varchar), 0, 1, 0, 1}, {&__pyx_n_u_void, __pyx_k_void, sizeof(__pyx_k_void), 0, 1, 0, 1}, {&__pyx_n_u_vscii, __pyx_k_vscii, sizeof(__pyx_k_vscii), 0, 1, 0, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1}, {&__pyx_n_s_wait_for, __pyx_k_wait_for, sizeof(__pyx_k_wait_for), 0, 0, 1, 1}, {&__pyx_n_s_wait_for_cancellation, __pyx_k_wait_for_cancellation, sizeof(__pyx_k_wait_for_cancellation), 0, 0, 1, 1}, {&__pyx_n_s_waiter, __pyx_k_waiter, sizeof(__pyx_k_waiter), 0, 0, 1, 1}, {&__pyx_kp_u_waiter_is_not_done_while_handlin, __pyx_k_waiter_is_not_done_while_handlin, sizeof(__pyx_k_waiter_is_not_done_while_handlin), 0, 1, 0, 0}, {&__pyx_n_u_was, __pyx_k_was, sizeof(__pyx_k_was), 0, 1, 0, 1}, {&__pyx_n_s_wbuf, __pyx_k_wbuf, sizeof(__pyx_k_wbuf), 0, 0, 1, 1}, {&__pyx_n_s_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1}, {&__pyx_n_u_were, __pyx_k_were, sizeof(__pyx_k_were), 0, 1, 0, 1}, {&__pyx_n_u_win, __pyx_k_win, sizeof(__pyx_k_win), 0, 1, 0, 1}, {&__pyx_n_u_win1250, __pyx_k_win1250, sizeof(__pyx_k_win1250), 0, 1, 0, 1}, {&__pyx_n_u_win1251, __pyx_k_win1251, sizeof(__pyx_k_win1251), 0, 1, 0, 1}, {&__pyx_n_u_win1252, __pyx_k_win1252, sizeof(__pyx_k_win1252), 0, 1, 0, 1}, {&__pyx_n_u_win1253, __pyx_k_win1253, sizeof(__pyx_k_win1253), 0, 1, 0, 1}, {&__pyx_n_u_win1254, __pyx_k_win1254, sizeof(__pyx_k_win1254), 0, 1, 0, 1}, {&__pyx_n_u_win1255, __pyx_k_win1255, sizeof(__pyx_k_win1255), 0, 1, 0, 1}, {&__pyx_n_u_win1256, __pyx_k_win1256, sizeof(__pyx_k_win1256), 0, 1, 0, 1}, {&__pyx_n_u_win1257, __pyx_k_win1257, sizeof(__pyx_k_win1257), 0, 1, 0, 1}, {&__pyx_n_u_win1258, __pyx_k_win1258, sizeof(__pyx_k_win1258), 0, 1, 0, 1}, {&__pyx_n_u_win866, __pyx_k_win866, sizeof(__pyx_k_win866), 0, 1, 0, 1}, {&__pyx_n_u_win874, __pyx_k_win874, sizeof(__pyx_k_win874), 0, 1, 0, 1}, {&__pyx_n_u_win932, __pyx_k_win932, sizeof(__pyx_k_win932), 0, 1, 0, 1}, {&__pyx_n_u_win936, __pyx_k_win936, sizeof(__pyx_k_win936), 0, 1, 0, 1}, {&__pyx_n_u_win949, __pyx_k_win949, sizeof(__pyx_k_win949), 0, 1, 0, 1}, {&__pyx_n_u_win950, __pyx_k_win950, sizeof(__pyx_k_win950), 0, 1, 0, 1}, {&__pyx_n_u_windows1250, __pyx_k_windows1250, sizeof(__pyx_k_windows1250), 0, 1, 0, 1}, {&__pyx_n_u_windows1251, __pyx_k_windows1251, sizeof(__pyx_k_windows1251), 0, 1, 0, 1}, {&__pyx_n_u_windows1252, __pyx_k_windows1252, sizeof(__pyx_k_windows1252), 0, 1, 0, 1}, {&__pyx_n_u_windows1253, __pyx_k_windows1253, sizeof(__pyx_k_windows1253), 0, 1, 0, 1}, {&__pyx_n_u_windows1254, __pyx_k_windows1254, sizeof(__pyx_k_windows1254), 0, 1, 0, 1}, {&__pyx_n_u_windows1255, __pyx_k_windows1255, sizeof(__pyx_k_windows1255), 0, 1, 0, 1}, {&__pyx_n_u_windows1256, __pyx_k_windows1256, sizeof(__pyx_k_windows1256), 0, 1, 0, 1}, {&__pyx_n_u_windows1257, __pyx_k_windows1257, sizeof(__pyx_k_windows1257), 0, 1, 0, 1}, {&__pyx_n_u_windows1258, __pyx_k_windows1258, sizeof(__pyx_k_windows1258), 0, 1, 0, 1}, {&__pyx_n_u_windows866, __pyx_k_windows866, sizeof(__pyx_k_windows866), 0, 1, 0, 1}, {&__pyx_n_u_windows874, __pyx_k_windows874, sizeof(__pyx_k_windows874), 0, 1, 0, 1}, {&__pyx_n_u_windows932, __pyx_k_windows932, sizeof(__pyx_k_windows932), 0, 1, 0, 1}, {&__pyx_n_u_windows936, __pyx_k_windows936, sizeof(__pyx_k_windows936), 0, 1, 0, 1}, {&__pyx_n_u_windows949, __pyx_k_windows949, sizeof(__pyx_k_windows949), 0, 1, 0, 1}, {&__pyx_n_u_windows950, __pyx_k_windows950, sizeof(__pyx_k_windows950), 0, 1, 0, 1}, {&__pyx_n_s_with_msg, __pyx_k_with_msg, sizeof(__pyx_k_with_msg), 0, 0, 1, 1}, {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, {&__pyx_n_s_writelines, __pyx_k_writelines, sizeof(__pyx_k_writelines), 0, 0, 1, 1}, {&__pyx_n_s_writing_allowed, __pyx_k_writing_allowed, sizeof(__pyx_k_writing_allowed), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_xformat, __pyx_k_xformat, sizeof(__pyx_k_xformat), 0, 0, 1, 1}, {&__pyx_n_u_xid, __pyx_k_xid, sizeof(__pyx_k_xid), 0, 1, 0, 1}, {&__pyx_n_u_xid8, __pyx_k_xid8, sizeof(__pyx_k_xid8), 0, 1, 0, 1}, {&__pyx_n_u_xml, __pyx_k_xml, sizeof(__pyx_k_xml), 0, 1, 0, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_kp_u_you_need_values_from_server_to_g, __pyx_k_you_need_values_from_server_to_g, sizeof(__pyx_k_you_need_values_from_server_to_g), 0, 1, 0, 0}, {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 72, __pyx_L1_error) __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(1, 100, __pyx_L1_error) __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(1, 101, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 2, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(3, 171, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(3, 179, __pyx_L1_error) __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(3, 476, __pyx_L1_error) __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(3, 557, __pyx_L1_error) __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_n_s_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(4, 379, __pyx_L1_error) __pyx_builtin_any = __Pyx_GetBuiltinName(__pyx_n_s_any); if (!__pyx_builtin_any) __PYX_ERR(5, 132, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(5, 154, __pyx_L1_error) __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(5, 188, __pyx_L1_error) __pyx_builtin_UnicodeEncodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeEncodeError); if (!__pyx_builtin_UnicodeEncodeError) __PYX_ERR(5, 276, __pyx_L1_error) __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(6, 149, __pyx_L1_error) __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(6, 1057, __pyx_L1_error) __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(6, 1208, __pyx_L1_error) __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(7, 176, __pyx_L1_error) __pyx_builtin_BufferError = __Pyx_GetBuiltinName(__pyx_n_s_BufferError); if (!__pyx_builtin_BufferError) __PYX_ERR(7, 330, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "asyncpg/protocol/codecs/base.pyx":191 * count = len(obj) * if count > _MAXINT32: * raise ValueError('too many elements in composite type record') # <<<<<<<<<<<<<< * * elem_data = WriteBuffer.new() */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_too_many_elements_in_composite_t); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(3, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "asyncpg/protocol/codecs/base.pyx":523 * # Canonicalize type name to "elemtype[]" * if name.startswith('_'): * name = name[1:] # <<<<<<<<<<<<<< * name = '{}[]'.format(name) * */ __pyx_slice__4 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__4)) __PYX_ERR(3, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__4); __Pyx_GIVEREF(__pyx_slice__4); /* "asyncpg/protocol/codecs/base.pyx":888 * kind = 'scalar' * * codec = Codec(INVALIDOID) # <<<<<<<<<<<<<< * codec.init(name, None, kind, CODEC_C, format, PG_XFORMAT_OBJECT, * encode, decode, None, None, None, None, None, None, None, 0) */ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(3, 888, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); /* "asyncpg/protocol/codecs/array.pyx":59 * * if mylen > _MAXINT32: * raise ValueError('too many elements in array value') # <<<<<<<<<<<<<< * * if ndims[0] > ARRAY_MAXDIM: */ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_too_many_elements_in_array_value); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(4, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); /* "asyncpg/protocol/codecs/array.pyx":78 * else: * if len(elem) != elemlen: * raise ValueError('non-homogeneous array') # <<<<<<<<<<<<<< * else: * if elemlen >= 0: */ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_non_homogeneous_array); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(4, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); /* "asyncpg/protocol/codecs/array.pyx":492 * ptr = apg_parse_int32(ptr, &ubound) * if ptr == NULL: * raise ValueError('missing array dimension value') # <<<<<<<<<<<<<< * * if ptr[0] == ':': */ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_missing_array_dimension_value); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(4, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* "asyncpg/protocol/codecs/array.pyx":506 * * if ptr[0] != ']': * raise ValueError('missing \']\' after array dimensions') # <<<<<<<<<<<<<< * * ptr += 1 # ']' */ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_missing_after_array_dimensions); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(4, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); /* "asyncpg/protocol/codecs/array.pyx":516 * # If dimensions were given, the '=' token is expected. * if ptr[0] != '=': * raise ValueError('missing \'=\' after array dimensions') # <<<<<<<<<<<<<< * * ptr += 1 # '=' */ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_missing_after_array_dimensions_2); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(4, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); /* "asyncpg/protocol/codecs/array.pyx":531 * * if inferred_ndims != ndims: * raise ValueError( # <<<<<<<<<<<<<< * 'specified array dimensions do not match array content') * */ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_specified_array_dimensions_do_no); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(4, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); /* "asyncpg/protocol/codecs/array.pyx":708 * while not end_of_item: * if ptr[0] == '\0': * raise ValueError('unexpected end of string') # <<<<<<<<<<<<<< * * elif ptr[0] == '"': */ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_unexpected_end_of_string); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(4, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); /* "asyncpg/protocol/codecs/range.pyx":164 * elem_count = len(obj) * if elem_count > INT32_MAX: * raise OverflowError(f'too many elements in multirange value') # <<<<<<<<<<<<<< * * elem_data_len = elem_data.len() */ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_too_many_elements_in_multirange); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(14, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); /* "asyncpg/protocol/codecs/record.pyx":55 * * cdef anonymous_record_encode(ConnectionSettings settings, WriteBuffer buf, obj): * raise exceptions.UnsupportedClientFeatureError( # <<<<<<<<<<<<<< * 'input of anonymous composite types is not supported', * hint=( */ __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_input_of_anonymous_composite_typ); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(15, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); /* "asyncpg/protocol/scram.pyx":123 * client_first_message = self.client_channel_binding + \ * self.client_first_message_bare * msg += (len(client_first_message)).to_bytes(4, byteorder='big') + \ # <<<<<<<<<<<<<< * client_first_message * return msg */ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_int_4); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(5, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); /* "asyncpg/protocol/scram.pyx":134 * if any([getattr(self, val) is None for val in * self.REQUIREMENTS_CLIENT_FINAL_MESSAGE]): * raise Exception( # <<<<<<<<<<<<<< * "you need values from server to generate a client proof") * */ __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_u_you_need_values_from_server_to_g); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(5, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); /* "asyncpg/protocol/scram.pyx":155 * self.server_first_message).group(1) * except IndexError: * raise Exception("could not get nonce") # <<<<<<<<<<<<<< * if not self.server_nonce.startswith(self.client_nonce): * raise Exception("invalid nonce") */ __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_u_could_not_get_nonce); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(5, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); /* "asyncpg/protocol/scram.pyx":157 * raise Exception("could not get nonce") * if not self.server_nonce.startswith(self.client_nonce): * raise Exception("invalid nonce") # <<<<<<<<<<<<<< * try: * self.password_salt = re.search(b',s=([^,]+),', */ __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_u_invalid_nonce); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(5, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); /* "asyncpg/protocol/scram.pyx":162 * self.server_first_message).group(1) * except IndexError: * raise Exception("could not get salt") # <<<<<<<<<<<<<< * try: * self.password_iterations = int(re.search(b',i=(\d+),?', */ __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_u_could_not_get_salt); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(5, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); /* "asyncpg/protocol/scram.pyx":167 * self.server_first_message).group(1)) * except (IndexError, TypeError, ValueError): * raise Exception("could not get iterations") # <<<<<<<<<<<<<< * * cdef verify_server_final_message(self, bytes server_final_message): */ __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_u_could_not_get_iterations); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(5, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); /* "asyncpg/protocol/scram.pyx":178 * server_final_message).group(1) * except IndexError: * raise Exception("could not get server signature") # <<<<<<<<<<<<<< * * verify_server_signature = hmac.new(self.server_key.digest(), */ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_u_could_not_get_server_signature); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(5, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); /* "asyncpg/protocol/prepared_stmt.pyx":202 * value_repr = repr(arg) * if len(value_repr) > 40: * value_repr = value_repr[:40] + '...' # <<<<<<<<<<<<<< * * raise exceptions.DataError( */ __pyx_slice__43 = PySlice_New(Py_None, __pyx_int_40, Py_None); if (unlikely(!__pyx_slice__43)) __PYX_ERR(7, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__43); __Pyx_GIVEREF(__pyx_slice__43); /* "asyncpg/protocol/protocol.pyx":250 * * while more: * with timer: # <<<<<<<<<<<<<< * await compat.wait_for( * self.writing_allowed.wait(), */ __pyx_tuple__49 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__49); __Pyx_GIVEREF(__pyx_tuple__49); /* "asyncpg/protocol/protocol.pyx":525 * aiter = reader.__aiter__ * except AttributeError: * raise TypeError('reader is not an asynchronous iterable') # <<<<<<<<<<<<<< * else: * iterator = aiter() */ __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_u_reader_is_not_an_asynchronous_it); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__56); __Pyx_GIVEREF(__pyx_tuple__56); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0xd9a8555, 0xea6089f, 0x7336a95): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xd9a8555, 0xea6089f, 0x7336a95) = (_custom_type_codecs, _derived_type_codecs))" % __pyx_checksum */ __pyx_tuple__60 = PyTuple_Pack(3, __pyx_int_228230485, __pyx_int_245762207, __pyx_int_120810133); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__60); __Pyx_GIVEREF(__pyx_tuple__60); __pyx_tuple__61 = PyTuple_Pack(3, __pyx_int_175807176, __pyx_int_252635979, __pyx_int_89793719); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__61); __Pyx_GIVEREF(__pyx_tuple__61); __pyx_tuple__62 = PyTuple_Pack(3, __pyx_int_134522893, __pyx_int_40941617, __pyx_int_232227937); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__62); __Pyx_GIVEREF(__pyx_tuple__62); /* "asyncpg/protocol/protocol.pyx":16 * import builtins * import codecs * import collections.abc # <<<<<<<<<<<<<< * import socket * import time */ __pyx_tuple__63 = PyTuple_Pack(2, __pyx_n_s_collections, __pyx_n_s_abc); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__63); __Pyx_GIVEREF(__pyx_tuple__63); /* "asyncpg/protocol/pgtypes.pxi":116 * DEF ANYCOMPATIBLERANGEOID = 5080 * * cdef ARRAY_TYPES = (_TEXTOID, _OIDOID,) # <<<<<<<<<<<<<< * * BUILTIN_TYPE_OID_MAP = { */ __pyx_tuple__64 = PyTuple_Pack(2, __pyx_int_1009, __pyx_int_1028); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(23, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__64); __Pyx_GIVEREF(__pyx_tuple__64); /* "asyncpg/protocol/settings.pyx":32 * return self._is_utf8 * * cpdef get_text_codec(self): # <<<<<<<<<<<<<< * return self._codec * */ __pyx_tuple__65 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(1, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__65); __Pyx_GIVEREF(__pyx_tuple__65); __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_settings_pyx, __pyx_n_s_get_text_codec, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(1, 32, __pyx_L1_error) /* "asyncpg/protocol/settings.pyx":35 * return self._codec * * cpdef inline register_data_types(self, types): # <<<<<<<<<<<<<< * self._data_codecs.add_types(types) * */ __pyx_tuple__67 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_types); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(1, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__67); __Pyx_GIVEREF(__pyx_tuple__67); __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_settings_pyx, __pyx_n_s_register_data_types, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(1, 35, __pyx_L1_error) /* "asyncpg/protocol/settings.pyx":38 * self._data_codecs.add_types(types) * * cpdef inline add_python_codec(self, typeoid, typename, typeschema, # <<<<<<<<<<<<<< * typeinfos, typekind, encoder, decoder, * format): */ __pyx_tuple__69 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_typeoid, __pyx_n_s_typename, __pyx_n_s_typeschema, __pyx_n_s_typeinfos, __pyx_n_s_typekind, __pyx_n_s_encoder, __pyx_n_s_decoder, __pyx_n_s_format); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(1, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69); __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(9, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_settings_pyx, __pyx_n_s_add_python_codec, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(1, 38, __pyx_L1_error) /* "asyncpg/protocol/settings.pyx":65 * _format, xformat) * * cpdef inline remove_python_codec(self, typeoid, typename, typeschema): # <<<<<<<<<<<<<< * self._data_codecs.remove_python_codec(typeoid, typename, typeschema) * */ __pyx_tuple__71 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_typeoid, __pyx_n_s_typename, __pyx_n_s_typeschema); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__71); __Pyx_GIVEREF(__pyx_tuple__71); __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_settings_pyx, __pyx_n_s_remove_python_codec, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(1, 65, __pyx_L1_error) /* "asyncpg/protocol/settings.pyx":68 * self._data_codecs.remove_python_codec(typeoid, typename, typeschema) * * cpdef inline clear_type_cache(self): # <<<<<<<<<<<<<< * self._data_codecs.clear_type_cache() * */ __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_settings_pyx, __pyx_n_s_clear_type_cache, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(1, 68, __pyx_L1_error) /* "asyncpg/protocol/settings.pyx":71 * self._data_codecs.clear_type_cache() * * cpdef inline set_builtin_type_codec(self, typeoid, typename, typeschema, # <<<<<<<<<<<<<< * typekind, alias_to, format): * cdef: */ __pyx_tuple__74 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_typeoid, __pyx_n_s_typename, __pyx_n_s_typeschema, __pyx_n_s_typekind, __pyx_n_s_alias_to, __pyx_n_s_format); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(1, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__74); __Pyx_GIVEREF(__pyx_tuple__74); __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_settings_pyx, __pyx_n_s_set_builtin_type_codec, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(1, 71, __pyx_L1_error) /* "asyncpg/protocol/settings.pyx":91 * typekind, alias_to, _format) * * cpdef inline Codec get_data_codec(self, uint32_t oid, # <<<<<<<<<<<<<< * ServerDataFormat format=PG_FORMAT_ANY, * bint ignore_custom_codec=False): */ __pyx_tuple__76 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_oid, __pyx_n_s_format, __pyx_n_s_ignore_custom_codec); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(1, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__76); __Pyx_GIVEREF(__pyx_tuple__76); __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_settings_pyx, __pyx_n_s_get_data_codec, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(1, 91, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(2, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_tuple__79 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__79); __Pyx_GIVEREF(__pyx_tuple__79); __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(2, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(2, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(2, 3, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":493 * self._custom_type_codecs = {} * * def add_types(self, types): # <<<<<<<<<<<<<< * cdef: * Codec elem_codec */ __pyx_tuple__83 = PyTuple_Pack(20, __pyx_n_s_self, __pyx_n_s_types, __pyx_n_s_elem_codec, __pyx_n_s_comp_elem_codecs, __pyx_n_s_format, __pyx_n_s_elem_format, __pyx_n_s_has_text_elements, __pyx_n_s_elem_delim, __pyx_n_s_ti, __pyx_n_s_oid, __pyx_n_s_name, __pyx_n_s_schema, __pyx_n_s_array_element_oid, __pyx_n_s_range_subtype_oid, __pyx_n_s_comp_type_attrs, __pyx_n_s_base_type, __pyx_n_s_typoid, __pyx_n_s_element_names, __pyx_n_s_i, __pyx_n_s_attrname); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(3, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__83); __Pyx_GIVEREF(__pyx_tuple__83); __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_codecs_base_pyx, __pyx_n_s_add_types, 493, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(3, 493, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":623 * self.declare_fallback_codec(oid, name, schema) * * def add_python_codec(self, typeoid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * typeinfos, encoder, decoder, format, xformat): * cdef: */ __pyx_tuple__85 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_typeoid, __pyx_n_s_typename, __pyx_n_s_typeschema, __pyx_n_s_typekind, __pyx_n_s_typeinfos, __pyx_n_s_encoder, __pyx_n_s_decoder, __pyx_n_s_format, __pyx_n_s_xformat, __pyx_n_s_core_codec, __pyx_n_s_c_encoder, __pyx_n_s_c_decoder, __pyx_n_s_base_codec, __pyx_n_s_oid, __pyx_n_s_codec_set, __pyx_n_s_formats, __pyx_n_s_fmt); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(3, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__85); __Pyx_GIVEREF(__pyx_tuple__85); __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(10, 0, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_codecs_base_pyx, __pyx_n_s_add_python_codec, 623, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(3, 623, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":668 * typename)) * * def remove_python_codec(self, typeoid, typename, typeschema): # <<<<<<<<<<<<<< * for fmt in (PG_FORMAT_BINARY, PG_FORMAT_TEXT): * self._custom_type_codecs.pop((typeoid, fmt), None) */ __pyx_tuple__87 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_typeoid, __pyx_n_s_typename, __pyx_n_s_typeschema, __pyx_n_s_fmt); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(3, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__87); __Pyx_GIVEREF(__pyx_tuple__87); __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_codecs_base_pyx, __pyx_n_s_remove_python_codec, 668, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(3, 668, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":673 * self.clear_type_cache() * * def _set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * alias_to, format=PG_FORMAT_ANY): * cdef: */ __pyx_tuple__89 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_typeoid, __pyx_n_s_typename, __pyx_n_s_typeschema, __pyx_n_s_typekind, __pyx_n_s_alias_to, __pyx_n_s_format, __pyx_n_s_codec, __pyx_n_s_target_codec, __pyx_n_s_oid, __pyx_n_s_alias_oid, __pyx_n_s_codec_set, __pyx_n_s_formats, __pyx_n_s_codec_str); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(3, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__89); __Pyx_GIVEREF(__pyx_tuple__89); __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_codecs_base_pyx, __pyx_n_s_set_builtin_type_codec_2, 673, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(3, 673, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":722 * f'there is no {codec_str} codec for {alias_to}') * * def set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * alias_to, format=PG_FORMAT_ANY): * self._set_builtin_type_codec(typeoid, typename, typeschema, typekind, */ __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_codecs_base_pyx, __pyx_n_s_set_builtin_type_codec, 722, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(3, 722, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":728 * self.clear_type_cache() * * def clear_type_cache(self): # <<<<<<<<<<<<<< * self._derived_type_codecs.clear() * */ __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_codecs_base_pyx, __pyx_n_s_clear_type_cache, 728, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(3, 728, __pyx_L1_error) /* "asyncpg/protocol/codecs/base.pyx":731 * self._derived_type_codecs.clear() * * def declare_fallback_codec(self, uint32_t oid, str name, str schema): # <<<<<<<<<<<<<< * cdef Codec codec * */ __pyx_tuple__93 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_oid, __pyx_n_s_name, __pyx_n_s_schema, __pyx_n_s_codec); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(3, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__93); __Pyx_GIVEREF(__pyx_tuple__93); __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_codecs_base_pyx, __pyx_n_s_declare_fallback_codec, 731, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(3, 731, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_tuple__95 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__95); __Pyx_GIVEREF(__pyx_tuple__95); __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(2, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: * return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_DataCodecConfig__set_state(self, __pyx_state) */ __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(2, 16, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(2, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(2, 3, __pyx_L1_error) /* "asyncpg/protocol/coreproto.pyx":46 * self._reset_result() * * cpdef is_in_transaction(self): # <<<<<<<<<<<<<< * # PQTRANS_INTRANS = idle, within transaction block * # PQTRANS_INERROR = idle, within failed transaction */ __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_coreproto_pyx, __pyx_n_s_is_in_transaction, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(6, 46, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(2, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: * return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_CoreProtocol__set_state(self, __pyx_state) */ __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(2, 16, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":35 * self.ignore_custom_codec = ignore_custom_codec * * def _get_parameters(self): # <<<<<<<<<<<<<< * cdef Codec codec * */ __pyx_tuple__103 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_codec, __pyx_n_s_result, __pyx_n_s_oid); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(7, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__103); __Pyx_GIVEREF(__pyx_tuple__103); __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_prepared_stmt_p, __pyx_n_s_get_parameters, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(7, 35, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":49 * return tuple(result) * * def _get_attributes(self): # <<<<<<<<<<<<<< * cdef Codec codec * */ __pyx_tuple__105 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_codec, __pyx_n_s_result, __pyx_n_s_d, __pyx_n_s_name, __pyx_n_s_oid); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(7, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__105); __Pyx_GIVEREF(__pyx_tuple__105); __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_prepared_stmt_p, __pyx_n_s_get_attributes, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(7, 49, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":73 * return tuple(result) * * def _init_types(self): # <<<<<<<<<<<<<< * cdef: * Codec codec */ __pyx_tuple__107 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_codec, __pyx_n_s_missing, __pyx_n_s_p_oid, __pyx_n_s_rdesc); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(7, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__107); __Pyx_GIVEREF(__pyx_tuple__107); __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_prepared_stmt_p, __pyx_n_s_init_types, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(7, 73, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":92 * return missing * * cpdef _init_codecs(self): # <<<<<<<<<<<<<< * self._ensure_args_encoder() * self._ensure_rows_decoder() */ __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_prepared_stmt_p, __pyx_n_s_init_codecs, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(7, 92, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":96 * self._ensure_rows_decoder() * * def attach(self): # <<<<<<<<<<<<<< * self.refs += 1 * */ __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_prepared_stmt_p, __pyx_n_s_attach, 96, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(7, 96, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":99 * self.refs += 1 * * def detach(self): # <<<<<<<<<<<<<< * self.refs -= 1 * */ __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_prepared_stmt_p, __pyx_n_s_detach, 99, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(7, 99, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":102 * self.refs -= 1 * * def mark_closed(self): # <<<<<<<<<<<<<< * self.closed = True * */ __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_prepared_stmt_p, __pyx_n_s_mark_closed, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(7, 102, __pyx_L1_error) /* "asyncpg/protocol/prepared_stmt.pyx":105 * self.closed = True * * def mark_unprepared(self): # <<<<<<<<<<<<<< * if self.name: * raise exceptions.InternalClientError( */ __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_prepared_stmt_p, __pyx_n_s_mark_unprepared, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(7, 105, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(2, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(2, 3, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":110 * self.create_future = self._create_future_fallback * * def set_connection(self, connection): # <<<<<<<<<<<<<< * self.conref = weakref.ref(connection) * */ __pyx_tuple__116 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_connection); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__116); __Pyx_GIVEREF(__pyx_tuple__116); __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_set_connection, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 110, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":119 * return None * * def get_server_pid(self): # <<<<<<<<<<<<<< * return self.backend_pid * */ __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_get_server_pid, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(0, 119, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":122 * return self.backend_pid * * def get_settings(self): # <<<<<<<<<<<<<< * return self.settings * */ __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_get_settings, 122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 122, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":125 * return self.settings * * def get_record_class(self): # <<<<<<<<<<<<<< * return self.record_class * */ __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_get_record_class, 125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(0, 125, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":138 * self.transport.pause_reading() * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def prepare(self, stmt_name, query, timeout, * *, */ __pyx_tuple__121 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_stmt_name, __pyx_n_s_query, __pyx_n_s_timeout, __pyx_n_s_state, __pyx_n_s_ignore_custom_codec, __pyx_n_s_record_class, __pyx_n_s_waiter, __pyx_n_s_ex); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__121); __Pyx_GIVEREF(__pyx_tuple__121); __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(4, 0, 3, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_prepare, 138, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 138, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":167 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def bind_execute( * self, */ __pyx_tuple__122 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_args, __pyx_n_s_portal_name, __pyx_n_s_limit, __pyx_n_s_return_extra, __pyx_n_s_timeout, __pyx_n_s_args_buf, __pyx_n_s_waiter, __pyx_n_s_ex); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__122); __Pyx_GIVEREF(__pyx_tuple__122); __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_bind_execute, 167, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 167, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":208 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def bind_execute_many( * self, */ __pyx_tuple__123 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_args, __pyx_n_s_portal_name, __pyx_n_s_timeout, __pyx_n_s_return_rows, __pyx_n_s_timer, __pyx_n_s_data_gen, __pyx_n_s_arg_bufs, __pyx_n_s_waiter, __pyx_n_s_more, __pyx_n_s_e, __pyx_n_s_ex, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__123); __Pyx_GIVEREF(__pyx_tuple__123); __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_bind_execute_many, 208, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 208, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":270 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def bind(self, PreparedStatementState state, args, * str portal_name, timeout): */ __pyx_tuple__124 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_args, __pyx_n_s_portal_name, __pyx_n_s_timeout, __pyx_n_s_args_buf, __pyx_n_s_waiter, __pyx_n_s_ex); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__124); __Pyx_GIVEREF(__pyx_tuple__124); __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_bind, 270, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 270, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":299 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def execute(self, PreparedStatementState state, * str portal_name, int limit, return_extra, */ __pyx_tuple__125 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_portal_name, __pyx_n_s_limit, __pyx_n_s_return_extra, __pyx_n_s_timeout, __pyx_n_s_waiter, __pyx_n_s_ex); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__125); __Pyx_GIVEREF(__pyx_tuple__125); __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_execute, 299, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 299, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":329 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def close_portal(self, str portal_name, timeout): * */ __pyx_tuple__126 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_portal_name, __pyx_n_s_timeout, __pyx_n_s_waiter, __pyx_n_s_ex); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__126); __Pyx_GIVEREF(__pyx_tuple__126); __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_close_portal, 329, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 329, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":352 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def query(self, query, timeout): * if self.cancel_waiter is not None: */ __pyx_tuple__127 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_query, __pyx_n_s_timeout, __pyx_n_s_waiter, __pyx_n_s_ex); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__127); __Pyx_GIVEREF(__pyx_tuple__127); __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_query, 352, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 352, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":377 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def copy_out(self, copy_stmt, sink, timeout): * if self.cancel_waiter is not None: */ __pyx_tuple__128 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_copy_stmt, __pyx_n_s_sink, __pyx_n_s_timeout, __pyx_n_s_timer, __pyx_n_s_waiter, __pyx_n_s_buffer, __pyx_n_s_done, __pyx_n_s_status_msg, __pyx_n_s_ex); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__128); __Pyx_GIVEREF(__pyx_tuple__128); __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_copy_out, 377, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 377, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":431 * return status_msg * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def copy_in(self, copy_stmt, reader, data, * records, PreparedStatementState record_stmt, timeout): */ __pyx_tuple__129 = PyTuple_Pack(22, __pyx_n_s_self, __pyx_n_s_copy_stmt, __pyx_n_s_reader, __pyx_n_s_data, __pyx_n_s_records, __pyx_n_s_record_stmt, __pyx_n_s_timeout, __pyx_n_s_wbuf, __pyx_n_s_num_cols, __pyx_n_s_codec, __pyx_n_s_timer, __pyx_n_s_waiter, __pyx_n_s_codecs, __pyx_n_s_settings, __pyx_n_s_row, __pyx_n_s_i, __pyx_n_s_item, __pyx_n_s_aiter_2, __pyx_n_s_iterator, __pyx_n_s_chunk, __pyx_n_s_e, __pyx_n_s_status_msg); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__129); __Pyx_GIVEREF(__pyx_tuple__129); __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 22, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_copy_in, 431, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 431, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":570 * return status_msg * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def close_statement(self, PreparedStatementState state, timeout): * if self.cancel_waiter is not None: */ __pyx_tuple__130 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_timeout, __pyx_n_s_waiter, __pyx_n_s_ex); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__130); __Pyx_GIVEREF(__pyx_tuple__130); __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_close_statement, 570, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 570, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":596 * return await waiter * * def is_closed(self): # <<<<<<<<<<<<<< * return self.closing * */ __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_is_closed, 596, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 596, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":599 * return self.closing * * def is_connected(self): # <<<<<<<<<<<<<< * return not self.closing and self.con_status == CONNECTION_OK * */ __pyx_codeobj__132 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_is_connected, 599, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__132)) __PYX_ERR(0, 599, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":602 * return not self.closing and self.con_status == CONNECTION_OK * * def abort(self): # <<<<<<<<<<<<<< * if self.closing: * return */ __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_abort, 602, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(0, 602, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":611 * self.transport = None * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def close(self, timeout): * if self.closing: */ __pyx_tuple__134 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__134); __Pyx_GIVEREF(__pyx_tuple__134); __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_close, 611, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 611, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":652 * self.transport.abort() * * def _request_cancel(self): # <<<<<<<<<<<<<< * self.cancel_waiter = self.create_future() * self.cancel_sent_waiter = self.create_future() */ __pyx_tuple__135 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_con); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__135); __Pyx_GIVEREF(__pyx_tuple__135); __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_request_cancel, 652, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(0, 652, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":679 * self._set_state(PROTOCOL_CANCELLED) * * def _on_timeout(self, fut): # <<<<<<<<<<<<<< * if self.waiter is not fut or fut.done() or \ * self.cancel_waiter is not None or \ */ __pyx_tuple__137 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_fut); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__137); __Pyx_GIVEREF(__pyx_tuple__137); __pyx_codeobj__138 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_on_timeout, 679, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__138)) __PYX_ERR(0, 679, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":687 * self.waiter.set_exception(asyncio.TimeoutError()) * * def _on_waiter_completed(self, fut): # <<<<<<<<<<<<<< * if self.timeout_handle: * self.timeout_handle.cancel() */ __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_on_waiter_completed, 687, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) __PYX_ERR(0, 687, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":696 * self._request_cancel() * * def _create_future_fallback(self): # <<<<<<<<<<<<<< * return asyncio.Future(loop=self.loop) * */ __pyx_codeobj__140 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_create_future_fallback, 696, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__140)) __PYX_ERR(0, 696, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":712 * self.settings.add_setting(name, val) * * def _get_timeout(self, timeout): # <<<<<<<<<<<<<< * if timeout is not None: * try: */ __pyx_codeobj__141 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_get_timeout, 712, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__141)) __PYX_ERR(0, 712, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":748 * 'cannot perform operation: another operation is in progress') * * def _is_cancelling(self): # <<<<<<<<<<<<<< * return ( * self.cancel_waiter is not None or */ __pyx_codeobj__142 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_is_cancelling, 748, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__142)) __PYX_ERR(0, 748, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":754 * ) * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def _wait_for_cancellation(self): * if self.cancel_sent_waiter is not None: */ __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_wait_for_cancellation, 754, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 754, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":974 * # asyncio callbacks: * * def data_received(self, data): # <<<<<<<<<<<<<< * self.buffer.feed_data(data) * self._read_server_messages() */ __pyx_tuple__143 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__143); __Pyx_GIVEREF(__pyx_tuple__143); __pyx_codeobj__144 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__143, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_data_received, 974, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__144)) __PYX_ERR(0, 974, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":978 * self._read_server_messages() * * def connection_made(self, transport): # <<<<<<<<<<<<<< * self.transport = transport * */ __pyx_tuple__145 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_transport, __pyx_n_s_sock, __pyx_n_s_ex); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__145); __Pyx_GIVEREF(__pyx_tuple__145); __pyx_codeobj__146 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_connection_made, 978, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__146)) __PYX_ERR(0, 978, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":996 * self._on_error(ex) * * def connection_lost(self, exc): # <<<<<<<<<<<<<< * self.con_status = CONNECTION_BAD * self._set_state(PROTOCOL_FAILED) */ __pyx_tuple__147 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_exc); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__147); __Pyx_GIVEREF(__pyx_tuple__147); __pyx_codeobj__148 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_connection_lost, 996, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__148)) __PYX_ERR(0, 996, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":1001 * self._on_connection_lost(exc) * * def pause_writing(self): # <<<<<<<<<<<<<< * self.writing_allowed.clear() * */ __pyx_codeobj__149 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_pause_writing, 1001, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__149)) __PYX_ERR(0, 1001, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":1004 * self.writing_allowed.clear() * * def resume_writing(self): # <<<<<<<<<<<<<< * self.writing_allowed.set() * */ __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_resume_writing, 1004, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) __PYX_ERR(0, 1004, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_codeobj__151 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__151)) __PYX_ERR(2, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: * return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_BaseProtocol__set_state(self, __pyx_state) */ __pyx_codeobj__152 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) __PYX_ERR(2, 16, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":1017 * * class Timer: * def __init__(self, budget): # <<<<<<<<<<<<<< * self._budget = budget * self._started = 0 */ __pyx_tuple__153 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_budget); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(0, 1017, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__153); __Pyx_GIVEREF(__pyx_tuple__153); __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_init, 1017, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) __PYX_ERR(0, 1017, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":1021 * self._started = 0 * * def __enter__(self): # <<<<<<<<<<<<<< * if self._budget is not None: * self._started = time.monotonic() */ __pyx_codeobj__155 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_enter, 1021, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__155)) __PYX_ERR(0, 1021, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":1025 * self._started = time.monotonic() * * def __exit__(self, et, e, tb): # <<<<<<<<<<<<<< * if self._budget is not None: * self._budget -= time.monotonic() - self._started */ __pyx_tuple__156 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_et, __pyx_n_s_e, __pyx_n_s_tb); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(0, 1025, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__156); __Pyx_GIVEREF(__pyx_tuple__156); __pyx_codeobj__157 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__156, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_exit, 1025, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__157)) __PYX_ERR(0, 1025, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":1029 * self._budget -= time.monotonic() - self._started * * def get_remaining_budget(self): # <<<<<<<<<<<<<< * return self._budget * */ __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_get_remaining_budget, 1029, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) __PYX_ERR(0, 1029, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":1032 * return self._budget * * def has_budget_greater_than(self, amount): # <<<<<<<<<<<<<< * if self._budget is None: * # Unlimited budget. */ __pyx_tuple__159 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_amount); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__159); __Pyx_GIVEREF(__pyx_tuple__159); __pyx_codeobj__160 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__159, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_has_budget_greater_than, 1032, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) __PYX_ERR(0, 1032, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":1044 * * * def _create_record(object mapping, tuple elems): # <<<<<<<<<<<<<< * # Exposed only for testing purposes. * */ __pyx_tuple__161 = PyTuple_Pack(6, __pyx_n_s_mapping, __pyx_n_s_elems, __pyx_n_s_rec, __pyx_n_s_i, __pyx_n_s_desc, __pyx_n_s_elem); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__161); __Pyx_GIVEREF(__pyx_tuple__161); __pyx_codeobj__162 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__161, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_asyncpg_protocol_protocol_pyx, __pyx_n_s_create_record, 1044, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__162)) __PYX_ERR(0, 1044, __pyx_L1_error) /* "(tree fragment)":1 * def __pyx_unpickle_DataCodecConfig(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_tuple__163 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__163); __Pyx_GIVEREF(__pyx_tuple__163); __pyx_codeobj__164 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_DataCodecConfig, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) __PYX_ERR(2, 1, __pyx_L1_error) __pyx_codeobj__165 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_CoreProtocol, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__165)) __PYX_ERR(2, 1, __pyx_L1_error) __pyx_codeobj__166 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_BaseProtocol, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__166)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; __pyx_umethod_PyDict_Type_get.method_name = &__pyx_n_s_get; __pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; __pyx_umethod_PyDict_Type_pop.method_name = &__pyx_n_s_pop; if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_17 = PyInt_FromLong(17); if (unlikely(!__pyx_int_17)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_19 = PyInt_FromLong(19); if (unlikely(!__pyx_int_19)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_21 = PyInt_FromLong(21); if (unlikely(!__pyx_int_21)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_23 = PyInt_FromLong(23); if (unlikely(!__pyx_int_23)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_24 = PyInt_FromLong(24); if (unlikely(!__pyx_int_24)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_25 = PyInt_FromLong(25); if (unlikely(!__pyx_int_25)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_26 = PyInt_FromLong(26); if (unlikely(!__pyx_int_26)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_27 = PyInt_FromLong(27); if (unlikely(!__pyx_int_27)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_28 = PyInt_FromLong(28); if (unlikely(!__pyx_int_28)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_29 = PyInt_FromLong(29); if (unlikely(!__pyx_int_29)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_40 = PyInt_FromLong(40); if (unlikely(!__pyx_int_40)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_114 = PyInt_FromLong(114); if (unlikely(!__pyx_int_114)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_142 = PyInt_FromLong(142); if (unlikely(!__pyx_int_142)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_194 = PyInt_FromLong(194); if (unlikely(!__pyx_int_194)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_210 = PyInt_FromLong(210); if (unlikely(!__pyx_int_210)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_269 = PyInt_FromLong(269); if (unlikely(!__pyx_int_269)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_325 = PyInt_FromLong(325); if (unlikely(!__pyx_int_325)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_600 = PyInt_FromLong(600); if (unlikely(!__pyx_int_600)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_601 = PyInt_FromLong(601); if (unlikely(!__pyx_int_601)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_602 = PyInt_FromLong(602); if (unlikely(!__pyx_int_602)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_603 = PyInt_FromLong(603); if (unlikely(!__pyx_int_603)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_604 = PyInt_FromLong(604); if (unlikely(!__pyx_int_604)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_628 = PyInt_FromLong(628); if (unlikely(!__pyx_int_628)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_650 = PyInt_FromLong(650); if (unlikely(!__pyx_int_650)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_700 = PyInt_FromLong(700); if (unlikely(!__pyx_int_700)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_701 = PyInt_FromLong(701); if (unlikely(!__pyx_int_701)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_702 = PyInt_FromLong(702); if (unlikely(!__pyx_int_702)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_703 = PyInt_FromLong(703); if (unlikely(!__pyx_int_703)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_704 = PyInt_FromLong(704); if (unlikely(!__pyx_int_704)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_705 = PyInt_FromLong(705); if (unlikely(!__pyx_int_705)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_718 = PyInt_FromLong(718); if (unlikely(!__pyx_int_718)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_774 = PyInt_FromLong(774); if (unlikely(!__pyx_int_774)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_790 = PyInt_FromLong(790); if (unlikely(!__pyx_int_790)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_829 = PyInt_FromLong(829); if (unlikely(!__pyx_int_829)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_869 = PyInt_FromLong(869); if (unlikely(!__pyx_int_869)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1009 = PyInt_FromLong(1009); if (unlikely(!__pyx_int_1009)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1028 = PyInt_FromLong(1028); if (unlikely(!__pyx_int_1028)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1033 = PyInt_FromLong(1033); if (unlikely(!__pyx_int_1033)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1042 = PyInt_FromLong(1042); if (unlikely(!__pyx_int_1042)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1043 = PyInt_FromLong(1043); if (unlikely(!__pyx_int_1043)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1082 = PyInt_FromLong(1082); if (unlikely(!__pyx_int_1082)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1083 = PyInt_FromLong(1083); if (unlikely(!__pyx_int_1083)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1114 = PyInt_FromLong(1114); if (unlikely(!__pyx_int_1114)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1184 = PyInt_FromLong(1184); if (unlikely(!__pyx_int_1184)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1186 = PyInt_FromLong(1186); if (unlikely(!__pyx_int_1186)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1266 = PyInt_FromLong(1266); if (unlikely(!__pyx_int_1266)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1560 = PyInt_FromLong(1560); if (unlikely(!__pyx_int_1560)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1562 = PyInt_FromLong(1562); if (unlikely(!__pyx_int_1562)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1700 = PyInt_FromLong(1700); if (unlikely(!__pyx_int_1700)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1790 = PyInt_FromLong(1790); if (unlikely(!__pyx_int_1790)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2202 = PyInt_FromLong(2202); if (unlikely(!__pyx_int_2202)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2203 = PyInt_FromLong(2203); if (unlikely(!__pyx_int_2203)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2204 = PyInt_FromLong(2204); if (unlikely(!__pyx_int_2204)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2205 = PyInt_FromLong(2205); if (unlikely(!__pyx_int_2205)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2206 = PyInt_FromLong(2206); if (unlikely(!__pyx_int_2206)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2249 = PyInt_FromLong(2249); if (unlikely(!__pyx_int_2249)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2275 = PyInt_FromLong(2275); if (unlikely(!__pyx_int_2275)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2276 = PyInt_FromLong(2276); if (unlikely(!__pyx_int_2276)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2277 = PyInt_FromLong(2277); if (unlikely(!__pyx_int_2277)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2278 = PyInt_FromLong(2278); if (unlikely(!__pyx_int_2278)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2279 = PyInt_FromLong(2279); if (unlikely(!__pyx_int_2279)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2280 = PyInt_FromLong(2280); if (unlikely(!__pyx_int_2280)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2281 = PyInt_FromLong(2281); if (unlikely(!__pyx_int_2281)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2282 = PyInt_FromLong(2282); if (unlikely(!__pyx_int_2282)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2283 = PyInt_FromLong(2283); if (unlikely(!__pyx_int_2283)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2776 = PyInt_FromLong(2776); if (unlikely(!__pyx_int_2776)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2950 = PyInt_FromLong(2950); if (unlikely(!__pyx_int_2950)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_2970 = PyInt_FromLong(2970); if (unlikely(!__pyx_int_2970)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3115 = PyInt_FromLong(3115); if (unlikely(!__pyx_int_3115)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3220 = PyInt_FromLong(3220); if (unlikely(!__pyx_int_3220)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3310 = PyInt_FromLong(3310); if (unlikely(!__pyx_int_3310)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3361 = PyInt_FromLong(3361); if (unlikely(!__pyx_int_3361)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3402 = PyInt_FromLong(3402); if (unlikely(!__pyx_int_3402)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3500 = PyInt_FromLong(3500); if (unlikely(!__pyx_int_3500)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3614 = PyInt_FromLong(3614); if (unlikely(!__pyx_int_3614)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3615 = PyInt_FromLong(3615); if (unlikely(!__pyx_int_3615)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3642 = PyInt_FromLong(3642); if (unlikely(!__pyx_int_3642)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3734 = PyInt_FromLong(3734); if (unlikely(!__pyx_int_3734)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3769 = PyInt_FromLong(3769); if (unlikely(!__pyx_int_3769)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3802 = PyInt_FromLong(3802); if (unlikely(!__pyx_int_3802)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3831 = PyInt_FromLong(3831); if (unlikely(!__pyx_int_3831)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_3838 = PyInt_FromLong(3838); if (unlikely(!__pyx_int_3838)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4072 = PyInt_FromLong(4072); if (unlikely(!__pyx_int_4072)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4089 = PyInt_FromLong(4089); if (unlikely(!__pyx_int_4089)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4096 = PyInt_FromLong(4096); if (unlikely(!__pyx_int_4096)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4191 = PyInt_FromLong(4191); if (unlikely(!__pyx_int_4191)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4537 = PyInt_FromLong(4537); if (unlikely(!__pyx_int_4537)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4538 = PyInt_FromLong(4538); if (unlikely(!__pyx_int_4538)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4600 = PyInt_FromLong(4600); if (unlikely(!__pyx_int_4600)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4601 = PyInt_FromLong(4601); if (unlikely(!__pyx_int_4601)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_5017 = PyInt_FromLong(5017); if (unlikely(!__pyx_int_5017)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_5038 = PyInt_FromLong(5038); if (unlikely(!__pyx_int_5038)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_5069 = PyInt_FromLong(5069); if (unlikely(!__pyx_int_5069)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_5077 = PyInt_FromLong(5077); if (unlikely(!__pyx_int_5077)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_5078 = PyInt_FromLong(5078); if (unlikely(!__pyx_int_5078)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_5079 = PyInt_FromLong(5079); if (unlikely(!__pyx_int_5079)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_5080 = PyInt_FromLong(5080); if (unlikely(!__pyx_int_5080)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_32768 = PyInt_FromLong(32768L); if (unlikely(!__pyx_int_32768)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_524288 = PyInt_FromLong(524288L); if (unlikely(!__pyx_int_524288)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_40941617 = PyInt_FromLong(40941617L); if (unlikely(!__pyx_int_40941617)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_89793719 = PyInt_FromLong(89793719L); if (unlikely(!__pyx_int_89793719)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_120810133 = PyInt_FromLong(120810133L); if (unlikely(!__pyx_int_120810133)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_134522893 = PyInt_FromLong(134522893L); if (unlikely(!__pyx_int_134522893)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_175807176 = PyInt_FromLong(175807176L); if (unlikely(!__pyx_int_175807176)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_228230485 = PyInt_FromLong(228230485L); if (unlikely(!__pyx_int_228230485)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_232227937 = PyInt_FromLong(232227937L); if (unlikely(!__pyx_int_232227937)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_245762207 = PyInt_FromLong(245762207L); if (unlikely(!__pyx_int_245762207)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_252635979 = PyInt_FromLong(252635979L); if (unlikely(!__pyx_int_252635979)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { /* AssertionsEnabled.init */ if (likely(__Pyx_init_assertions_enabled() == 0)); else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __pyx_v_7asyncpg_8protocol_8protocol_ARRAY_TYPES = Py_None; Py_INCREF(Py_None); __pyx_7genexpr__pyx_v_7asyncpg_8protocol_8protocol_k = Py_None; Py_INCREF(Py_None); __pyx_7genexpr__pyx_v_7asyncpg_8protocol_8protocol_v = Py_None; Py_INCREF(Py_None); __pyx_v_7asyncpg_8protocol_8protocol_ENCODINGS_MAP = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_7asyncpg_8protocol_8protocol_EXTRA_CODECS = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_7asyncpg_8protocol_8protocol_AUTH_METHOD_NAME = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_7asyncpg_8protocol_8protocol_FLUSH_MESSAGE = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_k = Py_None; Py_INCREF(Py_None); __pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_v = Py_None; Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ if (__Pyx_ExportVoidPtr(__pyx_n_s_ARRAY_TYPES, (void *)&__pyx_v_7asyncpg_8protocol_8protocol_ARRAY_TYPES, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __pyx_vtabptr_7asyncpg_8protocol_8protocol_Codec = &__pyx_vtable_7asyncpg_8protocol_8protocol_Codec; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.init = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, PyObject *, PyObject *, PyObject *, enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, __pyx_t_7asyncpg_8protocol_8protocol_encode_func, __pyx_t_7asyncpg_8protocol_8protocol_decode_func, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, PyObject *, PyObject *, PyObject *, Py_UCS4))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_init; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.encode_scalar = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_scalar; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.encode_array = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_array; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.encode_array_text = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_array_text; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.encode_range = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_range; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.encode_multirange = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_multirange; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.encode_composite = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_composite; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.encode_in_python = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_in_python; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.decode_scalar = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_scalar; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.decode_array = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_array; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.decode_array_text = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_array_text; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.decode_range = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_range; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.decode_multirange = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_multirange; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.decode_composite = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_composite; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.decode_in_python = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_in_python; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.encode = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.decode = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.has_encoder = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_encoder; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.has_decoder = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.is_binary = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_is_binary; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.copy = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_copy; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.new_array_codec = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*)(uint32_t, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, Py_UCS4))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_array_codec; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.new_range_codec = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*)(uint32_t, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_range_codec; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.new_multirange_codec = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*)(uint32_t, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_multirange_codec; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.new_composite_codec = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*)(uint32_t, PyObject *, PyObject *, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, PyObject *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_composite_codec; __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.new_python_codec = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*)(uint32_t, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, __pyx_t_7asyncpg_8protocol_8protocol_encode_func, __pyx_t_7asyncpg_8protocol_8protocol_decode_func, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_python_codec; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol_Codec = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol_Codec_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol_Codec)) __PYX_ERR(3, 20, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_Codec_spec, __pyx_ptype_7asyncpg_8protocol_8protocol_Codec) < 0) __PYX_ERR(3, 20, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol_Codec = &__pyx_type_7asyncpg_8protocol_8protocol_Codec; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol_Codec) < 0) __PYX_ERR(3, 20, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol_Codec->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol_Codec->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol_Codec->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol_Codec->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif if (__Pyx_SetVtable(__pyx_ptype_7asyncpg_8protocol_8protocol_Codec, __pyx_vtabptr_7asyncpg_8protocol_8protocol_Codec) < 0) __PYX_ERR(3, 20, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_7asyncpg_8protocol_8protocol_Codec) < 0) __PYX_ERR(3, 20, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Codec, (PyObject *) __pyx_ptype_7asyncpg_8protocol_8protocol_Codec) < 0) __PYX_ERR(3, 20, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7asyncpg_8protocol_8protocol_Codec) < 0) __PYX_ERR(3, 20, __pyx_L1_error) #endif __pyx_vtabptr_7asyncpg_8protocol_8protocol_DataCodecConfig = &__pyx_vtable_7asyncpg_8protocol_8protocol_DataCodecConfig; __pyx_vtable_7asyncpg_8protocol_8protocol_DataCodecConfig.get_codec = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *, uint32_t, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec *__pyx_optional_args))__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec; __pyx_vtable_7asyncpg_8protocol_8protocol_DataCodecConfig.get_custom_codec = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *, uint32_t, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat))__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_custom_codec; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig)) __PYX_ERR(3, 485, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig_spec, __pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig) < 0) __PYX_ERR(3, 485, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig = &__pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig) < 0) __PYX_ERR(3, 485, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_vtabptr_7asyncpg_8protocol_8protocol_DataCodecConfig) < 0) __PYX_ERR(3, 485, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig) < 0) __PYX_ERR(3, 485, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DataCodecConfig, (PyObject *) __pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig) < 0) __PYX_ERR(3, 485, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig) < 0) __PYX_ERR(3, 485, __pyx_L1_error) #endif __pyx_t_1 = PyImport_ImportModule("asyncpg.pgproto.pgproto"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext = __Pyx_ImportType_3_0_11(__pyx_t_1, "asyncpg.pgproto.pgproto", "CodecContext", sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_vtabptr_7asyncpg_7pgproto_7pgproto_CodecContext = (struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext*)__Pyx_GetVtable(__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext); if (unlikely(!__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_CodecContext)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_vtabptr_7asyncpg_8protocol_8protocol_ConnectionSettings = &__pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings; __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings.__pyx_base = *__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_CodecContext; __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings.__pyx_base.get_text_codec = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, int __pyx_skip_dispatch))__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_text_codec; __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings.__pyx_base.is_encoding_utf8 = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *))__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_is_encoding_utf8; __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings.add_setting = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_add_setting; __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings.register_data_types = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_register_data_types; __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings.add_python_codec = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_add_python_codec; __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings.remove_python_codec = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_remove_python_codec; __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings.clear_type_cache = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, int __pyx_skip_dispatch))__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_clear_type_cache; __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings.set_builtin_type_codec = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_set_builtin_type_codec; __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings.get_data_codec = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, uint32_t, int __pyx_skip_dispatch, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec *__pyx_optional_args))__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec; #if CYTHON_USE_TYPE_SPECS __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings_spec, __pyx_t_2); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings)) __PYX_ERR(1, 12, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings_spec, __pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings) < 0) __PYX_ERR(1, 12, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings = &__pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings->tp_base = __pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings) < 0) __PYX_ERR(1, 12, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings->tp_print = 0; #endif if (__Pyx_SetVtable(__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_vtabptr_7asyncpg_8protocol_8protocol_ConnectionSettings) < 0) __PYX_ERR(1, 12, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings) < 0) __PYX_ERR(1, 12, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ConnectionSettings, (PyObject *) __pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings) < 0) __PYX_ERR(1, 12, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings) < 0) __PYX_ERR(1, 12, __pyx_L1_error) #endif __pyx_vtabptr_7asyncpg_8protocol_8protocol_SCRAMAuthentication = &__pyx_vtable_7asyncpg_8protocol_8protocol_SCRAMAuthentication; __pyx_vtable_7asyncpg_8protocol_8protocol_SCRAMAuthentication.create_client_first_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_create_client_first_message; __pyx_vtable_7asyncpg_8protocol_8protocol_SCRAMAuthentication.create_client_final_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_create_client_final_message; __pyx_vtable_7asyncpg_8protocol_8protocol_SCRAMAuthentication.parse_server_first_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_parse_server_first_message; __pyx_vtable_7asyncpg_8protocol_8protocol_SCRAMAuthentication.verify_server_final_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_verify_server_final_message; __pyx_vtable_7asyncpg_8protocol_8protocol_SCRAMAuthentication._bytes_xor = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__bytes_xor; __pyx_vtable_7asyncpg_8protocol_8protocol_SCRAMAuthentication._generate_client_nonce = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, int))__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_client_nonce; __pyx_vtable_7asyncpg_8protocol_8protocol_SCRAMAuthentication._generate_client_proof = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_client_proof; __pyx_vtable_7asyncpg_8protocol_8protocol_SCRAMAuthentication._generate_salted_password = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *, PyObject *, int))__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_salted_password; __pyx_vtable_7asyncpg_8protocol_8protocol_SCRAMAuthentication._normalize_password = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__normalize_password; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication)) __PYX_ERR(5, 18, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication_spec, __pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication) < 0) __PYX_ERR(5, 18, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication = &__pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication) < 0) __PYX_ERR(5, 18, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif if (__Pyx_SetVtable(__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_vtabptr_7asyncpg_8protocol_8protocol_SCRAMAuthentication) < 0) __PYX_ERR(5, 18, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication) < 0) __PYX_ERR(5, 18, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SCRAMAuthentication, (PyObject *) __pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication) < 0) __PYX_ERR(5, 18, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication) < 0) __PYX_ERR(5, 18, __pyx_L1_error) #endif __pyx_vtabptr_7asyncpg_8protocol_8protocol_CoreProtocol = &__pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol.is_in_transaction = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, int __pyx_skip_dispatch))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol_is_in_transaction; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._process__auth = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__auth; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._process__prepare = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__prepare; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._process__bind_execute = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__bind_execute; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._process__bind_execute_many = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__bind_execute_many; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._process__close_stmt_portal = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__close_stmt_portal; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._process__simple_query = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__simple_query; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._process__bind = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__bind; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._process__copy_out = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_out; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._process__copy_out_data = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_out_data; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._process__copy_in = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_in; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._process__copy_in_data = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_in_data; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._parse_msg_authentication = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_authentication; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._parse_msg_parameter_status = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_parameter_status; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._parse_msg_notification = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_notification; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._parse_msg_backend_key_data = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_backend_key_data; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._parse_msg_ready_for_query = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_ready_for_query; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._parse_data_msgs = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_data_msgs; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._parse_copy_data_msgs = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_copy_data_msgs; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._parse_msg_error_response = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_error_response; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._parse_msg_command_complete = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_command_complete; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._write_copy_data_msg = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_copy_data_msg; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._write_copy_done_msg = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_copy_done_msg; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._write_copy_fail_msg = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_copy_fail_msg; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._auth_password_message_cleartext = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_cleartext; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._auth_password_message_md5 = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_md5; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._auth_password_message_sasl_initial = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_sasl_initial; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._auth_password_message_sasl_continue = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_sasl_continue; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._auth_gss_init_gssapi = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_init_gssapi; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._auth_gss_init_sspi = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, int))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_init_sspi; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._auth_gss_get_service = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_get_service; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._auth_gss_step = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_step; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._write = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._writelines = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__writelines; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._read_server_messages = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__read_server_messages; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._push_result = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__push_result; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._reset_result = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__reset_result; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._set_state = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__set_state; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._ensure_connected = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__ensure_connected; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._build_parse_message = (struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_parse_message; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._build_bind_message = (struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_bind_message; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._build_empty_bind_data = (struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_empty_bind_data; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._build_execute_message = (struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, int32_t))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_execute_message; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._connect = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__connect; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._prepare_and_describe = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__prepare_and_describe; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._send_parse_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__send_parse_message; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._send_bind_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int32_t))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__send_bind_message; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._bind_execute = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int32_t))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._bind_execute_many = (int (*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, PyObject *, int))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._bind_execute_many_more = (int (*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_more *__pyx_optional_args))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_more; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._bind_execute_many_fail = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_fail *__pyx_optional_args))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_fail; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._bind = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._execute = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, int32_t))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__execute; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._close = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, int))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__close; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._simple_query = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__simple_query; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._copy_out = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__copy_out; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._copy_in = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__copy_in; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._terminate = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__terminate; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._decode_row = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char const *, Py_ssize_t))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__decode_row; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._on_result = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_result; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._on_notification = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_notification; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._on_notice = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_notice; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._set_server_parameter = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__set_server_parameter; __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._on_connection_lost = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_connection_lost; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol)) __PYX_ERR(6, 24, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol_spec, __pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol) < 0) __PYX_ERR(6, 24, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol = &__pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol) < 0) __PYX_ERR(6, 24, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol, __pyx_vtabptr_7asyncpg_8protocol_8protocol_CoreProtocol) < 0) __PYX_ERR(6, 24, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol) < 0) __PYX_ERR(6, 24, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CoreProtocol, (PyObject *) __pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol) < 0) __PYX_ERR(6, 24, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol) < 0) __PYX_ERR(6, 24, __pyx_L1_error) #endif __pyx_vtabptr_7asyncpg_8protocol_8protocol_PreparedStatementState = &__pyx_vtable_7asyncpg_8protocol_8protocol_PreparedStatementState; __pyx_vtable_7asyncpg_8protocol_8protocol_PreparedStatementState._encode_bind_msg = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, PyObject *, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg *__pyx_optional_args))__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg; __pyx_vtable_7asyncpg_8protocol_8protocol_PreparedStatementState._init_codecs = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, int __pyx_skip_dispatch))__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__init_codecs; __pyx_vtable_7asyncpg_8protocol_8protocol_PreparedStatementState._ensure_rows_decoder = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *))__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_rows_decoder; __pyx_vtable_7asyncpg_8protocol_8protocol_PreparedStatementState._ensure_args_encoder = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *))__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_args_encoder; __pyx_vtable_7asyncpg_8protocol_8protocol_PreparedStatementState._set_row_desc = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_row_desc; __pyx_vtable_7asyncpg_8protocol_8protocol_PreparedStatementState._set_args_desc = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_args_desc; __pyx_vtable_7asyncpg_8protocol_8protocol_PreparedStatementState._decode_row = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, char const *, Py_ssize_t))__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__decode_row; #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState)) __PYX_ERR(7, 12, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState_spec, __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState) < 0) __PYX_ERR(7, 12, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState = &__pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState) < 0) __PYX_ERR(7, 12, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif if (__Pyx_SetVtable(__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_vtabptr_7asyncpg_8protocol_8protocol_PreparedStatementState) < 0) __PYX_ERR(7, 12, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState) < 0) __PYX_ERR(7, 12, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PreparedStatementState, (PyObject *) __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState) < 0) __PYX_ERR(7, 12, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState) < 0) __PYX_ERR(7, 12, __pyx_L1_error) #endif __pyx_vtabptr_7asyncpg_8protocol_8protocol_BaseProtocol = &__pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.__pyx_base = *__pyx_vtabptr_7asyncpg_8protocol_8protocol_CoreProtocol; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.__pyx_base._write = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__write; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.__pyx_base._writelines = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__writelines; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.__pyx_base._decode_row = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char const *, Py_ssize_t))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__decode_row; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.__pyx_base._on_result = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.__pyx_base._on_notification = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_notification; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.__pyx_base._on_notice = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_notice; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.__pyx_base._set_server_parameter = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__set_server_parameter; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.__pyx_base._on_connection_lost = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_connection_lost; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.get_connection = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_get_connection; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._get_timeout_impl = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._check_state = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__check_state; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._new_waiter = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__new_waiter; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._coreproto_error = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__coreproto_error; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._on_result__connect = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__connect; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._on_result__prepare = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__prepare; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._on_result__bind_and_exec = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__bind_and_exec; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._on_result__close_stmt_or_portal = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__close_stmt_or_portal; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._on_result__simple_query = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__simple_query; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._on_result__bind = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__bind; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._on_result__copy_out = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__copy_out; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._on_result__copy_in = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__copy_in; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._handle_waiter_on_connection_lost = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__handle_waiter_on_connection_lost; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._dispatch_result = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__dispatch_result; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.resume_reading = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_resume_reading; __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.pause_reading = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_pause_reading; #if CYTHON_USE_TYPE_SPECS __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol_spec, __pyx_t_2); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol)) __PYX_ERR(0, 75, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol_spec, __pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol) < 0) __PYX_ERR(0, 75, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol = &__pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol; #endif #if !CYTHON_COMPILING_IN_LIMITED_API __pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol->tp_base = __pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol; #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol) < 0) __PYX_ERR(0, 75, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (__Pyx_SetVtable(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_vtabptr_7asyncpg_8protocol_8protocol_BaseProtocol) < 0) __PYX_ERR(0, 75, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_MergeVtables(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol) < 0) __PYX_ERR(0, 75, __pyx_L1_error) #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BaseProtocol, (PyObject *) __pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol) < 0) __PYX_ERR(0, 75, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol) < 0) __PYX_ERR(0, 75, __pyx_L1_error) #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr)) __PYX_ERR(5, 188, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr_spec, __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr) < 0) __PYX_ERR(5, 188, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr) < 0) __PYX_ERR(5, 188, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password)) __PYX_ERR(5, 256, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password_spec, __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password) < 0) __PYX_ERR(5, 256, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password) < 0) __PYX_ERR(5, 256, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr)) __PYX_ERR(5, 287, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr_spec, __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(5, 287, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(5, 287, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr)) __PYX_ERR(5, 313, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr_spec, __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(5, 313, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(5, 313, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr)) __PYX_ERR(5, 327, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr_spec, __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(5, 327, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(5, 327, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr)) __PYX_ERR(5, 336, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr_spec, __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(5, 336, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(5, 336, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare)) __PYX_ERR(0, 138, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare_spec, __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare) < 0) __PYX_ERR(0, 138, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare) < 0) __PYX_ERR(0, 138, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute)) __PYX_ERR(0, 167, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute_spec, __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute) < 0) __PYX_ERR(0, 167, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute) < 0) __PYX_ERR(0, 167, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many)) __PYX_ERR(0, 208, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many_spec, __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many) < 0) __PYX_ERR(0, 208, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many) < 0) __PYX_ERR(0, 208, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr)) __PYX_ERR(0, 230, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr_spec, __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr) < 0) __PYX_ERR(0, 230, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr) < 0) __PYX_ERR(0, 230, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind)) __PYX_ERR(0, 270, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind_spec, __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind) < 0) __PYX_ERR(0, 270, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind) < 0) __PYX_ERR(0, 270, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute)) __PYX_ERR(0, 299, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute_spec, __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute) < 0) __PYX_ERR(0, 299, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute) < 0) __PYX_ERR(0, 299, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal)) __PYX_ERR(0, 329, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal_spec, __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal) < 0) __PYX_ERR(0, 329, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal) < 0) __PYX_ERR(0, 329, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query)) __PYX_ERR(0, 352, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query_spec, __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query) < 0) __PYX_ERR(0, 352, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query) < 0) __PYX_ERR(0, 352, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out)) __PYX_ERR(0, 377, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out_spec, __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out) < 0) __PYX_ERR(0, 377, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out) < 0) __PYX_ERR(0, 377, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in)) __PYX_ERR(0, 431, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in_spec, __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in) < 0) __PYX_ERR(0, 431, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in) < 0) __PYX_ERR(0, 431, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement)) __PYX_ERR(0, 570, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement_spec, __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement) < 0) __PYX_ERR(0, 570, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement) < 0) __PYX_ERR(0, 570, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close)) __PYX_ERR(0, 611, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close_spec, __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close) < 0) __PYX_ERR(0, 611, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close) < 0) __PYX_ERR(0, 611, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation_spec, NULL); if (unlikely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation)) __PYX_ERR(0, 754, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation_spec, __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation) < 0) __PYX_ERR(0, 754, __pyx_L1_error) #else __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation) < 0) __PYX_ERR(0, 754, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation->tp_dictoffset && __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject), #else sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyHeapTypeObject), #endif __Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(20, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyBoolObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(21, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyComplexObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(22, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("asyncpg.pgproto.pgproto"); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer = __Pyx_ImportType_3_0_11(__pyx_t_1, "asyncpg.pgproto.pgproto", "WriteBuffer", sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer) __PYX_ERR(10, 8, __pyx_L1_error) __pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer = (struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer*)__Pyx_GetVtable(__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer); if (unlikely(!__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer)) __PYX_ERR(10, 8, __pyx_L1_error) __pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer = __Pyx_ImportType_3_0_11(__pyx_t_1, "asyncpg.pgproto.pgproto", "ReadBuffer", sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer) __PYX_ERR(10, 68, __pyx_L1_error) __pyx_vtabptr_7asyncpg_7pgproto_7pgproto_ReadBuffer = (struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer*)__Pyx_GetVtable(__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer); if (unlikely(!__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_ReadBuffer)) __PYX_ERR(10, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("asyncpg.pgproto.pgproto"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "frb_check", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_frb_check, "PyObject *(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, Py_ssize_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "date_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_date_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "date_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_date_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "date_encode_tuple", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_date_encode_tuple, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "date_decode_tuple", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_date_decode_tuple, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "timestamp_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "timestamp_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "timestamp_encode_tuple", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_encode_tuple, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "timestamp_decode_tuple", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_decode_tuple, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "timestamptz_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamptz_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "timestamptz_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamptz_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "time_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_time_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "time_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_time_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "time_encode_tuple", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_time_encode_tuple, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "time_decode_tuple", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_time_decode_tuple, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "timetz_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "timetz_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "timetz_encode_tuple", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_encode_tuple, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "timetz_decode_tuple", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_decode_tuple, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "interval_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_interval_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "interval_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_interval_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "interval_encode_tuple", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_interval_encode_tuple, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "interval_decode_tuple", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_interval_decode_tuple, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "bits_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bits_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "bits_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bits_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "bool_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bool_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "bool_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bool_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "box_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_box_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "box_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_box_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "line_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_line_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "line_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_line_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "lseg_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_lseg_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "lseg_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_lseg_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "point_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_point_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "point_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_point_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "path_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_path_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "path_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_path_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "poly_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_poly_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "poly_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_poly_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "circle_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_circle_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "circle_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_circle_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "hstore_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_hstore_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "hstore_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_hstore_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "int2_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int2_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "int2_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int2_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "int4_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int4_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "int4_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int4_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "uint4_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uint4_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "uint4_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uint4_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "int8_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int8_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "int8_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int8_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "uint8_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uint8_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "uint8_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uint8_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "float4_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_float4_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "float4_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_float4_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "float8_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_float8_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "float8_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_float8_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "jsonb_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_jsonb_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "jsonb_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_jsonb_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "jsonpath_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_jsonpath_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "jsonpath_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_jsonpath_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "as_pg_string_and_size", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_as_pg_string_and_size, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, PyObject *, char **, Py_ssize_t *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "text_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "text_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "bytea_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "bytea_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "uuid_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uuid_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "uuid_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uuid_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "numeric_encode_text", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_encode_text, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "numeric_decode_text", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_text, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "numeric_encode_binary", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_encode_binary, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "numeric_decode_binary", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_binary, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "void_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_void_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "void_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_void_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "tid_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_tid_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "tid_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_tid_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "cidr_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_cidr_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "cidr_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_cidr_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "inet_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_inet_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "inet_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_inet_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "pg_snapshot_encode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_encode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "pg_snapshot_decode", (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_decode, "PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_protocol(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_protocol}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "protocol", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initprotocol(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initprotocol(void) #else __Pyx_PyMODINIT_FUNC PyInit_protocol(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_protocol(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_protocol(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; Py_ssize_t __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; static Py_UCS4 __pyx_t_10[5]; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyTypeObject *__pyx_t_18; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'protocol' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("protocol", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "protocol" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_protocol(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_asyncpg__protocol__protocol) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "asyncpg.protocol.protocol")) { if (unlikely((PyDict_SetItemString(modules, "asyncpg.protocol.protocol", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); if (unlikely((__Pyx_modinit_variable_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "asyncpg/protocol/protocol.pyx":13 * cimport cpython * * import asyncio # <<<<<<<<<<<<<< * import builtins * import codecs */ __pyx_t_2 = __Pyx_patch_asyncio(__Pyx_ImportDottedModule(__pyx_n_s_asyncio, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_asyncio, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":14 * * import asyncio * import builtins # <<<<<<<<<<<<<< * import codecs * import collections.abc */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_builtins, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_builtins, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":15 * import asyncio * import builtins * import codecs # <<<<<<<<<<<<<< * import collections.abc * import socket */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_codecs, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_codecs, __pyx_t_2) < 0) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":16 * import builtins * import codecs * import collections.abc # <<<<<<<<<<<<<< * import socket * import time */ __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections_abc, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":17 * import codecs * import collections.abc * import socket # <<<<<<<<<<<<<< * import time * import weakref */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_socket, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_socket, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":18 * import collections.abc * import socket * import time # <<<<<<<<<<<<<< * import weakref * */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_time, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":19 * import socket * import time * import weakref # <<<<<<<<<<<<<< * * from asyncpg.pgproto.pgproto cimport ( */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_weakref, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_weakref, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":43 * INT32_MAX, UINT32_MAX * * from asyncpg.exceptions import _base as apg_exc_base # <<<<<<<<<<<<<< * from asyncpg import compat * from asyncpg import types as apg_types */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_base); __Pyx_GIVEREF(__pyx_n_s_base); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_base)) __PYX_ERR(0, 43, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_asyncpg_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_apg_exc_base, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":44 * * from asyncpg.exceptions import _base as apg_exc_base * from asyncpg import compat # <<<<<<<<<<<<<< * from asyncpg import types as apg_types * from asyncpg import exceptions as apg_exc */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_compat); __Pyx_GIVEREF(__pyx_n_s_compat); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_compat)) __PYX_ERR(0, 44, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_asyncpg, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_compat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_compat, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":45 * from asyncpg.exceptions import _base as apg_exc_base * from asyncpg import compat * from asyncpg import types as apg_types # <<<<<<<<<<<<<< * from asyncpg import exceptions as apg_exc * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_types); __Pyx_GIVEREF(__pyx_n_s_types); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_types)) __PYX_ERR(0, 45, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_asyncpg, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_apg_types, __pyx_t_2) < 0) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/protocol.pyx":46 * from asyncpg import compat * from asyncpg import types as apg_types * from asyncpg import exceptions as apg_exc # <<<<<<<<<<<<<< * * from asyncpg.pgproto cimport hton */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_exceptions); __Pyx_GIVEREF(__pyx_n_s_exceptions); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_exceptions)) __PYX_ERR(0, 46, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_asyncpg, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_apg_exc, __pyx_t_3) < 0) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/pgtypes.pxi":116 * DEF ANYCOMPATIBLERANGEOID = 5080 * * cdef ARRAY_TYPES = (_TEXTOID, _OIDOID,) # <<<<<<<<<<<<<< * * BUILTIN_TYPE_OID_MAP = { */ __Pyx_INCREF(__pyx_tuple__64); __Pyx_XGOTREF(__pyx_v_7asyncpg_8protocol_8protocol_ARRAY_TYPES); __Pyx_DECREF_SET(__pyx_v_7asyncpg_8protocol_8protocol_ARRAY_TYPES, __pyx_tuple__64); __Pyx_GIVEREF(__pyx_tuple__64); /* "asyncpg/protocol/pgtypes.pxi":119 * * BUILTIN_TYPE_OID_MAP = { * ABSTIMEOID: 'abstime', # <<<<<<<<<<<<<< * ACLITEMOID: 'aclitem', * ANYARRAYOID: 'anyarray', */ __pyx_t_2 = __Pyx_PyDict_NewPresized(100); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_int_702, __pyx_n_u_abstime) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_1033, __pyx_n_u_aclitem) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_2277, __pyx_n_u_anyarray) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_5078, __pyx_n_u_anycompatiblearray) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_4538, __pyx_n_u_anycompatiblemultirange) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_5079, __pyx_n_u_anycompatiblenonarray) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_5077, __pyx_n_u_anycompatible) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_5080, __pyx_n_u_anycompatiblerange) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_2283, __pyx_n_u_anyelement) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_3500, __pyx_n_u_anyenum) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_4537, __pyx_n_u_anymultirange) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_2776, __pyx_n_u_anynonarray) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_2276, __pyx_n_u_any) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_3831, __pyx_n_u_anyrange) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_1560, __pyx_n_u_bit) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_16, __pyx_n_u_bool) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_603, __pyx_n_u_box) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_1042, __pyx_n_u_bpchar) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_17, __pyx_n_u_bytea) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_18, __pyx_n_u_char) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_29, __pyx_n_u_cid) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_650, __pyx_n_u_cidr) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_718, __pyx_n_u_circle) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_2275, __pyx_n_u_cstring) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_1082, __pyx_n_u_date) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_3838, __pyx_n_u_event_trigger) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_3115, __pyx_n_u_fdw_handler) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_700, __pyx_n_u_float4) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_701, __pyx_n_u_float8) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_3642, __pyx_n_u_gtsvector) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_325, __pyx_n_u_index_am_handler) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_869, __pyx_n_u_inet) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_21, __pyx_n_u_int2) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_23, __pyx_n_u_int4) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_20, __pyx_n_u_int8) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_2281, __pyx_n_u_internal) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_1186, __pyx_n_u_interval) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_3802, __pyx_n_u_jsonb) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_114, __pyx_n_u_json) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_4072, __pyx_n_u_jsonpath) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_2280, __pyx_n_u_language_handler) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_628, __pyx_n_u_line) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_601, __pyx_n_u_lseg) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_774, __pyx_n_u_macaddr8) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_829, __pyx_n_u_macaddr) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_790, __pyx_n_u_money) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_19, __pyx_n_u_name) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_1700, __pyx_n_u_numeric) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_26, __pyx_n_u_oid) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_2282, __pyx_n_u_opaque) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_602, __pyx_n_u_path) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_4600, __pyx_n_u_pg_brin_bloom_summary) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_4601, __pyx_n_u_pg_brin_minmax_multi_summary) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_32, __pyx_n_u_pg_ddl_command) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_3402, __pyx_n_u_pg_dependencies) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_3220, __pyx_n_u_pg_lsn) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_5017, __pyx_n_u_pg_mcv_list) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_3361, __pyx_n_u_pg_ndistinct) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_194, __pyx_n_u_pg_node_tree) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_5038, __pyx_n_u_pg_snapshot) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_600, __pyx_n_u_point) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_604, __pyx_n_u_polygon) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_2249, __pyx_n_u_record) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_1790, __pyx_n_u_refcursor) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_2205, __pyx_n_u_regclass) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_4191, __pyx_n_u_regcollation) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_3734, __pyx_n_u_regconfig) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_3769, __pyx_n_u_regdictionary) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_4089, __pyx_n_u_regnamespace) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_2204, __pyx_n_u_regoperator) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_2203, __pyx_n_u_regoper) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_2202, __pyx_n_u_regprocedure) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_24, __pyx_n_u_regproc) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_4096, __pyx_n_u_regrole) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_2206, __pyx_n_u_regtype) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_703, __pyx_n_u_reltime) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_210, __pyx_n_u_smgr) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_269, __pyx_n_u_table_am_handler) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_25, __pyx_n_u_text) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_27, __pyx_n_u_tid) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_1083, __pyx_n_u_time) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_1114, __pyx_n_u_timestamp) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_1184, __pyx_n_u_timestamptz) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_1266, __pyx_n_u_timetz) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_704, __pyx_n_u_tinterval) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_2279, __pyx_n_u_trigger) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_3310, __pyx_n_u_tsm_handler) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_3615, __pyx_n_u_tsquery) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_3614, __pyx_n_u_tsvector) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_2970, __pyx_n_u_txid_snapshot) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_705, __pyx_n_u_unknown) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_2950, __pyx_n_u_uuid) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_1562, __pyx_n_u_varbit) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_1043, __pyx_n_u_varchar) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_2278, __pyx_n_u_void) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_5069, __pyx_n_u_xid8) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_28, __pyx_n_u_xid) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_142, __pyx_n_u_xml) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_1028, __pyx_kp_u_oid_2) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_int_1009, __pyx_kp_u_text_2) < 0) __PYX_ERR(23, 119, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_BUILTIN_TYPE_OID_MAP, __pyx_t_2) < 0) __PYX_ERR(23, 118, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/pgtypes.pxi":221 * } * * BUILTIN_TYPE_NAME_MAP = {v: k for k, v in BUILTIN_TYPE_OID_MAP.items()} # <<<<<<<<<<<<<< * * BUILTIN_TYPE_NAME_MAP['smallint'] = \ */ { /* enter inner scope */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 221, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = 0; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BUILTIN_TYPE_OID_MAP); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 221, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); if (unlikely(__pyx_t_7 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(23, 221, __pyx_L4_error) } __pyx_t_8 = __Pyx_dict_iterator(__pyx_t_7, 0, __pyx_n_s_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_8)) __PYX_ERR(23, 221, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_8; __pyx_t_8 = 0; while (1) { __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_5, &__pyx_t_4, &__pyx_t_8, &__pyx_t_7, NULL, __pyx_t_6); if (unlikely(__pyx_t_9 == 0)) break; if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(23, 221, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_k); __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_k, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XGOTREF(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_v); __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_v, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_v, (PyObject*)__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_k))) __PYX_ERR(23, 221, __pyx_L4_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_k); __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_k, Py_None); __Pyx_GOTREF(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_v); __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_v, Py_None); goto __pyx_L7_exit_scope; __pyx_L4_error:; __Pyx_GOTREF(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_k); __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_k, Py_None); __Pyx_GOTREF(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_v); __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_v, Py_None); goto __pyx_L1_error; __pyx_L7_exit_scope:; } /* exit inner scope */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BUILTIN_TYPE_NAME_MAP, __pyx_t_2) < 0) __PYX_ERR(23, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/pgtypes.pxi":224 * * BUILTIN_TYPE_NAME_MAP['smallint'] = \ * BUILTIN_TYPE_NAME_MAP['int2'] # <<<<<<<<<<<<<< * * BUILTIN_TYPE_NAME_MAP['int'] = \ */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_int2); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/pgtypes.pxi":223 * BUILTIN_TYPE_NAME_MAP = {v: k for k, v in BUILTIN_TYPE_OID_MAP.items()} * * BUILTIN_TYPE_NAME_MAP['smallint'] = \ # <<<<<<<<<<<<<< * BUILTIN_TYPE_NAME_MAP['int2'] * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_n_u_smallint, __pyx_t_3) < 0))) __PYX_ERR(23, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/pgtypes.pxi":227 * * BUILTIN_TYPE_NAME_MAP['int'] = \ * BUILTIN_TYPE_NAME_MAP['int4'] # <<<<<<<<<<<<<< * * BUILTIN_TYPE_NAME_MAP['integer'] = \ */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_u_int4); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/pgtypes.pxi":226 * BUILTIN_TYPE_NAME_MAP['int2'] * * BUILTIN_TYPE_NAME_MAP['int'] = \ # <<<<<<<<<<<<<< * BUILTIN_TYPE_NAME_MAP['int4'] * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely((PyObject_SetItem(__pyx_t_3, __pyx_n_u_int, __pyx_t_2) < 0))) __PYX_ERR(23, 226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/pgtypes.pxi":230 * * BUILTIN_TYPE_NAME_MAP['integer'] = \ * BUILTIN_TYPE_NAME_MAP['int4'] # <<<<<<<<<<<<<< * * BUILTIN_TYPE_NAME_MAP['bigint'] = \ */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_int4); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/pgtypes.pxi":229 * BUILTIN_TYPE_NAME_MAP['int4'] * * BUILTIN_TYPE_NAME_MAP['integer'] = \ # <<<<<<<<<<<<<< * BUILTIN_TYPE_NAME_MAP['int4'] * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_n_u_integer, __pyx_t_3) < 0))) __PYX_ERR(23, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/pgtypes.pxi":233 * * BUILTIN_TYPE_NAME_MAP['bigint'] = \ * BUILTIN_TYPE_NAME_MAP['int8'] # <<<<<<<<<<<<<< * * BUILTIN_TYPE_NAME_MAP['decimal'] = \ */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_u_int8); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/pgtypes.pxi":232 * BUILTIN_TYPE_NAME_MAP['int4'] * * BUILTIN_TYPE_NAME_MAP['bigint'] = \ # <<<<<<<<<<<<<< * BUILTIN_TYPE_NAME_MAP['int8'] * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely((PyObject_SetItem(__pyx_t_3, __pyx_n_u_bigint, __pyx_t_2) < 0))) __PYX_ERR(23, 232, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/pgtypes.pxi":236 * * BUILTIN_TYPE_NAME_MAP['decimal'] = \ * BUILTIN_TYPE_NAME_MAP['numeric'] # <<<<<<<<<<<<<< * * BUILTIN_TYPE_NAME_MAP['real'] = \ */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_numeric); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/pgtypes.pxi":235 * BUILTIN_TYPE_NAME_MAP['int8'] * * BUILTIN_TYPE_NAME_MAP['decimal'] = \ # <<<<<<<<<<<<<< * BUILTIN_TYPE_NAME_MAP['numeric'] * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_n_u_decimal, __pyx_t_3) < 0))) __PYX_ERR(23, 235, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/pgtypes.pxi":239 * * BUILTIN_TYPE_NAME_MAP['real'] = \ * BUILTIN_TYPE_NAME_MAP['float4'] # <<<<<<<<<<<<<< * * BUILTIN_TYPE_NAME_MAP['double precision'] = \ */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_u_float4); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/pgtypes.pxi":238 * BUILTIN_TYPE_NAME_MAP['numeric'] * * BUILTIN_TYPE_NAME_MAP['real'] = \ # <<<<<<<<<<<<<< * BUILTIN_TYPE_NAME_MAP['float4'] * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely((PyObject_SetItem(__pyx_t_3, __pyx_n_u_real, __pyx_t_2) < 0))) __PYX_ERR(23, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/pgtypes.pxi":242 * * BUILTIN_TYPE_NAME_MAP['double precision'] = \ * BUILTIN_TYPE_NAME_MAP['float8'] # <<<<<<<<<<<<<< * * BUILTIN_TYPE_NAME_MAP['timestamp with timezone'] = \ */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_float8); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/pgtypes.pxi":241 * BUILTIN_TYPE_NAME_MAP['float4'] * * BUILTIN_TYPE_NAME_MAP['double precision'] = \ # <<<<<<<<<<<<<< * BUILTIN_TYPE_NAME_MAP['float8'] * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_kp_u_double_precision, __pyx_t_3) < 0))) __PYX_ERR(23, 241, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/pgtypes.pxi":245 * * BUILTIN_TYPE_NAME_MAP['timestamp with timezone'] = \ * BUILTIN_TYPE_NAME_MAP['timestamptz'] # <<<<<<<<<<<<<< * * BUILTIN_TYPE_NAME_MAP['timestamp without timezone'] = \ */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_u_timestamptz); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/pgtypes.pxi":244 * BUILTIN_TYPE_NAME_MAP['float8'] * * BUILTIN_TYPE_NAME_MAP['timestamp with timezone'] = \ # <<<<<<<<<<<<<< * BUILTIN_TYPE_NAME_MAP['timestamptz'] * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely((PyObject_SetItem(__pyx_t_3, __pyx_kp_u_timestamp_with_timezone, __pyx_t_2) < 0))) __PYX_ERR(23, 244, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/pgtypes.pxi":248 * * BUILTIN_TYPE_NAME_MAP['timestamp without timezone'] = \ * BUILTIN_TYPE_NAME_MAP['timestamp'] # <<<<<<<<<<<<<< * * BUILTIN_TYPE_NAME_MAP['time with timezone'] = \ */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_timestamp); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/pgtypes.pxi":247 * BUILTIN_TYPE_NAME_MAP['timestamptz'] * * BUILTIN_TYPE_NAME_MAP['timestamp without timezone'] = \ # <<<<<<<<<<<<<< * BUILTIN_TYPE_NAME_MAP['timestamp'] * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_kp_u_timestamp_without_timezone, __pyx_t_3) < 0))) __PYX_ERR(23, 247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/pgtypes.pxi":251 * * BUILTIN_TYPE_NAME_MAP['time with timezone'] = \ * BUILTIN_TYPE_NAME_MAP['timetz'] # <<<<<<<<<<<<<< * * BUILTIN_TYPE_NAME_MAP['time without timezone'] = \ */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_u_timetz); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/pgtypes.pxi":250 * BUILTIN_TYPE_NAME_MAP['timestamp'] * * BUILTIN_TYPE_NAME_MAP['time with timezone'] = \ # <<<<<<<<<<<<<< * BUILTIN_TYPE_NAME_MAP['timetz'] * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely((PyObject_SetItem(__pyx_t_3, __pyx_kp_u_time_with_timezone, __pyx_t_2) < 0))) __PYX_ERR(23, 250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/pgtypes.pxi":254 * * BUILTIN_TYPE_NAME_MAP['time without timezone'] = \ * BUILTIN_TYPE_NAME_MAP['time'] # <<<<<<<<<<<<<< * * BUILTIN_TYPE_NAME_MAP['char'] = \ */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/pgtypes.pxi":253 * BUILTIN_TYPE_NAME_MAP['timetz'] * * BUILTIN_TYPE_NAME_MAP['time without timezone'] = \ # <<<<<<<<<<<<<< * BUILTIN_TYPE_NAME_MAP['time'] * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_kp_u_time_without_timezone, __pyx_t_3) < 0))) __PYX_ERR(23, 253, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/pgtypes.pxi":257 * * BUILTIN_TYPE_NAME_MAP['char'] = \ * BUILTIN_TYPE_NAME_MAP['bpchar'] # <<<<<<<<<<<<<< * * BUILTIN_TYPE_NAME_MAP['character'] = \ */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_u_bpchar); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/pgtypes.pxi":256 * BUILTIN_TYPE_NAME_MAP['time'] * * BUILTIN_TYPE_NAME_MAP['char'] = \ # <<<<<<<<<<<<<< * BUILTIN_TYPE_NAME_MAP['bpchar'] * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely((PyObject_SetItem(__pyx_t_3, __pyx_n_u_char, __pyx_t_2) < 0))) __PYX_ERR(23, 256, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/pgtypes.pxi":260 * * BUILTIN_TYPE_NAME_MAP['character'] = \ * BUILTIN_TYPE_NAME_MAP['bpchar'] # <<<<<<<<<<<<<< * * BUILTIN_TYPE_NAME_MAP['character varying'] = \ */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_bpchar); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/pgtypes.pxi":259 * BUILTIN_TYPE_NAME_MAP['bpchar'] * * BUILTIN_TYPE_NAME_MAP['character'] = \ # <<<<<<<<<<<<<< * BUILTIN_TYPE_NAME_MAP['bpchar'] * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_n_u_character, __pyx_t_3) < 0))) __PYX_ERR(23, 259, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/pgtypes.pxi":263 * * BUILTIN_TYPE_NAME_MAP['character varying'] = \ * BUILTIN_TYPE_NAME_MAP['varchar'] # <<<<<<<<<<<<<< * * BUILTIN_TYPE_NAME_MAP['bit varying'] = \ */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_u_varchar); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/pgtypes.pxi":262 * BUILTIN_TYPE_NAME_MAP['bpchar'] * * BUILTIN_TYPE_NAME_MAP['character varying'] = \ # <<<<<<<<<<<<<< * BUILTIN_TYPE_NAME_MAP['varchar'] * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely((PyObject_SetItem(__pyx_t_3, __pyx_kp_u_character_varying, __pyx_t_2) < 0))) __PYX_ERR(23, 262, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/pgtypes.pxi":266 * * BUILTIN_TYPE_NAME_MAP['bit varying'] = \ * BUILTIN_TYPE_NAME_MAP['varbit'] # <<<<<<<<<<<<<< */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_varbit); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/pgtypes.pxi":265 * BUILTIN_TYPE_NAME_MAP['varchar'] * * BUILTIN_TYPE_NAME_MAP['bit varying'] = \ # <<<<<<<<<<<<<< * BUILTIN_TYPE_NAME_MAP['varbit'] */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_kp_u_bit_varying, __pyx_t_3) < 0))) __PYX_ERR(23, 265, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/encodings.pyx":14 * * cdef dict ENCODINGS_MAP = { * 'abc': 'cp1258', # <<<<<<<<<<<<<< * 'alt': 'cp866', * 'euc_cn': 'euccn', */ __pyx_t_3 = __Pyx_PyDict_NewPresized(45); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_abc, __pyx_n_u_cp1258) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_alt, __pyx_n_u_cp866) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_euc_cn, __pyx_n_u_euccn) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_euc_jp, __pyx_n_u_eucjp) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_euc_kr, __pyx_n_u_euckr) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_koi8r, __pyx_n_u_koi8_r) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_koi8u, __pyx_n_u_koi8_u) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_shift_jis_2004, __pyx_n_u_euc_jis_2004) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_sjis, __pyx_n_u_shift_jis) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_sql_ascii, __pyx_n_u_ascii) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_vscii, __pyx_n_u_cp1258) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_tcvn, __pyx_n_u_cp1258) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_tcvn5712, __pyx_n_u_cp1258) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_unicode, __pyx_n_u_utf_8_2) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_win, __pyx_n_u_cp1521) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_win1250, __pyx_n_u_cp1250) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_win1251, __pyx_n_u_cp1251) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_win1252, __pyx_n_u_cp1252) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_win1253, __pyx_n_u_cp1253) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_win1254, __pyx_n_u_cp1254) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_win1255, __pyx_n_u_cp1255) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_win1256, __pyx_n_u_cp1256) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_win1257, __pyx_n_u_cp1257) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_win1258, __pyx_n_u_cp1258) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_win866, __pyx_n_u_cp866) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_win874, __pyx_n_u_cp874) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_win932, __pyx_n_u_cp932) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_win936, __pyx_n_u_cp936) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_win949, __pyx_n_u_cp949) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_win950, __pyx_n_u_cp950) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_windows1250, __pyx_n_u_cp1250) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_windows1251, __pyx_n_u_cp1251) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_windows1252, __pyx_n_u_cp1252) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_windows1253, __pyx_n_u_cp1253) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_windows1254, __pyx_n_u_cp1254) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_windows1255, __pyx_n_u_cp1255) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_windows1256, __pyx_n_u_cp1256) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_windows1257, __pyx_n_u_cp1257) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_windows1258, __pyx_n_u_cp1258) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_windows866, __pyx_n_u_cp866) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_windows874, __pyx_n_u_cp874) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_windows932, __pyx_n_u_cp932) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_windows936, __pyx_n_u_cp936) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_windows949, __pyx_n_u_cp949) < 0) __PYX_ERR(11, 14, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_windows950, __pyx_n_u_cp950) < 0) __PYX_ERR(11, 14, __pyx_L1_error) __Pyx_XGOTREF(__pyx_v_7asyncpg_8protocol_8protocol_ENCODINGS_MAP); __Pyx_DECREF_SET(__pyx_v_7asyncpg_8protocol_8protocol_ENCODINGS_MAP, ((PyObject*)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/settings.pyx":8 * * * from asyncpg import exceptions # <<<<<<<<<<<<<< * * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_exceptions); __Pyx_GIVEREF(__pyx_n_s_exceptions); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_exceptions)) __PYX_ERR(1, 8, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_asyncpg, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_exceptions, __pyx_t_3) < 0) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/settings.pyx":32 * return self._is_utf8 * * cpdef get_text_codec(self): # <<<<<<<<<<<<<< * return self._codec * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_3get_text_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConnectionSettings_get_text_code, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_n_s_get_text_codec, __pyx_t_2) < 0) __PYX_ERR(1, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings); /* "asyncpg/protocol/settings.pyx":35 * return self._codec * * cpdef inline register_data_types(self, types): # <<<<<<<<<<<<<< * self._data_codecs.add_types(types) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_5register_data_types, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConnectionSettings_register_data, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_n_s_register_data_types, __pyx_t_2) < 0) __PYX_ERR(1, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings); /* "asyncpg/protocol/settings.pyx":38 * self._data_codecs.add_types(types) * * cpdef inline add_python_codec(self, typeoid, typename, typeschema, # <<<<<<<<<<<<<< * typeinfos, typekind, encoder, decoder, * format): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_7add_python_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConnectionSettings_add_python_co, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_n_s_add_python_codec, __pyx_t_2) < 0) __PYX_ERR(1, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings); /* "asyncpg/protocol/settings.pyx":65 * _format, xformat) * * cpdef inline remove_python_codec(self, typeoid, typename, typeschema): # <<<<<<<<<<<<<< * self._data_codecs.remove_python_codec(typeoid, typename, typeschema) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_9remove_python_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConnectionSettings_remove_python, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_n_s_remove_python_codec, __pyx_t_2) < 0) __PYX_ERR(1, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings); /* "asyncpg/protocol/settings.pyx":68 * self._data_codecs.remove_python_codec(typeoid, typename, typeschema) * * cpdef inline clear_type_cache(self): # <<<<<<<<<<<<<< * self._data_codecs.clear_type_cache() * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_11clear_type_cache, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConnectionSettings_clear_type_ca, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_n_s_clear_type_cache, __pyx_t_2) < 0) __PYX_ERR(1, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings); /* "asyncpg/protocol/settings.pyx":71 * self._data_codecs.clear_type_cache() * * cpdef inline set_builtin_type_codec(self, typeoid, typename, typeschema, # <<<<<<<<<<<<<< * typekind, alias_to, format): * cdef: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_13set_builtin_type_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConnectionSettings_set_builtin_t, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_n_s_set_builtin_type_codec, __pyx_t_2) < 0) __PYX_ERR(1, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings); /* "asyncpg/protocol/settings.pyx":92 * * cpdef inline Codec get_data_codec(self, uint32_t oid, * ServerDataFormat format=PG_FORMAT_ANY, # <<<<<<<<<<<<<< * bint ignore_custom_codec=False): * return self._data_codecs.get_codec(oid, format, ignore_custom_codec) */ __pyx_k_ = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY; /* "asyncpg/protocol/settings.pyx":91 * typekind, alias_to, _format) * * cpdef inline Codec get_data_codec(self, uint32_t oid, # <<<<<<<<<<<<<< * ServerDataFormat format=PG_FORMAT_ANY, * bint ignore_custom_codec=False): */ __pyx_t_2 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/settings.pyx":93 * cpdef inline Codec get_data_codec(self, uint32_t oid, * ServerDataFormat format=PG_FORMAT_ANY, * bint ignore_custom_codec=False): # <<<<<<<<<<<<<< * return self._data_codecs.get_codec(oid, format, ignore_custom_codec) * */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(1, 91, __pyx_L1_error); __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, Py_False)) __PYX_ERR(1, 91, __pyx_L1_error); __pyx_t_2 = 0; /* "asyncpg/protocol/settings.pyx":91 * typekind, alias_to, _format) * * cpdef inline Codec get_data_codec(self, uint32_t oid, # <<<<<<<<<<<<<< * ServerDataFormat format=PG_FORMAT_ANY, * bint ignore_custom_codec=False): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_15get_data_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConnectionSettings_get_data_code, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_n_s_get_data_codec, __pyx_t_2) < 0) __PYX_ERR(1, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_21__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConnectionSettings___reduce_cyth, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_23__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ConnectionSettings___setstate_cy, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":8 * * * from collections.abc import Mapping as MappingABC # <<<<<<<<<<<<<< * * import asyncpg */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Mapping); __Pyx_GIVEREF(__pyx_n_s_Mapping); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Mapping)) __PYX_ERR(3, 8, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_collections_abc, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Mapping); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MappingABC, __pyx_t_2) < 0) __PYX_ERR(3, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":10 * from collections.abc import Mapping as MappingABC * * import asyncpg # <<<<<<<<<<<<<< * from asyncpg import exceptions * */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_asyncpg, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_asyncpg, __pyx_t_3) < 0) __PYX_ERR(3, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/base.pyx":11 * * import asyncpg * from asyncpg import exceptions # <<<<<<<<<<<<<< * * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_exceptions); __Pyx_GIVEREF(__pyx_n_s_exceptions); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_exceptions)) __PYX_ERR(3, 11, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_asyncpg, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_exceptions, __pyx_t_3) < 0) __PYX_ERR(3, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":16 * cdef void* binary_codec_map[(MAXSUPPORTEDOID + 1) * 2] * cdef void* text_codec_map[(MAXSUPPORTEDOID + 1) * 2] * cdef dict EXTRA_CODECS = {} # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_7asyncpg_8protocol_8protocol_EXTRA_CODECS); __Pyx_DECREF_SET(__pyx_v_7asyncpg_8protocol_8protocol_EXTRA_CODECS, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Codec_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Codec___reduce_cython, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Codec_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Codec___setstate_cython, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":493 * self._custom_type_codecs = {} * * def add_types(self, types): # <<<<<<<<<<<<<< * cdef: * Codec elem_codec */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_3add_types, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataCodecConfig_add_types, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_n_s_add_types, __pyx_t_2) < 0) __PYX_ERR(3, 493, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig); /* "asyncpg/protocol/codecs/base.pyx":623 * self.declare_fallback_codec(oid, name, schema) * * def add_python_codec(self, typeoid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * typeinfos, encoder, decoder, format, xformat): * cdef: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_5add_python_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataCodecConfig_add_python_codec, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_n_s_add_python_codec, __pyx_t_2) < 0) __PYX_ERR(3, 623, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig); /* "asyncpg/protocol/codecs/base.pyx":668 * typename)) * * def remove_python_codec(self, typeoid, typename, typeschema): # <<<<<<<<<<<<<< * for fmt in (PG_FORMAT_BINARY, PG_FORMAT_TEXT): * self._custom_type_codecs.pop((typeoid, fmt), None) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_7remove_python_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataCodecConfig_remove_python_co, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_n_s_remove_python_codec, __pyx_t_2) < 0) __PYX_ERR(3, 668, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig); /* "asyncpg/protocol/codecs/base.pyx":674 * * def _set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, * alias_to, format=PG_FORMAT_ANY): # <<<<<<<<<<<<<< * cdef: * Codec codec */ __pyx_t_2 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_k__6 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":673 * self.clear_type_cache() * * def _set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * alias_to, format=PG_FORMAT_ANY): * cdef: */ __pyx_t_2 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(3, 673, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_9_set_builtin_type_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataCodecConfig__set_builtin_typ, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_n_s_set_builtin_type_codec_2, __pyx_t_2) < 0) __PYX_ERR(3, 673, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig); /* "asyncpg/protocol/codecs/base.pyx":723 * * def set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, * alias_to, format=PG_FORMAT_ANY): # <<<<<<<<<<<<<< * self._set_builtin_type_codec(typeoid, typename, typeschema, typekind, * alias_to, format) */ __pyx_t_2 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_k__7 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/base.pyx":722 * f'there is no {codec_str} codec for {alias_to}') * * def set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, # <<<<<<<<<<<<<< * alias_to, format=PG_FORMAT_ANY): * self._set_builtin_type_codec(typeoid, typename, typeschema, typekind, */ __pyx_t_2 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(3, 722, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_11set_builtin_type_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataCodecConfig_set_builtin_type, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_n_s_set_builtin_type_codec, __pyx_t_2) < 0) __PYX_ERR(3, 722, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig); /* "asyncpg/protocol/codecs/base.pyx":728 * self.clear_type_cache() * * def clear_type_cache(self): # <<<<<<<<<<<<<< * self._derived_type_codecs.clear() * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_13clear_type_cache, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataCodecConfig_clear_type_cache, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_n_s_clear_type_cache, __pyx_t_2) < 0) __PYX_ERR(3, 728, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig); /* "asyncpg/protocol/codecs/base.pyx":731 * self._derived_type_codecs.clear() * * def declare_fallback_codec(self, uint32_t oid, str name, str schema): # <<<<<<<<<<<<<< * cdef Codec codec * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_15declare_fallback_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataCodecConfig_declare_fallback, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__94)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_n_s_declare_fallback_codec, __pyx_t_2) < 0) __PYX_ERR(3, 731, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_17__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataCodecConfig___reduce_cython, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig); /* "(tree fragment)":16 * else: * return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_DataCodecConfig__set_state(self, __pyx_state) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_19__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DataCodecConfig___setstate_cytho, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(2, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig); /* "asyncpg/protocol/codecs/base.pyx":807 * cdef inline Codec get_core_codec( * uint32_t oid, ServerDataFormat format, * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): # <<<<<<<<<<<<<< * cdef: * void *ptr = NULL */ __pyx_k__9 = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT; /* "asyncpg/protocol/codecs/base.pyx":826 * cdef inline Codec get_any_core_codec( * uint32_t oid, ServerDataFormat format, * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): # <<<<<<<<<<<<<< * """A version of get_core_codec that accepts PG_FORMAT_ANY.""" * cdef: */ __pyx_k__10 = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT; /* "asyncpg/protocol/codecs/base.pyx":849 * decode_func decode, * ServerDataFormat format, * ClientExchangeFormat xformat=PG_XFORMAT_OBJECT): # <<<<<<<<<<<<<< * * if oid > MAXSUPPORTEDOID: */ __pyx_k__11 = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT; /* "asyncpg/protocol/codecs/pgproto.pyx":484 * * * init_all_pgproto_codecs() # <<<<<<<<<<<<<< */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_init_all_pgproto_codecs(); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/array.pyx":8 * * * from collections.abc import (Iterable as IterableABC, # <<<<<<<<<<<<<< * Mapping as MappingABC, * Sized as SizedABC) */ __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Iterable); __Pyx_GIVEREF(__pyx_n_s_Iterable); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Iterable)) __PYX_ERR(4, 8, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_Mapping); __Pyx_GIVEREF(__pyx_n_s_Mapping); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_Mapping)) __PYX_ERR(4, 8, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_Sized); __Pyx_GIVEREF(__pyx_n_s_Sized); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_Sized)) __PYX_ERR(4, 8, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_collections_abc, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Iterable); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_IterableABC, __pyx_t_2) < 0) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Mapping); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MappingABC, __pyx_t_2) < 0) __PYX_ERR(4, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Sized); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SizedABC, __pyx_t_2) < 0) __PYX_ERR(4, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/array.pyx":12 * Sized as SizedABC) * * from asyncpg import exceptions # <<<<<<<<<<<<<< * * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_exceptions); __Pyx_GIVEREF(__pyx_n_s_exceptions); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_exceptions)) __PYX_ERR(4, 12, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_asyncpg, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_exceptions, __pyx_t_3) < 0) __PYX_ERR(4, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/array.pyx":18 * * # "NULL" * cdef Py_UCS4 *APG_NULL = [0x004E, 0x0055, 0x004C, 0x004C, 0x0000] # <<<<<<<<<<<<<< * * */ __pyx_t_10[0] = 0x004E; __pyx_t_10[1] = 0x0055; __pyx_t_10[2] = 0x004C; __pyx_t_10[3] = 0x004C; __pyx_t_10[4] = 0x0000; __pyx_v_7asyncpg_8protocol_8protocol_APG_NULL = __pyx_t_10; /* "asyncpg/protocol/codecs/array.pyx":875 * PG_FORMAT_BINARY) * * init_array_codecs() # <<<<<<<<<<<<<< */ __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_init_array_codecs(); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/range.pyx":8 * * * from asyncpg import types as apg_types # <<<<<<<<<<<<<< * * from collections.abc import Sequence as SequenceABC */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_types); __Pyx_GIVEREF(__pyx_n_s_types); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_types)) __PYX_ERR(14, 8, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_asyncpg, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_apg_types, __pyx_t_2) < 0) __PYX_ERR(14, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/range.pyx":10 * from asyncpg import types as apg_types * * from collections.abc import Sequence as SequenceABC # <<<<<<<<<<<<<< * * # defined in postgresql/src/include/utils/rangetypes.h */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_Sequence); __Pyx_GIVEREF(__pyx_n_s_Sequence); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Sequence)) __PYX_ERR(14, 10, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections_abc, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SequenceABC, __pyx_t_3) < 0) __PYX_ERR(14, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/codecs/record.pyx":8 * * * from asyncpg import exceptions # <<<<<<<<<<<<<< * * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_exceptions); __Pyx_GIVEREF(__pyx_n_s_exceptions); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_exceptions)) __PYX_ERR(15, 8, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_asyncpg, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_exceptions, __pyx_t_2) < 0) __PYX_ERR(15, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/codecs/record.pyx":71 * PG_FORMAT_BINARY) * * init_record_codecs() # <<<<<<<<<<<<<< */ __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_init_record_codecs(); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/coreproto.pyx":8 * * * import hashlib # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_hashlib, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_hashlib, __pyx_t_3) < 0) __PYX_ERR(6, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/scram.pyx":8 * * * import base64 # <<<<<<<<<<<<<< * import hashlib * import hmac */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_base64, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_base64, __pyx_t_3) < 0) __PYX_ERR(5, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/scram.pyx":9 * * import base64 * import hashlib # <<<<<<<<<<<<<< * import hmac * import re */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_hashlib, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_hashlib, __pyx_t_3) < 0) __PYX_ERR(5, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/scram.pyx":10 * import base64 * import hashlib * import hmac # <<<<<<<<<<<<<< * import re * import secrets */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_hmac, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_hmac, __pyx_t_3) < 0) __PYX_ERR(5, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/scram.pyx":11 * import hashlib * import hmac * import re # <<<<<<<<<<<<<< * import secrets * import stringprep */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_re, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_3) < 0) __PYX_ERR(5, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/scram.pyx":12 * import hmac * import re * import secrets # <<<<<<<<<<<<<< * import stringprep * import unicodedata */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_secrets, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_secrets, __pyx_t_3) < 0) __PYX_ERR(5, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/scram.pyx":13 * import re * import secrets * import stringprep # <<<<<<<<<<<<<< * import unicodedata * */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_stringprep, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_stringprep, __pyx_t_3) < 0) __PYX_ERR(5, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/scram.pyx":14 * import secrets * import stringprep * import unicodedata # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_unicodedata, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_unicodedata, __pyx_t_3) < 0) __PYX_ERR(5, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "asyncpg/protocol/scram.pyx":73 * to support other channel binding methos in the future * """ * AUTHENTICATION_METHODS = [b"SCRAM-SHA-256"] # <<<<<<<<<<<<<< * DEFAULT_CLIENT_NONCE_BYTES = 24 * DIGEST = hashlib.sha256 */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_kp_b_SCRAM_SHA_256); __Pyx_GIVEREF(__pyx_kp_b_SCRAM_SHA_256); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_kp_b_SCRAM_SHA_256)) __PYX_ERR(5, 73, __pyx_L1_error); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_n_s_AUTHENTICATION_METHODS, __pyx_t_3) < 0) __PYX_ERR(5, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication); /* "asyncpg/protocol/scram.pyx":74 * """ * AUTHENTICATION_METHODS = [b"SCRAM-SHA-256"] * DEFAULT_CLIENT_NONCE_BYTES = 24 # <<<<<<<<<<<<<< * DIGEST = hashlib.sha256 * REQUIREMENTS_CLIENT_FINAL_MESSAGE = ['client_channel_binding', */ if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_n_s_DEFAULT_CLIENT_NONCE_BYTES, __pyx_int_24) < 0) __PYX_ERR(5, 74, __pyx_L1_error) PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication); /* "asyncpg/protocol/scram.pyx":75 * AUTHENTICATION_METHODS = [b"SCRAM-SHA-256"] * DEFAULT_CLIENT_NONCE_BYTES = 24 * DIGEST = hashlib.sha256 # <<<<<<<<<<<<<< * REQUIREMENTS_CLIENT_FINAL_MESSAGE = ['client_channel_binding', * 'server_nonce'] */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_hashlib); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sha256); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_n_s_DIGEST, __pyx_t_2) < 0) __PYX_ERR(5, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication); /* "asyncpg/protocol/scram.pyx":76 * DEFAULT_CLIENT_NONCE_BYTES = 24 * DIGEST = hashlib.sha256 * REQUIREMENTS_CLIENT_FINAL_MESSAGE = ['client_channel_binding', # <<<<<<<<<<<<<< * 'server_nonce'] * REQUIREMENTS_CLIENT_PROOF = ['password_iterations', 'password_salt', */ __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_u_client_channel_binding); __Pyx_GIVEREF(__pyx_n_u_client_channel_binding); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_client_channel_binding)) __PYX_ERR(5, 76, __pyx_L1_error); __Pyx_INCREF(__pyx_n_u_server_nonce); __Pyx_GIVEREF(__pyx_n_u_server_nonce); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_u_server_nonce)) __PYX_ERR(5, 76, __pyx_L1_error); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_n_s_REQUIREMENTS_CLIENT_FINAL_MESSAG, __pyx_t_2) < 0) __PYX_ERR(5, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication); /* "asyncpg/protocol/scram.pyx":78 * REQUIREMENTS_CLIENT_FINAL_MESSAGE = ['client_channel_binding', * 'server_nonce'] * REQUIREMENTS_CLIENT_PROOF = ['password_iterations', 'password_salt', # <<<<<<<<<<<<<< * 'server_first_message', 'server_nonce'] * SASLPREP_PROHIBITED = ( */ __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_u_password_iterations); __Pyx_GIVEREF(__pyx_n_u_password_iterations); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_password_iterations)) __PYX_ERR(5, 78, __pyx_L1_error); __Pyx_INCREF(__pyx_n_u_password_salt); __Pyx_GIVEREF(__pyx_n_u_password_salt); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_u_password_salt)) __PYX_ERR(5, 78, __pyx_L1_error); __Pyx_INCREF(__pyx_n_u_server_first_message); __Pyx_GIVEREF(__pyx_n_u_server_first_message); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_u_server_first_message)) __PYX_ERR(5, 78, __pyx_L1_error); __Pyx_INCREF(__pyx_n_u_server_nonce); __Pyx_GIVEREF(__pyx_n_u_server_nonce); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_u_server_nonce)) __PYX_ERR(5, 78, __pyx_L1_error); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_n_s_REQUIREMENTS_CLIENT_PROOF, __pyx_t_2) < 0) __PYX_ERR(5, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication); /* "asyncpg/protocol/scram.pyx":81 * 'server_first_message', 'server_nonce'] * SASLPREP_PROHIBITED = ( * stringprep.in_table_a1, # PostgreSQL treats this as prohibited # <<<<<<<<<<<<<< * stringprep.in_table_c12, * stringprep.in_table_c21_c22, */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_in_table_a1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/scram.pyx":82 * SASLPREP_PROHIBITED = ( * stringprep.in_table_a1, # PostgreSQL treats this as prohibited * stringprep.in_table_c12, # <<<<<<<<<<<<<< * stringprep.in_table_c21_c22, * stringprep.in_table_c3, */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_in_table_c12); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/scram.pyx":83 * stringprep.in_table_a1, # PostgreSQL treats this as prohibited * stringprep.in_table_c12, * stringprep.in_table_c21_c22, # <<<<<<<<<<<<<< * stringprep.in_table_c3, * stringprep.in_table_c4, */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_in_table_c21_c22); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/scram.pyx":84 * stringprep.in_table_c12, * stringprep.in_table_c21_c22, * stringprep.in_table_c3, # <<<<<<<<<<<<<< * stringprep.in_table_c4, * stringprep.in_table_c5, */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_in_table_c3); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/scram.pyx":85 * stringprep.in_table_c21_c22, * stringprep.in_table_c3, * stringprep.in_table_c4, # <<<<<<<<<<<<<< * stringprep.in_table_c5, * stringprep.in_table_c6, */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_in_table_c4); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/scram.pyx":86 * stringprep.in_table_c3, * stringprep.in_table_c4, * stringprep.in_table_c5, # <<<<<<<<<<<<<< * stringprep.in_table_c6, * stringprep.in_table_c7, */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_in_table_c5); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/scram.pyx":87 * stringprep.in_table_c4, * stringprep.in_table_c5, * stringprep.in_table_c6, # <<<<<<<<<<<<<< * stringprep.in_table_c7, * stringprep.in_table_c8, */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_in_table_c6); if (unlikely(!__pyx_t_14)) __PYX_ERR(5, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/scram.pyx":88 * stringprep.in_table_c5, * stringprep.in_table_c6, * stringprep.in_table_c7, # <<<<<<<<<<<<<< * stringprep.in_table_c8, * stringprep.in_table_c9, */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_in_table_c7); if (unlikely(!__pyx_t_15)) __PYX_ERR(5, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/scram.pyx":89 * stringprep.in_table_c6, * stringprep.in_table_c7, * stringprep.in_table_c8, # <<<<<<<<<<<<<< * stringprep.in_table_c9, * ) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_in_table_c8); if (unlikely(!__pyx_t_16)) __PYX_ERR(5, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/scram.pyx":90 * stringprep.in_table_c7, * stringprep.in_table_c8, * stringprep.in_table_c9, # <<<<<<<<<<<<<< * ) * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_in_table_c9); if (unlikely(!__pyx_t_17)) __PYX_ERR(5, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/scram.pyx":81 * 'server_first_message', 'server_nonce'] * SASLPREP_PROHIBITED = ( * stringprep.in_table_a1, # PostgreSQL treats this as prohibited # <<<<<<<<<<<<<< * stringprep.in_table_c12, * stringprep.in_table_c21_c22, */ __pyx_t_2 = PyTuple_New(10); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(5, 81, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7)) __PYX_ERR(5, 81, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_8)) __PYX_ERR(5, 81, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_11)) __PYX_ERR(5, 81, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_12); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_12)) __PYX_ERR(5, 81, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_13); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_13)) __PYX_ERR(5, 81, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_14); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_t_14)) __PYX_ERR(5, 81, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_15); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_t_15)) __PYX_ERR(5, 81, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_16); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 8, __pyx_t_16)) __PYX_ERR(5, 81, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_17); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 9, __pyx_t_17)) __PYX_ERR(5, 81, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_n_s_SASLPREP_PROHIBITED, __pyx_t_2) < 0) __PYX_ERR(5, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SCRAMAuthentication___reduce_cyt, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SCRAMAuthentication___setstate_c, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":15 * * cdef dict AUTH_METHOD_NAME = { * AUTH_REQUIRED_KERBEROS: 'kerberosv5', # <<<<<<<<<<<<<< * AUTH_REQUIRED_PASSWORD: 'password', * AUTH_REQUIRED_PASSWORDMD5: 'md5', */ __pyx_t_2 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_17 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(__pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_KERBEROS); if (unlikely(!__pyx_t_17)) __PYX_ERR(6, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (PyDict_SetItem(__pyx_t_2, __pyx_t_17, __pyx_n_u_kerberosv5) < 0) __PYX_ERR(6, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/coreproto.pyx":16 * cdef dict AUTH_METHOD_NAME = { * AUTH_REQUIRED_KERBEROS: 'kerberosv5', * AUTH_REQUIRED_PASSWORD: 'password', # <<<<<<<<<<<<<< * AUTH_REQUIRED_PASSWORDMD5: 'md5', * AUTH_REQUIRED_GSS: 'gss', */ __pyx_t_17 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(__pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_PASSWORD); if (unlikely(!__pyx_t_17)) __PYX_ERR(6, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (PyDict_SetItem(__pyx_t_2, __pyx_t_17, __pyx_n_u_password) < 0) __PYX_ERR(6, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/coreproto.pyx":17 * AUTH_REQUIRED_KERBEROS: 'kerberosv5', * AUTH_REQUIRED_PASSWORD: 'password', * AUTH_REQUIRED_PASSWORDMD5: 'md5', # <<<<<<<<<<<<<< * AUTH_REQUIRED_GSS: 'gss', * AUTH_REQUIRED_SASL: 'scram-sha-256', */ __pyx_t_17 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(__pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_PASSWORDMD5); if (unlikely(!__pyx_t_17)) __PYX_ERR(6, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (PyDict_SetItem(__pyx_t_2, __pyx_t_17, __pyx_n_u_md5) < 0) __PYX_ERR(6, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/coreproto.pyx":18 * AUTH_REQUIRED_PASSWORD: 'password', * AUTH_REQUIRED_PASSWORDMD5: 'md5', * AUTH_REQUIRED_GSS: 'gss', # <<<<<<<<<<<<<< * AUTH_REQUIRED_SASL: 'scram-sha-256', * AUTH_REQUIRED_SSPI: 'sspi', */ __pyx_t_17 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(__pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_GSS); if (unlikely(!__pyx_t_17)) __PYX_ERR(6, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (PyDict_SetItem(__pyx_t_2, __pyx_t_17, __pyx_n_u_gss) < 0) __PYX_ERR(6, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/coreproto.pyx":19 * AUTH_REQUIRED_PASSWORDMD5: 'md5', * AUTH_REQUIRED_GSS: 'gss', * AUTH_REQUIRED_SASL: 'scram-sha-256', # <<<<<<<<<<<<<< * AUTH_REQUIRED_SSPI: 'sspi', * } */ __pyx_t_17 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(__pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_SASL); if (unlikely(!__pyx_t_17)) __PYX_ERR(6, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (PyDict_SetItem(__pyx_t_2, __pyx_t_17, __pyx_kp_u_scram_sha_256) < 0) __PYX_ERR(6, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/coreproto.pyx":20 * AUTH_REQUIRED_GSS: 'gss', * AUTH_REQUIRED_SASL: 'scram-sha-256', * AUTH_REQUIRED_SSPI: 'sspi', # <<<<<<<<<<<<<< * } * */ __pyx_t_17 = __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(__pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_SSPI); if (unlikely(!__pyx_t_17)) __PYX_ERR(6, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (PyDict_SetItem(__pyx_t_2, __pyx_t_17, __pyx_n_u_sspi) < 0) __PYX_ERR(6, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XGOTREF(__pyx_v_7asyncpg_8protocol_8protocol_AUTH_METHOD_NAME); __Pyx_DECREF_SET(__pyx_v_7asyncpg_8protocol_8protocol_AUTH_METHOD_NAME, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":46 * self._reset_result() * * cpdef is_in_transaction(self): # <<<<<<<<<<<<<< * # PQTRANS_INTRANS = idle, within transaction block * # PQTRANS_INERROR = idle, within failed transaction */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12CoreProtocol_3is_in_transaction, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CoreProtocol_is_in_transaction, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol, __pyx_n_s_is_in_transaction, __pyx_t_2) < 0) __PYX_ERR(6, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12CoreProtocol_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CoreProtocol___reduce_cython, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol); /* "(tree fragment)":16 * else: * return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_CoreProtocol__set_state(self, __pyx_state) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12CoreProtocol_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CoreProtocol___setstate_cython, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(2, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol); /* "asyncpg/protocol/coreproto.pyx":1232 * * * cdef bytes SYNC_MESSAGE = bytes(WriteBuffer.new_message(b'S').end_message()) # <<<<<<<<<<<<<< * cdef bytes FLUSH_MESSAGE = bytes(WriteBuffer.new_message(b'H').end_message()) */ __pyx_t_2 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('S')); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_17 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_2)->__pyx_vtab)->end_message(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_2)); if (unlikely(!__pyx_t_17)) __PYX_ERR(6, 1232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XGOTREF(__pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE); __Pyx_DECREF_SET(__pyx_v_7asyncpg_8protocol_8protocol_SYNC_MESSAGE, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/coreproto.pyx":1233 * * cdef bytes SYNC_MESSAGE = bytes(WriteBuffer.new_message(b'S').end_message()) * cdef bytes FLUSH_MESSAGE = bytes(WriteBuffer.new_message(b'H').end_message()) # <<<<<<<<<<<<<< */ __pyx_t_2 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('H')); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_17 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_2)->__pyx_vtab)->end_message(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_2)); if (unlikely(!__pyx_t_17)) __PYX_ERR(6, 1233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XGOTREF(__pyx_v_7asyncpg_8protocol_8protocol_FLUSH_MESSAGE); __Pyx_DECREF_SET(__pyx_v_7asyncpg_8protocol_8protocol_FLUSH_MESSAGE, ((PyObject*)__pyx_t_2)); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":8 * * * from asyncpg import exceptions # <<<<<<<<<<<<<< * * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_exceptions); __Pyx_GIVEREF(__pyx_n_s_exceptions); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_exceptions)) __PYX_ERR(7, 8, __pyx_L1_error); __pyx_t_17 = __Pyx_Import(__pyx_n_s_asyncpg, __pyx_t_2, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(7, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_17, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_exceptions, __pyx_t_2) < 0) __PYX_ERR(7, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/prepared_stmt.pyx":35 * self.ignore_custom_codec = ignore_custom_codec * * def _get_parameters(self): # <<<<<<<<<<<<<< * cdef Codec codec * */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_3_get_parameters, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PreparedStatementState__get_para, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_17)) __PYX_ERR(7, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_n_s_get_parameters, __pyx_t_17) < 0) __PYX_ERR(7, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState); /* "asyncpg/protocol/prepared_stmt.pyx":49 * return tuple(result) * * def _get_attributes(self): # <<<<<<<<<<<<<< * cdef Codec codec * */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_5_get_attributes, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PreparedStatementState__get_attr, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_17)) __PYX_ERR(7, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_n_s_get_attributes, __pyx_t_17) < 0) __PYX_ERR(7, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState); /* "asyncpg/protocol/prepared_stmt.pyx":73 * return tuple(result) * * def _init_types(self): # <<<<<<<<<<<<<< * cdef: * Codec codec */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_7_init_types, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PreparedStatementState__init_typ, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_17)) __PYX_ERR(7, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_n_s_init_types, __pyx_t_17) < 0) __PYX_ERR(7, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState); /* "asyncpg/protocol/prepared_stmt.pyx":92 * return missing * * cpdef _init_codecs(self): # <<<<<<<<<<<<<< * self._ensure_args_encoder() * self._ensure_rows_decoder() */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_9_init_codecs, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PreparedStatementState__init_cod, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_17)) __PYX_ERR(7, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_n_s_init_codecs, __pyx_t_17) < 0) __PYX_ERR(7, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState); /* "asyncpg/protocol/prepared_stmt.pyx":96 * self._ensure_rows_decoder() * * def attach(self): # <<<<<<<<<<<<<< * self.refs += 1 * */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_11attach, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PreparedStatementState_attach, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_17)) __PYX_ERR(7, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_n_s_attach, __pyx_t_17) < 0) __PYX_ERR(7, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState); /* "asyncpg/protocol/prepared_stmt.pyx":99 * self.refs += 1 * * def detach(self): # <<<<<<<<<<<<<< * self.refs -= 1 * */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_13detach, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PreparedStatementState_detach, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_17)) __PYX_ERR(7, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_n_s_detach, __pyx_t_17) < 0) __PYX_ERR(7, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState); /* "asyncpg/protocol/prepared_stmt.pyx":102 * self.refs -= 1 * * def mark_closed(self): # <<<<<<<<<<<<<< * self.closed = True * */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_15mark_closed, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PreparedStatementState_mark_clos, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_17)) __PYX_ERR(7, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_n_s_mark_closed, __pyx_t_17) < 0) __PYX_ERR(7, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState); /* "asyncpg/protocol/prepared_stmt.pyx":105 * self.closed = True * * def mark_unprepared(self): # <<<<<<<<<<<<<< * if self.name: * raise exceptions.InternalClientError( */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_17mark_unprepared, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PreparedStatementState_mark_unpr, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_17)) __PYX_ERR(7, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_n_s_mark_unprepared, __pyx_t_17) < 0) __PYX_ERR(7, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_19__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PreparedStatementState___reduce, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_17) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_21__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PreparedStatementState___setstat, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_17) < 0) __PYX_ERR(2, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":72 * * * NO_TIMEOUT = object() # <<<<<<<<<<<<<< * * */ __pyx_t_17 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_TIMEOUT, __pyx_t_17) < 0) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":110 * self.create_future = self._create_future_fallback * * def set_connection(self, connection): # <<<<<<<<<<<<<< * self.conref = weakref.ref(connection) * */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_3set_connection, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseProtocol_set_connection, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_set_connection, __pyx_t_17) < 0) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":119 * return None * * def get_server_pid(self): # <<<<<<<<<<<<<< * return self.backend_pid * */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_5get_server_pid, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseProtocol_get_server_pid, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_get_server_pid, __pyx_t_17) < 0) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":122 * return self.backend_pid * * def get_settings(self): # <<<<<<<<<<<<<< * return self.settings * */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_7get_settings, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseProtocol_get_settings, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_get_settings, __pyx_t_17) < 0) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":125 * return self.settings * * def get_record_class(self): # <<<<<<<<<<<<<< * return self.record_class * */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_9get_record_class, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseProtocol_get_record_class, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_get_record_class, __pyx_t_17) < 0) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":138 * self.transport.pause_reading() * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def prepare(self, stmt_name, query, timeout, * *, */ __pyx_t_17 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); /* "asyncpg/protocol/protocol.pyx":141 * async def prepare(self, stmt_name, query, timeout, * *, * PreparedStatementState state=None, # <<<<<<<<<<<<<< * ignore_custom_codec=False, * record_class): */ if (PyDict_SetItem(__pyx_t_17, __pyx_n_s_state, Py_None) < 0) __PYX_ERR(0, 138, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":142 * *, * PreparedStatementState state=None, * ignore_custom_codec=False, # <<<<<<<<<<<<<< * record_class): * if self.cancel_waiter is not None: */ if (PyDict_SetItem(__pyx_t_17, __pyx_n_s_ignore_custom_codec, Py_False) < 0) __PYX_ERR(0, 138, __pyx_L1_error) /* "asyncpg/protocol/protocol.pyx":138 * self.transport.pause_reading() * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def prepare(self, stmt_name, query, timeout, * *, */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_11prepare, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_BaseProtocol_prepare, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_17); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_prepare, __pyx_t_2) < 0) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":167 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def bind_execute( * self, */ __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_n_s_PreparedStatementState) < 0) __PYX_ERR(0, 167, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_portal_name, __pyx_n_s_str) < 0) __PYX_ERR(0, 167, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_limit, __pyx_n_s_int) < 0) __PYX_ERR(0, 167, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return_extra, __pyx_n_s_bool) < 0) __PYX_ERR(0, 167, __pyx_L1_error) __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_14bind_execute, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_BaseProtocol_bind_execute, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_17, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_bind_execute, __pyx_t_17) < 0) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":208 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def bind_execute_many( * self, */ __pyx_t_17 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (PyDict_SetItem(__pyx_t_17, __pyx_n_s_state, __pyx_n_s_PreparedStatementState) < 0) __PYX_ERR(0, 208, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_17, __pyx_n_s_portal_name, __pyx_n_s_str) < 0) __PYX_ERR(0, 208, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_17, __pyx_n_s_return_rows, __pyx_n_s_bool) < 0) __PYX_ERR(0, 208, __pyx_L1_error) __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_BaseProtocol_bind_execute_many, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_17); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_bind_execute_many, __pyx_t_2) < 0) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":270 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def bind(self, PreparedStatementState state, args, * str portal_name, timeout): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_20bind, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_BaseProtocol_bind, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_bind, __pyx_t_2) < 0) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":299 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def execute(self, PreparedStatementState state, * str portal_name, int limit, return_extra, */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_23execute, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_BaseProtocol_execute, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_execute, __pyx_t_2) < 0) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":329 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def close_portal(self, str portal_name, timeout): * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_26close_portal, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_BaseProtocol_close_portal, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_close_portal, __pyx_t_2) < 0) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":352 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def query(self, query, timeout): * if self.cancel_waiter is not None: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_29query, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_BaseProtocol_query, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_query, __pyx_t_2) < 0) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":377 * return await waiter * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def copy_out(self, copy_stmt, sink, timeout): * if self.cancel_waiter is not None: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_32copy_out, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_BaseProtocol_copy_out, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_copy_out, __pyx_t_2) < 0) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":431 * return status_msg * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def copy_in(self, copy_stmt, reader, data, * records, PreparedStatementState record_stmt, timeout): */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_35copy_in, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_BaseProtocol_copy_in, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_copy_in, __pyx_t_2) < 0) __PYX_ERR(0, 431, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":570 * return status_msg * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def close_statement(self, PreparedStatementState state, timeout): * if self.cancel_waiter is not None: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_38close_statement, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_BaseProtocol_close_statement, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_close_statement, __pyx_t_2) < 0) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":596 * return await waiter * * def is_closed(self): # <<<<<<<<<<<<<< * return self.closing * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_41is_closed, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseProtocol_is_closed, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_is_closed, __pyx_t_2) < 0) __PYX_ERR(0, 596, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":599 * return self.closing * * def is_connected(self): # <<<<<<<<<<<<<< * return not self.closing and self.con_status == CONNECTION_OK * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_43is_connected, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseProtocol_is_connected, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_is_connected, __pyx_t_2) < 0) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":602 * return not self.closing and self.con_status == CONNECTION_OK * * def abort(self): # <<<<<<<<<<<<<< * if self.closing: * return */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_45abort, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseProtocol_abort, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_abort, __pyx_t_2) < 0) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":611 * self.transport = None * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def close(self, timeout): * if self.closing: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_47close, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_BaseProtocol_close, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_close, __pyx_t_2) < 0) __PYX_ERR(0, 611, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":652 * self.transport.abort() * * def _request_cancel(self): # <<<<<<<<<<<<<< * self.cancel_waiter = self.create_future() * self.cancel_sent_waiter = self.create_future() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_50_request_cancel, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseProtocol__request_cancel, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_request_cancel, __pyx_t_2) < 0) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":679 * self._set_state(PROTOCOL_CANCELLED) * * def _on_timeout(self, fut): # <<<<<<<<<<<<<< * if self.waiter is not fut or fut.done() or \ * self.cancel_waiter is not None or \ */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_52_on_timeout, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseProtocol__on_timeout, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__138)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_on_timeout, __pyx_t_2) < 0) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":687 * self.waiter.set_exception(asyncio.TimeoutError()) * * def _on_waiter_completed(self, fut): # <<<<<<<<<<<<<< * if self.timeout_handle: * self.timeout_handle.cancel() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_54_on_waiter_completed, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseProtocol__on_waiter_complete, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__139)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_on_waiter_completed, __pyx_t_2) < 0) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":696 * self._request_cancel() * * def _create_future_fallback(self): # <<<<<<<<<<<<<< * return asyncio.Future(loop=self.loop) * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_56_create_future_fallback, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseProtocol__create_future_fall, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__140)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_create_future_fallback, __pyx_t_2) < 0) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":712 * self.settings.add_setting(name, val) * * def _get_timeout(self, timeout): # <<<<<<<<<<<<<< * if timeout is not None: * try: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_58_get_timeout, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseProtocol__get_timeout, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__141)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_get_timeout, __pyx_t_2) < 0) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":748 * 'cannot perform operation: another operation is in progress') * * def _is_cancelling(self): # <<<<<<<<<<<<<< * return ( * self.cancel_waiter is not None or */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_60_is_cancelling, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseProtocol__is_cancelling, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__142)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_is_cancelling, __pyx_t_2) < 0) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":754 * ) * * @cython.iterable_coroutine # <<<<<<<<<<<<<< * async def _wait_for_cancellation(self): * if self.cancel_sent_waiter is not None: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_62_wait_for_cancellation, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_BaseProtocol__wait_for_cancellat, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_wait_for_cancellation, __pyx_t_2) < 0) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":974 * # asyncio callbacks: * * def data_received(self, data): # <<<<<<<<<<<<<< * self.buffer.feed_data(data) * self._read_server_messages() */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_65data_received, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseProtocol_data_received, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__144)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_data_received, __pyx_t_2) < 0) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":978 * self._read_server_messages() * * def connection_made(self, transport): # <<<<<<<<<<<<<< * self.transport = transport * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_67connection_made, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseProtocol_connection_made, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__146)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_connection_made, __pyx_t_2) < 0) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":996 * self._on_error(ex) * * def connection_lost(self, exc): # <<<<<<<<<<<<<< * self.con_status = CONNECTION_BAD * self._set_state(PROTOCOL_FAILED) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_69connection_lost, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseProtocol_connection_lost, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__148)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_connection_lost, __pyx_t_2) < 0) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":1001 * self._on_connection_lost(exc) * * def pause_writing(self): # <<<<<<<<<<<<<< * self.writing_allowed.clear() * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_71pause_writing, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseProtocol_pause_writing, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__149)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_pause_writing, __pyx_t_2) < 0) __PYX_ERR(0, 1001, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":1004 * self.writing_allowed.clear() * * def resume_writing(self): # <<<<<<<<<<<<<< * self.writing_allowed.set() * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_73resume_writing, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseProtocol_resume_writing, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__150)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_resume_writing, __pyx_t_2) < 0) __PYX_ERR(0, 1004, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_75__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseProtocol___reduce_cython, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__151)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "(tree fragment)":16 * else: * return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_BaseProtocol__set_state(self, __pyx_state) */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_77__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseProtocol___setstate_cython, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__152)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(2, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); /* "asyncpg/protocol/protocol.pyx":1016 * * * class Timer: # <<<<<<<<<<<<<< * def __init__(self, budget): * self._budget = budget */ __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Timer, __pyx_n_s_Timer, (PyObject *) NULL, __pyx_n_s_asyncpg_protocol_protocol, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "asyncpg/protocol/protocol.pyx":1017 * * class Timer: * def __init__(self, budget): # <<<<<<<<<<<<<< * self._budget = budget * self._started = 0 */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_1__init__, 0, __pyx_n_s_Timer___init, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__154)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1017, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_17) < 0) __PYX_ERR(0, 1017, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":1021 * self._started = 0 * * def __enter__(self): # <<<<<<<<<<<<<< * if self._budget is not None: * self._started = time.monotonic() */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_3__enter__, 0, __pyx_n_s_Timer___enter, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__155)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1021, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_enter, __pyx_t_17) < 0) __PYX_ERR(0, 1021, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":1025 * self._started = time.monotonic() * * def __exit__(self, et, e, tb): # <<<<<<<<<<<<<< * if self._budget is not None: * self._budget -= time.monotonic() - self._started */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_5__exit__, 0, __pyx_n_s_Timer___exit, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__157)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_exit, __pyx_t_17) < 0) __PYX_ERR(0, 1025, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":1029 * self._budget -= time.monotonic() - self._started * * def get_remaining_budget(self): # <<<<<<<<<<<<<< * return self._budget * */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_7get_remaining_budget, 0, __pyx_n_s_Timer_get_remaining_budget, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__158)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1029, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_get_remaining_budget, __pyx_t_17) < 0) __PYX_ERR(0, 1029, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":1032 * return self._budget * * def has_budget_greater_than(self, amount): # <<<<<<<<<<<<<< * if self._budget is None: * # Unlimited budget. */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_9has_budget_greater_than, 0, __pyx_n_s_Timer_has_budget_greater_than, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__160)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_has_budget_greater_than, __pyx_t_17) < 0) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":1016 * * * class Timer: # <<<<<<<<<<<<<< * def __init__(self, budget): * self._budget = budget */ __pyx_t_17 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_Timer, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Timer, __pyx_t_17) < 0) __PYX_ERR(0, 1016, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "asyncpg/protocol/protocol.pyx":1040 * * * class Protocol(BaseProtocol, asyncio.Protocol): # <<<<<<<<<<<<<< * pass * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Protocol); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); __Pyx_GIVEREF((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol))) __PYX_ERR(0, 1040, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_17); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_17)) __PYX_ERR(0, 1040, __pyx_L1_error); __pyx_t_17 = 0; __pyx_t_17 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_16 = __Pyx_CalculateMetaclass(NULL, __pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_15 = __Pyx_Py3MetaclassPrepare(__pyx_t_16, __pyx_t_17, __pyx_n_s_Protocol, __pyx_n_s_Protocol, (PyObject *) NULL, __pyx_n_s_asyncpg_protocol_protocol, (PyObject *) NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (__pyx_t_17 != __pyx_t_2) { if (unlikely((PyDict_SetItemString(__pyx_t_15, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 1040, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_16, __pyx_n_s_Protocol, __pyx_t_17, __pyx_t_15, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Protocol, __pyx_t_2) < 0) __PYX_ERR(0, 1040, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":1044 * * * def _create_record(object mapping, tuple elems): # <<<<<<<<<<<<<< * # Exposed only for testing purposes. * */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_1_create_record, 0, __pyx_n_s_create_record, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__162)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (PyDict_SetItem(__pyx_d, __pyx_n_s_create_record, __pyx_t_17) < 0) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":1065 * * * Record = record.ApgRecord_InitTypes() # <<<<<<<<<<<<<< */ __pyx_t_18 = ApgRecord_InitTypes(); if (unlikely(__pyx_t_18 == ((PyTypeObject *)NULL))) __PYX_ERR(0, 1065, __pyx_L1_error) __pyx_t_17 = ((PyObject *)__pyx_t_18); __Pyx_INCREF(__pyx_t_17); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Record, __pyx_t_17) < 0) __PYX_ERR(0, 1065, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "(tree fragment)":1 * def __pyx_unpickle_DataCodecConfig(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_3__pyx_unpickle_DataCodecConfig, 0, __pyx_n_s_pyx_unpickle_DataCodecConfig, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_DataCodecConfig, __pyx_t_17) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "(tree fragment)":11 * __pyx_unpickle_DataCodecConfig__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result._custom_type_codecs = __pyx_state[0]; __pyx_result._derived_type_codecs = __pyx_state[1] * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5__pyx_unpickle_CoreProtocol, 0, __pyx_n_s_pyx_unpickle_CoreProtocol, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__165)); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_CoreProtocol, __pyx_t_17) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "(tree fragment)":1 * def __pyx_unpickle_BaseProtocol(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_7__pyx_unpickle_BaseProtocol, 0, __pyx_n_s_pyx_unpickle_BaseProtocol, NULL, __pyx_n_s_asyncpg_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__166)); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BaseProtocol, __pyx_t_17) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /* "asyncpg/protocol/protocol.pyx":1 * # Copyright (C) 2016-present the asyncpg authors and contributors # <<<<<<<<<<<<<< * # * # */ __pyx_t_17 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_17) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init asyncpg.protocol.protocol", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init asyncpg.protocol.protocol"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* UnpackUnboundCMethod */ static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { PyObject *result; PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); if (unlikely(!selfless_args)) return NULL; result = PyObject_Call(method, selfless_args, kwargs); Py_DECREF(selfless_args); return result; } static PyMethodDef __Pyx_UnboundCMethod_Def = { "CythonUnboundCMethod", __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), METH_VARARGS | METH_KEYWORDS, NULL }; static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { PyObject *method; method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); if (unlikely(!method)) return -1; target->method = method; #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) #else if (likely(!__Pyx_CyOrPyCFunction_Check(method))) #endif { PyMethodDescrObject *descr = (PyMethodDescrObject*) method; target->func = descr->d_method->ml_meth; target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); } else #endif #if CYTHON_COMPILING_IN_PYPY #else if (PyCFunction_Check(method)) #endif { PyObject *self; int self_found; #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY self = PyObject_GetAttrString(method, "__self__"); if (!self) { PyErr_Clear(); } #else self = PyCFunction_GET_SELF(method); #endif self_found = (self && self != Py_None); #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY Py_XDECREF(self); #endif if (self_found) { PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); if (unlikely(!unbound_method)) return -1; Py_DECREF(method); target->method = unbound_method; } } return 0; } /* CallUnboundCMethod1 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { if (likely(cfunc->func)) { int flag = cfunc->flag; if (flag == METH_O) { return (*(cfunc->func))(self, arg); } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) { #if PY_VERSION_HEX >= 0x030700A0 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); #else return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); #endif } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) { return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); } } return __Pyx__CallUnboundCMethod1(cfunc, self, arg); } #endif static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ PyObject *args, *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { args = PyTuple_New(1); if (unlikely(!args)) goto bad; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); } else { args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); PyTuple_SET_ITEM(args, 1, arg); result = __Pyx_PyObject_Call(cfunc->method, args, NULL); } #else args = PyTuple_Pack(2, self, arg); if (unlikely(!args)) goto bad; result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif bad: Py_XDECREF(args); return result; } /* CallUnboundCMethod2 */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { if (likely(cfunc->func)) { PyObject *args[2] = {arg1, arg2}; if (cfunc->flag == METH_FASTCALL) { #if PY_VERSION_HEX >= 0x030700A0 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2); #else return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); #endif } #if PY_VERSION_HEX >= 0x030700A0 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); #endif } return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); } #endif static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ PyObject *args, *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(arg1); PyTuple_SET_ITEM(args, 0, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 1, arg2); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); } else { args = PyTuple_New(3); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg1); PyTuple_SET_ITEM(args, 1, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 2, arg2); result = __Pyx_PyObject_Call(cfunc->method, args, NULL); } #else args = PyTuple_Pack(3, self, arg1, arg2); if (unlikely(!args)) goto bad; result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif bad: Py_XDECREF(args); return result; } /* dict_getitem_default */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { PyObject* value; #if PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (unlikely(PyErr_Occurred())) return NULL; value = default_value; } Py_INCREF(value); if ((1)); #else if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { value = PyDict_GetItem(d, key); if (unlikely(!value)) { value = default_value; } Py_INCREF(value); } #endif else { if (default_value == Py_None) value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key); else value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value); } return value; } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; itp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* RaiseUnexpectedTypeError */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) { __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, expected, obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* DictGetItem */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) { if (unlikely(PyTuple_Check(key))) { PyObject* args = PyTuple_Pack(1, key); if (likely(args)) { PyErr_SetObject(PyExc_KeyError, args); Py_DECREF(args); } } else { PyErr_SetObject(PyExc_KeyError, key); } } return NULL; } Py_INCREF(value); return value; } #endif /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); __Pyx_DECREF_TypeName(index_type_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); if (!meth) { PyErr_Clear(); } else { PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); Py_DECREF(meth); return result; } } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { __Pyx_TypeName obj_type_name; __Pyx_TypeName type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(__Pyx_TypeCheck(obj, type))) return 1; obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_TypeError, "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, obj_type_name, type_name); __Pyx_DECREF_TypeName(obj_type_name); __Pyx_DECREF_TypeName(type_name); return 0; } /* SliceObject */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_slice(obj, cstart, cstop); } #else CYTHON_UNUSED_VAR(wraparound); #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #else CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_USE_TYPE_SLOTS result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); bad: return NULL; } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a + (unsigned long)b); if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op2); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla + llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif /* py_dict_pop */ static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B3 & PY_VERSION_HEX < 0x030d0000 if ((1)) { return _PyDict_Pop(d, key, default_value); } else #endif if (default_value) { return __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_pop, d, key, default_value); } else { return __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_pop, d, key); } } /* JoinPyUnicode */ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char) { #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyObject *result_uval; int result_ukind, kind_shift; Py_ssize_t i, char_pos; void *result_udata; CYTHON_MAYBE_UNUSED_VAR(max_char); #if CYTHON_PEP393_ENABLED result_uval = PyUnicode_New(result_ulength, max_char); if (unlikely(!result_uval)) return NULL; result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; result_udata = PyUnicode_DATA(result_uval); #else result_uval = PyUnicode_FromUnicode(NULL, result_ulength); if (unlikely(!result_uval)) return NULL; result_ukind = sizeof(Py_UNICODE); kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1; result_udata = PyUnicode_AS_UNICODE(result_uval); #endif assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); char_pos = 0; for (i=0; i < value_count; i++) { int ukind; Py_ssize_t ulength; void *udata; PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); if (unlikely(__Pyx_PyUnicode_READY(uval))) goto bad; ulength = __Pyx_PyUnicode_GET_LENGTH(uval); if (unlikely(!ulength)) continue; if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) goto overflow; ukind = __Pyx_PyUnicode_KIND(uval); udata = __Pyx_PyUnicode_DATA(uval); if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); } else { #if PY_VERSION_HEX >= 0x030d0000 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); #else Py_ssize_t j; for (j=0; j < ulength; j++) { Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); } #endif } char_pos += ulength; } return result_uval; overflow: PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); bad: Py_DECREF(result_uval); return NULL; #else CYTHON_UNUSED_VAR(max_char); CYTHON_UNUSED_VAR(result_ulength); CYTHON_UNUSED_VAR(value_count); return PyUnicode_Join(__pyx_empty_unicode, value_tuple); #endif } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* PyObjectFormatAndDecref */ static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { if (unlikely(!s)) return NULL; if (likely(PyUnicode_CheckExact(s))) return s; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(s))) { PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict"); Py_DECREF(s); return result; } #endif return __Pyx_PyObject_FormatAndDecref(s, f); } static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { PyObject *result; if (unlikely(!s)) return NULL; result = PyObject_Format(s, f); Py_DECREF(s); return result; } /* GetAttr3 */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static PyObject *__Pyx_GetAttr3Default(PyObject *d) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(d); return d; } #endif static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 int res = PyObject_GetOptionalAttr(o, n, &r); return (res != 0) ? r : __Pyx_NewRef(d); #else #if CYTHON_USE_TYPE_SLOTS if (likely(PyString_Check(n))) { r = __Pyx_PyObject_GetAttrStrNoError(o, n); if (unlikely(!r) && likely(!PyErr_Occurred())) { r = __Pyx_NewRef(d); } return r; } #endif r = PyObject_GetAttr(o, n); return (likely(r)) ? r : __Pyx_GetAttr3Default(d); #endif } /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; tmp_value = exc_info->exc_value; exc_info->exc_value = *value; if (tmp_value == NULL || tmp_value == Py_None) { Py_XDECREF(tmp_value); tmp_value = NULL; tmp_type = NULL; tmp_tb = NULL; } else { tmp_type = (PyObject*) Py_TYPE(tmp_value); Py_INCREF(tmp_type); #if CYTHON_COMPILING_IN_CPYTHON tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; Py_XINCREF(tmp_tb); #else tmp_tb = PyException_GetTraceback(tmp_value); #endif } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a - (unsigned long)b); if (likely((x^a) >= 0 || (x^~b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return PyLong_FromLong(-intval); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } } x = a - b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla - llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("subtract", return NULL) result = ((double)a) - (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); } #endif /* RaiseUnboundLocalError */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op2))) { const long a = intval; long x; long b = PyInt_AS_LONG(op2); x = (long)((unsigned long)a + (unsigned long)b); if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op2))) { const long a = intval; long b, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG lla = intval; PY_LONG_LONG llb, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op2))) { return __Pyx_NewRef(op1); } if (likely(__Pyx_PyLong_IsCompact(op2))) { b = __Pyx_PyLong_CompactValue(op2); } else { const digit* digits = __Pyx_PyLong_Digits(op2); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla + llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op2)) { const long a = intval; #if CYTHON_COMPILING_IN_LIMITED_API double b = __pyx_PyFloat_AsDouble(op2); #else double b = PyFloat_AS_DOUBLE(op2); #endif double result; PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif /* CIntToDigits */ static const char DIGIT_PAIRS_10[2*10*10+1] = { "00010203040506070809" "10111213141516171819" "20212223242526272829" "30313233343536373839" "40414243444546474849" "50515253545556575859" "60616263646566676869" "70717273747576777879" "80818283848586878889" "90919293949596979899" }; static const char DIGIT_PAIRS_8[2*8*8+1] = { "0001020304050607" "1011121314151617" "2021222324252627" "3031323334353637" "4041424344454647" "5051525354555657" "6061626364656667" "7071727374757677" }; static const char DIGITS_HEX[2*16+1] = { "0123456789abcdef" "0123456789ABCDEF" }; /* BuildPyUnicode */ static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength, int prepend_sign, char padding_char) { PyObject *uval; Py_ssize_t uoffset = ulength - clength; #if CYTHON_USE_UNICODE_INTERNALS Py_ssize_t i; #if CYTHON_PEP393_ENABLED void *udata; uval = PyUnicode_New(ulength, 127); if (unlikely(!uval)) return NULL; udata = PyUnicode_DATA(uval); #else Py_UNICODE *udata; uval = PyUnicode_FromUnicode(NULL, ulength); if (unlikely(!uval)) return NULL; udata = PyUnicode_AS_UNICODE(uval); #endif if (uoffset > 0) { i = 0; if (prepend_sign) { __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-'); i++; } for (; i < uoffset; i++) { __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char); } } for (i=0; i < clength; i++) { __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]); } #else { PyObject *sign = NULL, *padding = NULL; uval = NULL; if (uoffset > 0) { prepend_sign = !!prepend_sign; if (uoffset > prepend_sign) { padding = PyUnicode_FromOrdinal(padding_char); if (likely(padding) && uoffset > prepend_sign + 1) { PyObject *tmp; PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign); if (unlikely(!repeat)) goto done_or_error; tmp = PyNumber_Multiply(padding, repeat); Py_DECREF(repeat); Py_DECREF(padding); padding = tmp; } if (unlikely(!padding)) goto done_or_error; } if (prepend_sign) { sign = PyUnicode_FromOrdinal('-'); if (unlikely(!sign)) goto done_or_error; } } uval = PyUnicode_DecodeASCII(chars, clength, NULL); if (likely(uval) && padding) { PyObject *tmp = PyNumber_Add(padding, uval); Py_DECREF(uval); uval = tmp; } if (likely(uval) && sign) { PyObject *tmp = PyNumber_Add(sign, uval); Py_DECREF(uval); uval = tmp; } done_or_error: Py_XDECREF(padding); Py_XDECREF(sign); } #endif return uval; } /* CIntToPyUnicode */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char) { char digits[sizeof(long)*3+2]; char *dpos, *end = digits + sizeof(long)*3+2; const char *hex_digits = DIGITS_HEX; Py_ssize_t length, ulength; int prepend_sign, last_one_off; long remaining; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (format_char == 'X') { hex_digits += 16; format_char = 'x'; } remaining = value; last_one_off = 0; dpos = end; do { int digit_pos; switch (format_char) { case 'o': digit_pos = abs((int)(remaining % (8*8))); remaining = (long) (remaining / (8*8)); dpos -= 2; memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2); last_one_off = (digit_pos < 8); break; case 'd': digit_pos = abs((int)(remaining % (10*10))); remaining = (long) (remaining / (10*10)); dpos -= 2; memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2); last_one_off = (digit_pos < 10); break; case 'x': *(--dpos) = hex_digits[abs((int)(remaining % 16))]; remaining = (long) (remaining / 16); break; default: assert(0); break; } } while (unlikely(remaining != 0)); assert(!last_one_off || *dpos == '0'); dpos += last_one_off; length = end - dpos; ulength = length; prepend_sign = 0; if (!is_unsigned && value <= neg_one) { if (padding_char == ' ' || width <= length + 1) { *(--dpos) = '-'; ++length; } else { prepend_sign = 1; } ++ulength; } if (width > ulength) { ulength = width; } if (ulength == 1) { return PyUnicode_FromOrdinal(*dpos); } return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* bytes_tailmatch */ static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg, Py_ssize_t start, Py_ssize_t end, int direction) { const char* self_ptr = PyBytes_AS_STRING(self); Py_ssize_t self_len = PyBytes_GET_SIZE(self); const char* sub_ptr; Py_ssize_t sub_len; int retval; Py_buffer view; view.obj = NULL; if ( PyBytes_Check(arg) ) { sub_ptr = PyBytes_AS_STRING(arg); sub_len = PyBytes_GET_SIZE(arg); } #if PY_MAJOR_VERSION < 3 else if ( PyUnicode_Check(arg) ) { return (int) PyUnicode_Tailmatch(self, arg, start, end, direction); } #endif else { if (unlikely(PyObject_GetBuffer(arg, &view, PyBUF_SIMPLE) == -1)) return -1; sub_ptr = (const char*) view.buf; sub_len = view.len; } if (end > self_len) end = self_len; else if (end < 0) end += self_len; if (end < 0) end = 0; if (start < 0) start += self_len; if (start < 0) start = 0; if (direction > 0) { if (end-sub_len > start) start = end - sub_len; } if (start + sub_len <= end) retval = !memcmp(self_ptr+start, sub_ptr, (size_t)sub_len); else retval = 0; if (view.obj) PyBuffer_Release(&view); return retval; } static int __Pyx_PyBytes_TailmatchTuple(PyObject* self, PyObject* substrings, Py_ssize_t start, Py_ssize_t end, int direction) { Py_ssize_t i, count = PyTuple_GET_SIZE(substrings); for (i = 0; i < count; i++) { int result; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS result = __Pyx_PyBytes_SingleTailmatch(self, PyTuple_GET_ITEM(substrings, i), start, end, direction); #else PyObject* sub = PySequence_ITEM(substrings, i); if (unlikely(!sub)) return -1; result = __Pyx_PyBytes_SingleTailmatch(self, sub, start, end, direction); Py_DECREF(sub); #endif if (result) { return result; } } return 0; } static int __Pyx_PyBytes_Tailmatch(PyObject* self, PyObject* substr, Py_ssize_t start, Py_ssize_t end, int direction) { if (unlikely(PyTuple_Check(substr))) { return __Pyx_PyBytes_TailmatchTuple(self, substr, start, end, direction); } return __Pyx_PyBytes_SingleTailmatch(self, substr, start, end, direction); } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* pep479 */ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { PyObject *exc, *val, *tb, *cur_exc; __Pyx_PyThreadState_declare #ifdef __Pyx_StopAsyncIteration_USED int is_async_stopiteration = 0; #endif CYTHON_MAYBE_UNUSED_VAR(in_async_gen); cur_exc = PyErr_Occurred(); if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) { #ifdef __Pyx_StopAsyncIteration_USED if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) { is_async_stopiteration = 1; } else #endif return; } __Pyx_PyThreadState_assign __Pyx_GetException(&exc, &val, &tb); Py_XDECREF(exc); Py_XDECREF(val); Py_XDECREF(tb); PyErr_SetString(PyExc_RuntimeError, #ifdef __Pyx_StopAsyncIteration_USED is_async_stopiteration ? "async generator raised StopAsyncIteration" : in_async_gen ? "async generator raised StopIteration" : #endif "generator raised StopIteration"); } /* RaiseClosureNameError */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* CIntToPyUnicode */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState value, Py_ssize_t width, char padding_char, char format_char) { char digits[sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)*3+2]; char *dpos, *end = digits + sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)*3+2; const char *hex_digits = DIGITS_HEX; Py_ssize_t length, ulength; int prepend_sign, last_one_off; enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState remaining; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (format_char == 'X') { hex_digits += 16; format_char = 'x'; } remaining = value; last_one_off = 0; dpos = end; do { int digit_pos; switch (format_char) { case 'o': digit_pos = abs((int)(remaining % (8*8))); remaining = (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) (remaining / (8*8)); dpos -= 2; memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2); last_one_off = (digit_pos < 8); break; case 'd': digit_pos = abs((int)(remaining % (10*10))); remaining = (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) (remaining / (10*10)); dpos -= 2; memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2); last_one_off = (digit_pos < 10); break; case 'x': *(--dpos) = hex_digits[abs((int)(remaining % 16))]; remaining = (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) (remaining / 16); break; default: assert(0); break; } } while (unlikely(remaining != 0)); assert(!last_one_off || *dpos == '0'); dpos += last_one_off; length = end - dpos; ulength = length; prepend_sign = 0; if (!is_unsigned && value <= neg_one) { if (padding_char == ' ' || width <= length + 1) { *(--dpos) = '-'; ++length; } else { prepend_sign = 1; } ++ulength; } if (width > ulength) { ulength = width; } if (ulength == 1) { return PyUnicode_FromOrdinal(*dpos); } return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportDottedModule */ #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); if (unlikely(!slice)) goto bad; sep = PyUnicode_FromStringAndSize(".", 1); if (unlikely(!sep)) goto bad; partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( #if PY_MAJOR_VERSION < 3 PyExc_ImportError, "No module named '%s'", PyString_AS_STRING(partial_name)); #else #if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, #else PyExc_ImportError, #endif "No module named '%U'", partial_name); #endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; imported_module = __Pyx_PyDict_GetItemStr(modules, name); Py_XINCREF(imported_module); #else imported_module = PyImport_GetModule(name); #endif return imported_module; } #endif #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; nparts = PyTuple_GET_SIZE(parts_tuple); for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else part = PySequence_ITEM(parts_tuple, i); #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(part); #endif Py_DECREF(module); module = submodule; } if (unlikely(!module)) { return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); } return module; } #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 PyObject *module, *from_list, *star = __pyx_n_s__37; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) return NULL; Py_INCREF(star); PyList_SET_ITEM(from_list, 0, star); module = __Pyx_Import(name, from_list, 0); Py_DECREF(from_list); return module; #else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) return module; imported_module = __Pyx__ImportDottedModule_Lookup(name); if (likely(imported_module)) { Py_DECREF(module); return imported_module; } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); #endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); if (likely(spec)) { PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; } Py_XDECREF(unsafe); } if (likely(!spec)) { PyErr_Clear(); return module; } Py_DECREF(spec); Py_DECREF(module); } else if (PyErr_Occurred()) { PyErr_Clear(); } #endif return __Pyx__ImportDottedModule(name, parts_tuple); } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i length) stop = length; if (unlikely(stop <= start)) return __Pyx_NewRef(__pyx_empty_unicode); length = stop - start; cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* RaiseNoneIterError */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* UnpackTupleError */ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { __Pyx_RaiseTooManyValuesError(index); } } /* UnpackTuple2 */ static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { PyObject *value1 = NULL, *value2 = NULL; #if CYTHON_COMPILING_IN_PYPY value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); #endif if (decref_tuple) { Py_DECREF(tuple); } *pvalue1 = value1; *pvalue2 = value2; return 0; #if CYTHON_COMPILING_IN_PYPY bad: Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; #endif } static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int has_known_size, int decref_tuple) { Py_ssize_t index; PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; iternextfunc iternext; iter = PyObject_GetIter(tuple); if (unlikely(!iter)) goto bad; if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } iternext = __Pyx_PyObject_GetIterNextFunc(iter); value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; Py_DECREF(iter); *pvalue1 = value1; *pvalue2 = value2; return 0; unpacking_failed: if (!has_known_size && __Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); bad: Py_XDECREF(iter); Py_XDECREF(value1); Py_XDECREF(value2); if (decref_tuple) { Py_XDECREF(tuple); } return -1; } /* dict_iter */ #if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 #include #endif static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_source_is_dict) { is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; if (is_dict) { #if !CYTHON_COMPILING_IN_PYPY *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; #elif PY_MAJOR_VERSION >= 3 static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; PyObject **pp = NULL; if (method_name) { const char *name = PyUnicode_AsUTF8(method_name); if (strcmp(name, "iteritems") == 0) pp = &py_items; else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; else if (strcmp(name, "itervalues") == 0) pp = &py_values; if (pp) { if (!*pp) { *pp = PyUnicode_FromString(name + 4); if (!*pp) return NULL; } method_name = *pp; } } #endif } *p_orig_length = 0; if (method_name) { PyObject* iter; iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); if (!iterable) return NULL; #if !CYTHON_COMPILING_IN_PYPY if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) return iterable; #endif iter = PyObject_GetIter(iterable); Py_DECREF(iterable); return iter; } return PyObject_GetIter(iterable); } static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; #if !CYTHON_COMPILING_IN_PYPY if (source_is_dict) { PyObject *key, *value; if (unlikely(orig_length != PyDict_Size(iter_obj))) { PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); return -1; } if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { return 0; } if (pitem) { PyObject* tuple = PyTuple_New(2); if (unlikely(!tuple)) { return -1; } Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); *pitem = tuple; } else { if (pkey) { Py_INCREF(key); *pkey = key; } if (pvalue) { Py_INCREF(value); *pvalue = value; } } return 1; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyTuple_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; *ppos = pos + 1; next_item = PyList_GET_ITEM(iter_obj, pos); Py_INCREF(next_item); } else #endif { next_item = PyIter_Next(iter_obj); if (unlikely(!next_item)) { return __Pyx_IterFinish(); } } if (pitem) { *pitem = next_item; } else if (pkey && pvalue) { if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) return -1; } else if (pkey) { *pkey = next_item; } else { *pvalue = next_item; } return 1; } /* IterNext */ static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (!defval || unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(defval); return defval; } if (defval) { Py_INCREF(defval); return defval; } __Pyx_PyErr_SetNone(PyExc_StopIteration); return NULL; } static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) { __Pyx_TypeName iterator_type_name = __Pyx_PyType_GetName(Py_TYPE(iterator)); PyErr_Format(PyExc_TypeError, __Pyx_FMT_TYPENAME " object is not an iterator", iterator_type_name); __Pyx_DECREF_TypeName(iterator_type_name); } static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) { PyObject* next; iternextfunc iternext = Py_TYPE(iterator)->tp_iternext; if (likely(iternext)) { #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY next = iternext(iterator); if (likely(next)) return next; #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 if (unlikely(iternext == &_PyObject_NextNotImplemented)) return NULL; #endif #else next = PyIter_Next(iterator); if (likely(next)) return next; #endif } else if (CYTHON_USE_TYPE_SLOTS || unlikely(!PyIter_Check(iterator))) { __Pyx_PyIter_Next_ErrorNoIterator(iterator); return NULL; } #if !CYTHON_USE_TYPE_SLOTS else { next = PyIter_Next(iterator); if (likely(next)) return next; } #endif return __Pyx_PyIter_Next2Default(defval); } /* CIntToPyUnicode */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) { char digits[sizeof(int)*3+2]; char *dpos, *end = digits + sizeof(int)*3+2; const char *hex_digits = DIGITS_HEX; Py_ssize_t length, ulength; int prepend_sign, last_one_off; int remaining; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (format_char == 'X') { hex_digits += 16; format_char = 'x'; } remaining = value; last_one_off = 0; dpos = end; do { int digit_pos; switch (format_char) { case 'o': digit_pos = abs((int)(remaining % (8*8))); remaining = (int) (remaining / (8*8)); dpos -= 2; memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2); last_one_off = (digit_pos < 8); break; case 'd': digit_pos = abs((int)(remaining % (10*10))); remaining = (int) (remaining / (10*10)); dpos -= 2; memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2); last_one_off = (digit_pos < 10); break; case 'x': *(--dpos) = hex_digits[abs((int)(remaining % 16))]; remaining = (int) (remaining / 16); break; default: assert(0); break; } } while (unlikely(remaining != 0)); assert(!last_one_off || *dpos == '0'); dpos += last_one_off; length = end - dpos; ulength = length; prepend_sign = 0; if (!is_unsigned && value <= neg_one) { if (padding_char == ' ' || width <= length + 1) { *(--dpos) = '-'; ++length; } else { prepend_sign = 1; } ++ulength; } if (width > ulength) { ulength = width; } if (ulength == 1) { return PyUnicode_FromOrdinal(*dpos); } return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char); } /* UnicodeConcatInPlace */ # if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 static int __Pyx_unicode_modifiable(PyObject *unicode) { if (Py_REFCNT(unicode) != 1) return 0; if (!PyUnicode_CheckExact(unicode)) return 0; if (PyUnicode_CHECK_INTERNED(unicode)) return 0; return 1; } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right #if CYTHON_REFNANNY , void* __pyx_refnanny #endif ) { PyObject *left = *p_left; Py_ssize_t left_len, right_len, new_len; if (unlikely(__Pyx_PyUnicode_READY(left) == -1)) return NULL; if (unlikely(__Pyx_PyUnicode_READY(right) == -1)) return NULL; left_len = PyUnicode_GET_LENGTH(left); if (left_len == 0) { Py_INCREF(right); return right; } right_len = PyUnicode_GET_LENGTH(right); if (right_len == 0) { Py_INCREF(left); return left; } if (unlikely(left_len > PY_SSIZE_T_MAX - right_len)) { PyErr_SetString(PyExc_OverflowError, "strings are too large to concat"); return NULL; } new_len = left_len + right_len; if (__Pyx_unicode_modifiable(left) && PyUnicode_CheckExact(right) && PyUnicode_KIND(right) <= PyUnicode_KIND(left) && !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right))) { int ret; __Pyx_GIVEREF(*p_left); ret = PyUnicode_Resize(p_left, new_len); __Pyx_GOTREF(*p_left); if (unlikely(ret != 0)) return NULL; #if PY_VERSION_HEX >= 0x030d0000 if (unlikely(PyUnicode_CopyCharacters(*p_left, left_len, right, 0, right_len) < 0)) return NULL; #else _PyUnicode_FastCopyCharacters(*p_left, left_len, right, 0, right_len); #endif __Pyx_INCREF(*p_left); __Pyx_GIVEREF(*p_left); return *p_left; } else { return __Pyx_PyUnicode_Concat(left, right); } } #endif /* RaiseKeywordRequired */ static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() needs keyword-only argument %U", func_name, kw_name); #else "%s() needs keyword-only argument %s", func_name, PyString_AS_STRING(kw_name)); #endif } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectCallMethod1 */ #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 PyObject *args[2] = {obj, arg}; (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); #else PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); #endif } /* CoroutineBase */ #include #if PY_VERSION_HEX >= 0x030b00a6 #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) { PyObject *et, *ev, *tb; PyObject *value = NULL; CYTHON_UNUSED_VAR(__pyx_tstate); __Pyx_ErrFetch(&et, &ev, &tb); if (!et) { Py_XDECREF(tb); Py_XDECREF(ev); Py_INCREF(Py_None); *pvalue = Py_None; return 0; } if (likely(et == PyExc_StopIteration)) { if (!ev) { Py_INCREF(Py_None); value = Py_None; } #if PY_VERSION_HEX >= 0x030300A0 else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) { value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); Py_DECREF(ev); } #endif else if (unlikely(PyTuple_Check(ev))) { if (PyTuple_GET_SIZE(ev) >= 1) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS value = PyTuple_GET_ITEM(ev, 0); Py_INCREF(value); #else value = PySequence_ITEM(ev, 0); #endif } else { Py_INCREF(Py_None); value = Py_None; } Py_DECREF(ev); } else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) { value = ev; } if (likely(value)) { Py_XDECREF(tb); Py_DECREF(et); *pvalue = value; return 0; } } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) { __Pyx_ErrRestore(et, ev, tb); return -1; } PyErr_NormalizeException(&et, &ev, &tb); if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) { __Pyx_ErrRestore(et, ev, tb); return -1; } Py_XDECREF(tb); Py_DECREF(et); #if PY_VERSION_HEX >= 0x030300A0 value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); Py_DECREF(ev); #else { PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); Py_DECREF(ev); if (likely(args)) { value = PySequence_GetItem(args, 0); Py_DECREF(args); } if (unlikely(!value)) { __Pyx_ErrRestore(NULL, NULL, NULL); Py_INCREF(Py_None); value = Py_None; } } #endif *pvalue = value; return 0; } static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { #if PY_VERSION_HEX >= 0x030B00a4 Py_CLEAR(exc_state->exc_value); #else PyObject *t, *v, *tb; t = exc_state->exc_type; v = exc_state->exc_value; tb = exc_state->exc_traceback; exc_state->exc_type = NULL; exc_state->exc_value = NULL; exc_state->exc_traceback = NULL; Py_XDECREF(t); Py_XDECREF(v); Py_XDECREF(tb); #endif } #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) { const char *msg; CYTHON_MAYBE_UNUSED_VAR(gen); if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check((PyObject*)gen)) { msg = "coroutine already executing"; #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) { msg = "async generator already executing"; #endif } else { msg = "generator already executing"; } PyErr_SetString(PyExc_ValueError, msg); } #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) static void __Pyx__Coroutine_NotStartedError(PyObject *gen) { const char *msg; CYTHON_MAYBE_UNUSED_VAR(gen); if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check(gen)) { msg = "can't send non-None value to a just-started coroutine"; #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact(gen)) { msg = "can't send non-None value to a just-started async generator"; #endif } else { msg = "can't send non-None value to a just-started generator"; } PyErr_SetString(PyExc_TypeError, msg); } #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { CYTHON_MAYBE_UNUSED_VAR(gen); CYTHON_MAYBE_UNUSED_VAR(closing); #ifdef __Pyx_Coroutine_USED if (!closing && __Pyx_Coroutine_Check(gen)) { PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine"); } else #endif if (value) { #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(gen)) PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); else #endif PyErr_SetNone(PyExc_StopIteration); } } static PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { __Pyx_PyThreadState_declare PyThreadState *tstate; __Pyx_ExcInfoStruct *exc_state; PyObject *retval; assert(!self->is_running); if (unlikely(self->resume_label == 0)) { if (unlikely(value && value != Py_None)) { return __Pyx_Coroutine_NotStartedError((PyObject*)self); } } if (unlikely(self->resume_label == -1)) { return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); } #if CYTHON_FAST_THREAD_STATE __Pyx_PyThreadState_assign tstate = __pyx_tstate; #else tstate = __Pyx_PyThreadState_Current; #endif exc_state = &self->gi_exc_state; if (exc_state->exc_value) { #if CYTHON_COMPILING_IN_PYPY #else PyObject *exc_tb; #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON exc_tb = PyException_GetTraceback(exc_state->exc_value); #elif PY_VERSION_HEX >= 0x030B00a4 exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback; #else exc_tb = exc_state->exc_traceback; #endif if (exc_tb) { PyTracebackObject *tb = (PyTracebackObject *) exc_tb; PyFrameObject *f = tb->tb_frame; assert(f->f_back == NULL); #if PY_VERSION_HEX >= 0x030B00A1 f->f_back = PyThreadState_GetFrame(tstate); #else Py_XINCREF(tstate->frame); f->f_back = tstate->frame; #endif #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON Py_DECREF(exc_tb); #endif } #endif } #if CYTHON_USE_EXC_INFO_STACK exc_state->previous_item = tstate->exc_info; tstate->exc_info = exc_state; #else if (exc_state->exc_type) { __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); } else { __Pyx_Coroutine_ExceptionClear(exc_state); __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); } #endif self->is_running = 1; retval = self->body(self, tstate, value); self->is_running = 0; #if CYTHON_USE_EXC_INFO_STACK exc_state = &self->gi_exc_state; tstate->exc_info = exc_state->previous_item; exc_state->previous_item = NULL; __Pyx_Coroutine_ResetFrameBackpointer(exc_state); #endif return retval; } static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { #if CYTHON_COMPILING_IN_PYPY CYTHON_UNUSED_VAR(exc_state); #else PyObject *exc_tb; #if PY_VERSION_HEX >= 0x030B00a4 if (!exc_state->exc_value) return; exc_tb = PyException_GetTraceback(exc_state->exc_value); #else exc_tb = exc_state->exc_traceback; #endif if (likely(exc_tb)) { PyTracebackObject *tb = (PyTracebackObject *) exc_tb; PyFrameObject *f = tb->tb_frame; Py_CLEAR(f->f_back); #if PY_VERSION_HEX >= 0x030B00a4 Py_DECREF(exc_tb); #endif } #endif } static CYTHON_INLINE PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) { CYTHON_MAYBE_UNUSED_VAR(gen); if (unlikely(!retval)) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (!__Pyx_PyErr_Occurred()) { PyObject *exc = PyExc_StopIteration; #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(gen)) exc = __Pyx_PyExc_StopAsyncIteration; #endif __Pyx_PyErr_SetNone(exc); } } return retval; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) static CYTHON_INLINE PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { #if PY_VERSION_HEX <= 0x030A00A1 return _PyGen_Send(gen, arg); #else PyObject *result; if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) { if (PyAsyncGen_CheckExact(gen)) { assert(result == Py_None); PyErr_SetNone(PyExc_StopAsyncIteration); } else if (result == Py_None) { PyErr_SetNone(PyExc_StopIteration); } else { #if PY_VERSION_HEX < 0x030d00A1 _PyGen_SetStopIterationValue(result); #else if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) { PyErr_SetObject(PyExc_StopIteration, result); } else { PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result); if (likely(exc != NULL)) { PyErr_SetObject(PyExc_StopIteration, exc); Py_DECREF(exc); } } #endif } Py_DECREF(result); result = NULL; } return result; #endif } #endif static CYTHON_INLINE PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { PyObject *ret; PyObject *val = NULL; __Pyx_Coroutine_Undelegate(gen); __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); ret = __Pyx_Coroutine_SendEx(gen, val, 0); Py_XDECREF(val); return ret; } static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { PyObject *retval; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; PyObject *yf = gen->yieldfrom; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { PyObject *ret; gen->is_running = 1; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, value); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { ret = __Pyx_Coroutine_Send(yf, value); } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { ret = __Pyx_async_gen_asend_send(yf, value); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyGen_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyCoro_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif { if (value == Py_None) ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); else ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); } gen->is_running = 0; if (likely(ret)) { return ret; } retval = __Pyx_Coroutine_FinishDelegation(gen); } else { retval = __Pyx_Coroutine_SendEx(gen, value, 0); } return __Pyx_Coroutine_MethodReturn(self, retval); } static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { PyObject *retval = NULL; int err = 0; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { retval = __Pyx_Coroutine_Close(yf); if (!retval) return -1; } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { retval = __Pyx_Coroutine_Close(yf); if (!retval) return -1; } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); if (!retval) return -1; } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { retval = __Pyx_async_gen_asend_close(yf, NULL); } else if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { retval = __Pyx_async_gen_athrow_close(yf, NULL); } else #endif { PyObject *meth; gen->is_running = 1; meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_close); if (unlikely(!meth)) { if (unlikely(PyErr_Occurred())) { PyErr_WriteUnraisable(yf); } } else { retval = __Pyx_PyObject_CallNoArg(meth); Py_DECREF(meth); if (unlikely(!retval)) err = -1; } gen->is_running = 0; } Py_XDECREF(retval); return err; } static PyObject *__Pyx_Generator_Next(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; PyObject *yf = gen->yieldfrom; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { PyObject *ret; gen->is_running = 1; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Generator_Next(yf); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyGen_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { ret = __Pyx_Coroutine_Send(yf, Py_None); } else #endif ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); gen->is_running = 0; if (likely(ret)) { return ret; } return __Pyx_Coroutine_FinishDelegation(gen); } return __Pyx_Coroutine_SendEx(gen, Py_None, 0); } static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) { CYTHON_UNUSED_VAR(arg); return __Pyx_Coroutine_Close(self); } static PyObject *__Pyx_Coroutine_Close(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject *retval, *raised_exception; PyObject *yf = gen->yieldfrom; int err = 0; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { Py_INCREF(yf); err = __Pyx_Coroutine_CloseIter(gen, yf); __Pyx_Coroutine_Undelegate(gen); Py_DECREF(yf); } if (err == 0) PyErr_SetNone(PyExc_GeneratorExit); retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); if (unlikely(retval)) { const char *msg; Py_DECREF(retval); if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check(self)) { msg = "coroutine ignored GeneratorExit"; #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact(self)) { #if PY_VERSION_HEX < 0x03060000 msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; #else msg = "async generator ignored GeneratorExit"; #endif #endif } else { msg = "generator ignored GeneratorExit"; } PyErr_SetString(PyExc_RuntimeError, msg); return NULL; } raised_exception = PyErr_Occurred(); if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { if (raised_exception) PyErr_Clear(); Py_INCREF(Py_None); return Py_None; } return NULL; } static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, PyObject *args, int close_on_genexit) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject *yf = gen->yieldfrom; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { PyObject *ret; Py_INCREF(yf); if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { int err = __Pyx_Coroutine_CloseIter(gen, yf); Py_DECREF(yf); __Pyx_Coroutine_Undelegate(gen); if (err < 0) return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); goto throw_here; } gen->is_running = 1; if (0 #ifdef __Pyx_Generator_USED || __Pyx_Generator_CheckExact(yf) #endif #ifdef __Pyx_Coroutine_USED || __Pyx_Coroutine_Check(yf) #endif ) { ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit); #ifdef __Pyx_Coroutine_USED } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); #endif } else { PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_throw); if (unlikely(!meth)) { Py_DECREF(yf); if (unlikely(PyErr_Occurred())) { gen->is_running = 0; return NULL; } __Pyx_Coroutine_Undelegate(gen); gen->is_running = 0; goto throw_here; } if (likely(args)) { ret = __Pyx_PyObject_Call(meth, args, NULL); } else { PyObject *cargs[4] = {NULL, typ, val, tb}; ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } Py_DECREF(meth); } gen->is_running = 0; Py_DECREF(yf); if (!ret) { ret = __Pyx_Coroutine_FinishDelegation(gen); } return __Pyx_Coroutine_MethodReturn(self, ret); } throw_here: __Pyx_Raise(typ, val, tb, NULL); return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); } static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { PyObject *typ; PyObject *val = NULL; PyObject *tb = NULL; if (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))) return NULL; return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); } static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) { #if PY_VERSION_HEX >= 0x030B00a4 Py_VISIT(exc_state->exc_value); #else Py_VISIT(exc_state->exc_type); Py_VISIT(exc_state->exc_value); Py_VISIT(exc_state->exc_traceback); #endif return 0; } static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { Py_VISIT(gen->closure); Py_VISIT(gen->classobj); Py_VISIT(gen->yieldfrom); return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg); } static int __Pyx_Coroutine_clear(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; Py_CLEAR(gen->closure); Py_CLEAR(gen->classobj); Py_CLEAR(gen->yieldfrom); __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer); } #endif Py_CLEAR(gen->gi_code); Py_CLEAR(gen->gi_frame); Py_CLEAR(gen->gi_name); Py_CLEAR(gen->gi_qualname); Py_CLEAR(gen->gi_modulename); return 0; } static void __Pyx_Coroutine_dealloc(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject_GC_UnTrack(gen); if (gen->gi_weakreflist != NULL) PyObject_ClearWeakRefs(self); if (gen->resume_label >= 0) { PyObject_GC_Track(self); #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE if (unlikely(PyObject_CallFinalizerFromDealloc(self))) #else Py_TYPE(gen)->tp_del(self); if (unlikely(Py_REFCNT(self) > 0)) #endif { return; } PyObject_GC_UnTrack(self); } #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { /* We have to handle this case for asynchronous generators right here, because this code has to be between UNTRACK and GC_Del. */ Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer); } #endif __Pyx_Coroutine_clear(self); __Pyx_PyHeapTypeObject_GC_Del(gen); } static void __Pyx_Coroutine_del(PyObject *self) { PyObject *error_type, *error_value, *error_traceback; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; __Pyx_PyThreadState_declare if (gen->resume_label < 0) { return; } #if !CYTHON_USE_TP_FINALIZE assert(self->ob_refcnt == 0); __Pyx_SET_REFCNT(self, 1); #endif __Pyx_PyThreadState_assign __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self; PyObject *finalizer = agen->ag_finalizer; if (finalizer && !agen->ag_closed) { PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self); if (unlikely(!res)) { PyErr_WriteUnraisable(self); } else { Py_DECREF(res); } __Pyx_ErrRestore(error_type, error_value, error_traceback); return; } } #endif if (unlikely(gen->resume_label == 0 && !error_value)) { #ifdef __Pyx_Coroutine_USED #ifdef __Pyx_Generator_USED if (!__Pyx_Generator_CheckExact(self)) #endif { PyObject_GC_UnTrack(self); #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) PyErr_WriteUnraisable(self); #else {PyObject *msg; char *cmsg; #if CYTHON_COMPILING_IN_PYPY msg = NULL; cmsg = (char*) "coroutine was never awaited"; #else char *cname; PyObject *qualname; qualname = gen->gi_qualname; cname = PyString_AS_STRING(qualname); msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); if (unlikely(!msg)) { PyErr_Clear(); cmsg = (char*) "coroutine was never awaited"; } else { cmsg = PyString_AS_STRING(msg); } #endif if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) PyErr_WriteUnraisable(self); Py_XDECREF(msg);} #endif PyObject_GC_Track(self); } #endif } else { PyObject *res = __Pyx_Coroutine_Close(self); if (unlikely(!res)) { if (PyErr_Occurred()) PyErr_WriteUnraisable(self); } else { Py_DECREF(res); } } __Pyx_ErrRestore(error_type, error_value, error_traceback); #if !CYTHON_USE_TP_FINALIZE assert(Py_REFCNT(self) > 0); if (likely(--self->ob_refcnt == 0)) { return; } { Py_ssize_t refcnt = Py_REFCNT(self); _Py_NewReference(self); __Pyx_SET_REFCNT(self, refcnt); } #if CYTHON_COMPILING_IN_CPYTHON assert(PyType_IS_GC(Py_TYPE(self)) && _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); _Py_DEC_REFTOTAL; #endif #ifdef COUNT_ALLOCS --Py_TYPE(self)->tp_frees; --Py_TYPE(self)->tp_allocs; #endif #endif } static PyObject * __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context) { PyObject *name = self->gi_name; CYTHON_UNUSED_VAR(context); if (unlikely(!name)) name = Py_None; Py_INCREF(name); return name; } static int __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(self->gi_name, value); return 0; } static PyObject * __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context) { PyObject *name = self->gi_qualname; CYTHON_UNUSED_VAR(context); if (unlikely(!name)) name = Py_None; Py_INCREF(name); return name; } static int __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(self->gi_qualname, value); return 0; } static PyObject * __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) { PyObject *frame = self->gi_frame; CYTHON_UNUSED_VAR(context); if (!frame) { if (unlikely(!self->gi_code)) { Py_RETURN_NONE; } frame = (PyObject *) PyFrame_New( PyThreadState_Get(), /*PyThreadState *tstate,*/ (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (unlikely(!frame)) return NULL; self->gi_frame = frame; } Py_INCREF(frame); return frame; } static __pyx_CoroutineObject *__Pyx__Coroutine_New( PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name) { __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type); if (unlikely(!gen)) return NULL; return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name); } static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name) { gen->body = body; gen->closure = closure; Py_XINCREF(closure); gen->is_running = 0; gen->resume_label = 0; gen->classobj = NULL; gen->yieldfrom = NULL; #if PY_VERSION_HEX >= 0x030B00a4 gen->gi_exc_state.exc_value = NULL; #else gen->gi_exc_state.exc_type = NULL; gen->gi_exc_state.exc_value = NULL; gen->gi_exc_state.exc_traceback = NULL; #endif #if CYTHON_USE_EXC_INFO_STACK gen->gi_exc_state.previous_item = NULL; #endif gen->gi_weakreflist = NULL; Py_XINCREF(qualname); gen->gi_qualname = qualname; Py_XINCREF(name); gen->gi_name = name; Py_XINCREF(module_name); gen->gi_modulename = module_name; Py_XINCREF(code); gen->gi_code = code; gen->gi_frame = NULL; PyObject_GC_Track(gen); return gen; } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PatchModuleWithCoroutine */ static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) int result; PyObject *globals, *result_obj; globals = PyDict_New(); if (unlikely(!globals)) goto ignore; result = PyDict_SetItemString(globals, "_cython_coroutine_type", #ifdef __Pyx_Coroutine_USED (PyObject*)__pyx_CoroutineType); #else Py_None); #endif if (unlikely(result < 0)) goto ignore; result = PyDict_SetItemString(globals, "_cython_generator_type", #ifdef __Pyx_Generator_USED (PyObject*)__pyx_GeneratorType); #else Py_None); #endif if (unlikely(result < 0)) goto ignore; if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; result_obj = PyRun_String(py_code, Py_file_input, globals, globals); if (unlikely(!result_obj)) goto ignore; Py_DECREF(result_obj); Py_DECREF(globals); return module; ignore: Py_XDECREF(globals); PyErr_WriteUnraisable(module); if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { Py_DECREF(module); module = NULL; } #else py_code++; #endif return module; } /* PatchGeneratorABC */ #ifndef CYTHON_REGISTER_ABCS #define CYTHON_REGISTER_ABCS 1 #endif #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) static PyObject* __Pyx_patch_abc_module(PyObject *module); static PyObject* __Pyx_patch_abc_module(PyObject *module) { module = __Pyx_Coroutine_patch_module( module, "" "if _cython_generator_type is not None:\n" " try: Generator = _module.Generator\n" " except AttributeError: pass\n" " else: Generator.register(_cython_generator_type)\n" "if _cython_coroutine_type is not None:\n" " try: Coroutine = _module.Coroutine\n" " except AttributeError: pass\n" " else: Coroutine.register(_cython_coroutine_type)\n" ); return module; } #endif static int __Pyx_patch_abc(void) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) static int abc_patched = 0; if (CYTHON_REGISTER_ABCS && !abc_patched) { PyObject *module; module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); if (unlikely(!module)) { PyErr_WriteUnraisable(NULL); if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, ((PY_MAJOR_VERSION >= 3) ? "Cython module failed to register with collections.abc module" : "Cython module failed to register with collections module"), 1) < 0)) { return -1; } } else { module = __Pyx_patch_abc_module(module); abc_patched = 1; if (unlikely(!module)) return -1; Py_DECREF(module); } module = PyImport_ImportModule("backports_abc"); if (module) { module = __Pyx_patch_abc_module(module); Py_XDECREF(module); } if (!module) { PyErr_Clear(); } } #else if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); #endif return 0; } /* Coroutine */ static void __Pyx_CoroutineAwait_dealloc(PyObject *self) { PyObject_GC_UnTrack(self); Py_CLEAR(((__pyx_CoroutineAwaitObject*)self)->coroutine); __Pyx_PyHeapTypeObject_GC_Del(self); } static int __Pyx_CoroutineAwait_traverse(__pyx_CoroutineAwaitObject *self, visitproc visit, void *arg) { Py_VISIT(self->coroutine); return 0; } static int __Pyx_CoroutineAwait_clear(__pyx_CoroutineAwaitObject *self) { Py_CLEAR(self->coroutine); return 0; } static PyObject *__Pyx_CoroutineAwait_Next(__pyx_CoroutineAwaitObject *self) { return __Pyx_Generator_Next(self->coroutine); } static PyObject *__Pyx_CoroutineAwait_Send(__pyx_CoroutineAwaitObject *self, PyObject *value) { return __Pyx_Coroutine_Send(self->coroutine, value); } static PyObject *__Pyx_CoroutineAwait_Throw(__pyx_CoroutineAwaitObject *self, PyObject *args) { return __Pyx_Coroutine_Throw(self->coroutine, args); } static PyObject *__Pyx_CoroutineAwait_Close(__pyx_CoroutineAwaitObject *self, PyObject *arg) { CYTHON_UNUSED_VAR(arg); return __Pyx_Coroutine_Close(self->coroutine); } static PyObject *__Pyx_CoroutineAwait_self(PyObject *self) { Py_INCREF(self); return self; } #if !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_CoroutineAwait_no_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) { CYTHON_UNUSED_VAR(type); CYTHON_UNUSED_VAR(args); CYTHON_UNUSED_VAR(kwargs); PyErr_SetString(PyExc_TypeError, "cannot instantiate type, use 'await coroutine' instead"); return NULL; } #endif static PyObject *__Pyx_CoroutineAwait_reduce_ex(__pyx_CoroutineAwaitObject *self, PyObject *arg) { CYTHON_UNUSED_VAR(arg); PyErr_Format(PyExc_TypeError, "cannot pickle '%.200s' object", Py_TYPE(self)->tp_name); return NULL; } static PyMethodDef __pyx_CoroutineAwait_methods[] = { {"send", (PyCFunction) __Pyx_CoroutineAwait_Send, METH_O, (char*) PyDoc_STR("send(arg) -> send 'arg' into coroutine,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_CoroutineAwait_Throw, METH_VARARGS, (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in coroutine,\nreturn next yielded value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_CoroutineAwait_Close, METH_NOARGS, (char*) PyDoc_STR("close() -> raise GeneratorExit inside coroutine.")}, {"__reduce_ex__", (PyCFunction) __Pyx_CoroutineAwait_reduce_ex, METH_O, 0}, {"__reduce__", (PyCFunction) __Pyx_CoroutineAwait_reduce_ex, METH_NOARGS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CoroutineAwaitType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CoroutineAwait_dealloc}, {Py_tp_traverse, (void *)__Pyx_CoroutineAwait_traverse}, {Py_tp_clear, (void *)__Pyx_CoroutineAwait_clear}, #if !CYTHON_COMPILING_IN_PYPY {Py_tp_new, (void *)__Pyx_CoroutineAwait_no_new}, #endif {Py_tp_methods, (void *)__pyx_CoroutineAwait_methods}, {Py_tp_iter, (void *)__Pyx_CoroutineAwait_self}, {Py_tp_iternext, (void *)__Pyx_CoroutineAwait_Next}, {0, 0}, }; static PyType_Spec __pyx_CoroutineAwaitType_spec = { __PYX_TYPE_MODULE_PREFIX "coroutine_wrapper", sizeof(__pyx_CoroutineAwaitObject), 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, __pyx_CoroutineAwaitType_slots }; #else static PyTypeObject __pyx_CoroutineAwaitType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "coroutine_wrapper", sizeof(__pyx_CoroutineAwaitObject), 0, (destructor) __Pyx_CoroutineAwait_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, PyDoc_STR("A wrapper object implementing __await__ for coroutines."), (traverseproc) __Pyx_CoroutineAwait_traverse, (inquiry) __Pyx_CoroutineAwait_clear, 0, 0, __Pyx_CoroutineAwait_self, (iternextfunc) __Pyx_CoroutineAwait_Next, __pyx_CoroutineAwait_methods, 0 , 0 , 0, 0, 0, 0, 0, 0, 0, #if !CYTHON_COMPILING_IN_PYPY __Pyx_CoroutineAwait_no_new, #else 0, #endif 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif #if PY_VERSION_HEX < 0x030500B1 || defined(__Pyx_IterableCoroutine_USED) || CYTHON_USE_ASYNC_SLOTS static CYTHON_INLINE PyObject *__Pyx__Coroutine_await(PyObject *coroutine) { __pyx_CoroutineAwaitObject *await = PyObject_GC_New(__pyx_CoroutineAwaitObject, __pyx_CoroutineAwaitType); if (unlikely(!await)) return NULL; Py_INCREF(coroutine); await->coroutine = coroutine; PyObject_GC_Track(await); return (PyObject*)await; } #endif #if PY_VERSION_HEX < 0x030500B1 static PyObject *__Pyx_Coroutine_await_method(PyObject *coroutine, PyObject *arg) { CYTHON_UNUSED_VAR(arg); return __Pyx__Coroutine_await(coroutine); } #endif #if defined(__Pyx_IterableCoroutine_USED) || CYTHON_USE_ASYNC_SLOTS static PyObject *__Pyx_Coroutine_await(PyObject *coroutine) { if (unlikely(!coroutine || !__Pyx_Coroutine_Check(coroutine))) { PyErr_SetString(PyExc_TypeError, "invalid input, expected coroutine"); return NULL; } return __Pyx__Coroutine_await(coroutine); } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 && PY_VERSION_HEX < 0x030500B1 static PyObject *__Pyx_Coroutine_compare(PyObject *obj, PyObject *other, int op) { PyObject* result; switch (op) { case Py_EQ: result = (other == obj) ? Py_True : Py_False; break; case Py_NE: result = (other != obj) ? Py_True : Py_False; break; default: result = Py_NotImplemented; } Py_INCREF(result); return result; } #endif static PyMethodDef __pyx_Coroutine_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, (char*) PyDoc_STR("send(arg) -> send 'arg' into coroutine,\nreturn next iterated value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in coroutine,\nreturn next iterated value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, (char*) PyDoc_STR("close() -> raise GeneratorExit inside coroutine.")}, #if PY_VERSION_HEX < 0x030500B1 {"__await__", (PyCFunction) __Pyx_Coroutine_await_method, METH_NOARGS, (char*) PyDoc_STR("__await__() -> return an iterator to be used in await expression.")}, #endif {0, 0, 0, 0} }; static PyMemberDef __pyx_Coroutine_memberlist[] = { {(char *) "cr_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, {(char*) "cr_await", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, (char*) PyDoc_STR("object being awaited, or None")}, {(char*) "cr_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, #if CYTHON_USE_TYPE_SPECS {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, #endif {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Coroutine_getsets[] = { {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, (char*) PyDoc_STR("name of the coroutine"), 0}, {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, (char*) PyDoc_STR("qualified name of the coroutine"), 0}, {(char *) "cr_frame", (getter)__Pyx_Coroutine_get_frame, NULL, (char*) PyDoc_STR("Frame of the coroutine"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CoroutineType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc}, {Py_am_await, (void *)&__Pyx_Coroutine_await}, {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse}, {Py_tp_methods, (void *)__pyx_Coroutine_methods}, {Py_tp_members, (void *)__pyx_Coroutine_memberlist}, {Py_tp_getset, (void *)__pyx_Coroutine_getsets}, {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict}, #if CYTHON_USE_TP_FINALIZE {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, #endif {0, 0}, }; static PyType_Spec __pyx_CoroutineType_spec = { __PYX_TYPE_MODULE_PREFIX "coroutine", sizeof(__pyx_CoroutineObject), 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, __pyx_CoroutineType_slots }; #else #if CYTHON_USE_ASYNC_SLOTS static __Pyx_PyAsyncMethodsStruct __pyx_Coroutine_as_async = { __Pyx_Coroutine_await, 0, 0, #if PY_VERSION_HEX >= 0x030A00A3 0, #endif }; #endif static PyTypeObject __pyx_CoroutineType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "coroutine", sizeof(__pyx_CoroutineObject), 0, (destructor) __Pyx_Coroutine_dealloc, 0, 0, 0, #if CYTHON_USE_ASYNC_SLOTS &__pyx_Coroutine_as_async, #else 0, #endif 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, 0, (traverseproc) __Pyx_Coroutine_traverse, 0, #if CYTHON_USE_ASYNC_SLOTS && CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 && PY_VERSION_HEX < 0x030500B1 __Pyx_Coroutine_compare, #else 0, #endif offsetof(__pyx_CoroutineObject, gi_weakreflist), 0, 0, __pyx_Coroutine_methods, __pyx_Coroutine_memberlist, __pyx_Coroutine_getsets, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if CYTHON_USE_TP_FINALIZE 0, #else __Pyx_Coroutine_del, #endif 0, #if CYTHON_USE_TP_FINALIZE __Pyx_Coroutine_del, #elif PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_Coroutine_init(PyObject *module) { CYTHON_MAYBE_UNUSED_VAR(module); #if CYTHON_USE_TYPE_SPECS __pyx_CoroutineType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CoroutineType_spec, NULL); #else __pyx_CoroutineType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; __pyx_CoroutineType = __Pyx_FetchCommonType(&__pyx_CoroutineType_type); #endif if (unlikely(!__pyx_CoroutineType)) return -1; #ifdef __Pyx_IterableCoroutine_USED if (unlikely(__pyx_IterableCoroutine_init(module) == -1)) return -1; #endif #if CYTHON_USE_TYPE_SPECS __pyx_CoroutineAwaitType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CoroutineAwaitType_spec, NULL); #else __pyx_CoroutineAwaitType = __Pyx_FetchCommonType(&__pyx_CoroutineAwaitType_type); #endif if (unlikely(!__pyx_CoroutineAwaitType)) return -1; return 0; } /* GetAwaitIter */ static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAwaitableIter(PyObject *o) { #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(o)) { return __Pyx_NewRef(o); } #endif return __Pyx__Coroutine_GetAwaitableIter(o); } static void __Pyx_Coroutine_AwaitableIterError(PyObject *source) { #if PY_VERSION_HEX >= 0x030600B3 && PY_VERSION_HEX < 0x030d0000 || defined(_PyErr_FormatFromCause) __Pyx_TypeName source_type_name = __Pyx_PyType_GetName(Py_TYPE(source)); _PyErr_FormatFromCause(PyExc_TypeError, "'async for' received an invalid object from __anext__: " __Pyx_FMT_TYPENAME, source_type_name); __Pyx_DECREF_TypeName(source_type_name); #elif PY_MAJOR_VERSION >= 3 PyObject *exc, *val, *val2, *tb; __Pyx_TypeName source_type_name = __Pyx_PyType_GetName(Py_TYPE(source)); assert(PyErr_Occurred()); PyErr_Fetch(&exc, &val, &tb); PyErr_NormalizeException(&exc, &val, &tb); if (tb != NULL) { PyException_SetTraceback(val, tb); Py_DECREF(tb); } Py_DECREF(exc); assert(!PyErr_Occurred()); PyErr_Format(PyExc_TypeError, "'async for' received an invalid object from __anext__: " __Pyx_FMT_TYPENAME, source_type_name); __Pyx_DECREF_TypeName(source_type_name); PyErr_Fetch(&exc, &val2, &tb); PyErr_NormalizeException(&exc, &val2, &tb); Py_INCREF(val); PyException_SetCause(val2, val); PyException_SetContext(val2, val); PyErr_Restore(exc, val2, tb); #else CYTHON_UNUSED_VAR(source); #endif } static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *obj) { PyObject *res; #if CYTHON_USE_ASYNC_SLOTS __Pyx_PyAsyncMethodsStruct* am = __Pyx_PyType_AsAsync(obj); if (likely(am && am->am_await)) { res = (*am->am_await)(obj); } else #endif #if PY_VERSION_HEX >= 0x030500B2 || defined(PyCoro_CheckExact) if (PyCoro_CheckExact(obj)) { return __Pyx_NewRef(obj); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && defined(CO_ITERABLE_COROUTINE) #if PY_VERSION_HEX >= 0x030C00A6 if (PyGen_CheckExact(obj) && (PyGen_GetCode((PyGenObject*)obj)->co_flags & CO_ITERABLE_COROUTINE)) { #else if (PyGen_CheckExact(obj) && ((PyGenObject*)obj)->gi_code && ((PyCodeObject *)((PyGenObject*)obj)->gi_code)->co_flags & CO_ITERABLE_COROUTINE) { #endif return __Pyx_NewRef(obj); } else #endif { PyObject *method = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, __pyx_n_s_await, &method); if (likely(is_method)) { res = __Pyx_PyObject_CallOneArg(method, obj); } else if (likely(method)) { res = __Pyx_PyObject_CallNoArg(method); } else goto slot_error; Py_DECREF(method); } if (unlikely(!res)) { __Pyx_Coroutine_AwaitableIterError(obj); goto bad; } if (unlikely(!PyIter_Check(res))) { __Pyx_TypeName res_type_name = __Pyx_PyType_GetName(Py_TYPE(res)); PyErr_Format(PyExc_TypeError, "__await__() returned non-iterator of type '" __Pyx_FMT_TYPENAME "'", res_type_name); __Pyx_DECREF_TypeName(res_type_name); Py_CLEAR(res); } else { int is_coroutine = 0; #ifdef __Pyx_Coroutine_USED is_coroutine |= __Pyx_Coroutine_Check(res); #endif #if PY_VERSION_HEX >= 0x030500B2 || defined(PyCoro_CheckExact) is_coroutine |= PyCoro_CheckExact(res); #endif if (unlikely(is_coroutine)) { /* __await__ must return an *iterator*, not a coroutine or another awaitable (see PEP 492) */ PyErr_SetString(PyExc_TypeError, "__await__() returned a coroutine"); Py_CLEAR(res); } } return res; slot_error: { __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "object " __Pyx_FMT_TYPENAME " can't be used in 'await' expression", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); } bad: return NULL; } /* CoroutineYieldFrom */ static PyObject* __Pyx__Coroutine_Yield_From_Generic(__pyx_CoroutineObject *gen, PyObject *source) { PyObject *retval; PyObject *source_gen = __Pyx__Coroutine_GetAwaitableIter(source); if (unlikely(!source_gen)) { return NULL; } if (__Pyx_Coroutine_Check(source_gen)) { retval = __Pyx_Generator_Next(source_gen); } else { retval = __Pyx_PyObject_GetIterNextFunc(source_gen)(source_gen); } if (retval) { gen->yieldfrom = source_gen; return retval; } Py_DECREF(source_gen); return NULL; } static CYTHON_INLINE PyObject* __Pyx_Coroutine_Yield_From(__pyx_CoroutineObject *gen, PyObject *source) { PyObject *retval; if (__Pyx_Coroutine_Check(source)) { if (unlikely(((__pyx_CoroutineObject*)source)->yieldfrom)) { PyErr_SetString( PyExc_RuntimeError, "coroutine is being awaited already"); return NULL; } retval = __Pyx_Generator_Next(source); #ifdef __Pyx_AsyncGen_USED } else if (__pyx_PyAsyncGenASend_CheckExact(source)) { retval = __Pyx_async_gen_asend_iternext(source); #endif } else { return __Pyx__Coroutine_Yield_From_Generic(gen, source); } if (retval) { Py_INCREF(source); gen->yieldfrom = source; } return retval; } /* ReturnWithStopIteration */ static void __Pyx__ReturnWithStopIteration(PyObject* value) { PyObject *exc, *args; #if CYTHON_COMPILING_IN_CPYTHON __Pyx_PyThreadState_declare if (PY_VERSION_HEX >= 0x030C00A6 || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) { args = PyTuple_New(1); if (unlikely(!args)) return; Py_INCREF(value); PyTuple_SET_ITEM(args, 0, value); exc = PyType_Type.tp_call(PyExc_StopIteration, args, NULL); Py_DECREF(args); if (!exc) return; } else { Py_INCREF(value); exc = value; } #if CYTHON_FAST_THREAD_STATE __Pyx_PyThreadState_assign #if CYTHON_USE_EXC_INFO_STACK if (!__pyx_tstate->exc_info->exc_value) #else if (!__pyx_tstate->exc_type) #endif { Py_INCREF(PyExc_StopIteration); __Pyx_ErrRestore(PyExc_StopIteration, exc, NULL); return; } #endif #else args = PyTuple_Pack(1, value); if (unlikely(!args)) return; exc = PyObject_Call(PyExc_StopIteration, args, NULL); Py_DECREF(args); if (unlikely(!exc)) return; #endif PyErr_SetObject(PyExc_StopIteration, exc); Py_DECREF(exc); } /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* AsyncIter */ static PyObject *__Pyx_Coroutine_GetAsyncIter_Generic(PyObject *obj) { __Pyx_TypeName obj_type_name; #if PY_VERSION_HEX < 0x030500B1 { PyObject *iter = __Pyx_PyObject_CallMethod0(obj, __pyx_n_s_aiter); if (likely(iter)) return iter; if (!PyErr_ExceptionMatches(PyExc_AttributeError)) return NULL; } #else (void)&__Pyx_PyObject_CallMethod0; #endif obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'async for' requires an object with __aiter__ method, got " __Pyx_FMT_TYPENAME, obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return NULL; } static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAsyncIter(PyObject *obj) { #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(obj)) { return __Pyx_NewRef(obj); } #endif #if CYTHON_USE_ASYNC_SLOTS { __Pyx_PyAsyncMethodsStruct* am = __Pyx_PyType_AsAsync(obj); if (likely(am && am->am_aiter)) { return (*am->am_aiter)(obj); } } #endif return __Pyx_Coroutine_GetAsyncIter_Generic(obj); } static PyObject *__Pyx__Coroutine_AsyncIterNext(PyObject *obj) { #if PY_VERSION_HEX < 0x030500B1 { PyObject *value = __Pyx_PyObject_CallMethod0(obj, __pyx_n_s_anext); if (likely(value)) return value; } if (PyErr_ExceptionMatches(PyExc_AttributeError)) #endif { __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'async for' requires an object with __anext__ method, got " __Pyx_FMT_TYPENAME, obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); } return NULL; } static CYTHON_INLINE PyObject *__Pyx_Coroutine_AsyncIterNext(PyObject *obj) { #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(obj)) { return __Pyx_async_gen_anext(obj); } #endif #if CYTHON_USE_ASYNC_SLOTS { __Pyx_PyAsyncMethodsStruct* am = __Pyx_PyType_AsAsync(obj); if (likely(am && am->am_anext)) { return (*am->am_anext)(obj); } } #endif return __Pyx__Coroutine_AsyncIterNext(obj); } /* StopAsyncIteration */ #if PY_VERSION_HEX < 0x030500B1 #if CYTHON_USE_TYPE_SPECS #error Using async coroutines with type specs requires Python 3.5 or later. #else static PyTypeObject __Pyx__PyExc_StopAsyncIteration_type = { PyVarObject_HEAD_INIT(0, 0) "StopAsyncIteration", sizeof(PyBaseExceptionObject), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, PyDoc_STR("Signal the end from iterator.__anext__()."), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000 0, #endif }; #endif #endif static int __pyx_StopAsyncIteration_init(PyObject *module) { CYTHON_UNUSED_VAR(module); #if PY_VERSION_HEX >= 0x030500B1 __Pyx_PyExc_StopAsyncIteration = PyExc_StopAsyncIteration; #else PyObject *builtins = PyEval_GetBuiltins(); if (likely(builtins)) { PyObject *exc = PyMapping_GetItemString(builtins, (char*) "StopAsyncIteration"); if (exc) { __Pyx_PyExc_StopAsyncIteration = exc; return 0; } } PyErr_Clear(); __Pyx__PyExc_StopAsyncIteration_type.tp_traverse = ((PyTypeObject*)PyExc_BaseException)->tp_traverse; __Pyx__PyExc_StopAsyncIteration_type.tp_clear = ((PyTypeObject*)PyExc_BaseException)->tp_clear; __Pyx__PyExc_StopAsyncIteration_type.tp_dictoffset = ((PyTypeObject*)PyExc_BaseException)->tp_dictoffset; __Pyx__PyExc_StopAsyncIteration_type.tp_base = (PyTypeObject*)PyExc_Exception; __Pyx_PyExc_StopAsyncIteration = (PyObject*) __Pyx_FetchCommonType(&__Pyx__PyExc_StopAsyncIteration_type); if (unlikely(!__Pyx_PyExc_StopAsyncIteration)) return -1; if (likely(builtins) && unlikely(PyMapping_SetItemString(builtins, (char*) "StopAsyncIteration", __Pyx_PyExc_StopAsyncIteration) < 0)) return -1; #endif return 0; } /* pybytes_as_double */ static double __Pyx_SlowPyString_AsDouble(PyObject *obj) { PyObject *float_value; #if PY_MAJOR_VERSION >= 3 float_value = PyFloat_FromString(obj); #else float_value = PyFloat_FromString(obj, 0); #endif if (likely(float_value)) { #if CYTHON_ASSUME_SAFE_MACROS double value = PyFloat_AS_DOUBLE(float_value); #else double value = PyFloat_AsDouble(float_value); #endif Py_DECREF(float_value); return value; } return (double)-1; } static const char* __Pyx__PyBytes_AsDouble_Copy(const char* start, char* buffer, Py_ssize_t length) { int last_was_punctuation = 1; Py_ssize_t i; for (i=0; i < length; i++) { char chr = start[i]; int is_punctuation = (chr == '_') | (chr == '.') | (chr == 'e') | (chr == 'E'); *buffer = chr; buffer += (chr != '_'); if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure; last_was_punctuation = is_punctuation; } if (unlikely(last_was_punctuation)) goto parse_failure; *buffer = '\0'; return buffer; parse_failure: return NULL; } static double __Pyx__PyBytes_AsDouble_inf_nan(const char* start, Py_ssize_t length) { int matches = 1; char sign = start[0]; int is_signed = (sign == '+') | (sign == '-'); start += is_signed; length -= is_signed; switch (start[0]) { #ifdef Py_NAN case 'n': case 'N': if (unlikely(length != 3)) goto parse_failure; matches &= (start[1] == 'a' || start[1] == 'A'); matches &= (start[2] == 'n' || start[2] == 'N'); if (unlikely(!matches)) goto parse_failure; return (sign == '-') ? -Py_NAN : Py_NAN; #endif case 'i': case 'I': if (unlikely(length < 3)) goto parse_failure; matches &= (start[1] == 'n' || start[1] == 'N'); matches &= (start[2] == 'f' || start[2] == 'F'); if (likely(length == 3 && matches)) return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; if (unlikely(length != 8)) goto parse_failure; matches &= (start[3] == 'i' || start[3] == 'I'); matches &= (start[4] == 'n' || start[4] == 'N'); matches &= (start[5] == 'i' || start[5] == 'I'); matches &= (start[6] == 't' || start[6] == 'T'); matches &= (start[7] == 'y' || start[7] == 'Y'); if (unlikely(!matches)) goto parse_failure; return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL; case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; default: goto parse_failure; } return 0.0; parse_failure: return -1.0; } static CYTHON_INLINE int __Pyx__PyBytes_AsDouble_IsSpace(char ch) { return (ch == 0x20) | !((ch < 0x9) | (ch > 0xd)); } CYTHON_UNUSED static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length) { double value; Py_ssize_t i, digits; const char *last = start + length; char *end; while (__Pyx__PyBytes_AsDouble_IsSpace(*start)) start++; while (start < last - 1 && __Pyx__PyBytes_AsDouble_IsSpace(last[-1])) last--; length = last - start; if (unlikely(length <= 0)) goto fallback; value = __Pyx__PyBytes_AsDouble_inf_nan(start, length); if (unlikely(value == -1.0)) goto fallback; if (value != 0.0) return value; digits = 0; for (i=0; i < length; digits += start[i++] != '_'); if (likely(digits == length)) { value = PyOS_string_to_double(start, &end, NULL); } else if (digits < 40) { char number[40]; last = __Pyx__PyBytes_AsDouble_Copy(start, number, length); if (unlikely(!last)) goto fallback; value = PyOS_string_to_double(number, &end, NULL); } else { char *number = (char*) PyMem_Malloc((digits + 1) * sizeof(char)); if (unlikely(!number)) goto fallback; last = __Pyx__PyBytes_AsDouble_Copy(start, number, length); if (unlikely(!last)) { PyMem_Free(number); goto fallback; } value = PyOS_string_to_double(number, &end, NULL); PyMem_Free(number); } if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) { return value; } fallback: return __Pyx_SlowPyString_AsDouble(obj); } /* pynumber_float */ static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj) { double val; if (PyLong_CheckExact(obj)) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(obj))) { val = (double) __Pyx_PyLong_CompactValue(obj); goto no_error; } #endif val = PyLong_AsDouble(obj); } else if (PyUnicode_CheckExact(obj)) { val = __Pyx_PyUnicode_AsDouble(obj); } else if (PyBytes_CheckExact(obj)) { val = __Pyx_PyBytes_AsDouble(obj); } else if (PyByteArray_CheckExact(obj)) { val = __Pyx_PyByteArray_AsDouble(obj); } else { return PyNumber_Float(obj); } if (unlikely(val == -1 && PyErr_Occurred())) { return NULL; } #if CYTHON_USE_PYLONG_INTERNALS no_error: #endif return PyFloat_FromDouble(val); } /* HasAttr */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; if (unlikely(!__Pyx_PyBaseString_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } r = __Pyx_GetAttr(o, n); if (!r) { PyErr_Clear(); return 0; } else { Py_DECREF(r); return 1; } } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__35); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* CallNextTpDealloc */ static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { PyTypeObject* type = Py_TYPE(obj); destructor tp_dealloc = NULL; while (type && __Pyx_PyType_GetSlot(type, tp_dealloc, destructor) != current_tp_dealloc) type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); while (type && (tp_dealloc = __Pyx_PyType_GetSlot(type, tp_dealloc, destructor)) == current_tp_dealloc) type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); if (type) tp_dealloc(obj); } /* CallNextTpTraverse */ static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { PyTypeObject* type = Py_TYPE(obj); traverseproc tp_traverse = NULL; while (type && __Pyx_PyType_GetSlot(type, tp_traverse, traverseproc) != current_tp_traverse) type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); while (type && (tp_traverse = __Pyx_PyType_GetSlot(type, tp_traverse, traverseproc)) == current_tp_traverse) type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); if (type && tp_traverse) return tp_traverse(obj, v, a); return 0; } /* CallNextTpClear */ static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { PyTypeObject* type = Py_TYPE(obj); inquiry tp_clear = NULL; while (type && __Pyx_PyType_GetSlot(type, tp_clear, inquiry) != current_tp_clear) type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); while (type && (tp_clear = __Pyx_PyType_GetSlot(type, tp_clear, inquiry)) == current_tp_clear) type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); if (type && tp_clear) tp_clear(obj); } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* SetVTable */ static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) { PyObject *ob = PyCapsule_New(vtable, 0, 0); if (unlikely(!ob)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0)) #else if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0)) #endif goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* GetVTable */ static void* __Pyx_GetVtable(PyTypeObject *type) { void* ptr; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); #else PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); #endif if (!ob) goto bad; ptr = PyCapsule_GetPointer(ob, 0); if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* MergeVTables */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_MergeVtables(PyTypeObject *type) { int i; void** base_vtables; __Pyx_TypeName tp_base_name; __Pyx_TypeName base_name; void* unknown = (void*)-1; PyObject* bases = type->tp_bases; int base_depth = 0; { PyTypeObject* base = type->tp_base; while (base) { base_depth += 1; base = base->tp_base; } } base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1)); base_vtables[0] = unknown; for (i = 1; i < PyTuple_GET_SIZE(bases); i++) { void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i))); if (base_vtable != NULL) { int j; PyTypeObject* base = type->tp_base; for (j = 0; j < base_depth; j++) { if (base_vtables[j] == unknown) { base_vtables[j] = __Pyx_GetVtable(base); base_vtables[j + 1] = unknown; } if (base_vtables[j] == base_vtable) { break; } else if (base_vtables[j] == NULL) { goto bad; } base = base->tp_base; } } } PyErr_Clear(); free(base_vtables); return 0; bad: tp_base_name = __Pyx_PyType_GetName(type->tp_base); base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i)); PyErr_Format(PyExc_TypeError, "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name); __Pyx_DECREF_TypeName(tp_base_name); __Pyx_DECREF_TypeName(base_name); free(base_vtables); return -1; } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_11 #define __PYX_HAVE_RT_ImportType_3_0_11 static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_11 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_11 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* PatchInspect */ static PyObject* __Pyx_patch_inspect(PyObject* module) { #if defined(__Pyx_Generator_USED) && (!defined(CYTHON_PATCH_INSPECT) || CYTHON_PATCH_INSPECT) static int inspect_patched = 0; if (unlikely((!inspect_patched) && module)) { module = __Pyx_Coroutine_patch_module( module, "" "old_types = getattr(_module.isgenerator, '_cython_generator_types', None)\n" "if old_types is None or not isinstance(old_types, set):\n" " old_types = set()\n" " def cy_wrap(orig_func, type=type, cython_generator_types=old_types):\n" " def cy_isgenerator(obj): return type(obj) in cython_generator_types or orig_func(obj)\n" " cy_isgenerator._cython_generator_types = cython_generator_types\n" " return cy_isgenerator\n" " _module.isgenerator = cy_wrap(_module.isgenerator)\n" "old_types.add(_cython_generator_type)\n" ); inspect_patched = 1; } #else if ((0)) return __Pyx_Coroutine_patch_module(module, NULL); #endif return module; } /* PatchAsyncIO */ static PyObject* __Pyx_patch_asyncio(PyObject* module) { #if PY_VERSION_HEX < 0x030500B2 &&\ (defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED)) &&\ (!defined(CYTHON_PATCH_ASYNCIO) || CYTHON_PATCH_ASYNCIO) PyObject *patch_module = NULL; static int asyncio_patched = 0; if (unlikely((!asyncio_patched) && module)) { PyObject *package; package = __Pyx_Import(__pyx_n_s_asyncio_coroutines, NULL, 0); if (package) { patch_module = __Pyx_Coroutine_patch_module( PyObject_GetAttrString(package, "coroutines"), "" "try:\n" " coro_types = _module._COROUTINE_TYPES\n" "except AttributeError: pass\n" "else:\n" " if _cython_coroutine_type is not None and _cython_coroutine_type not in coro_types:\n" " coro_types = tuple(coro_types) + (_cython_coroutine_type,)\n" " if _cython_generator_type is not None and _cython_generator_type not in coro_types:\n" " coro_types = tuple(coro_types) + (_cython_generator_type,)\n" "_module._COROUTINE_TYPES = coro_types\n" ); } else { PyErr_Clear(); package = __Pyx_Import(__pyx_n_s_asyncio_tasks, NULL, 0); if (unlikely(!package)) goto asyncio_done; patch_module = __Pyx_Coroutine_patch_module( PyObject_GetAttrString(package, "tasks"), "" "if hasattr(_module, 'iscoroutine'):\n" " old_types = getattr(_module.iscoroutine, '_cython_coroutine_types', None)\n" " if old_types is None or not isinstance(old_types, set):\n" " old_types = set()\n" " def cy_wrap(orig_func, type=type, cython_coroutine_types=old_types):\n" " def cy_iscoroutine(obj): return type(obj) in cython_coroutine_types or orig_func(obj)\n" " cy_iscoroutine._cython_coroutine_types = cython_coroutine_types\n" " return cy_iscoroutine\n" " _module.iscoroutine = cy_wrap(_module.iscoroutine)\n" " if _cython_coroutine_type is not None:\n" " old_types.add(_cython_coroutine_type)\n" " if _cython_generator_type is not None:\n" " old_types.add(_cython_generator_type)\n" ); } Py_DECREF(package); if (unlikely(!patch_module)) goto ignore; asyncio_done: PyErr_Clear(); asyncio_patched = 1; #ifdef __Pyx_Generator_USED { PyObject *inspect_module; if (patch_module) { inspect_module = PyObject_GetAttr(patch_module, __pyx_n_s_inspect); Py_DECREF(patch_module); } else { inspect_module = __Pyx_Import(__pyx_n_s_inspect, NULL, 0); } if (unlikely(!inspect_module)) goto ignore; inspect_module = __Pyx_patch_inspect(inspect_module); if (unlikely(!inspect_module)) { Py_DECREF(module); module = NULL; } Py_XDECREF(inspect_module); } #else if ((0)) return __Pyx_patch_inspect(module); #endif } return module; ignore: PyErr_WriteUnraisable(module); if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch asyncio package with custom generator type", 1) < 0)) { Py_DECREF(module); module = NULL; } #else if ((0)) return __Pyx_patch_inspect(__Pyx_Coroutine_patch_module(module, NULL)); #endif return module; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_MACROS nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); if (nbases < 0) return NULL; #endif for (i=0; i < nbases; i++) { PyTypeObject *tmptype; #if CYTHON_ASSUME_SAFE_MACROS PyObject *tmp = PyTuple_GET_ITEM(bases, i); #else PyObject *tmp = PyTuple_GetItem(bases, i); if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare_2); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_DECREF(prep); } else { if (unlikely(PyErr_Occurred())) return NULL; ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; #if PY_VERSION_HEX >= 0x03030000 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; #else CYTHON_MAYBE_UNUSED_VAR(qualname); #endif if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS static int __Pyx_SetNamesPEP487(PyObject *type_obj) { PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *names_to_set, *key, *value, *set_name, *tmp; Py_ssize_t i = 0; #if CYTHON_USE_TYPE_SLOTS names_to_set = PyDict_Copy(type->tp_dict); #else { PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); names_to_set = NULL; if (likely(d)) { PyObject *names_to_set = PyDict_New(); int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; Py_DECREF(d); if (unlikely(ret < 0)) Py_CLEAR(names_to_set); } } #endif if (unlikely(names_to_set == NULL)) goto bad; while (PyDict_Next(names_to_set, &i, &key, &value)) { set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); if (unlikely(set_name != NULL)) { tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); Py_DECREF(set_name); if (unlikely(tmp == NULL)) { __Pyx_TypeName value_type_name = __Pyx_PyType_GetName(Py_TYPE(value)); __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_RuntimeError, #if PY_MAJOR_VERSION >= 3 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", value_type_name, key, type_name); #else "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", value_type_name, PyString_Check(key) ? PyString_AS_STRING(key) : "?", type_name); #endif goto bad; } else { Py_DECREF(tmp); } } else if (unlikely(PyErr_Occurred())) { goto bad; } } Py_DECREF(names_to_set); return 0; bad: Py_XDECREF(names_to_set); return -1; } static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *mro = type->tp_mro; Py_ssize_t i, nbases; if (unlikely(!mro)) goto done; (void) &__Pyx_GetBuiltinName; Py_INCREF(mro); nbases = PyTuple_GET_SIZE(mro); assert(PyTuple_GET_ITEM(mro, 0) == type_obj); for (i = 1; i < nbases-1; i++) { PyObject *base, *dict, *meth; base = PyTuple_GET_ITEM(mro, i); dict = ((PyTypeObject *)base)->tp_dict; meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); if (unlikely(meth)) { descrgetfunc f = Py_TYPE(meth)->tp_descr_get; PyObject *res; Py_INCREF(meth); if (likely(f)) { res = f(meth, NULL, type_obj); Py_DECREF(meth); if (unlikely(!res)) goto bad; meth = res; } res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); Py_DECREF(meth); if (unlikely(!res)) goto bad; Py_DECREF(res); goto done; } else if (unlikely(PyErr_Occurred())) { goto bad; } } done: Py_XDECREF(mro); return type_obj; bad: Py_XDECREF(mro); Py_DECREF(type_obj); return NULL; #else PyObject *super_type, *super, *func, *res; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); #else super_type = (PyObject*) &PySuper_Type; (void) &__Pyx_GetBuiltinName; #endif super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) Py_XDECREF(super_type); #endif if (unlikely(!super)) { Py_CLEAR(type_obj); goto done; } func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); Py_DECREF(super); if (likely(!func)) { if (unlikely(PyErr_Occurred())) Py_CLEAR(type_obj); goto done; } res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); Py_DECREF(func); if (unlikely(!res)) Py_CLEAR(type_obj); Py_XDECREF(res); done: return type_obj; #endif } #endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result; PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, #if PY_VERSION_HEX < 0x030600A4 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw #else mkw #endif ); Py_XDECREF(owned_metaclass); #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS if (likely(result) && likely(PyType_Check(result))) { if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { Py_CLEAR(result); } else { result = __Pyx_InitSubclassPEP487(result, mkw); } } #else (void) &__Pyx_GetBuiltinName; #endif return result; } /* Py3UpdateBases */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; PyObject *base, *meth, *new_base, *result, *new_bases = NULL; size_bases = PyTuple_GET_SIZE(bases); for (i = 0; i < size_bases; i++) { base = PyTuple_GET_ITEM(bases, i); if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } if (!meth) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } new_base = __Pyx_PyObject_CallOneArg(meth, bases); Py_DECREF(meth); if (!new_base) { goto error; } if (!PyTuple_Check(new_base)) { PyErr_SetString(PyExc_TypeError, "__mro_entries__ must return a tuple"); Py_DECREF(new_base); goto error; } if (!new_bases) { if (!(new_bases = PyList_New(i))) { goto error; } for (j = 0; j < i; j++) { base = PyTuple_GET_ITEM(bases, j); PyList_SET_ITEM(new_bases, j, base); Py_INCREF(base); } } j = PyList_GET_SIZE(new_bases); if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } Py_DECREF(new_base); } if (!new_bases) { Py_INCREF(bases); return bases; } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); return result; error: Py_XDECREF(new_bases); return NULL; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* UnicodeAsUCS4 */ static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { Py_ssize_t length; #if CYTHON_PEP393_ENABLED length = PyUnicode_GET_LENGTH(x); if (likely(length == 1)) { return PyUnicode_READ_CHAR(x, 0); } #else length = PyUnicode_GET_SIZE(x); if (likely(length == 1)) { return PyUnicode_AS_UNICODE(x)[0]; } #if Py_UNICODE_SIZE == 2 else if (PyUnicode_GET_SIZE(x) == 2) { Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0]; if (high_val >= 0xD800 && high_val <= 0xDBFF) { Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1]; if (low_val >= 0xDC00 && low_val <= 0xDFFF) { return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1))); } } } #endif #endif PyErr_Format(PyExc_ValueError, "only single character unicode strings can be converted to Py_UCS4, " "got length %" CYTHON_FORMAT_SSIZE_T "d", length); return (Py_UCS4)-1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int32_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int32_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int32_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int32_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { int32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int32_t) -1; val = __Pyx_PyInt_As_int32_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) >= 2 * PyLong_SHIFT)) { return (int32_t) (((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); } } break; case 3: if ((8 * sizeof(int32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) >= 3 * PyLong_SHIFT)) { return (int32_t) (((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); } } break; case 4: if ((8 * sizeof(int32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) >= 4 * PyLong_SHIFT)) { return (int32_t) (((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int32_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int32_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { return (int32_t) (((int32_t)-1)*(((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case 2: if ((8 * sizeof(int32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { return (int32_t) ((((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case -3: if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { return (int32_t) (((int32_t)-1)*(((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case 3: if ((8 * sizeof(int32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { return (int32_t) ((((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case -4: if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT)) { return (int32_t) (((int32_t)-1)*(((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; case 4: if ((8 * sizeof(int32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT)) { return (int32_t) ((((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); } } break; } } #endif if ((sizeof(int32_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int32_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int32_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int32_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int32_t) -1; } else { stepval = v; } v = NULL; val = (int32_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int32_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int32_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int32_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int32_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int32_t) 1) << (sizeof(int32_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int32_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int32_t"); return (int32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int32_t"); return (int32_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) val; } } #endif if (unlikely(!PyLong_Check(x))) { enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) -1; val = __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) >= 2 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) (((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0])); } } break; case 3: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) >= 3 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) (((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0])); } } break; case 4: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) >= 4 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) (((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 2 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)-1)*(((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0]))); } } break; case 2: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 2 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) ((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0]))); } } break; case -3: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 3 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)-1)*(((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0]))); } } break; case 3: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 3 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) ((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0]))); } } break; case -4: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 4 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)-1)*(((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0]))); } } break; case 4: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 4 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) ((((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0]))); } } break; } } #endif if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums"); val = (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) -1; #endif if (unlikely(ret)) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus"); return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus"); return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) val; } } #endif if (unlikely(!PyLong_Check(x))) { enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) -1; val = __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) >= 2 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) (((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0])); } } break; case 3: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) >= 3 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) (((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0])); } } break; case 4: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) >= 4 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) (((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 2 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)-1)*(((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0]))); } } break; case 2: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 2 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) ((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0]))); } } break; case -3: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 3 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)-1)*(((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0]))); } } break; case 3: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 3 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) ((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0]))); } } break; case -4: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 4 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)-1)*(((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0]))); } } break; case 4: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 4 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) ((((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0]))); } } break; } } #endif if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums"); val = (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) -1; #endif if (unlikely(ret)) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType"); return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType"); return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) val; } } #endif if (unlikely(!PyLong_Check(x))) { enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1; val = __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) >= 2 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) (((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0])); } } break; case 3: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) >= 3 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) (((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0])); } } break; case 4: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) >= 4 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) (((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 2 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)-1)*(((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0]))); } } break; case 2: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 2 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) ((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0]))); } } break; case -3: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 3 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)-1)*(((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0]))); } } break; case 3: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 3 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) ((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0]))); } } break; case -4: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 4 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)-1)*(((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0]))); } } break; case 4: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 4 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) ((((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0]))); } } break; } } #endif if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums"); val = (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1; #endif if (unlikely(ret)) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState"); return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState"); return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) val; } } #endif if (unlikely(!PyLong_Check(x))) { enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) -1; val = __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) >= 2 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) (((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0])); } } break; case 3: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) >= 3 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) (((((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0])); } } break; case 4: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) >= 4 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) (((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 2 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) (((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)-1)*(((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0]))); } } break; case 2: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 2 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) ((((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0]))); } } break; case -3: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 3 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) (((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)-1)*(((((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0]))); } } break; case 3: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 3 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) ((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0]))); } } break; case -4: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 4 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) (((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)-1)*(((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0]))); } } break; case 4: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 4 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) ((((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0]))); } } break; } } #endif if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums"); val = (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) -1; #endif if (unlikely(ret)) return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus"); return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus"); return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(uint64_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint64_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint64_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint64_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint64_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { uint64_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint64_t) -1; val = __Pyx_PyInt_As_uint64_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint64_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint64_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint64_t) >= 2 * PyLong_SHIFT)) { return (uint64_t) (((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint64_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint64_t) >= 3 * PyLong_SHIFT)) { return (uint64_t) (((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint64_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint64_t) >= 4 * PyLong_SHIFT)) { return (uint64_t) (((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint64_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint64_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint64_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint64_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT)) { return (uint64_t) (((uint64_t)-1)*(((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint64_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT)) { return (uint64_t) ((((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT)) { return (uint64_t) (((uint64_t)-1)*(((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint64_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT)) { return (uint64_t) ((((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT)) { return (uint64_t) (((uint64_t)-1)*(((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint64_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT)) { return (uint64_t) ((((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]))); } } break; } } #endif if ((sizeof(uint64_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint64_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint64_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint64_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (uint64_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (uint64_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (uint64_t) -1; } else { stepval = v; } v = NULL; val = (uint64_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint64_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((uint64_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint64_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint64_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((uint64_t) 1) << (sizeof(uint64_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (uint64_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint64_t"); return (uint64_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint64_t"); return (uint64_t) -1; } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(uint32_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT)) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT)) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT)) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(uint32_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } } #endif if ((sizeof(uint32_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(uint32_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { uint32_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (uint32_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (uint32_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (uint32_t) -1; } else { stepval = v; } v = NULL; val = (uint32_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(uint32_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((uint32_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(uint32_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((uint32_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((uint32_t) 1) << (sizeof(uint32_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (uint32_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* CIntFromPy */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) val; } } #endif if (unlikely(!PyLong_Check(x))) { enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) -1; val = __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) >= 2 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) (((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0])); } } break; case 3: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) >= 3 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) (((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0])); } } break; case 4: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) >= 4 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) (((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 2 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)-1)*(((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0]))); } } break; case 2: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 2 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) ((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0]))); } } break; case -3: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 3 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)-1)*(((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0]))); } } break; case 3: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 3 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) ((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0]))); } } break; case -4: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 4 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)-1)*(((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0]))); } } break; case 4: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 4 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) ((((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0]))); } } break; } } #endif if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums"); val = (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) -1; #endif if (unlikely(ret)) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat"); return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat"); return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_7asyncpg_8protocol_8protocol_CodecType(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint32_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) val; } } #endif if (unlikely(!PyLong_Check(x))) { enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) -1; val = __Pyx_PyInt_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) >= 2 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) (((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0])); } } break; case 3: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) >= 3 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) (((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0])); } } break; case 4: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) >= 4 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) (((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 2 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)-1)*(((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0]))); } } break; case 2: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 2 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) ((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0]))); } } break; case -3: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 3 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)-1)*(((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0]))); } } break; case 3: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 3 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) ((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0]))); } } break; case -4: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 4 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)-1)*(((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0]))); } } break; case 4: if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 4 * PyLong_SHIFT)) { return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) ((((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0]))); } } break; } } #endif if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums"); val = (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) -1; #endif if (unlikely(ret)) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat"); return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat"); return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) -1; } /* CIntFromPy */ static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int64_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int64_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { int64_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int64_t) -1; val = __Pyx_PyInt_As_int64_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int64_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) >= 2 * PyLong_SHIFT)) { return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; case 3: if ((8 * sizeof(int64_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) >= 3 * PyLong_SHIFT)) { return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; case 4: if ((8 * sizeof(int64_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) >= 4 * PyLong_SHIFT)) { return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int64_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int64_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 2: if ((8 * sizeof(int64_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case -3: if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 3: if ((8 * sizeof(int64_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case -4: if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT)) { return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 4: if ((8 * sizeof(int64_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT)) { return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; } } #endif if ((sizeof(int64_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int64_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int64_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int64_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int64_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int64_t) -1; } else { stepval = v; } v = NULL; val = (int64_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int64_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int64_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int64_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int64_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int64_t) 1) << (sizeof(int64_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int64_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int64_t"); return (int64_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int64_t"); return (int64_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int64_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int64_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = (ptrdiff_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(ptrdiff_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ptrdiff_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(ptrdiff_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ptrdiff_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(ptrdiff_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(ptrdiff_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const char neg_one = (char) -1, const_zero = (char) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(char) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(char) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(char) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(char), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(char)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int16_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int16_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* ObjectAsUCS4 */ static Py_UCS4 __Pyx__PyObject_AsPy_UCS4_raise_error(long ival) { if (ival < 0) { if (!PyErr_Occurred()) PyErr_SetString(PyExc_OverflowError, "cannot convert negative value to Py_UCS4"); } else { PyErr_SetString(PyExc_OverflowError, "value too large to convert to Py_UCS4"); } return (Py_UCS4)-1; } static Py_UCS4 __Pyx__PyObject_AsPy_UCS4(PyObject* x) { long ival; ival = __Pyx_PyInt_As_long(x); if (unlikely(!__Pyx_is_valid_index(ival, 1114111 + 1))) { return __Pyx__PyObject_AsPy_UCS4_raise_error(ival); } return (Py_UCS4)ival; } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name_2); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__167); } return name; } #endif /* Generator */ static PyMethodDef __pyx_Generator_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, {0, 0, 0, 0} }; static PyMemberDef __pyx_Generator_memberlist[] = { {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, #if CYTHON_USE_TYPE_SPECS {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, #endif {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Generator_getsets[] = { {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, (char*) PyDoc_STR("name of the generator"), 0}, {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, (char*) PyDoc_STR("qualified name of the generator"), 0}, {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, (char*) PyDoc_STR("Frame of the generator"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_GeneratorType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc}, {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse}, {Py_tp_iter, (void *)PyObject_SelfIter}, {Py_tp_iternext, (void *)__Pyx_Generator_Next}, {Py_tp_methods, (void *)__pyx_Generator_methods}, {Py_tp_members, (void *)__pyx_Generator_memberlist}, {Py_tp_getset, (void *)__pyx_Generator_getsets}, {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict}, #if CYTHON_USE_TP_FINALIZE {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, #endif {0, 0}, }; static PyType_Spec __pyx_GeneratorType_spec = { __PYX_TYPE_MODULE_PREFIX "generator", sizeof(__pyx_CoroutineObject), 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, __pyx_GeneratorType_slots }; #else static PyTypeObject __pyx_GeneratorType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "generator", sizeof(__pyx_CoroutineObject), 0, (destructor) __Pyx_Coroutine_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, 0, (traverseproc) __Pyx_Coroutine_traverse, 0, 0, offsetof(__pyx_CoroutineObject, gi_weakreflist), 0, (iternextfunc) __Pyx_Generator_Next, __pyx_Generator_methods, __pyx_Generator_memberlist, __pyx_Generator_getsets, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if CYTHON_USE_TP_FINALIZE 0, #else __Pyx_Coroutine_del, #endif 0, #if CYTHON_USE_TP_FINALIZE __Pyx_Coroutine_del, #elif PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_Generator_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); #endif if (unlikely(!__pyx_GeneratorType)) { return -1; } return 0; } /* IterableCoroutine */ #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_IterableCoroutineType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc}, {Py_am_await, (void *)&__Pyx_Coroutine_await}, {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse}, {Py_tp_iter, (void *)__Pyx_Coroutine_await}, {Py_tp_iternext, (void *)__Pyx_Generator_Next}, {Py_tp_methods, (void *)__pyx_Coroutine_methods}, {Py_tp_members, (void *)__pyx_Coroutine_memberlist}, {Py_tp_getset, (void *)__pyx_Coroutine_getsets}, {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict}, #if CYTHON_USE_TP_FINALIZE {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, #endif {0, 0}, }; static PyType_Spec __pyx_IterableCoroutineType_spec = { __PYX_TYPE_MODULE_PREFIX "iterable_coroutine", sizeof(__pyx_CoroutineObject), 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, __pyx_IterableCoroutineType_slots }; #else static PyTypeObject __pyx_IterableCoroutineType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "iterable_coroutine", sizeof(__pyx_CoroutineObject), 0, (destructor) __Pyx_Coroutine_dealloc, 0, 0, 0, #if CYTHON_USE_ASYNC_SLOTS &__pyx_Coroutine_as_async, #else 0, #endif 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, 0, (traverseproc) __Pyx_Coroutine_traverse, 0, #if CYTHON_USE_ASYNC_SLOTS && CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 && PY_VERSION_HEX < 0x030500B1 __Pyx_Coroutine_compare, #else 0, #endif offsetof(__pyx_CoroutineObject, gi_weakreflist), __Pyx_Coroutine_await, (iternextfunc) __Pyx_Generator_Next, __pyx_Coroutine_methods, __pyx_Coroutine_memberlist, __pyx_Coroutine_getsets, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #else __Pyx_Coroutine_del, #endif 0, #if PY_VERSION_HEX >= 0x030400a1 && !CYTHON_COMPILING_IN_PYPY __Pyx_Coroutine_del, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_IterableCoroutine_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_IterableCoroutineType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_IterableCoroutineType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_IterableCoroutineType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; __pyx_IterableCoroutineType = __Pyx_FetchCommonType(&__pyx_IterableCoroutineType_type); #endif if (unlikely(!__pyx_IterableCoroutineType)) return -1; return 0; } /* CheckBinaryVersion */ static unsigned long __Pyx_get_runtime_version(void) { #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* VoidPtrExport */ static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) { PyObject *d; PyObject *cobj = 0; d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi); Py_XINCREF(d); if (!d) { d = PyDict_New(); if (!d) goto bad; if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0) goto bad; } cobj = PyCapsule_New(p, sig, 0); if (!cobj) goto bad; if (PyDict_SetItem(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* FunctionImport */ #ifndef __PYX_HAVE_RT_ImportFunction_3_0_11 #define __PYX_HAVE_RT_ImportFunction_3_0_11 static int __Pyx_ImportFunction_3_0_11(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/protocol.pxd0000644000175100001770000000360714705014413020533 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 from libc.stdint cimport int16_t, int32_t, uint16_t, \ uint32_t, int64_t, uint64_t from asyncpg.pgproto.debug cimport PG_DEBUG from asyncpg.pgproto.pgproto cimport ( WriteBuffer, ReadBuffer, FRBuffer, ) from asyncpg.pgproto cimport pgproto include "consts.pxi" include "pgtypes.pxi" include "codecs/base.pxd" include "settings.pxd" include "coreproto.pxd" include "prepared_stmt.pxd" cdef class BaseProtocol(CoreProtocol): cdef: object loop ConnectionSettings settings object cancel_sent_waiter object cancel_waiter object waiter bint return_extra object create_future object timeout_handle object conref type record_class bint is_reading str last_query bint writing_paused bint closing readonly uint64_t queries_count bint _is_ssl PreparedStatementState statement cdef get_connection(self) cdef _get_timeout_impl(self, timeout) cdef _check_state(self) cdef _new_waiter(self, timeout) cdef _coreproto_error(self) cdef _on_result__connect(self, object waiter) cdef _on_result__prepare(self, object waiter) cdef _on_result__bind_and_exec(self, object waiter) cdef _on_result__close_stmt_or_portal(self, object waiter) cdef _on_result__simple_query(self, object waiter) cdef _on_result__bind(self, object waiter) cdef _on_result__copy_out(self, object waiter) cdef _on_result__copy_in(self, object waiter) cdef _handle_waiter_on_connection_lost(self, cause) cdef _dispatch_result(self) cdef inline resume_reading(self) cdef inline pause_reading(self) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/protocol.pyi0000644000175100001770000002300414705014413020532 0ustar00runnerdockerimport asyncio import asyncio.protocols import hmac from codecs import CodecInfo from collections.abc import Callable, Iterable, Iterator, Sequence from hashlib import md5, sha256 from typing import ( Any, ClassVar, Final, Generic, Literal, NewType, TypeVar, final, overload, ) from typing_extensions import TypeAlias import asyncpg.pgproto.pgproto from ..connect_utils import _ConnectionParameters from ..pgproto.pgproto import WriteBuffer from ..types import Attribute, Type _T = TypeVar('_T') _Record = TypeVar('_Record', bound=Record) _OtherRecord = TypeVar('_OtherRecord', bound=Record) _PreparedStatementState = TypeVar( '_PreparedStatementState', bound=PreparedStatementState[Any] ) _NoTimeoutType = NewType('_NoTimeoutType', object) _TimeoutType: TypeAlias = float | None | _NoTimeoutType BUILTIN_TYPE_NAME_MAP: Final[dict[str, int]] BUILTIN_TYPE_OID_MAP: Final[dict[int, str]] NO_TIMEOUT: Final[_NoTimeoutType] hashlib_md5 = md5 @final class ConnectionSettings(asyncpg.pgproto.pgproto.CodecContext): __pyx_vtable__: Any def __init__(self, conn_key: object) -> None: ... def add_python_codec( self, typeoid: int, typename: str, typeschema: str, typeinfos: Iterable[object], typekind: str, encoder: Callable[[Any], Any], decoder: Callable[[Any], Any], format: object, ) -> Any: ... def clear_type_cache(self) -> None: ... def get_data_codec( self, oid: int, format: object = ..., ignore_custom_codec: bool = ... ) -> Any: ... def get_text_codec(self) -> CodecInfo: ... def register_data_types(self, types: Iterable[object]) -> None: ... def remove_python_codec( self, typeoid: int, typename: str, typeschema: str ) -> None: ... def set_builtin_type_codec( self, typeoid: int, typename: str, typeschema: str, typekind: str, alias_to: str, format: object = ..., ) -> Any: ... def __getattr__(self, name: str) -> Any: ... def __reduce__(self) -> Any: ... @final class PreparedStatementState(Generic[_Record]): closed: bool prepared: bool name: str query: str refs: int record_class: type[_Record] ignore_custom_codec: bool __pyx_vtable__: Any def __init__( self, name: str, query: str, protocol: BaseProtocol[Any], record_class: type[_Record], ignore_custom_codec: bool, ) -> None: ... def _get_parameters(self) -> tuple[Type, ...]: ... def _get_attributes(self) -> tuple[Attribute, ...]: ... def _init_types(self) -> set[int]: ... def _init_codecs(self) -> None: ... def attach(self) -> None: ... def detach(self) -> None: ... def mark_closed(self) -> None: ... def mark_unprepared(self) -> None: ... def __reduce__(self) -> Any: ... class CoreProtocol: backend_pid: Any backend_secret: Any __pyx_vtable__: Any def __init__(self, addr: object, con_params: _ConnectionParameters) -> None: ... def is_in_transaction(self) -> bool: ... def __reduce__(self) -> Any: ... class BaseProtocol(CoreProtocol, Generic[_Record]): queries_count: Any is_ssl: bool __pyx_vtable__: Any def __init__( self, addr: object, connected_fut: object, con_params: _ConnectionParameters, record_class: type[_Record], loop: object, ) -> None: ... def set_connection(self, connection: object) -> None: ... def get_server_pid(self, *args: object, **kwargs: object) -> int: ... def get_settings(self, *args: object, **kwargs: object) -> ConnectionSettings: ... def get_record_class(self) -> type[_Record]: ... def abort(self) -> None: ... async def bind( self, state: PreparedStatementState[_OtherRecord], args: Sequence[object], portal_name: str, timeout: _TimeoutType, ) -> Any: ... @overload async def bind_execute( self, state: PreparedStatementState[_OtherRecord], args: Sequence[object], portal_name: str, limit: int, return_extra: Literal[False], timeout: _TimeoutType, ) -> list[_OtherRecord]: ... @overload async def bind_execute( self, state: PreparedStatementState[_OtherRecord], args: Sequence[object], portal_name: str, limit: int, return_extra: Literal[True], timeout: _TimeoutType, ) -> tuple[list[_OtherRecord], bytes, bool]: ... @overload async def bind_execute( self, state: PreparedStatementState[_OtherRecord], args: Sequence[object], portal_name: str, limit: int, return_extra: bool, timeout: _TimeoutType, ) -> list[_OtherRecord] | tuple[list[_OtherRecord], bytes, bool]: ... async def bind_execute_many( self, state: PreparedStatementState[_OtherRecord], args: Iterable[Sequence[object]], portal_name: str, timeout: _TimeoutType, ) -> None: ... async def close(self, timeout: _TimeoutType) -> None: ... def _get_timeout(self, timeout: _TimeoutType) -> float | None: ... def _is_cancelling(self) -> bool: ... async def _wait_for_cancellation(self) -> None: ... async def close_statement( self, state: PreparedStatementState[_OtherRecord], timeout: _TimeoutType ) -> Any: ... async def copy_in(self, *args: object, **kwargs: object) -> str: ... async def copy_out(self, *args: object, **kwargs: object) -> str: ... async def execute(self, *args: object, **kwargs: object) -> Any: ... def is_closed(self, *args: object, **kwargs: object) -> Any: ... def is_connected(self, *args: object, **kwargs: object) -> Any: ... def data_received(self, data: object) -> None: ... def connection_made(self, transport: object) -> None: ... def connection_lost(self, exc: Exception | None) -> None: ... def pause_writing(self, *args: object, **kwargs: object) -> Any: ... @overload async def prepare( self, stmt_name: str, query: str, timeout: float | None = ..., *, state: _PreparedStatementState, ignore_custom_codec: bool = ..., record_class: None, ) -> _PreparedStatementState: ... @overload async def prepare( self, stmt_name: str, query: str, timeout: float | None = ..., *, state: None = ..., ignore_custom_codec: bool = ..., record_class: type[_OtherRecord], ) -> PreparedStatementState[_OtherRecord]: ... async def close_portal(self, portal_name: str, timeout: _TimeoutType) -> None: ... async def query(self, *args: object, **kwargs: object) -> str: ... def resume_writing(self, *args: object, **kwargs: object) -> Any: ... def __reduce__(self) -> Any: ... @final class Codec: __pyx_vtable__: Any def __reduce__(self) -> Any: ... class DataCodecConfig: __pyx_vtable__: Any def __init__(self) -> None: ... def add_python_codec( self, typeoid: int, typename: str, typeschema: str, typekind: str, typeinfos: Iterable[object], encoder: Callable[[ConnectionSettings, WriteBuffer, object], object], decoder: Callable[..., object], format: object, xformat: object, ) -> Any: ... def add_types(self, types: Iterable[object]) -> Any: ... def clear_type_cache(self) -> None: ... def declare_fallback_codec(self, oid: int, name: str, schema: str) -> Codec: ... def remove_python_codec( self, typeoid: int, typename: str, typeschema: str ) -> Any: ... def set_builtin_type_codec( self, typeoid: int, typename: str, typeschema: str, typekind: str, alias_to: str, format: object = ..., ) -> Any: ... def __reduce__(self) -> Any: ... class Protocol(BaseProtocol[_Record], asyncio.protocols.Protocol): ... class Record: @overload def get(self, key: str) -> Any | None: ... @overload def get(self, key: str, default: _T) -> Any | _T: ... def items(self) -> Iterator[tuple[str, Any]]: ... def keys(self) -> Iterator[str]: ... def values(self) -> Iterator[Any]: ... @overload def __getitem__(self, index: str) -> Any: ... @overload def __getitem__(self, index: int) -> Any: ... @overload def __getitem__(self, index: slice) -> tuple[Any, ...]: ... def __iter__(self) -> Iterator[Any]: ... def __contains__(self, x: object) -> bool: ... def __len__(self) -> int: ... class Timer: def __init__(self, budget: float | None) -> None: ... def __enter__(self) -> None: ... def __exit__(self, et: object, e: object, tb: object) -> None: ... def get_remaining_budget(self) -> float: ... def has_budget_greater_than(self, amount: float) -> bool: ... @final class SCRAMAuthentication: AUTHENTICATION_METHODS: ClassVar[list[str]] DEFAULT_CLIENT_NONCE_BYTES: ClassVar[int] DIGEST = sha256 REQUIREMENTS_CLIENT_FINAL_MESSAGE: ClassVar[list[str]] REQUIREMENTS_CLIENT_PROOF: ClassVar[list[str]] SASLPREP_PROHIBITED: ClassVar[tuple[Callable[[str], bool], ...]] authentication_method: bytes authorization_message: bytes | None client_channel_binding: bytes client_first_message_bare: bytes | None client_nonce: bytes | None client_proof: bytes | None password_salt: bytes | None password_iterations: int server_first_message: bytes | None server_key: hmac.HMAC | None server_nonce: bytes | None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/protocol.pyx0000644000175100001770000010404214705014413020553 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 # cython: language_level=3 cimport cython cimport cpython import asyncio import builtins import codecs import collections.abc import socket import time import weakref from asyncpg.pgproto.pgproto cimport ( WriteBuffer, ReadBuffer, FRBuffer, frb_init, frb_read, frb_read_all, frb_slice_from, frb_check, frb_set_len, frb_get_len, ) from asyncpg.pgproto cimport pgproto from asyncpg.protocol cimport cpythonx from asyncpg.protocol cimport record from libc.stdint cimport int8_t, uint8_t, int16_t, uint16_t, \ int32_t, uint32_t, int64_t, uint64_t, \ INT32_MAX, UINT32_MAX from asyncpg.exceptions import _base as apg_exc_base from asyncpg import compat from asyncpg import types as apg_types from asyncpg import exceptions as apg_exc from asyncpg.pgproto cimport hton include "consts.pxi" include "pgtypes.pxi" include "encodings.pyx" include "settings.pyx" include "codecs/base.pyx" include "codecs/textutils.pyx" # register codecs provided by pgproto include "codecs/pgproto.pyx" # nonscalar include "codecs/array.pyx" include "codecs/range.pyx" include "codecs/record.pyx" include "coreproto.pyx" include "prepared_stmt.pyx" NO_TIMEOUT = object() cdef class BaseProtocol(CoreProtocol): def __init__(self, addr, connected_fut, con_params, record_class: type, loop): # type of `con_params` is `_ConnectionParameters` CoreProtocol.__init__(self, addr, con_params) self.loop = loop self.transport = None self.waiter = connected_fut self.cancel_waiter = None self.cancel_sent_waiter = None self.settings = ConnectionSettings((addr, con_params.database)) self.record_class = record_class self.statement = None self.return_extra = False self.last_query = None self.closing = False self.is_reading = True self.writing_allowed = asyncio.Event() self.writing_allowed.set() self.timeout_handle = None self.queries_count = 0 self._is_ssl = False try: self.create_future = loop.create_future except AttributeError: self.create_future = self._create_future_fallback def set_connection(self, connection): self.conref = weakref.ref(connection) cdef get_connection(self): if self.conref is not None: return self.conref() else: return None def get_server_pid(self): return self.backend_pid def get_settings(self): return self.settings def get_record_class(self): return self.record_class cdef inline resume_reading(self): if not self.is_reading: self.is_reading = True self.transport.resume_reading() cdef inline pause_reading(self): if self.is_reading: self.is_reading = False self.transport.pause_reading() @cython.iterable_coroutine async def prepare(self, stmt_name, query, timeout, *, PreparedStatementState state=None, ignore_custom_codec=False, record_class): if self.cancel_waiter is not None: await self.cancel_waiter if self.cancel_sent_waiter is not None: await self.cancel_sent_waiter self.cancel_sent_waiter = None self._check_state() timeout = self._get_timeout_impl(timeout) waiter = self._new_waiter(timeout) try: self._prepare_and_describe(stmt_name, query) # network op self.last_query = query if state is None: state = PreparedStatementState( stmt_name, query, self, record_class, ignore_custom_codec) self.statement = state except Exception as ex: waiter.set_exception(ex) self._coreproto_error() finally: return await waiter @cython.iterable_coroutine async def bind_execute( self, state: PreparedStatementState, args, portal_name: str, limit: int, return_extra: bool, timeout, ): if self.cancel_waiter is not None: await self.cancel_waiter if self.cancel_sent_waiter is not None: await self.cancel_sent_waiter self.cancel_sent_waiter = None self._check_state() timeout = self._get_timeout_impl(timeout) args_buf = state._encode_bind_msg(args) waiter = self._new_waiter(timeout) try: if not state.prepared: self._send_parse_message(state.name, state.query) self._bind_execute( portal_name, state.name, args_buf, limit) # network op self.last_query = state.query self.statement = state self.return_extra = return_extra self.queries_count += 1 except Exception as ex: waiter.set_exception(ex) self._coreproto_error() finally: return await waiter @cython.iterable_coroutine async def bind_execute_many( self, state: PreparedStatementState, args, portal_name: str, timeout, return_rows: bool, ): if self.cancel_waiter is not None: await self.cancel_waiter if self.cancel_sent_waiter is not None: await self.cancel_sent_waiter self.cancel_sent_waiter = None self._check_state() timeout = self._get_timeout_impl(timeout) timer = Timer(timeout) # Make sure the argument sequence is encoded lazily with # this generator expression to keep the memory pressure under # control. data_gen = (state._encode_bind_msg(b, i) for i, b in enumerate(args)) arg_bufs = iter(data_gen) waiter = self._new_waiter(timeout) try: if not state.prepared: self._send_parse_message(state.name, state.query) more = self._bind_execute_many( portal_name, state.name, arg_bufs, return_rows) # network op self.last_query = state.query self.statement = state self.return_extra = False self.queries_count += 1 while more: with timer: await compat.wait_for( self.writing_allowed.wait(), timeout=timer.get_remaining_budget()) # On Windows the above event somehow won't allow context # switch, so forcing one with sleep(0) here await asyncio.sleep(0) if not timer.has_budget_greater_than(0): raise asyncio.TimeoutError more = self._bind_execute_many_more() # network op except asyncio.TimeoutError as e: self._bind_execute_many_fail(e) # network op except Exception as ex: waiter.set_exception(ex) self._coreproto_error() finally: return await waiter @cython.iterable_coroutine async def bind(self, PreparedStatementState state, args, str portal_name, timeout): if self.cancel_waiter is not None: await self.cancel_waiter if self.cancel_sent_waiter is not None: await self.cancel_sent_waiter self.cancel_sent_waiter = None self._check_state() timeout = self._get_timeout_impl(timeout) args_buf = state._encode_bind_msg(args) waiter = self._new_waiter(timeout) try: self._bind( portal_name, state.name, args_buf) # network op self.last_query = state.query self.statement = state except Exception as ex: waiter.set_exception(ex) self._coreproto_error() finally: return await waiter @cython.iterable_coroutine async def execute(self, PreparedStatementState state, str portal_name, int limit, return_extra, timeout): if self.cancel_waiter is not None: await self.cancel_waiter if self.cancel_sent_waiter is not None: await self.cancel_sent_waiter self.cancel_sent_waiter = None self._check_state() timeout = self._get_timeout_impl(timeout) waiter = self._new_waiter(timeout) try: self._execute( portal_name, limit) # network op self.last_query = state.query self.statement = state self.return_extra = return_extra self.queries_count += 1 except Exception as ex: waiter.set_exception(ex) self._coreproto_error() finally: return await waiter @cython.iterable_coroutine async def close_portal(self, str portal_name, timeout): if self.cancel_waiter is not None: await self.cancel_waiter if self.cancel_sent_waiter is not None: await self.cancel_sent_waiter self.cancel_sent_waiter = None self._check_state() timeout = self._get_timeout_impl(timeout) waiter = self._new_waiter(timeout) try: self._close( portal_name, True) # network op except Exception as ex: waiter.set_exception(ex) self._coreproto_error() finally: return await waiter @cython.iterable_coroutine async def query(self, query, timeout): if self.cancel_waiter is not None: await self.cancel_waiter if self.cancel_sent_waiter is not None: await self.cancel_sent_waiter self.cancel_sent_waiter = None self._check_state() # query() needs to call _get_timeout instead of _get_timeout_impl # for consistent validation, as it is called differently from # prepare/bind/execute methods. timeout = self._get_timeout(timeout) waiter = self._new_waiter(timeout) try: self._simple_query(query) # network op self.last_query = query self.queries_count += 1 except Exception as ex: waiter.set_exception(ex) self._coreproto_error() finally: return await waiter @cython.iterable_coroutine async def copy_out(self, copy_stmt, sink, timeout): if self.cancel_waiter is not None: await self.cancel_waiter if self.cancel_sent_waiter is not None: await self.cancel_sent_waiter self.cancel_sent_waiter = None self._check_state() timeout = self._get_timeout_impl(timeout) timer = Timer(timeout) # The copy operation is guarded by a single timeout # on the top level. waiter = self._new_waiter(timer.get_remaining_budget()) self._copy_out(copy_stmt) try: while True: self.resume_reading() with timer: buffer, done, status_msg = await waiter # buffer will be empty if CopyDone was received apart from # the last CopyData message. if buffer: try: with timer: await compat.wait_for( sink(buffer), timeout=timer.get_remaining_budget()) except (Exception, asyncio.CancelledError) as ex: # Abort the COPY operation on any error in # output sink. self._request_cancel() # Make asyncio shut up about unretrieved # QueryCanceledError waiter.add_done_callback(lambda f: f.exception()) raise # done will be True upon receipt of CopyDone. if done: break waiter = self._new_waiter(timer.get_remaining_budget()) finally: self.resume_reading() return status_msg @cython.iterable_coroutine async def copy_in(self, copy_stmt, reader, data, records, PreparedStatementState record_stmt, timeout): cdef: WriteBuffer wbuf ssize_t num_cols Codec codec if self.cancel_waiter is not None: await self.cancel_waiter if self.cancel_sent_waiter is not None: await self.cancel_sent_waiter self.cancel_sent_waiter = None self._check_state() timeout = self._get_timeout_impl(timeout) timer = Timer(timeout) waiter = self._new_waiter(timer.get_remaining_budget()) # Initiate COPY IN. self._copy_in(copy_stmt) try: if record_stmt is not None: # copy_in_records in binary mode wbuf = WriteBuffer.new() # Signature wbuf.write_bytes(_COPY_SIGNATURE) # Flags field wbuf.write_int32(0) # No header extension wbuf.write_int32(0) record_stmt._ensure_rows_decoder() codecs = record_stmt.rows_codecs num_cols = len(codecs) settings = self.settings for codec in codecs: if (not codec.has_encoder() or codec.format != PG_FORMAT_BINARY): raise apg_exc.InternalClientError( 'no binary format encoder for ' 'type {} (OID {})'.format(codec.name, codec.oid)) if isinstance(records, collections.abc.AsyncIterable): async for row in records: # Tuple header wbuf.write_int16(num_cols) # Tuple data for i in range(num_cols): item = row[i] if item is None: wbuf.write_int32(-1) else: codec = cpython.PyTuple_GET_ITEM( codecs, i) codec.encode(settings, wbuf, item) if wbuf.len() >= _COPY_BUFFER_SIZE: with timer: await self.writing_allowed.wait() self._write_copy_data_msg(wbuf) wbuf = WriteBuffer.new() else: for row in records: # Tuple header wbuf.write_int16(num_cols) # Tuple data for i in range(num_cols): item = row[i] if item is None: wbuf.write_int32(-1) else: codec = cpython.PyTuple_GET_ITEM( codecs, i) codec.encode(settings, wbuf, item) if wbuf.len() >= _COPY_BUFFER_SIZE: with timer: await self.writing_allowed.wait() self._write_copy_data_msg(wbuf) wbuf = WriteBuffer.new() # End of binary copy. wbuf.write_int16(-1) self._write_copy_data_msg(wbuf) elif reader is not None: try: aiter = reader.__aiter__ except AttributeError: raise TypeError('reader is not an asynchronous iterable') else: iterator = aiter() try: while True: # We rely on protocol flow control to moderate the # rate of data messages. with timer: await self.writing_allowed.wait() with timer: chunk = await compat.wait_for( iterator.__anext__(), timeout=timer.get_remaining_budget()) self._write_copy_data_msg(chunk) except builtins.StopAsyncIteration: pass else: # Buffer passed in directly. await self.writing_allowed.wait() self._write_copy_data_msg(data) except asyncio.TimeoutError: self._write_copy_fail_msg('TimeoutError') self._on_timeout(self.waiter) try: await waiter except TimeoutError: raise else: raise apg_exc.InternalClientError('TimoutError was not raised') except (Exception, asyncio.CancelledError) as e: self._write_copy_fail_msg(str(e)) self._request_cancel() # Make asyncio shut up about unretrieved QueryCanceledError waiter.add_done_callback(lambda f: f.exception()) raise self._write_copy_done_msg() status_msg = await waiter return status_msg @cython.iterable_coroutine async def close_statement(self, PreparedStatementState state, timeout): if self.cancel_waiter is not None: await self.cancel_waiter if self.cancel_sent_waiter is not None: await self.cancel_sent_waiter self.cancel_sent_waiter = None self._check_state() if state.refs != 0: raise apg_exc.InternalClientError( 'cannot close prepared statement; refs == {} != 0'.format( state.refs)) timeout = self._get_timeout_impl(timeout) waiter = self._new_waiter(timeout) try: self._close(state.name, False) # network op state.closed = True except Exception as ex: waiter.set_exception(ex) self._coreproto_error() finally: return await waiter def is_closed(self): return self.closing def is_connected(self): return not self.closing and self.con_status == CONNECTION_OK def abort(self): if self.closing: return self.closing = True self._handle_waiter_on_connection_lost(None) self._terminate() self.transport.abort() self.transport = None @cython.iterable_coroutine async def close(self, timeout): if self.closing: return self.closing = True if self.cancel_sent_waiter is not None: await self.cancel_sent_waiter self.cancel_sent_waiter = None if self.cancel_waiter is not None: await self.cancel_waiter if self.waiter is not None: # If there is a query running, cancel it self._request_cancel() await self.cancel_sent_waiter self.cancel_sent_waiter = None if self.cancel_waiter is not None: await self.cancel_waiter assert self.waiter is None timeout = self._get_timeout_impl(timeout) # Ask the server to terminate the connection and wait for it # to drop. self.waiter = self._new_waiter(timeout) self._terminate() try: await self.waiter except ConnectionResetError: # There appears to be a difference in behaviour of asyncio # in Windows, where, instead of calling protocol.connection_lost() # a ConnectionResetError will be thrown into the task. pass finally: self.waiter = None self.transport.abort() def _request_cancel(self): self.cancel_waiter = self.create_future() self.cancel_sent_waiter = self.create_future() con = self.get_connection() if con is not None: # if 'con' is None it means that the connection object has been # garbage collected and that the transport will soon be aborted. con._cancel_current_command(self.cancel_sent_waiter) else: self.loop.call_exception_handler({ 'message': 'asyncpg.Protocol has no reference to its ' 'Connection object and yet a cancellation ' 'was requested. Please report this at ' 'github.com/magicstack/asyncpg.' }) self.abort() if self.state == PROTOCOL_PREPARE: # we need to send a SYNC to server if we cancel during the PREPARE phase # because the PREPARE sequence does not send a SYNC itself. # we cannot send this extra SYNC if we are not in PREPARE phase, # because then we would issue two SYNCs and we would get two ReadyForQuery # replies, which our current state machine implementation cannot handle self._write(SYNC_MESSAGE) self._set_state(PROTOCOL_CANCELLED) def _on_timeout(self, fut): if self.waiter is not fut or fut.done() or \ self.cancel_waiter is not None or \ self.timeout_handle is None: return self._request_cancel() self.waiter.set_exception(asyncio.TimeoutError()) def _on_waiter_completed(self, fut): if self.timeout_handle: self.timeout_handle.cancel() self.timeout_handle = None if fut is not self.waiter or self.cancel_waiter is not None: return if fut.cancelled(): self._request_cancel() def _create_future_fallback(self): return asyncio.Future(loop=self.loop) cdef _handle_waiter_on_connection_lost(self, cause): if self.waiter is not None and not self.waiter.done(): exc = apg_exc.ConnectionDoesNotExistError( 'connection was closed in the middle of ' 'operation') if cause is not None: exc.__cause__ = cause self.waiter.set_exception(exc) self.waiter = None cdef _set_server_parameter(self, name, val): self.settings.add_setting(name, val) def _get_timeout(self, timeout): if timeout is not None: try: if type(timeout) is bool: raise ValueError timeout = float(timeout) except ValueError: raise ValueError( 'invalid timeout value: expected non-negative float ' '(got {!r})'.format(timeout)) from None return self._get_timeout_impl(timeout) cdef inline _get_timeout_impl(self, timeout): if timeout is None: timeout = self.get_connection()._config.command_timeout elif timeout is NO_TIMEOUT: timeout = None else: timeout = float(timeout) if timeout is not None and timeout <= 0: raise asyncio.TimeoutError() return timeout cdef _check_state(self): if self.cancel_waiter is not None: raise apg_exc.InterfaceError( 'cannot perform operation: another operation is cancelling') if self.closing: raise apg_exc.InterfaceError( 'cannot perform operation: connection is closed') if self.waiter is not None or self.timeout_handle is not None: raise apg_exc.InterfaceError( 'cannot perform operation: another operation is in progress') def _is_cancelling(self): return ( self.cancel_waiter is not None or self.cancel_sent_waiter is not None ) @cython.iterable_coroutine async def _wait_for_cancellation(self): if self.cancel_sent_waiter is not None: await self.cancel_sent_waiter self.cancel_sent_waiter = None if self.cancel_waiter is not None: await self.cancel_waiter cdef _coreproto_error(self): try: if self.waiter is not None: if not self.waiter.done(): raise apg_exc.InternalClientError( 'waiter is not done while handling critical ' 'protocol error') self.waiter = None finally: self.abort() cdef _new_waiter(self, timeout): if self.waiter is not None: raise apg_exc.InterfaceError( 'cannot perform operation: another operation is in progress') self.waiter = self.create_future() if timeout is not None: self.timeout_handle = self.loop.call_later( timeout, self._on_timeout, self.waiter) self.waiter.add_done_callback(self._on_waiter_completed) return self.waiter cdef _on_result__connect(self, object waiter): waiter.set_result(True) cdef _on_result__prepare(self, object waiter): if PG_DEBUG: if self.statement is None: raise apg_exc.InternalClientError( '_on_result__prepare: statement is None') if self.result_param_desc is not None: self.statement._set_args_desc(self.result_param_desc) if self.result_row_desc is not None: self.statement._set_row_desc(self.result_row_desc) waiter.set_result(self.statement) cdef _on_result__bind_and_exec(self, object waiter): if self.return_extra: waiter.set_result(( self.result, self.result_status_msg, self.result_execute_completed)) else: waiter.set_result(self.result) cdef _on_result__bind(self, object waiter): waiter.set_result(self.result) cdef _on_result__close_stmt_or_portal(self, object waiter): waiter.set_result(self.result) cdef _on_result__simple_query(self, object waiter): waiter.set_result(self.result_status_msg.decode(self.encoding)) cdef _on_result__copy_out(self, object waiter): cdef bint copy_done = self.state == PROTOCOL_COPY_OUT_DONE if copy_done: status_msg = self.result_status_msg.decode(self.encoding) else: status_msg = None # We need to put some backpressure on Postgres # here in case the sink is slow to process the output. self.pause_reading() waiter.set_result((self.result, copy_done, status_msg)) cdef _on_result__copy_in(self, object waiter): status_msg = self.result_status_msg.decode(self.encoding) waiter.set_result(status_msg) cdef _decode_row(self, const char* buf, ssize_t buf_len): if PG_DEBUG: if self.statement is None: raise apg_exc.InternalClientError( '_decode_row: statement is None') return self.statement._decode_row(buf, buf_len) cdef _dispatch_result(self): waiter = self.waiter self.waiter = None if PG_DEBUG: if waiter is None: raise apg_exc.InternalClientError('_on_result: waiter is None') if waiter.cancelled(): return if waiter.done(): raise apg_exc.InternalClientError('_on_result: waiter is done') if self.result_type == RESULT_FAILED: if isinstance(self.result, dict): exc = apg_exc_base.PostgresError.new( self.result, query=self.last_query) else: exc = self.result waiter.set_exception(exc) return try: if self.state == PROTOCOL_AUTH: self._on_result__connect(waiter) elif self.state == PROTOCOL_PREPARE: self._on_result__prepare(waiter) elif self.state == PROTOCOL_BIND_EXECUTE: self._on_result__bind_and_exec(waiter) elif self.state == PROTOCOL_BIND_EXECUTE_MANY: self._on_result__bind_and_exec(waiter) elif self.state == PROTOCOL_EXECUTE: self._on_result__bind_and_exec(waiter) elif self.state == PROTOCOL_BIND: self._on_result__bind(waiter) elif self.state == PROTOCOL_CLOSE_STMT_PORTAL: self._on_result__close_stmt_or_portal(waiter) elif self.state == PROTOCOL_SIMPLE_QUERY: self._on_result__simple_query(waiter) elif (self.state == PROTOCOL_COPY_OUT_DATA or self.state == PROTOCOL_COPY_OUT_DONE): self._on_result__copy_out(waiter) elif self.state == PROTOCOL_COPY_IN_DATA: self._on_result__copy_in(waiter) elif self.state == PROTOCOL_TERMINATING: # We are waiting for the connection to drop, so # ignore any stray results at this point. pass else: raise apg_exc.InternalClientError( 'got result for unknown protocol state {}'. format(self.state)) except Exception as exc: waiter.set_exception(exc) cdef _on_result(self): if self.timeout_handle is not None: self.timeout_handle.cancel() self.timeout_handle = None if self.cancel_waiter is not None: # We have received the result of a cancelled command. if not self.cancel_waiter.done(): # The cancellation future might have been cancelled # by the cancellation of the entire task running the query. self.cancel_waiter.set_result(None) self.cancel_waiter = None if self.waiter is not None and self.waiter.done(): self.waiter = None if self.waiter is None: return try: self._dispatch_result() finally: self.statement = None self.last_query = None self.return_extra = False cdef _on_notice(self, parsed): con = self.get_connection() if con is not None: con._process_log_message(parsed, self.last_query) cdef _on_notification(self, pid, channel, payload): con = self.get_connection() if con is not None: con._process_notification(pid, channel, payload) cdef _on_connection_lost(self, exc): if self.closing: # The connection was lost because # Protocol.close() was called if self.waiter is not None and not self.waiter.done(): if exc is None: self.waiter.set_result(None) else: self.waiter.set_exception(exc) self.waiter = None else: # The connection was lost because it was # terminated or due to another error; # Throw an error in any awaiting waiter. self.closing = True # Cleanup the connection resources, including, possibly, # releasing the pool holder. con = self.get_connection() if con is not None: con._cleanup() self._handle_waiter_on_connection_lost(exc) cdef _write(self, buf): self.transport.write(memoryview(buf)) cdef _writelines(self, list buffers): self.transport.writelines(buffers) # asyncio callbacks: def data_received(self, data): self.buffer.feed_data(data) self._read_server_messages() def connection_made(self, transport): self.transport = transport sock = transport.get_extra_info('socket') if (sock is not None and (not hasattr(socket, 'AF_UNIX') or sock.family != socket.AF_UNIX)): sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) try: self._connect() except Exception as ex: transport.abort() self.con_status = CONNECTION_BAD self._set_state(PROTOCOL_FAILED) self._on_error(ex) def connection_lost(self, exc): self.con_status = CONNECTION_BAD self._set_state(PROTOCOL_FAILED) self._on_connection_lost(exc) def pause_writing(self): self.writing_allowed.clear() def resume_writing(self): self.writing_allowed.set() @property def is_ssl(self): return self._is_ssl @is_ssl.setter def is_ssl(self, value): self._is_ssl = value class Timer: def __init__(self, budget): self._budget = budget self._started = 0 def __enter__(self): if self._budget is not None: self._started = time.monotonic() def __exit__(self, et, e, tb): if self._budget is not None: self._budget -= time.monotonic() - self._started def get_remaining_budget(self): return self._budget def has_budget_greater_than(self, amount): if self._budget is None: # Unlimited budget. return True else: return self._budget > amount class Protocol(BaseProtocol, asyncio.Protocol): pass def _create_record(object mapping, tuple elems): # Exposed only for testing purposes. cdef: object rec int32_t i if mapping is None: desc = record.ApgRecordDesc_New({}, ()) else: desc = record.ApgRecordDesc_New( mapping, tuple(mapping) if mapping else ()) rec = record.ApgRecord_New(Record, desc, len(elems)) for i in range(len(elems)): elem = elems[i] cpython.Py_INCREF(elem) record.ApgRecord_SET_ITEM(rec, i, elem) return rec Record = record.ApgRecord_InitTypes() ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1729370387.4975543 asyncpg-0.30.0/asyncpg/protocol/record/0000755000175100001770000000000014705014423017426 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/record/__init__.pxd0000644000175100001770000000075714705014413021712 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cimport cpython cdef extern from "record/recordobj.h": cpython.PyTypeObject *ApgRecord_InitTypes() except NULL int ApgRecord_CheckExact(object) object ApgRecord_New(type, object, int) void ApgRecord_SET_ITEM(object, int, object) object ApgRecordDesc_New(object, object) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/record/recordobj.c0000644000175100001770000005705214705014413021553 0ustar00runnerdocker/* Big parts of this file are copied (with modifications) from CPython/Objects/tupleobject.c. Portions Copyright (c) PSF (and other CPython copyright holders). Portions Copyright (c) 2016-present MagicStack Inc. License: PSFL v2; see CPython/LICENSE for details. */ #include "recordobj.h" #ifdef _PyObject_GC_IS_TRACKED # define _ApgObject_GC_IS_TRACKED _PyObject_GC_IS_TRACKED #else # define _ApgObject_GC_IS_TRACKED PyObject_GC_IsTracked #endif static PyObject * record_iter(PyObject *); static PyObject * record_new_items_iter(PyObject *); static ApgRecordObject *free_list[ApgRecord_MAXSAVESIZE]; static int numfree[ApgRecord_MAXSAVESIZE]; static size_t MAX_RECORD_SIZE = ( ((size_t)PY_SSIZE_T_MAX - sizeof(ApgRecordObject) - sizeof(PyObject *)) / sizeof(PyObject *) ); PyObject * ApgRecord_New(PyTypeObject *type, PyObject *desc, Py_ssize_t size) { ApgRecordObject *o; Py_ssize_t i; int need_gc_track = 0; if (size < 0 || desc == NULL || !ApgRecordDesc_CheckExact(desc)) { PyErr_BadInternalCall(); return NULL; } if (type == &ApgRecord_Type) { if (size < ApgRecord_MAXSAVESIZE && (o = free_list[size]) != NULL) { free_list[size] = (ApgRecordObject *) o->ob_item[0]; numfree[size]--; _Py_NewReference((PyObject *)o); } else { /* Check for overflow */ if ((size_t)size > MAX_RECORD_SIZE) { return PyErr_NoMemory(); } o = PyObject_GC_NewVar(ApgRecordObject, &ApgRecord_Type, size); if (o == NULL) { return NULL; } } need_gc_track = 1; } else { assert(PyType_IsSubtype(type, &ApgRecord_Type)); if ((size_t)size > MAX_RECORD_SIZE) { return PyErr_NoMemory(); } o = (ApgRecordObject *)type->tp_alloc(type, size); if (!_ApgObject_GC_IS_TRACKED((PyObject *)o)) { PyErr_SetString( PyExc_TypeError, "record subclass is not tracked by GC" ); return NULL; } } for (i = 0; i < size; i++) { o->ob_item[i] = NULL; } Py_INCREF(desc); o->desc = (ApgRecordDescObject*)desc; o->self_hash = -1; if (need_gc_track) { PyObject_GC_Track(o); } return (PyObject *) o; } static void record_dealloc(ApgRecordObject *o) { Py_ssize_t i; Py_ssize_t len = Py_SIZE(o); PyObject_GC_UnTrack(o); o->self_hash = -1; Py_CLEAR(o->desc); Py_TRASHCAN_BEGIN(o, record_dealloc) if (len > 0) { i = len; while (--i >= 0) { Py_CLEAR(o->ob_item[i]); } if (len < ApgRecord_MAXSAVESIZE && numfree[len] < ApgRecord_MAXFREELIST && ApgRecord_CheckExact(o)) { o->ob_item[0] = (PyObject *) free_list[len]; numfree[len]++; free_list[len] = o; goto done; /* return */ } } Py_TYPE(o)->tp_free((PyObject *)o); done: Py_TRASHCAN_END } static int record_traverse(ApgRecordObject *o, visitproc visit, void *arg) { Py_ssize_t i; Py_VISIT(o->desc); for (i = Py_SIZE(o); --i >= 0;) { if (o->ob_item[i] != NULL) { Py_VISIT(o->ob_item[i]); } } return 0; } static Py_ssize_t record_length(ApgRecordObject *o) { return Py_SIZE(o); } #if PY_VERSION_HEX >= 0x03080000 #if SIZEOF_PY_UHASH_T > 4 #define _PyHASH_XXPRIME_1 ((Py_uhash_t)11400714785074694791ULL) #define _PyHASH_XXPRIME_2 ((Py_uhash_t)14029467366897019727ULL) #define _PyHASH_XXPRIME_5 ((Py_uhash_t)2870177450012600261ULL) #define _PyHASH_XXROTATE(x) ((x << 31) | (x >> 33)) /* Rotate left 31 bits */ #else #define _PyHASH_XXPRIME_1 ((Py_uhash_t)2654435761UL) #define _PyHASH_XXPRIME_2 ((Py_uhash_t)2246822519UL) #define _PyHASH_XXPRIME_5 ((Py_uhash_t)374761393UL) #define _PyHASH_XXROTATE(x) ((x << 13) | (x >> 19)) /* Rotate left 13 bits */ #endif static Py_hash_t record_hash(ApgRecordObject *v) { Py_uhash_t acc = _PyHASH_XXPRIME_5; size_t i, len = (size_t)Py_SIZE(v); PyObject **els = v->ob_item; for (i = 0; i < len; i++) { Py_uhash_t lane = (Py_uhash_t)PyObject_Hash(els[i]); if (lane == (Py_uhash_t)-1) { return -1; } acc += lane * _PyHASH_XXPRIME_2; acc = _PyHASH_XXROTATE(acc); acc *= _PyHASH_XXPRIME_1; } /* Add input length, mangled to keep the historical value of hash(()). */ acc += len ^ (_PyHASH_XXPRIME_5 ^ 3527539UL); if (acc == (Py_uhash_t)-1) { return 1546275796; } return (Py_hash_t)acc; } #else static Py_hash_t record_hash(ApgRecordObject *v) { Py_uhash_t x; /* Unsigned for defined overflow behavior. */ Py_hash_t y; Py_ssize_t len; PyObject **p; Py_uhash_t mult; if (v->self_hash != -1) { return v->self_hash; } len = Py_SIZE(v); mult = _PyHASH_MULTIPLIER; x = 0x345678UL; p = v->ob_item; while (--len >= 0) { y = PyObject_Hash(*p++); if (y == -1) { return -1; } x = (x ^ (Py_uhash_t)y) * mult; /* the cast might truncate len; that doesn't change hash stability */ mult += (Py_uhash_t)(82520UL + (size_t)len + (size_t)len); } x += 97531UL; if (x == (Py_uhash_t)-1) { x = (Py_uhash_t)-2; } v->self_hash = (Py_hash_t)x; return (Py_hash_t)x; } #endif static PyObject * record_richcompare(PyObject *v, PyObject *w, int op) { Py_ssize_t i; Py_ssize_t vlen, wlen; int v_is_tuple = 0; int w_is_tuple = 0; int v_is_record = 0; int w_is_record = 0; int comp; if (PyTuple_Check(v)) { v_is_tuple = 1; } else if (ApgRecord_CheckExact(v)) { v_is_record = 1; } else if (!ApgRecord_Check(v)) { Py_RETURN_NOTIMPLEMENTED; } if (PyTuple_Check(w)) { w_is_tuple = 1; } else if (ApgRecord_CheckExact(w)) { w_is_record = 1; } else if (!ApgRecord_Check(w)) { Py_RETURN_NOTIMPLEMENTED; } #define V_ITEM(i) \ (v_is_tuple ? \ PyTuple_GET_ITEM(v, i) \ : (v_is_record ? ApgRecord_GET_ITEM(v, i) : PySequence_GetItem(v, i))) #define W_ITEM(i) \ (w_is_tuple ? \ PyTuple_GET_ITEM(w, i) \ : (w_is_record ? ApgRecord_GET_ITEM(w, i) : PySequence_GetItem(w, i))) vlen = Py_SIZE(v); wlen = Py_SIZE(w); if (op == Py_EQ && vlen != wlen) { /* Checking if v == w, but len(v) != len(w): return False */ Py_RETURN_FALSE; } if (op == Py_NE && vlen != wlen) { /* Checking if v != w, and len(v) != len(w): return True */ Py_RETURN_TRUE; } /* Search for the first index where items are different. * Note that because tuples are immutable, it's safe to reuse * vlen and wlen across the comparison calls. */ for (i = 0; i < vlen && i < wlen; i++) { comp = PyObject_RichCompareBool(V_ITEM(i), W_ITEM(i), Py_EQ); if (comp < 0) { return NULL; } if (!comp) { break; } } if (i >= vlen || i >= wlen) { /* No more items to compare -- compare sizes */ int cmp; switch (op) { case Py_LT: cmp = vlen < wlen; break; case Py_LE: cmp = vlen <= wlen; break; case Py_EQ: cmp = vlen == wlen; break; case Py_NE: cmp = vlen != wlen; break; case Py_GT: cmp = vlen > wlen; break; case Py_GE: cmp = vlen >= wlen; break; default: return NULL; /* cannot happen */ } if (cmp) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } /* We have an item that differs -- shortcuts for EQ/NE */ if (op == Py_EQ) { Py_RETURN_FALSE; } if (op == Py_NE) { Py_RETURN_TRUE; } /* Compare the final item again using the proper operator */ return PyObject_RichCompare(V_ITEM(i), W_ITEM(i), op); #undef V_ITEM #undef W_ITEM } static PyObject * record_item(ApgRecordObject *o, Py_ssize_t i) { if (i < 0 || i >= Py_SIZE(o)) { PyErr_SetString(PyExc_IndexError, "record index out of range"); return NULL; } Py_INCREF(o->ob_item[i]); return o->ob_item[i]; } typedef enum item_by_name_result { APG_ITEM_FOUND = 0, APG_ERROR = -1, APG_ITEM_NOT_FOUND = -2 } item_by_name_result_t; /* Lookup a record value by its name. Return 0 on success, -2 if the * value was not found (with KeyError set), and -1 on all other errors. */ static item_by_name_result_t record_item_by_name(ApgRecordObject *o, PyObject *item, PyObject **result) { PyObject *mapped; PyObject *val; Py_ssize_t i; mapped = PyObject_GetItem(o->desc->mapping, item); if (mapped == NULL) { goto noitem; } if (!PyIndex_Check(mapped)) { Py_DECREF(mapped); goto error; } i = PyNumber_AsSsize_t(mapped, PyExc_IndexError); Py_DECREF(mapped); if (i < 0) { if (PyErr_Occurred()) PyErr_Clear(); goto error; } val = record_item(o, i); if (val == NULL) { PyErr_Clear(); goto error; } *result = val; return APG_ITEM_FOUND; noitem: PyErr_SetObject(PyExc_KeyError, item); return APG_ITEM_NOT_FOUND; error: PyErr_SetString(PyExc_RuntimeError, "invalid record descriptor"); return APG_ERROR; } static PyObject * record_subscript(ApgRecordObject* o, PyObject* item) { if (PyIndex_Check(item)) { Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); if (i == -1 && PyErr_Occurred()) return NULL; if (i < 0) { i += Py_SIZE(o); } return record_item(o, i); } else if (PySlice_Check(item)) { Py_ssize_t start, stop, step, slicelength, cur, i; PyObject* result; PyObject* it; PyObject **src, **dest; if (PySlice_GetIndicesEx( item, Py_SIZE(o), &start, &stop, &step, &slicelength) < 0) { return NULL; } if (slicelength <= 0) { return PyTuple_New(0); } else { result = PyTuple_New(slicelength); if (!result) return NULL; src = o->ob_item; dest = ((PyTupleObject *)result)->ob_item; for (cur = start, i = 0; i < slicelength; cur += step, i++) { it = src[cur]; Py_INCREF(it); dest[i] = it; } return result; } } else { PyObject* result; if (record_item_by_name(o, item, &result) < 0) return NULL; else return result; } } static const char * get_typename(PyTypeObject *type) { assert(type->tp_name != NULL); const char *s = strrchr(type->tp_name, '.'); if (s == NULL) { s = type->tp_name; } else { s++; } return s; } static PyObject * record_repr(ApgRecordObject *v) { Py_ssize_t i, n; PyObject *keys_iter, *type_prefix; _PyUnicodeWriter writer; n = Py_SIZE(v); if (n == 0) { return PyUnicode_FromFormat("<%s>", get_typename(Py_TYPE(v))); } keys_iter = PyObject_GetIter(v->desc->keys); if (keys_iter == NULL) { return NULL; } i = Py_ReprEnter((PyObject *)v); if (i != 0) { Py_DECREF(keys_iter); if (i > 0) { return PyUnicode_FromFormat("<%s ...>", get_typename(Py_TYPE(v))); } return NULL; } _PyUnicodeWriter_Init(&writer); writer.overallocate = 1; writer.min_length = 12; /* */ type_prefix = PyUnicode_FromFormat("<%s ", get_typename(Py_TYPE(v))); if (_PyUnicodeWriter_WriteStr(&writer, type_prefix) < 0) { Py_DECREF(type_prefix); goto error; } Py_DECREF(type_prefix); for (i = 0; i < n; ++i) { PyObject *key; PyObject *key_repr; PyObject *val_repr; if (i > 0) { if (_PyUnicodeWriter_WriteChar(&writer, ' ') < 0) { goto error; } } if (Py_EnterRecursiveCall(" while getting the repr of a record")) { goto error; } val_repr = PyObject_Repr(v->ob_item[i]); Py_LeaveRecursiveCall(); if (val_repr == NULL) { goto error; } key = PyIter_Next(keys_iter); if (key == NULL) { Py_DECREF(val_repr); PyErr_SetString(PyExc_RuntimeError, "invalid record mapping"); goto error; } key_repr = PyObject_Str(key); Py_DECREF(key); if (key_repr == NULL) { Py_DECREF(val_repr); goto error; } if (_PyUnicodeWriter_WriteStr(&writer, key_repr) < 0) { Py_DECREF(key_repr); Py_DECREF(val_repr); goto error; } Py_DECREF(key_repr); if (_PyUnicodeWriter_WriteChar(&writer, '=') < 0) { Py_DECREF(val_repr); goto error; } if (_PyUnicodeWriter_WriteStr(&writer, val_repr) < 0) { Py_DECREF(val_repr); goto error; } Py_DECREF(val_repr); } writer.overallocate = 0; if (_PyUnicodeWriter_WriteChar(&writer, '>') < 0) { goto error; } Py_DECREF(keys_iter); Py_ReprLeave((PyObject *)v); return _PyUnicodeWriter_Finish(&writer); error: Py_DECREF(keys_iter); _PyUnicodeWriter_Dealloc(&writer); Py_ReprLeave((PyObject *)v); return NULL; } static PyObject * record_values(PyObject *o, PyObject *args) { return record_iter(o); } static PyObject * record_keys(PyObject *o, PyObject *args) { if (!ApgRecord_Check(o)) { PyErr_BadInternalCall(); return NULL; } return PyObject_GetIter(((ApgRecordObject*)o)->desc->keys); } static PyObject * record_items(PyObject *o, PyObject *args) { if (!ApgRecord_Check(o)) { PyErr_BadInternalCall(); return NULL; } return record_new_items_iter(o); } static int record_contains(ApgRecordObject *o, PyObject *arg) { if (!ApgRecord_Check(o)) { PyErr_BadInternalCall(); return -1; } return PySequence_Contains(o->desc->mapping, arg); } static PyObject * record_get(ApgRecordObject* o, PyObject* args) { PyObject *key; PyObject *defval = Py_None; PyObject *val = NULL; int res; if (!PyArg_UnpackTuple(args, "get", 1, 2, &key, &defval)) return NULL; res = record_item_by_name(o, key, &val); if (res == APG_ITEM_NOT_FOUND) { PyErr_Clear(); Py_INCREF(defval); val = defval; } return val; } static PySequenceMethods record_as_sequence = { (lenfunc)record_length, /* sq_length */ 0, /* sq_concat */ 0, /* sq_repeat */ (ssizeargfunc)record_item, /* sq_item */ 0, /* sq_slice */ 0, /* sq_ass_item */ 0, /* sq_ass_slice */ (objobjproc)record_contains, /* sq_contains */ }; static PyMappingMethods record_as_mapping = { (lenfunc)record_length, /* mp_length */ (binaryfunc)record_subscript, /* mp_subscript */ 0 /* mp_ass_subscript */ }; static PyMethodDef record_methods[] = { {"values", (PyCFunction)record_values, METH_NOARGS}, {"keys", (PyCFunction)record_keys, METH_NOARGS}, {"items", (PyCFunction)record_items, METH_NOARGS}, {"get", (PyCFunction)record_get, METH_VARARGS}, {NULL, NULL} /* sentinel */ }; PyTypeObject ApgRecord_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "asyncpg.Record", .tp_basicsize = sizeof(ApgRecordObject) - sizeof(PyObject *), .tp_itemsize = sizeof(PyObject *), .tp_dealloc = (destructor)record_dealloc, .tp_repr = (reprfunc)record_repr, .tp_as_sequence = &record_as_sequence, .tp_as_mapping = &record_as_mapping, .tp_hash = (hashfunc)record_hash, .tp_getattro = PyObject_GenericGetAttr, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, .tp_traverse = (traverseproc)record_traverse, .tp_richcompare = record_richcompare, .tp_iter = record_iter, .tp_methods = record_methods, .tp_free = PyObject_GC_Del, }; /* Record Iterator */ typedef struct { PyObject_HEAD Py_ssize_t it_index; ApgRecordObject *it_seq; /* Set to NULL when iterator is exhausted */ } ApgRecordIterObject; static void record_iter_dealloc(ApgRecordIterObject *it) { PyObject_GC_UnTrack(it); Py_CLEAR(it->it_seq); PyObject_GC_Del(it); } static int record_iter_traverse(ApgRecordIterObject *it, visitproc visit, void *arg) { Py_VISIT(it->it_seq); return 0; } static PyObject * record_iter_next(ApgRecordIterObject *it) { ApgRecordObject *seq; PyObject *item; assert(it != NULL); seq = it->it_seq; if (seq == NULL) return NULL; assert(ApgRecord_Check(seq)); if (it->it_index < Py_SIZE(seq)) { item = ApgRecord_GET_ITEM(seq, it->it_index); ++it->it_index; Py_INCREF(item); return item; } it->it_seq = NULL; Py_DECREF(seq); return NULL; } static PyObject * record_iter_len(ApgRecordIterObject *it) { Py_ssize_t len = 0; if (it->it_seq) { len = Py_SIZE(it->it_seq) - it->it_index; } return PyLong_FromSsize_t(len); } PyDoc_STRVAR(record_iter_len_doc, "Private method returning an estimate of len(list(it))."); static PyMethodDef record_iter_methods[] = { {"__length_hint__", (PyCFunction)record_iter_len, METH_NOARGS, record_iter_len_doc}, {NULL, NULL} /* sentinel */ }; PyTypeObject ApgRecordIter_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "RecordIterator", .tp_basicsize = sizeof(ApgRecordIterObject), .tp_dealloc = (destructor)record_iter_dealloc, .tp_getattro = PyObject_GenericGetAttr, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, .tp_traverse = (traverseproc)record_iter_traverse, .tp_iter = PyObject_SelfIter, .tp_iternext = (iternextfunc)record_iter_next, .tp_methods = record_iter_methods, }; static PyObject * record_iter(PyObject *seq) { ApgRecordIterObject *it; if (!ApgRecord_Check(seq)) { PyErr_BadInternalCall(); return NULL; } it = PyObject_GC_New(ApgRecordIterObject, &ApgRecordIter_Type); if (it == NULL) return NULL; it->it_index = 0; Py_INCREF(seq); it->it_seq = (ApgRecordObject *)seq; PyObject_GC_Track(it); return (PyObject *)it; } /* Record Items Iterator */ typedef struct { PyObject_HEAD Py_ssize_t it_index; PyObject *it_key_iter; ApgRecordObject *it_seq; /* Set to NULL when iterator is exhausted */ } ApgRecordItemsObject; static void record_items_dealloc(ApgRecordItemsObject *it) { PyObject_GC_UnTrack(it); Py_CLEAR(it->it_key_iter); Py_CLEAR(it->it_seq); PyObject_GC_Del(it); } static int record_items_traverse(ApgRecordItemsObject *it, visitproc visit, void *arg) { Py_VISIT(it->it_key_iter); Py_VISIT(it->it_seq); return 0; } static PyObject * record_items_next(ApgRecordItemsObject *it) { ApgRecordObject *seq; PyObject *key; PyObject *val; PyObject *tup; assert(it != NULL); seq = it->it_seq; if (seq == NULL) { return NULL; } assert(ApgRecord_Check(seq)); assert(it->it_key_iter != NULL); key = PyIter_Next(it->it_key_iter); if (key == NULL) { /* likely it_key_iter had less items than seq has values */ goto exhausted; } if (it->it_index < Py_SIZE(seq)) { val = ApgRecord_GET_ITEM(seq, it->it_index); ++it->it_index; Py_INCREF(val); } else { /* it_key_iter had more items than seq has values */ Py_DECREF(key); goto exhausted; } tup = PyTuple_New(2); if (tup == NULL) { Py_DECREF(val); Py_DECREF(key); goto exhausted; } PyTuple_SET_ITEM(tup, 0, key); PyTuple_SET_ITEM(tup, 1, val); return tup; exhausted: Py_CLEAR(it->it_key_iter); Py_CLEAR(it->it_seq); return NULL; } static PyObject * record_items_len(ApgRecordItemsObject *it) { Py_ssize_t len = 0; if (it->it_seq) { len = Py_SIZE(it->it_seq) - it->it_index; } return PyLong_FromSsize_t(len); } PyDoc_STRVAR(record_items_len_doc, "Private method returning an estimate of len(list(it()))."); static PyMethodDef record_items_methods[] = { {"__length_hint__", (PyCFunction)record_items_len, METH_NOARGS, record_items_len_doc}, {NULL, NULL} /* sentinel */ }; PyTypeObject ApgRecordItems_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "RecordItemsIterator", .tp_basicsize = sizeof(ApgRecordItemsObject), .tp_dealloc = (destructor)record_items_dealloc, .tp_getattro = PyObject_GenericGetAttr, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, .tp_traverse = (traverseproc)record_items_traverse, .tp_iter = PyObject_SelfIter, .tp_iternext = (iternextfunc)record_items_next, .tp_methods = record_items_methods, }; static PyObject * record_new_items_iter(PyObject *seq) { ApgRecordItemsObject *it; PyObject *key_iter; if (!ApgRecord_Check(seq)) { PyErr_BadInternalCall(); return NULL; } key_iter = PyObject_GetIter(((ApgRecordObject*)seq)->desc->keys); if (key_iter == NULL) { return NULL; } it = PyObject_GC_New(ApgRecordItemsObject, &ApgRecordItems_Type); if (it == NULL) return NULL; it->it_key_iter = key_iter; it->it_index = 0; Py_INCREF(seq); it->it_seq = (ApgRecordObject *)seq; PyObject_GC_Track(it); return (PyObject *)it; } PyTypeObject * ApgRecord_InitTypes(void) { if (PyType_Ready(&ApgRecord_Type) < 0) { return NULL; } if (PyType_Ready(&ApgRecordDesc_Type) < 0) { return NULL; } if (PyType_Ready(&ApgRecordIter_Type) < 0) { return NULL; } if (PyType_Ready(&ApgRecordItems_Type) < 0) { return NULL; } return &ApgRecord_Type; } /* ----------------- */ static void record_desc_dealloc(ApgRecordDescObject *o) { PyObject_GC_UnTrack(o); Py_CLEAR(o->mapping); Py_CLEAR(o->keys); PyObject_GC_Del(o); } static int record_desc_traverse(ApgRecordDescObject *o, visitproc visit, void *arg) { Py_VISIT(o->mapping); Py_VISIT(o->keys); return 0; } PyTypeObject ApgRecordDesc_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "RecordDescriptor", .tp_basicsize = sizeof(ApgRecordDescObject), .tp_dealloc = (destructor)record_desc_dealloc, .tp_getattro = PyObject_GenericGetAttr, .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, .tp_traverse = (traverseproc)record_desc_traverse, .tp_iter = PyObject_SelfIter, }; PyObject * ApgRecordDesc_New(PyObject *mapping, PyObject *keys) { ApgRecordDescObject *o; if (!mapping || !keys || !PyTuple_CheckExact(keys)) { PyErr_BadInternalCall(); return NULL; } o = PyObject_GC_New(ApgRecordDescObject, &ApgRecordDesc_Type); if (o == NULL) { return NULL; } Py_INCREF(mapping); o->mapping = mapping; Py_INCREF(keys); o->keys = keys; PyObject_GC_Track(o); return (PyObject *) o; } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/record/recordobj.h0000644000175100001770000000256014705014413021552 0ustar00runnerdocker#ifndef APG_RECORDOBJ_H #define APG_RECORDOBJ_H #include "Python.h" /* Largest record to save on free list */ #define ApgRecord_MAXSAVESIZE 20 /* Maximum number of records of each size to save */ #define ApgRecord_MAXFREELIST 2000 typedef struct { PyObject_HEAD PyObject *mapping; PyObject *keys; } ApgRecordDescObject; typedef struct { PyObject_VAR_HEAD Py_hash_t self_hash; ApgRecordDescObject *desc; PyObject *ob_item[1]; /* ob_item contains space for 'ob_size' elements. * Items must normally not be NULL, except during construction when * the record is not yet visible outside the function that builds it. */ } ApgRecordObject; extern PyTypeObject ApgRecord_Type; extern PyTypeObject ApgRecordIter_Type; extern PyTypeObject ApgRecordItems_Type; extern PyTypeObject ApgRecordDesc_Type; #define ApgRecord_Check(self) PyObject_TypeCheck(self, &ApgRecord_Type) #define ApgRecord_CheckExact(o) (Py_TYPE(o) == &ApgRecord_Type) #define ApgRecordDesc_CheckExact(o) (Py_TYPE(o) == &ApgRecordDesc_Type) #define ApgRecord_SET_ITEM(op, i, v) \ (((ApgRecordObject *)(op))->ob_item[i] = v) #define ApgRecord_GET_ITEM(op, i) \ (((ApgRecordObject *)(op))->ob_item[i]) PyTypeObject *ApgRecord_InitTypes(void); PyObject *ApgRecord_New(PyTypeObject *, PyObject *, Py_ssize_t); PyObject *ApgRecordDesc_New(PyObject *, PyObject *); #endif ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/scram.pxd0000644000175100001770000000242314705014413017772 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef class SCRAMAuthentication: cdef: readonly bytes authentication_method readonly bytes authorization_message readonly bytes client_channel_binding readonly bytes client_first_message_bare readonly bytes client_nonce readonly bytes client_proof readonly bytes password_salt readonly int password_iterations readonly bytes server_first_message # server_key is an instance of hmac.HAMC readonly object server_key readonly bytes server_nonce cdef create_client_first_message(self, str username) cdef create_client_final_message(self, str password) cdef parse_server_first_message(self, bytes server_response) cdef verify_server_final_message(self, bytes server_final_message) cdef _bytes_xor(self, bytes a, bytes b) cdef _generate_client_nonce(self, int num_bytes) cdef _generate_client_proof(self, str password) cdef _generate_salted_password(self, str password, bytes salt, int iterations) cdef _normalize_password(self, str original_password) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/scram.pyx0000644000175100001770000003440214705014413020021 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import base64 import hashlib import hmac import re import secrets import stringprep import unicodedata @cython.final cdef class SCRAMAuthentication: """Contains the protocol for generating and a SCRAM hashed password. Since PostgreSQL 10, the option to hash passwords using the SCRAM-SHA-256 method was added. This module follows the defined protocol, which can be referenced from here: https://www.postgresql.org/docs/current/sasl-authentication.html#SASL-SCRAM-SHA-256 libpq references the following RFCs that it uses for implementation: * RFC 5802 * RFC 5803 * RFC 7677 The protocol works as such: - A client connets to the server. The server requests the client to begin SASL authentication using SCRAM and presents a client with the methods it supports. At present, those are SCRAM-SHA-256, and, on servers that are built with OpenSSL and are PG11+, SCRAM-SHA-256-PLUS (which supports channel binding, more on that below) - The client sends a "first message" to the server, where it chooses which method to authenticate with, and sends, along with the method, an indication of channel binding (we disable for now), a nonce, and the username. (Technically, PostgreSQL ignores the username as it already has it from the initical connection, but we add it for completeness) - The server responds with a "first message" in which it extends the nonce, as well as a password salt and the number of iterations to hash the password with. The client validates that the new nonce contains the first part of the client's original nonce - The client generates a salted password, but does not sent this up to the server. Instead, the client follows the SCRAM algorithm (RFC5802) to generate a proof. This proof is sent aspart of a client "final message" to the server for it to validate. - The server validates the proof. If it is valid, the server sends a verification code for the client to verify that the server came to the same proof the client did. PostgreSQL immediately sends an AuthenticationOK response right after a valid negotiation. If the password the client provided was invalid, then authentication fails. (The beauty of this is that the salted password is never transmitted over the wire!) PostgreSQL 11 added support for the channel binding (i.e. SCRAM-SHA-256-PLUS) but to do some ongoing discussion, there is a conscious decision by several driver authors to not support it as of yet. As such, the channel binding parameter is hard-coded to "n" for now, but can be updated to support other channel binding methos in the future """ AUTHENTICATION_METHODS = [b"SCRAM-SHA-256"] DEFAULT_CLIENT_NONCE_BYTES = 24 DIGEST = hashlib.sha256 REQUIREMENTS_CLIENT_FINAL_MESSAGE = ['client_channel_binding', 'server_nonce'] REQUIREMENTS_CLIENT_PROOF = ['password_iterations', 'password_salt', 'server_first_message', 'server_nonce'] SASLPREP_PROHIBITED = ( stringprep.in_table_a1, # PostgreSQL treats this as prohibited stringprep.in_table_c12, stringprep.in_table_c21_c22, stringprep.in_table_c3, stringprep.in_table_c4, stringprep.in_table_c5, stringprep.in_table_c6, stringprep.in_table_c7, stringprep.in_table_c8, stringprep.in_table_c9, ) def __cinit__(self, bytes authentication_method): self.authentication_method = authentication_method self.authorization_message = None # channel binding is turned off for the time being self.client_channel_binding = b"n,," self.client_first_message_bare = None self.client_nonce = None self.client_proof = None self.password_salt = None # self.password_iterations = None self.server_first_message = None self.server_key = None self.server_nonce = None cdef create_client_first_message(self, str username): """Create the initial client message for SCRAM authentication""" cdef: bytes msg bytes client_first_message self.client_nonce = \ self._generate_client_nonce(self.DEFAULT_CLIENT_NONCE_BYTES) # set the client first message bare here, as it's used in a later step self.client_first_message_bare = b"n=" + username.encode("utf-8") + \ b",r=" + self.client_nonce # put together the full message here msg = bytes() msg += self.authentication_method + b"\0" client_first_message = self.client_channel_binding + \ self.client_first_message_bare msg += (len(client_first_message)).to_bytes(4, byteorder='big') + \ client_first_message return msg cdef create_client_final_message(self, str password): """Create the final client message as part of SCRAM authentication""" cdef: bytes msg if any([getattr(self, val) is None for val in self.REQUIREMENTS_CLIENT_FINAL_MESSAGE]): raise Exception( "you need values from server to generate a client proof") # normalize the password using the SASLprep algorithm in RFC 4013 password = self._normalize_password(password) # generate the client proof self.client_proof = self._generate_client_proof(password=password) msg = bytes() msg += b"c=" + base64.b64encode(self.client_channel_binding) + \ b",r=" + self.server_nonce + \ b",p=" + base64.b64encode(self.client_proof) return msg cdef parse_server_first_message(self, bytes server_response): """Parse the response from the first message from the server""" self.server_first_message = server_response try: self.server_nonce = re.search(b'r=([^,]+),', self.server_first_message).group(1) except IndexError: raise Exception("could not get nonce") if not self.server_nonce.startswith(self.client_nonce): raise Exception("invalid nonce") try: self.password_salt = re.search(b',s=([^,]+),', self.server_first_message).group(1) except IndexError: raise Exception("could not get salt") try: self.password_iterations = int(re.search(b',i=(\d+),?', self.server_first_message).group(1)) except (IndexError, TypeError, ValueError): raise Exception("could not get iterations") cdef verify_server_final_message(self, bytes server_final_message): """Verify the final message from the server""" cdef: bytes server_signature try: server_signature = re.search(b'v=([^,]+)', server_final_message).group(1) except IndexError: raise Exception("could not get server signature") verify_server_signature = hmac.new(self.server_key.digest(), self.authorization_message, self.DIGEST) # validate the server signature against the verifier return server_signature == base64.b64encode( verify_server_signature.digest()) cdef _bytes_xor(self, bytes a, bytes b): """XOR two bytestrings together""" return bytes(a_i ^ b_i for a_i, b_i in zip(a, b)) cdef _generate_client_nonce(self, int num_bytes): cdef: bytes token token = secrets.token_bytes(num_bytes) return base64.b64encode(token) cdef _generate_client_proof(self, str password): """need to ensure a server response exists, i.e. """ cdef: bytes salted_password if any([getattr(self, val) is None for val in self.REQUIREMENTS_CLIENT_PROOF]): raise Exception( "you need values from server to generate a client proof") # generate a salt password salted_password = self._generate_salted_password(password, self.password_salt, self.password_iterations) # client key is derived from the salted password client_key = hmac.new(salted_password, b"Client Key", self.DIGEST) # this allows us to compute the stored key that is residing on the server stored_key = self.DIGEST(client_key.digest()) # as well as compute the server key self.server_key = hmac.new(salted_password, b"Server Key", self.DIGEST) # build the authorization message that will be used in the # client signature # the "c=" portion is for the channel binding, but this is not # presently implemented self.authorization_message = self.client_first_message_bare + b"," + \ self.server_first_message + b",c=" + \ base64.b64encode(self.client_channel_binding) + \ b",r=" + self.server_nonce # sign! client_signature = hmac.new(stored_key.digest(), self.authorization_message, self.DIGEST) # and the proof return self._bytes_xor(client_key.digest(), client_signature.digest()) cdef _generate_salted_password(self, str password, bytes salt, int iterations): """This follows the "Hi" algorithm specified in RFC5802""" cdef: bytes p bytes s bytes u # convert the password to a binary string - UTF8 is safe for SASL # (though there are SASLPrep rules) p = password.encode("utf8") # the salt needs to be base64 decoded -- full binary must be used s = base64.b64decode(salt) # the initial signature is the salt with a terminator of a 32-bit string # ending in 1 ui = hmac.new(p, s + b'\x00\x00\x00\x01', self.DIGEST) # grab the initial digest u = ui.digest() # for X number of iterations, recompute the HMAC signature against the # password and the latest iteration of the hash, and XOR it with the # previous version for x in range(iterations - 1): ui = hmac.new(p, ui.digest(), hashlib.sha256) # this is a fancy way of XORing two byte strings together u = self._bytes_xor(u, ui.digest()) return u cdef _normalize_password(self, str original_password): """Normalize the password using the SASLprep from RFC4013""" cdef: str normalized_password # Note: Per the PostgreSQL documentation, PostgreSWL does not require # UTF-8 to be used for the password, but will perform SASLprep on the # password regardless. # If the password is not valid UTF-8, PostgreSQL will then **not** use # SASLprep processing. # If the password fails SASLprep, the password should still be sent # See: https://www.postgresql.org/docs/current/sasl-authentication.html # and # https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/common/saslprep.c # using the `pg_saslprep` function normalized_password = original_password # if the original password is an ASCII string or fails to encode as a # UTF-8 string, then no further action is needed try: original_password.encode("ascii") except UnicodeEncodeError: pass else: return original_password # Step 1 of SASLPrep: Map. Per the algorithm, we map non-ascii space # characters to ASCII spaces (\x20 or \u0020, but we will use ' ') and # commonly mapped to nothing characters are removed # Table C.1.2 -- non-ASCII spaces # Table B.1 -- "Commonly mapped to nothing" normalized_password = u"".join( ' ' if stringprep.in_table_c12(c) else c for c in tuple(normalized_password) if not stringprep.in_table_b1(c) ) # If at this point the password is empty, PostgreSQL uses the original # password if not normalized_password: return original_password # Step 2 of SASLPrep: Normalize. Normalize the password using the # Unicode normalization algorithm to NFKC form normalized_password = unicodedata.normalize('NFKC', normalized_password) # If the password is not empty, PostgreSQL uses the original password if not normalized_password: return original_password normalized_password_tuple = tuple(normalized_password) # Step 3 of SASLPrep: Prohobited characters. If PostgreSQL detects any # of the prohibited characters in SASLPrep, it will use the original # password # We also include "unassigned code points" in the prohibited character # category as PostgreSQL does the same for c in normalized_password_tuple: if any( in_prohibited_table(c) for in_prohibited_table in self.SASLPREP_PROHIBITED ): return original_password # Step 4 of SASLPrep: Bi-directional characters. PostgreSQL follows the # rules for bi-directional characters laid on in RFC3454 Sec. 6 which # are: # 1. Characters in RFC 3454 Sec 5.8 are prohibited (C.8) # 2. If a string contains a RandALCat character, it cannot containy any # LCat character # 3. If the string contains any RandALCat character, an RandALCat # character must be the first and last character of the string # RandALCat characters are found in table D.1, whereas LCat are in D.2 if any(stringprep.in_table_d1(c) for c in normalized_password_tuple): # if the first character or the last character are not in D.1, # return the original password if not (stringprep.in_table_d1(normalized_password_tuple[0]) and stringprep.in_table_d1(normalized_password_tuple[-1])): return original_password # if any characters are in D.2, use the original password if any( stringprep.in_table_d2(c) for c in normalized_password_tuple ): return original_password # return the normalized password return normalized_password ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/settings.pxd0000644000175100001770000000205214705014413020523 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 cdef class ConnectionSettings(pgproto.CodecContext): cdef: str _encoding object _codec dict _settings bint _is_utf8 DataCodecConfig _data_codecs cdef add_setting(self, str name, str val) cdef is_encoding_utf8(self) cpdef get_text_codec(self) cpdef inline register_data_types(self, types) cpdef inline add_python_codec( self, typeoid, typename, typeschema, typeinfos, typekind, encoder, decoder, format) cpdef inline remove_python_codec( self, typeoid, typename, typeschema) cpdef inline clear_type_cache(self) cpdef inline set_builtin_type_codec( self, typeoid, typename, typeschema, typekind, alias_to, format) cpdef inline Codec get_data_codec( self, uint32_t oid, ServerDataFormat format=*, bint ignore_custom_codec=*) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/protocol/settings.pyx0000644000175100001770000000730114705014413020552 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 from asyncpg import exceptions @cython.final cdef class ConnectionSettings(pgproto.CodecContext): def __cinit__(self): self._encoding = 'utf-8' self._is_utf8 = True self._settings = {} self._codec = codecs.lookup('utf-8') self._data_codecs = DataCodecConfig() cdef add_setting(self, str name, str val): self._settings[name] = val if name == 'client_encoding': py_enc = get_python_encoding(val) self._codec = codecs.lookup(py_enc) self._encoding = self._codec.name self._is_utf8 = self._encoding == 'utf-8' cdef is_encoding_utf8(self): return self._is_utf8 cpdef get_text_codec(self): return self._codec cpdef inline register_data_types(self, types): self._data_codecs.add_types(types) cpdef inline add_python_codec(self, typeoid, typename, typeschema, typeinfos, typekind, encoder, decoder, format): cdef: ServerDataFormat _format ClientExchangeFormat xformat if format == 'binary': _format = PG_FORMAT_BINARY xformat = PG_XFORMAT_OBJECT elif format == 'text': _format = PG_FORMAT_TEXT xformat = PG_XFORMAT_OBJECT elif format == 'tuple': _format = PG_FORMAT_ANY xformat = PG_XFORMAT_TUPLE else: raise exceptions.InterfaceError( 'invalid `format` argument, expected {}, got {!r}'.format( "'text', 'binary' or 'tuple'", format )) self._data_codecs.add_python_codec(typeoid, typename, typeschema, typekind, typeinfos, encoder, decoder, _format, xformat) cpdef inline remove_python_codec(self, typeoid, typename, typeschema): self._data_codecs.remove_python_codec(typeoid, typename, typeschema) cpdef inline clear_type_cache(self): self._data_codecs.clear_type_cache() cpdef inline set_builtin_type_codec(self, typeoid, typename, typeschema, typekind, alias_to, format): cdef: ServerDataFormat _format if format is None: _format = PG_FORMAT_ANY elif format == 'binary': _format = PG_FORMAT_BINARY elif format == 'text': _format = PG_FORMAT_TEXT else: raise exceptions.InterfaceError( 'invalid `format` argument, expected {}, got {!r}'.format( "'text' or 'binary'", format )) self._data_codecs.set_builtin_type_codec(typeoid, typename, typeschema, typekind, alias_to, _format) cpdef inline Codec get_data_codec(self, uint32_t oid, ServerDataFormat format=PG_FORMAT_ANY, bint ignore_custom_codec=False): return self._data_codecs.get_codec(oid, format, ignore_custom_codec) def __getattr__(self, name): if not name.startswith('_'): try: return self._settings[name] except KeyError: raise AttributeError(name) from None return object.__getattribute__(self, name) def __repr__(self): return ''.format(self._settings) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/serverversion.py0000644000175100001770000000412514705014413017576 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 from __future__ import annotations import re import typing from .types import ServerVersion version_regex: typing.Final = re.compile( r"(Postgre[^\s]*)?\s*" r"(?P[0-9]+)\.?" r"((?P[0-9]+)\.?)?" r"(?P[0-9]+)?" r"(?P[a-z]+)?" r"(?P[0-9]+)?" ) class _VersionDict(typing.TypedDict): major: int minor: int | None micro: int | None releaselevel: str | None serial: int | None def split_server_version_string(version_string: str) -> ServerVersion: version_match = version_regex.search(version_string) if version_match is None: raise ValueError( "Unable to parse Postgres " f'version from "{version_string}"' ) version: _VersionDict = version_match.groupdict() # type: ignore[assignment] # noqa: E501 for ver_key, ver_value in version.items(): # Cast all possible versions parts to int try: version[ver_key] = int(ver_value) # type: ignore[literal-required, call-overload] # noqa: E501 except (TypeError, ValueError): pass if version["major"] < 10: return ServerVersion( version["major"], version.get("minor") or 0, version.get("micro") or 0, version.get("releaselevel") or "final", version.get("serial") or 0, ) # Since PostgreSQL 10 the versioning scheme has changed. # 10.x really means 10.0.x. While parsing 10.1 # as (10, 1) may seem less confusing, in practice most # version checks are written as version[:2], and we # want to keep that behaviour consistent, i.e not fail # a major version check due to a bugfix release. return ServerVersion( version["major"], 0, version.get("minor") or 0, version.get("releaselevel") or "final", version.get("serial") or 0, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/transaction.py0000644000175100001770000002046114705014413017210 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import enum from . import connresource from . import exceptions as apg_errors class TransactionState(enum.Enum): NEW = 0 STARTED = 1 COMMITTED = 2 ROLLEDBACK = 3 FAILED = 4 ISOLATION_LEVELS = { 'read_committed', 'read_uncommitted', 'serializable', 'repeatable_read', } ISOLATION_LEVELS_BY_VALUE = { 'read committed': 'read_committed', 'read uncommitted': 'read_uncommitted', 'serializable': 'serializable', 'repeatable read': 'repeatable_read', } class Transaction(connresource.ConnectionResource): """Represents a transaction or savepoint block. Transactions are created by calling the :meth:`Connection.transaction() ` function. """ __slots__ = ('_connection', '_isolation', '_readonly', '_deferrable', '_state', '_nested', '_id', '_managed') def __init__(self, connection, isolation, readonly, deferrable): super().__init__(connection) if isolation and isolation not in ISOLATION_LEVELS: raise ValueError( 'isolation is expected to be either of {}, ' 'got {!r}'.format(ISOLATION_LEVELS, isolation)) self._isolation = isolation self._readonly = readonly self._deferrable = deferrable self._state = TransactionState.NEW self._nested = False self._id = None self._managed = False async def __aenter__(self): if self._managed: raise apg_errors.InterfaceError( 'cannot enter context: already in an `async with` block') self._managed = True await self.start() async def __aexit__(self, extype, ex, tb): try: self._check_conn_validity('__aexit__') except apg_errors.InterfaceError: if extype is GeneratorExit: # When a PoolAcquireContext is being exited, and there # is an open transaction in an async generator that has # not been iterated fully, there is a possibility that # Pool.release() would race with this __aexit__(), since # both would be in concurrent tasks. In such case we # yield to Pool.release() to do the ROLLBACK for us. # See https://github.com/MagicStack/asyncpg/issues/232 # for an example. return else: raise try: if extype is not None: await self.__rollback() else: await self.__commit() finally: self._managed = False @connresource.guarded async def start(self): """Enter the transaction or savepoint block.""" self.__check_state_base('start') if self._state is TransactionState.STARTED: raise apg_errors.InterfaceError( 'cannot start; the transaction is already started') con = self._connection if con._top_xact is None: if con._protocol.is_in_transaction(): raise apg_errors.InterfaceError( 'cannot use Connection.transaction() in ' 'a manually started transaction') con._top_xact = self else: # Nested transaction block if self._isolation: top_xact_isolation = con._top_xact._isolation if top_xact_isolation is None: top_xact_isolation = ISOLATION_LEVELS_BY_VALUE[ await self._connection.fetchval( 'SHOW transaction_isolation;')] if self._isolation != top_xact_isolation: raise apg_errors.InterfaceError( 'nested transaction has a different isolation level: ' 'current {!r} != outer {!r}'.format( self._isolation, top_xact_isolation)) self._nested = True if self._nested: self._id = con._get_unique_id('savepoint') query = 'SAVEPOINT {};'.format(self._id) else: query = 'BEGIN' if self._isolation == 'read_committed': query += ' ISOLATION LEVEL READ COMMITTED' elif self._isolation == 'read_uncommitted': query += ' ISOLATION LEVEL READ UNCOMMITTED' elif self._isolation == 'repeatable_read': query += ' ISOLATION LEVEL REPEATABLE READ' elif self._isolation == 'serializable': query += ' ISOLATION LEVEL SERIALIZABLE' if self._readonly: query += ' READ ONLY' if self._deferrable: query += ' DEFERRABLE' query += ';' try: await self._connection.execute(query) except BaseException: self._state = TransactionState.FAILED raise else: self._state = TransactionState.STARTED def __check_state_base(self, opname): if self._state is TransactionState.COMMITTED: raise apg_errors.InterfaceError( 'cannot {}; the transaction is already committed'.format( opname)) if self._state is TransactionState.ROLLEDBACK: raise apg_errors.InterfaceError( 'cannot {}; the transaction is already rolled back'.format( opname)) if self._state is TransactionState.FAILED: raise apg_errors.InterfaceError( 'cannot {}; the transaction is in error state'.format( opname)) def __check_state(self, opname): if self._state is not TransactionState.STARTED: if self._state is TransactionState.NEW: raise apg_errors.InterfaceError( 'cannot {}; the transaction is not yet started'.format( opname)) self.__check_state_base(opname) async def __commit(self): self.__check_state('commit') if self._connection._top_xact is self: self._connection._top_xact = None if self._nested: query = 'RELEASE SAVEPOINT {};'.format(self._id) else: query = 'COMMIT;' try: await self._connection.execute(query) except BaseException: self._state = TransactionState.FAILED raise else: self._state = TransactionState.COMMITTED async def __rollback(self): self.__check_state('rollback') if self._connection._top_xact is self: self._connection._top_xact = None if self._nested: query = 'ROLLBACK TO {};'.format(self._id) else: query = 'ROLLBACK;' try: await self._connection.execute(query) except BaseException: self._state = TransactionState.FAILED raise else: self._state = TransactionState.ROLLEDBACK @connresource.guarded async def commit(self): """Exit the transaction or savepoint block and commit changes.""" if self._managed: raise apg_errors.InterfaceError( 'cannot manually commit from within an `async with` block') await self.__commit() @connresource.guarded async def rollback(self): """Exit the transaction or savepoint block and rollback changes.""" if self._managed: raise apg_errors.InterfaceError( 'cannot manually rollback from within an `async with` block') await self.__rollback() def __repr__(self): attrs = [] attrs.append('state:{}'.format(self._state.name.lower())) if self._isolation is not None: attrs.append(self._isolation) if self._readonly: attrs.append('readonly') if self._deferrable: attrs.append('deferrable') if self.__class__.__module__.startswith('asyncpg.'): mod = 'asyncpg' else: mod = self.__class__.__module__ return '<{}.{} {} {:#x}>'.format( mod, self.__class__.__name__, ' '.join(attrs), id(self)) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/types.py0000644000175100001770000001262014705014413016025 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 from __future__ import annotations import typing from asyncpg.pgproto.types import ( BitString, Point, Path, Polygon, Box, Line, LineSegment, Circle, ) if typing.TYPE_CHECKING: from typing_extensions import Self __all__ = ( 'Type', 'Attribute', 'Range', 'BitString', 'Point', 'Path', 'Polygon', 'Box', 'Line', 'LineSegment', 'Circle', 'ServerVersion', ) class Type(typing.NamedTuple): oid: int name: str kind: str schema: str Type.__doc__ = 'Database data type.' Type.oid.__doc__ = 'OID of the type.' Type.name.__doc__ = 'Type name. For example "int2".' Type.kind.__doc__ = \ 'Type kind. Can be "scalar", "array", "composite" or "range".' Type.schema.__doc__ = 'Name of the database schema that defines the type.' class Attribute(typing.NamedTuple): name: str type: Type Attribute.__doc__ = 'Database relation attribute.' Attribute.name.__doc__ = 'Attribute name.' Attribute.type.__doc__ = 'Attribute data type :class:`asyncpg.types.Type`.' class ServerVersion(typing.NamedTuple): major: int minor: int micro: int releaselevel: str serial: int ServerVersion.__doc__ = 'PostgreSQL server version tuple.' class _RangeValue(typing.Protocol): def __eq__(self, __value: object) -> bool: ... def __lt__(self, __other: _RangeValue) -> bool: ... def __gt__(self, __other: _RangeValue) -> bool: ... _RV = typing.TypeVar('_RV', bound=_RangeValue) class Range(typing.Generic[_RV]): """Immutable representation of PostgreSQL `range` type.""" __slots__ = ('_lower', '_upper', '_lower_inc', '_upper_inc', '_empty') _lower: _RV | None _upper: _RV | None _lower_inc: bool _upper_inc: bool _empty: bool def __init__( self, lower: _RV | None = None, upper: _RV | None = None, *, lower_inc: bool = True, upper_inc: bool = False, empty: bool = False ) -> None: self._empty = empty if empty: self._lower = self._upper = None self._lower_inc = self._upper_inc = False else: self._lower = lower self._upper = upper self._lower_inc = lower is not None and lower_inc self._upper_inc = upper is not None and upper_inc @property def lower(self) -> _RV | None: return self._lower @property def lower_inc(self) -> bool: return self._lower_inc @property def lower_inf(self) -> bool: return self._lower is None and not self._empty @property def upper(self) -> _RV | None: return self._upper @property def upper_inc(self) -> bool: return self._upper_inc @property def upper_inf(self) -> bool: return self._upper is None and not self._empty @property def isempty(self) -> bool: return self._empty def _issubset_lower(self, other: Self) -> bool: if other._lower is None: return True if self._lower is None: return False return self._lower > other._lower or ( self._lower == other._lower and (other._lower_inc or not self._lower_inc) ) def _issubset_upper(self, other: Self) -> bool: if other._upper is None: return True if self._upper is None: return False return self._upper < other._upper or ( self._upper == other._upper and (other._upper_inc or not self._upper_inc) ) def issubset(self, other: Self) -> bool: if self._empty: return True if other._empty: return False return self._issubset_lower(other) and self._issubset_upper(other) def issuperset(self, other: Self) -> bool: return other.issubset(self) def __bool__(self) -> bool: return not self._empty def __eq__(self, other: object) -> bool: if not isinstance(other, Range): return NotImplemented return ( self._lower, self._upper, self._lower_inc, self._upper_inc, self._empty ) == ( other._lower, # pyright: ignore [reportUnknownMemberType] other._upper, # pyright: ignore [reportUnknownMemberType] other._lower_inc, other._upper_inc, other._empty ) def __hash__(self) -> int: return hash(( self._lower, self._upper, self._lower_inc, self._upper_inc, self._empty )) def __repr__(self) -> str: if self._empty: desc = 'empty' else: if self._lower is None or not self._lower_inc: lb = '(' else: lb = '[' if self._lower is not None: lb += repr(self._lower) if self._upper is not None: ub = repr(self._upper) else: ub = '' if self._upper is None or not self._upper_inc: ub += ')' else: ub += ']' desc = '{}, {}'.format(lb, ub) return ''.format(desc) __str__ = __repr__ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/asyncpg/utils.py0000644000175100001770000000272714705014413016030 0ustar00runnerdocker# Copyright (C) 2016-present the ayncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import re def _quote_ident(ident): return '"{}"'.format(ident.replace('"', '""')) def _quote_literal(string): return "'{}'".format(string.replace("'", "''")) async def _mogrify(conn, query, args): """Safely inline arguments to query text.""" # Introspect the target query for argument types and # build a list of safely-quoted fully-qualified type names. ps = await conn.prepare(query) paramtypes = [] for t in ps.get_parameters(): if t.name.endswith('[]'): pname = '_' + t.name[:-2] else: pname = t.name paramtypes.append('{}.{}'.format( _quote_ident(t.schema), _quote_ident(pname))) del ps # Use Postgres to convert arguments to text representation # by casting each value to text. cols = ['quote_literal(${}::{}::text)'.format(i, t) for i, t in enumerate(paramtypes, start=1)] textified = await conn.fetchrow( 'SELECT {cols}'.format(cols=', '.join(cols)), *args) # Finally, replace $n references with text values. return re.sub( r"\$(\d+)\b", lambda m: ( textified[int(m.group(1)) - 1] if textified[int(m.group(1)) - 1] is not None else "NULL" ), query, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1729370387.5055544 asyncpg-0.30.0/asyncpg.egg-info/0000755000175100001770000000000014705014424016002 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370383.0 asyncpg-0.30.0/asyncpg.egg-info/PKG-INFO0000644000175100001770000001162214705014417017103 0ustar00runnerdockerMetadata-Version: 2.1 Name: asyncpg Version: 0.30.0 Summary: An asyncio PostgreSQL driver Author-email: MagicStack Inc License: Apache License, Version 2.0 Project-URL: github, https://github.com/MagicStack/asyncpg Keywords: database,postgres Classifier: Development Status :: 5 - Production/Stable Classifier: Framework :: AsyncIO Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: POSIX Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: Microsoft :: Windows Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Topic :: Database :: Front-Ends Requires-Python: >=3.8.0 Description-Content-Type: text/x-rst License-File: LICENSE License-File: AUTHORS Requires-Dist: async_timeout>=4.0.3; python_version < "3.11.0" Provides-Extra: gssauth Requires-Dist: gssapi; platform_system != "Windows" and extra == "gssauth" Requires-Dist: sspilib; platform_system == "Windows" and extra == "gssauth" Provides-Extra: test Requires-Dist: flake8~=6.1; extra == "test" Requires-Dist: flake8-pyi~=24.1.0; extra == "test" Requires-Dist: distro~=1.9.0; extra == "test" Requires-Dist: uvloop>=0.15.3; (platform_system != "Windows" and python_version < "3.14.0") and extra == "test" Requires-Dist: gssapi; platform_system == "Linux" and extra == "test" Requires-Dist: k5test; platform_system == "Linux" and extra == "test" Requires-Dist: sspilib; platform_system == "Windows" and extra == "test" Requires-Dist: mypy~=1.8.0; extra == "test" Provides-Extra: docs Requires-Dist: Sphinx~=8.1.3; extra == "docs" Requires-Dist: sphinx_rtd_theme>=1.2.2; extra == "docs" asyncpg -- A fast PostgreSQL Database Client Library for Python/asyncio ======================================================================= .. image:: https://github.com/MagicStack/asyncpg/workflows/Tests/badge.svg :target: https://github.com/MagicStack/asyncpg/actions?query=workflow%3ATests+branch%3Amaster :alt: GitHub Actions status .. image:: https://img.shields.io/pypi/v/asyncpg.svg :target: https://pypi.python.org/pypi/asyncpg **asyncpg** is a database interface library designed specifically for PostgreSQL and Python/asyncio. asyncpg is an efficient, clean implementation of PostgreSQL server binary protocol for use with Python's ``asyncio`` framework. You can read more about asyncpg in an introductory `blog post `_. asyncpg requires Python 3.8 or later and is supported for PostgreSQL versions 9.5 to 17. Other PostgreSQL versions or other databases implementing the PostgreSQL protocol *may* work, but are not being actively tested. Documentation ------------- The project documentation can be found `here `_. Performance ----------- In our testing asyncpg is, on average, **5x** faster than psycopg3. .. image:: https://raw.githubusercontent.com/MagicStack/asyncpg/master/performance.png?fddca40ab0 :target: https://gistpreview.github.io/?0ed296e93523831ea0918d42dd1258c2 The above results are a geometric mean of benchmarks obtained with PostgreSQL `client driver benchmarking toolbench `_ in June 2023 (click on the chart to see full details). Features -------- asyncpg implements PostgreSQL server protocol natively and exposes its features directly, as opposed to hiding them behind a generic facade like DB-API. This enables asyncpg to have easy-to-use support for: * **prepared statements** * **scrollable cursors** * **partial iteration** on query results * automatic encoding and decoding of composite types, arrays, and any combination of those * straightforward support for custom data types Installation ------------ asyncpg is available on PyPI. When not using GSSAPI/SSPI authentication it has no dependencies. Use pip to install:: $ pip install asyncpg If you need GSSAPI/SSPI authentication, use:: $ pip install 'asyncpg[gssauth]' For more details, please `see the documentation `_. Basic Usage ----------- .. code-block:: python import asyncio import asyncpg async def run(): conn = await asyncpg.connect(user='user', password='password', database='database', host='127.0.0.1') values = await conn.fetch( 'SELECT * FROM mytable WHERE id = $1', 10, ) await conn.close() asyncio.run(run()) License ------- asyncpg is developed and distributed under the Apache 2.0 license. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370387.0 asyncpg-0.30.0/asyncpg.egg-info/SOURCES.txt0000644000175100001770000000732014705014423017667 0ustar00runnerdocker.flake8 AUTHORS LICENSE MANIFEST.in Makefile README.rst performance.png pyproject.toml setup.py asyncpg/__init__.py asyncpg/_asyncio_compat.py asyncpg/_version.py asyncpg/cluster.py asyncpg/compat.py asyncpg/connect_utils.py asyncpg/connection.py asyncpg/connresource.py asyncpg/cursor.py asyncpg/introspection.py asyncpg/pool.py asyncpg/prepared_stmt.py asyncpg/serverversion.py asyncpg/transaction.py asyncpg/types.py asyncpg/utils.py asyncpg.egg-info/PKG-INFO asyncpg.egg-info/SOURCES.txt asyncpg.egg-info/dependency_links.txt asyncpg.egg-info/not-zip-safe asyncpg.egg-info/requires.txt asyncpg.egg-info/top_level.txt asyncpg/_testbase/__init__.py asyncpg/_testbase/fuzzer.py asyncpg/exceptions/__init__.py asyncpg/exceptions/_base.py asyncpg/pgproto/__init__.pxd asyncpg/pgproto/__init__.py asyncpg/pgproto/buffer.pxd asyncpg/pgproto/buffer.pyx asyncpg/pgproto/consts.pxi asyncpg/pgproto/cpythonx.pxd asyncpg/pgproto/debug.h asyncpg/pgproto/debug.pxd asyncpg/pgproto/frb.pxd asyncpg/pgproto/frb.pyx asyncpg/pgproto/hton.h asyncpg/pgproto/hton.pxd asyncpg/pgproto/pgproto.c asyncpg/pgproto/pgproto.pxd asyncpg/pgproto/pgproto.pyi asyncpg/pgproto/pgproto.pyx asyncpg/pgproto/tohex.h asyncpg/pgproto/tohex.pxd asyncpg/pgproto/types.py asyncpg/pgproto/uuid.pyx asyncpg/pgproto/codecs/__init__.pxd asyncpg/pgproto/codecs/bits.pyx asyncpg/pgproto/codecs/bytea.pyx asyncpg/pgproto/codecs/context.pyx asyncpg/pgproto/codecs/datetime.pyx asyncpg/pgproto/codecs/float.pyx asyncpg/pgproto/codecs/geometry.pyx asyncpg/pgproto/codecs/hstore.pyx asyncpg/pgproto/codecs/int.pyx asyncpg/pgproto/codecs/json.pyx asyncpg/pgproto/codecs/jsonpath.pyx asyncpg/pgproto/codecs/misc.pyx asyncpg/pgproto/codecs/network.pyx asyncpg/pgproto/codecs/numeric.pyx asyncpg/pgproto/codecs/pg_snapshot.pyx asyncpg/pgproto/codecs/text.pyx asyncpg/pgproto/codecs/tid.pyx asyncpg/pgproto/codecs/uuid.pyx asyncpg/protocol/__init__.py asyncpg/protocol/consts.pxi asyncpg/protocol/coreproto.pxd asyncpg/protocol/coreproto.pyx asyncpg/protocol/cpythonx.pxd asyncpg/protocol/encodings.pyx asyncpg/protocol/pgtypes.pxi asyncpg/protocol/prepared_stmt.pxd asyncpg/protocol/prepared_stmt.pyx asyncpg/protocol/protocol.c asyncpg/protocol/protocol.pxd asyncpg/protocol/protocol.pyi asyncpg/protocol/protocol.pyx asyncpg/protocol/scram.pxd asyncpg/protocol/scram.pyx asyncpg/protocol/settings.pxd asyncpg/protocol/settings.pyx asyncpg/protocol/codecs/__init__.py asyncpg/protocol/codecs/array.pyx asyncpg/protocol/codecs/base.pxd asyncpg/protocol/codecs/base.pyx asyncpg/protocol/codecs/pgproto.pyx asyncpg/protocol/codecs/range.pyx asyncpg/protocol/codecs/record.pyx asyncpg/protocol/codecs/textutils.pyx asyncpg/protocol/record/__init__.pxd asyncpg/protocol/record/recordobj.c asyncpg/protocol/record/recordobj.h docs/Makefile docs/conf.py docs/faq.rst docs/index.rst docs/installation.rst docs/usage.rst docs/_static/theme_overrides.css docs/api/index.rst tests/__init__.py tests/test__environment.py tests/test__sourcecode.py tests/test_adversity.py tests/test_cache_invalidation.py tests/test_cancellation.py tests/test_codecs.py tests/test_connect.py tests/test_copy.py tests/test_cursor.py tests/test_exceptions.py tests/test_execute.py tests/test_introspection.py tests/test_listeners.py tests/test_logging.py tests/test_pool.py tests/test_prepare.py tests/test_record.py tests/test_test.py tests/test_timeout.py tests/test_transaction.py tests/test_types.py tests/test_utils.py tests/certs/ca.cert.pem tests/certs/ca.crl.pem tests/certs/ca.key.pem tests/certs/client.cert.pem tests/certs/client.csr.pem tests/certs/client.key.pem tests/certs/client.key.protected.pem tests/certs/client_ca.cert.pem tests/certs/client_ca.key.pem tests/certs/gen.py tests/certs/server.cert.pem tests/certs/server.crl.pem tests/certs/server.key.pem././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370383.0 asyncpg-0.30.0/asyncpg.egg-info/dependency_links.txt0000644000175100001770000000000114705014417022052 0ustar00runnerdocker ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370383.0 asyncpg-0.30.0/asyncpg.egg-info/not-zip-safe0000644000175100001770000000000114705014417020232 0ustar00runnerdocker ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370383.0 asyncpg-0.30.0/asyncpg.egg-info/requires.txt0000644000175100001770000000067414705014417020413 0ustar00runnerdocker [:python_version < "3.11.0"] async_timeout>=4.0.3 [docs] Sphinx~=8.1.3 sphinx_rtd_theme>=1.2.2 [gssauth] [gssauth:platform_system != "Windows"] gssapi [gssauth:platform_system == "Windows"] sspilib [test] flake8~=6.1 flake8-pyi~=24.1.0 distro~=1.9.0 mypy~=1.8.0 [test:platform_system != "Windows" and python_version < "3.14.0"] uvloop>=0.15.3 [test:platform_system == "Linux"] gssapi k5test [test:platform_system == "Windows"] sspilib ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370383.0 asyncpg-0.30.0/asyncpg.egg-info/top_level.txt0000644000175100001770000000001014705014417020525 0ustar00runnerdockerasyncpg ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1729370387.4975543 asyncpg-0.30.0/docs/0000755000175100001770000000000014705014423013573 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/docs/Makefile0000644000175100001770000001667614705014413015252 0ustar00runnerdocker# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = python -m sphinx PAPER = BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " applehelp to make an Apple Help Book" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " epub3 to make an epub3" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " xml to make Docutils-native XML files" @echo " pseudoxml to make pseudoxml-XML files for display purposes" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" @echo " coverage to run coverage check of the documentation (if enabled)" @echo " dummy to check syntax errors of document sources" .PHONY: clean clean: rm -rf $(BUILDDIR)/* .PHONY: html html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." .PHONY: dirhtml dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." .PHONY: singlehtml singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." .PHONY: pickle pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." .PHONY: json json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." .PHONY: htmlhelp htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." .PHONY: qthelp qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/asyncpg.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/asyncpg.qhc" .PHONY: applehelp applehelp: $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp @echo @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." @echo "N.B. You won't be able to view it unless you put it in" \ "~/Library/Documentation/Help or install it in your application" \ "bundle." .PHONY: devhelp devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/asyncpg" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/asyncpg" @echo "# devhelp" .PHONY: epub epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." .PHONY: epub3 epub3: $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3 @echo @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3." .PHONY: latex latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." .PHONY: latexpdf latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." .PHONY: latexpdfja latexpdfja: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through platex and dvipdfmx..." $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." .PHONY: text text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." .PHONY: man man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." .PHONY: texinfo texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." .PHONY: info info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." .PHONY: gettext gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." .PHONY: changes changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." .PHONY: linkcheck linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." .PHONY: doctest doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." .PHONY: coverage coverage: $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage @echo "Testing of coverage in the sources finished, look at the " \ "results in $(BUILDDIR)/coverage/python.txt." .PHONY: xml xml: $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml @echo @echo "Build finished. The XML files are in $(BUILDDIR)/xml." .PHONY: pseudoxml pseudoxml: $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml @echo @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." .PHONY: dummy dummy: $(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy @echo @echo "Build finished. Dummy builder generates no files." ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1729370387.4975543 asyncpg-0.30.0/docs/_static/0000755000175100001770000000000014705014423015221 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/docs/_static/theme_overrides.css0000644000175100001770000000041214705014413021113 0ustar00runnerdocker/* override table width restrictions */ @media screen and (min-width: 767px) { .wy-table-responsive table td { white-space: normal !important; vertical-align: top !important; } .wy-table-responsive { overflow: visible !important; } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1729370387.4975543 asyncpg-0.30.0/docs/api/0000755000175100001770000000000014705014423014344 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/docs/api/index.rst0000644000175100001770000002204114705014413016203 0ustar00runnerdocker.. _asyncpg-api-reference: ============= API Reference ============= .. module:: asyncpg :synopsis: A fast PostgreSQL Database Client Library for Python/asyncio .. currentmodule:: asyncpg .. _asyncpg-api-connection: Connection ========== .. autofunction:: asyncpg.connection.connect .. autoclass:: asyncpg.connection.Connection :members: .. _asyncpg-api-prepared-stmt: Prepared Statements =================== Prepared statements are a PostgreSQL feature that can be used to optimize the performance of queries that are executed more than once. When a query is *prepared* by a call to :meth:`Connection.prepare`, the server parses, analyzes and compiles the query allowing to reuse that work once there is a need to run the same query again. .. code-block:: pycon >>> import asyncpg, asyncio >>> async def run(): ... conn = await asyncpg.connect() ... stmt = await conn.prepare('''SELECT 2 ^ $1''') ... print(await stmt.fetchval(10)) ... print(await stmt.fetchval(20)) ... >>> asyncio.run(run()) 1024.0 1048576.0 .. note:: asyncpg automatically maintains a small LRU cache for queries executed during calls to the :meth:`~Connection.fetch`, :meth:`~Connection.fetchrow`, or :meth:`~Connection.fetchval` methods. .. warning:: If you are using pgbouncer with ``pool_mode`` set to ``transaction`` or ``statement``, prepared statements will not work correctly. See :ref:`asyncpg-prepared-stmt-errors` for more information. .. autoclass:: asyncpg.prepared_stmt.PreparedStatement() :members: .. _asyncpg-api-transaction: Transactions ============ The most common way to use transactions is through an ``async with`` statement: .. code-block:: python async with connection.transaction(): await connection.execute("INSERT INTO mytable VALUES(1, 2, 3)") asyncpg supports nested transactions (a nested transaction context will create a `savepoint`_.): .. code-block:: python async with connection.transaction(): await connection.execute('CREATE TABLE mytab (a int)') try: # Create a nested transaction: async with connection.transaction(): await connection.execute('INSERT INTO mytab (a) VALUES (1), (2)') # This nested transaction will be automatically rolled back: raise Exception except: # Ignore exception pass # Because the nested transaction was rolled back, there # will be nothing in `mytab`. assert await connection.fetch('SELECT a FROM mytab') == [] Alternatively, transactions can be used without an ``async with`` block: .. code-block:: python tr = connection.transaction() await tr.start() try: ... except: await tr.rollback() raise else: await tr.commit() See also the :meth:`Connection.transaction() ` function. .. _savepoint: https://www.postgresql.org/docs/current/static/sql-savepoint.html .. autoclass:: asyncpg.transaction.Transaction() :members: .. describe:: async with c: start and commit/rollback the transaction or savepoint block automatically when entering and exiting the code inside the context manager block. .. _asyncpg-api-cursor: Cursors ======= Cursors are useful when there is a need to iterate over the results of a large query without fetching all rows at once. The cursor interface provided by asyncpg supports *asynchronous iteration* via the ``async for`` statement, and also a way to read row chunks and skip forward over the result set. To iterate over a cursor using a connection object use :meth:`Connection.cursor() `. To make the iteration efficient, the cursor will prefetch records to reduce the number of queries sent to the server: .. code-block:: python async def iterate(con: Connection): async with con.transaction(): # Postgres requires non-scrollable cursors to be created # and used in a transaction. async for record in con.cursor('SELECT generate_series(0, 100)'): print(record) Or, alternatively, you can iterate over the cursor manually (cursor won't be prefetching any rows): .. code-block:: python async def iterate(con: Connection): async with con.transaction(): # Postgres requires non-scrollable cursors to be created # and used in a transaction. # Create a Cursor object cur = await con.cursor('SELECT generate_series(0, 100)') # Move the cursor 10 rows forward await cur.forward(10) # Fetch one row and print it print(await cur.fetchrow()) # Fetch a list of 5 rows and print it print(await cur.fetch(5)) It's also possible to create cursors from prepared statements: .. code-block:: python async def iterate(con: Connection): # Create a prepared statement that will accept one argument stmt = await con.prepare('SELECT generate_series(0, $1)') async with con.transaction(): # Postgres requires non-scrollable cursors to be created # and used in a transaction. # Execute the prepared statement passing `10` as the # argument -- that will generate a series or records # from 0..10. Iterate over all of them and print every # record. async for record in stmt.cursor(10): print(record) .. note:: Cursors created by a call to :meth:`Connection.cursor() ` or :meth:`PreparedStatement.cursor() ` are *non-scrollable*: they can only be read forwards. To create a scrollable cursor, use the ``DECLARE ... SCROLL CURSOR`` SQL statement directly. .. warning:: Cursors created by a call to :meth:`Connection.cursor() ` or :meth:`PreparedStatement.cursor() ` cannot be used outside of a transaction. Any such attempt will result in :exc:`~asyncpg.exceptions.InterfaceError`. To create a cursor usable outside of a transaction, use the ``DECLARE ... CURSOR WITH HOLD`` SQL statement directly. .. autoclass:: asyncpg.cursor.CursorFactory() :members: .. describe:: async for row in c Execute the statement and iterate over the results asynchronously. .. describe:: await c Execute the statement and return an instance of :class:`~asyncpg.cursor.Cursor` which can be used to navigate over and fetch subsets of the query results. .. autoclass:: asyncpg.cursor.Cursor() :members: .. _asyncpg-api-pool: Connection Pools ================ .. autofunction:: asyncpg.pool.create_pool .. autoclass:: asyncpg.pool.Pool() :members: .. _asyncpg-api-record: Record Objects ============== Each row (or composite type value) returned by calls to ``fetch*`` methods is represented by an instance of the :class:`~asyncpg.Record` object. ``Record`` objects are a tuple-/dict-like hybrid, and allow addressing of items either by a numeric index or by a field name: .. code-block:: pycon >>> import asyncpg >>> import asyncio >>> loop = asyncio.get_event_loop() >>> conn = loop.run_until_complete(asyncpg.connect()) >>> r = loop.run_until_complete(conn.fetchrow(''' ... SELECT oid, rolname, rolsuper FROM pg_roles WHERE rolname = user''')) >>> r >>> r['oid'] 16388 >>> r[0] 16388 >>> dict(r) {'oid': 16388, 'rolname': 'elvis', 'rolsuper': True} >>> tuple(r) (16388, 'elvis', True) .. note:: ``Record`` objects currently cannot be created from Python code. .. class:: Record() A read-only representation of PostgreSQL row. .. describe:: len(r) Return the number of fields in record *r*. .. describe:: r[field] Return the field of *r* with field name or index *field*. .. describe:: name in r Return ``True`` if record *r* has a field named *name*. .. describe:: iter(r) Return an iterator over the *values* of the record *r*. .. describe:: get(name[, default]) Return the value for *name* if the record has a field named *name*, else return *default*. If *default* is not given, return ``None``. .. versionadded:: 0.18 .. method:: values() Return an iterator over the record values. .. method:: keys() Return an iterator over the record field names. .. method:: items() Return an iterator over ``(field, value)`` pairs. .. class:: ConnectionSettings() A read-only collection of Connection settings. .. describe:: settings.setting_name Return the value of the "setting_name" setting. Raises an ``AttributeError`` if the setting is not defined. Example: .. code-block:: pycon >>> connection.get_settings().client_encoding 'UTF8' Data Types ========== .. automodule:: asyncpg.types :members: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/docs/conf.py0000644000175100001770000000451314705014413015074 0ustar00runnerdocker#!/usr/bin/env python3 import os import sys sys.path.insert(0, os.path.abspath('..')) version_file = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'asyncpg', '_version.py') with open(version_file, 'r') as f: for line in f: if line.startswith('__version__: typing.Final ='): _, _, version = line.partition('=') version = version.strip(" \n'\"") break else: raise RuntimeError( 'unable to read the version from asyncpg/_version.py') # -- General configuration ------------------------------------------------ extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.viewcode', 'sphinx.ext.githubpages', 'sphinx.ext.intersphinx', ] add_module_names = False templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = 'asyncpg' copyright = '2016-present, the asyncpg authors and contributors' author = '' release = version language = "en" exclude_patterns = ['_build'] pygments_style = 'sphinx' todo_include_todos = False suppress_warnings = ['image.nonlocal_uri'] # -- Options for HTML output ---------------------------------------------- html_theme = 'sphinx_rtd_theme' html_title = 'asyncpg Documentation' html_short_title = 'asyncpg' html_static_path = ['_static'] html_sidebars = { '**': [ 'about.html', 'navigation.html', ] } html_show_sourcelink = False html_show_sphinx = False html_show_copyright = True htmlhelp_basename = 'asyncpgdoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = {} latex_documents = [ (master_doc, 'asyncpg.tex', 'asyncpg Documentation', author, 'manual'), ] # -- Options for manual page output --------------------------------------- man_pages = [ (master_doc, 'asyncpg', 'asyncpg Documentation', [author], 1) ] # -- Options for Texinfo output ------------------------------------------- texinfo_documents = [ (master_doc, 'asyncpg', 'asyncpg Documentation', author, 'asyncpg', 'asyncpg is a fast PostgreSQL client library for the ' 'Python asyncio framework', 'Miscellaneous'), ] # -- Options for intersphinx ---------------------------------------------- intersphinx_mapping = {'python': ('https://docs.python.org/3', None)} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/docs/faq.rst0000644000175100001770000000720114705014413015073 0ustar00runnerdocker.. _asyncpg-faq: Frequently Asked Questions ========================== Does asyncpg support DB-API? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ No. DB-API is a synchronous API, while asyncpg is based around an asynchronous I/O model. Thus, full drop-in compatibility with DB-API is not possible and we decided to design asyncpg API in a way that is better aligned with PostgreSQL architecture and terminology. We will release a synchronous DB-API-compatible version of asyncpg at some point in the future. Can I use asyncpg with SQLAlchemy ORM? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Yes. SQLAlchemy version 1.4 and later supports the asyncpg dialect natively. Please refer to its documentation for details. Older SQLAlchemy versions may be used in tandem with a third-party adapter such as asyncpgsa_ or databases_. Can I use dot-notation with :class:`asyncpg.Record`? It looks cleaner. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We decided against making :class:`asyncpg.Record` a named tuple because we want to keep the ``Record`` method namespace separate from the column namespace. That said, you can provide a custom ``Record`` class that implements dot-notation via the ``record_class`` argument to :func:`connect() ` or any of the Record-returning methods. .. code-block:: python class MyRecord(asyncpg.Record): def __getattr__(self, name): return self[name] Why can't I use a :ref:`cursor ` outside of a transaction? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Cursors created by a call to :meth:`Connection.cursor() ` or :meth:`PreparedStatement.cursor() \ ` cannot be used outside of a transaction. Any such attempt will result in ``InterfaceError``. To create a cursor usable outside of a transaction, use the ``DECLARE ... CURSOR WITH HOLD`` SQL statement directly. .. _asyncpg-prepared-stmt-errors: Why am I getting prepared statement errors? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If you are getting intermittent ``prepared statement "__asyncpg_stmt_xx__" does not exist`` or ``prepared statement “__asyncpg_stmt_xx__†already exists`` errors, you are most likely not connecting to the PostgreSQL server directly, but via `pgbouncer `_. pgbouncer, when in the ``"transaction"`` or ``"statement"`` pooling mode, does not support prepared statements. You have several options: * if you are using pgbouncer only to reduce the cost of new connections (as opposed to using pgbouncer for connection pooling from a large number of clients in the interest of better scalability), switch to the :ref:`connection pool ` functionality provided by asyncpg, it is a much better option for this purpose; * disable automatic use of prepared statements by passing ``statement_cache_size=0`` to :func:`asyncpg.connect() ` and :func:`asyncpg.create_pool() ` (and, obviously, avoid the use of :meth:`Connection.prepare() `); * switch pgbouncer's ``pool_mode`` to ``session``. Why do I get ``PostgresSyntaxError`` when using ``expression IN $1``? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``expression IN $1`` is not a valid PostgreSQL syntax. To check a value against a sequence use ``expression = any($1::mytype[])``, where ``mytype`` is the array element type. .. _asyncpgsa: https://github.com/CanopyTax/asyncpgsa .. _databases: https://github.com/encode/databases ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/docs/index.rst0000644000175100001770000000162514705014413015437 0ustar00runnerdocker.. image:: https://github.com/MagicStack/asyncpg/workflows/Tests/badge.svg :target: https://github.com/MagicStack/asyncpg/actions?query=workflow%3ATests+branch%3Amaster :alt: GitHub Actions status .. image:: https://img.shields.io/pypi/status/asyncpg.svg?maxAge=2592000?style=plastic :target: https://pypi.python.org/pypi/asyncpg ======= asyncpg ======= **asyncpg** is a database interface library designed specifically for PostgreSQL and Python/asyncio. asyncpg is an efficient, clean implementation of PostgreSQL server binary protocol for use with Python's ``asyncio`` framework. **asyncpg** requires Python 3.8 or later and is supported for PostgreSQL versions 9.5 to 17. Other PostgreSQL versions or other databases implementing the PostgreSQL protocol *may* work, but are not being actively tested. Contents -------- .. toctree:: :maxdepth: 2 installation usage api/index faq ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/docs/installation.rst0000644000175100001770000000412614705014413017030 0ustar00runnerdocker.. _asyncpg-installation: Installation ============ **asyncpg** has no external dependencies when not using GSSAPI/SSPI authentication. The recommended way to install it is to use **pip**: .. code-block:: bash $ pip install asyncpg If you need GSSAPI/SSPI authentication, the recommended way is to use .. code-block:: bash $ pip install 'asyncpg[gssauth]' This installs SSPI support on Windows and GSSAPI support on non-Windows platforms. SSPI and GSSAPI interoperate as clients and servers: an SSPI client can authenticate to a GSSAPI server and vice versa. On Linux installing GSSAPI requires a working C compiler and Kerberos 5 development files. The latter can be obtained by installing **libkrb5-dev** package on Debian/Ubuntu or **krb5-devel** on RHEL/Fedora. (This is needed because PyPI does not have Linux wheels for **gssapi**. See `here for the details `_.) It is also possible to use GSSAPI on Windows: * `pip install gssapi` * Install `Kerberos for Windows `_. * Set the ``gsslib`` parameter or the ``PGGSSLIB`` environment variable to `gssapi` when connecting. Building from source -------------------- If you want to build **asyncpg** from a Git checkout you will need: * To have cloned the repo with `--recurse-submodules`. * A working C compiler. * CPython header files. These can usually be obtained by installing the relevant Python development package: **python3-dev** on Debian/Ubuntu, **python3-devel** on RHEL/Fedora. Once the above requirements are satisfied, run the following command in the root of the source checkout: .. code-block:: bash $ pip install -e . A debug build containing more runtime checks can be created by setting the ``ASYNCPG_DEBUG`` environment variable when building: .. code-block:: bash $ env ASYNCPG_DEBUG=1 pip install -e . Running tests ------------- If you want to run tests you must have PostgreSQL installed. To execute the testsuite run: .. code-block:: bash $ python setup.py test ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/docs/usage.rst0000644000175100001770000004337614705014413015445 0ustar00runnerdocker.. _asyncpg-examples: asyncpg Usage ============= The interaction with the database normally starts with a call to :func:`connect() `, which establishes a new database session and returns a new :class:`Connection ` instance, which provides methods to run queries and manage transactions. .. code-block:: python import asyncio import asyncpg import datetime async def main(): # Establish a connection to an existing database named "test" # as a "postgres" user. conn = await asyncpg.connect('postgresql://postgres@localhost/test') # Execute a statement to create a new table. await conn.execute(''' CREATE TABLE users( id serial PRIMARY KEY, name text, dob date ) ''') # Insert a record into the created table. await conn.execute(''' INSERT INTO users(name, dob) VALUES($1, $2) ''', 'Bob', datetime.date(1984, 3, 1)) # Select a row from the table. row = await conn.fetchrow( 'SELECT * FROM users WHERE name = $1', 'Bob') # *row* now contains # asyncpg.Record(id=1, name='Bob', dob=datetime.date(1984, 3, 1)) # Close the connection. await conn.close() asyncio.run(main()) .. note:: asyncpg uses the native PostgreSQL syntax for query arguments: ``$n``. Type Conversion --------------- asyncpg automatically converts PostgreSQL types to the corresponding Python types and vice versa. All standard data types are supported out of the box, including arrays, composite types, range types, enumerations and any combination of them. It is possible to supply codecs for non-standard types or override standard codecs. See :ref:`asyncpg-custom-codecs` for more information. The table below shows the correspondence between PostgreSQL and Python types. +----------------------+-----------------------------------------------------+ | PostgreSQL Type | Python Type | +======================+=====================================================+ | ``anyarray`` | :class:`list ` | +----------------------+-----------------------------------------------------+ | ``anyenum`` | :class:`str ` | +----------------------+-----------------------------------------------------+ | ``anyrange`` | :class:`asyncpg.Range `, | | | :class:`tuple ` | +----------------------+-----------------------------------------------------+ | ``anymultirange`` | ``list[``:class:`asyncpg.Range\ | | | ` ``]``, | | | ``list[``:class:`tuple ` ``]`` [#f1]_ | +----------------------+-----------------------------------------------------+ | ``record`` | :class:`asyncpg.Record`, | | | :class:`tuple `, | | | :class:`Mapping ` | +----------------------+-----------------------------------------------------+ | ``bit``, ``varbit`` | :class:`asyncpg.BitString `| +----------------------+-----------------------------------------------------+ | ``bool`` | :class:`bool ` | +----------------------+-----------------------------------------------------+ | ``box`` | :class:`asyncpg.Box ` | +----------------------+-----------------------------------------------------+ | ``bytea`` | :class:`bytes ` | +----------------------+-----------------------------------------------------+ | ``char``, ``name``, | :class:`str ` | | ``varchar``, | | | ``text``, | | | ``xml`` | | +----------------------+-----------------------------------------------------+ | ``cidr`` | :class:`ipaddress.IPv4Network\ | | | `, | | | :class:`ipaddress.IPv6Network\ | | | ` | +----------------------+-----------------------------------------------------+ | ``inet`` | :class:`ipaddress.IPv4Interface\ | | | `, | | | :class:`ipaddress.IPv6Interface\ | | | `, | | | :class:`ipaddress.IPv4Address\ | | | `, | | | :class:`ipaddress.IPv6Address\ | | | ` [#f2]_ | +----------------------+-----------------------------------------------------+ | ``macaddr`` | :class:`str ` | +----------------------+-----------------------------------------------------+ | ``circle`` | :class:`asyncpg.Circle ` | +----------------------+-----------------------------------------------------+ | ``date`` | :class:`datetime.date ` | +----------------------+-----------------------------------------------------+ | ``time`` | offset-naïve :class:`datetime.time \ | | | ` | +----------------------+-----------------------------------------------------+ | ``time with | offset-aware :class:`datetime.time \ | | time zone`` | ` | +----------------------+-----------------------------------------------------+ | ``timestamp`` | offset-naïve :class:`datetime.datetime \ | | | ` | +----------------------+-----------------------------------------------------+ | ``timestamp with | offset-aware :class:`datetime.datetime \ | | time zone`` | ` | +----------------------+-----------------------------------------------------+ | ``interval`` | :class:`datetime.timedelta \ | | | ` | +----------------------+-----------------------------------------------------+ | ``float``, | :class:`float ` [#f3]_ | | ``double precision`` | | +----------------------+-----------------------------------------------------+ | ``smallint``, | :class:`int ` | | ``integer``, | | | ``bigint`` | | +----------------------+-----------------------------------------------------+ | ``numeric`` | :class:`Decimal ` | +----------------------+-----------------------------------------------------+ | ``json``, ``jsonb`` | :class:`str ` | +----------------------+-----------------------------------------------------+ | ``line`` | :class:`asyncpg.Line ` | +----------------------+-----------------------------------------------------+ | ``lseg`` | :class:`asyncpg.LineSegment \ | | | ` | +----------------------+-----------------------------------------------------+ | ``money`` | :class:`str ` | +----------------------+-----------------------------------------------------+ | ``path`` | :class:`asyncpg.Path ` | +----------------------+-----------------------------------------------------+ | ``point`` | :class:`asyncpg.Point ` | +----------------------+-----------------------------------------------------+ | ``polygon`` | :class:`asyncpg.Polygon ` | +----------------------+-----------------------------------------------------+ | ``uuid`` | :class:`uuid.UUID ` | +----------------------+-----------------------------------------------------+ | ``tid`` | :class:`tuple ` | +----------------------+-----------------------------------------------------+ All other types are encoded and decoded as text by default. .. [#f1] Since version 0.25.0 .. [#f2] Prior to version 0.20.0, asyncpg erroneously treated ``inet`` values with prefix as ``IPvXNetwork`` instead of ``IPvXInterface``. .. [#f3] Inexact single-precision ``float`` values may have a different representation when decoded into a Python float. This is inherent to the implementation of limited-precision floating point types. If you need the decimal representation to match, cast the expression to ``double`` or ``numeric`` in your query. .. _asyncpg-custom-codecs: Custom Type Conversions ----------------------- asyncpg allows defining custom type conversion functions both for standard and user-defined types using the :meth:`Connection.set_type_codec() \ ` and :meth:`Connection.set_builtin_type_codec() \ ` methods. Example: automatic JSON conversion ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The example below shows how to configure asyncpg to encode and decode JSON values using the :mod:`json ` module. .. code-block:: python import asyncio import asyncpg import json async def main(): conn = await asyncpg.connect() try: await conn.set_type_codec( 'json', encoder=json.dumps, decoder=json.loads, schema='pg_catalog' ) data = {'foo': 'bar', 'spam': 1} res = await conn.fetchval('SELECT $1::json', data) finally: await conn.close() asyncio.run(main()) Example: complex types ~~~~~~~~~~~~~~~~~~~~~~ The example below shows how to configure asyncpg to encode and decode Python :class:`complex ` values to a custom composite type in PostgreSQL. .. code-block:: python import asyncio import asyncpg async def main(): conn = await asyncpg.connect() try: await conn.execute( ''' CREATE TYPE mycomplex AS ( r float, i float );''' ) await conn.set_type_codec( 'complex', encoder=lambda x: (x.real, x.imag), decoder=lambda t: complex(t[0], t[1]), format='tuple', ) res = await conn.fetchval('SELECT $1::mycomplex', (1+2j)) finally: await conn.close() asyncio.run(main()) Example: automatic conversion of PostGIS types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The example below shows how to configure asyncpg to encode and decode the PostGIS ``geometry`` type. It works for any Python object that conforms to the `geo interface specification`_ and relies on Shapely_, although any library that supports reading and writing the WKB format will work. .. _Shapely: https://github.com/Toblerity/Shapely .. _geo interface specification: https://gist.github.com/sgillies/2217756 .. code-block:: python import asyncio import asyncpg import shapely.geometry import shapely.wkb from shapely.geometry.base import BaseGeometry async def main(): conn = await asyncpg.connect() try: def encode_geometry(geometry): if not hasattr(geometry, '__geo_interface__'): raise TypeError('{g} does not conform to ' 'the geo interface'.format(g=geometry)) shape = shapely.geometry.shape(geometry) return shapely.wkb.dumps(shape) def decode_geometry(wkb): return shapely.wkb.loads(wkb) await conn.set_type_codec( 'geometry', # also works for 'geography' encoder=encode_geometry, decoder=decode_geometry, format='binary', ) data = shapely.geometry.Point(-73.985661, 40.748447) res = await conn.fetchrow( '''SELECT 'Empire State Building' AS name, $1::geometry AS coordinates ''', data) print(res) finally: await conn.close() asyncio.run(main()) Example: decoding numeric columns as floats ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ By default asyncpg decodes numeric columns as Python :class:`Decimal ` instances. The example below shows how to instruct asyncpg to use floats instead. .. code-block:: python import asyncio import asyncpg async def main(): conn = await asyncpg.connect() try: await conn.set_type_codec( 'numeric', encoder=str, decoder=float, schema='pg_catalog', format='text' ) res = await conn.fetchval("SELECT $1::numeric", 11.123) print(res, type(res)) finally: await conn.close() asyncio.run(main()) Example: decoding hstore values ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ hstore_ is an extension data type used for storing key/value pairs. asyncpg includes a codec to decode and encode hstore values as ``dict`` objects. Because ``hstore`` is not a builtin type, the codec must be registered on a connection using :meth:`Connection.set_builtin_type_codec() `: .. code-block:: python import asyncpg import asyncio async def run(): conn = await asyncpg.connect() # Assuming the hstore extension exists in the public schema. await conn.set_builtin_type_codec( 'hstore', codec_name='pg_contrib.hstore') result = await conn.fetchval("SELECT 'a=>1,b=>2,c=>NULL'::hstore") assert result == {'a': '1', 'b': '2', 'c': None} asyncio.run(run()) .. _hstore: https://www.postgresql.org/docs/current/static/hstore.html Transactions ------------ To create transactions, the :meth:`Connection.transaction() ` method should be used. The most common way to use transactions is through an ``async with`` statement: .. code-block:: python async with connection.transaction(): await connection.execute("INSERT INTO mytable VALUES(1, 2, 3)") .. note:: When not in an explicit transaction block, any changes to the database will be applied immediately. This is also known as *auto-commit*. See the :ref:`asyncpg-api-transaction` API documentation for more information. .. _asyncpg-connection-pool: Connection Pools ---------------- For server-type type applications, that handle frequent requests and need the database connection for a short period time while handling a request, the use of a connection pool is recommended. asyncpg provides an advanced pool implementation, which eliminates the need to use an external connection pooler such as PgBouncer. To create a connection pool, use the :func:`asyncpg.create_pool() ` function. The resulting :class:`Pool ` object can then be used to borrow connections from the pool. Below is an example of how **asyncpg** can be used to implement a simple Web service that computes the requested power of two. .. code-block:: python import asyncio import asyncpg from aiohttp import web async def handle(request): """Handle incoming requests.""" pool = request.app['pool'] power = int(request.match_info.get('power', 10)) # Take a connection from the pool. async with pool.acquire() as connection: # Open a transaction. async with connection.transaction(): # Run the query passing the request argument. result = await connection.fetchval('select 2 ^ $1', power) return web.Response( text="2 ^ {} is {}".format(power, result)) async def init_db(app): """Initialize a connection pool.""" app['pool'] = await asyncpg.create_pool(database='postgres', user='postgres') yield await app['pool'].close() def init_app(): """Initialize the application server.""" app = web.Application() # Create a database context app.cleanup_ctx.append(init_db) # Configure service routes app.router.add_route('GET', '/{power:\d+}', handle) app.router.add_route('GET', '/', handle) return app app = init_app() web.run_app(app) See :ref:`asyncpg-api-pool` API documentation for more information. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/performance.png0000644000175100001770000004272614705014413015664 0ustar00runnerdocker‰PNG  IHDRþI Á  pHYsÄÄ•+PLTEUUUVVVWWWXXXYYYZZZ[[[\\\]]]^^^___```aaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwxxxyyyzzz{{{|||}}}~~~€€€‚‚‚ƒƒƒ„„„………†††‡‡‡ˆˆˆ‰‰‰ŠŠŠ‹‹‹ŒŒŒŽŽŽ‘‘‘’’’“““”””•••–––———˜˜˜˜«Å™™™ššš›››œœœžžžŸŸŸ   ¡¡¡¢¢¢£££¤¤¤¥¥¥¦¦¦§§§¨¨¨©©©ªªª«««¬¬¬­­­®®®¯¯¯°°°±±±²²²³³³´´´µµµ¶¶¶···¸¸¸¹¹¹ººº»»»¼¼¼½½½¾¾¾¿¿¿ÀÀÀÁÁÁÂÂÂÃÃÃÄÄÄÅÅÅÆÆÆÇÇÇÈÈÈÉÉÉÊÊÊËËËÌÌÌÍÍÍÎÎÎÏÏÏÐÐÐÑÑÑÒÒÒÓÓÓÔÔÔÕÕÕÖÖÖ×××ØØØÙÙÙÚÚÚÛÛÛÜÜÜÝÝÝÞÞÞßßßàààáááâââãããäääåååæææçççèèèéééêêêëëëìììíííîîîïïïðððñññòòòóóóôôôõõõööö÷÷÷øøøùùùúúúûûûüüüýýýþþþÿÿÿM]BCxIDATxÚíÝÿCÓõþÿÿÛ“±"âDDEBCRã‡ã1Ez›™™š/Â>Æ1K™‡È†›„·µHÕê»ì¡§U?lPï#–=Î9ó÷‡=õñšz²'Oj@¢$r‡‰P8 °Tg¡I_l¿wèNí8¡ÖG,{\þ’×SÞcΙ¿ß¿?ëPöä{™Ï\Žë"çµ€.}ÝøDíÙC×èÀ¨Ê±ì—øûçºa`j{ g?ô&sÎüýÎüÝ)×ô§ímÑ^VêŸi5=z“q¥¿ˆèŒ–d­×9€TH‰‡.ûEþ^Ö`¯B5%:í]æœùû}ùÛ¯ÖéÓ¯èkÕÇauð¾61¬ †T›=´ZéWÁÄtí¡Ë~‘¿yq`¼¬ô_Ëßóëœùû}ù» Mÿ¡#ó{p‡q@ë8 õ\RÀôO BW§>lÙ/ò¬ÞÖN`Iµw™sæï÷ä/±Pûù¿½÷÷§Íúÿ^Õ?Å‚ëÀªw™sæïwäo²U]3þxïA¼Ï9:ý Þ6ÆT:û±¿…|ì/wÙ/òצÓëô:@C¹w™sæïwä¯Sm3_r²7óî ñmæ)ÜÍÚÏTæ™ß~½œ=4óÌïužìùý—$Uã¡•ÞeΙ¿ß¿wÔ”óVÛ/õÀí’ I"ÜX¦hÔÀŽ{o{+}òK½ðˆe¿ÄGÄ^¼ðAìÞeΙ¿ß¿(>žó·ƒðЧV YÇk%Ñ$ìÒ@*®Áì¡§ÔÐ¥=Xö‹ü9çÌßÁß@¸â‡é?l¨ßlR{’‘úeb¶#¡Ò3Lu«¸ÛPÿ ¤âê…“¡ðXfþœ3yÉ_¹"sÓ% Z_ã5*oÔ0Õ¦ÒÅ1ÕÜè•ê« à '€Á@5uR/Zfþœ3ùÈ_HÙ~â¦"I€±®Ê Þ“þ´‚É=ñ ²ëFúà£M‘ØKçŽe^'}¡-YÖŸ>÷¡ËÌŸsæ/Ï?íù”þò¸—Å.ü­£ùsÎüåï<þ{n[" óçœù{jø[];õ˜Eª¬ó7_Œ3ù»á]åœù+ί: ­ù4éåœù+Bþj¥gºÎLyo9gþŠ¿©3]1©ö†½»œ3ÅÅütMHjþûOÞ`Ι¿â⸱o±tœ¸ë=æœù+.þ€ÿl¯”*Þ¸à]æœù+2þ õÕºˆä]æœù+:þ€Äá¼Ëœ3ÅÈŸsÎü™?çœù3Î9ógþœsæÏü9çÌŸùsΙ¿Âä/™~³Gê_ýÿösÎüTŸË$ýyÒ»Ì9óW<üµ„ǪÙP­¼Ëœ3ÅÃ_åbà{UÝäÇÒ&ï2çÌ_ñð¬^ÑA yŽw™sæ¯xø«­ƒ+¡ŠŸÃÞeΙ¿âá¯Ko¹Xûj+½Ëœ3ÅÃßpTÒŠIàÊãϰsÎü=/{þ~óËïþ пö¬w™sæÏïúpΙ¿ÿsþöª.çÏÿj+UoLûÚdw<¨ÞšHŸÑ×XVÞ~iæ¡çÖ”G—‘>=ÚYYºp_êþeæ¯nó§7¼¹œ3“]Êåï°T¿ªRÏ ©U /(SýÀ©vŽ¢ï:VÅ<éÀX•¢ñ:™½ìø“¤›ûG½Áœ3¿/?µª%‡¿ä3úÜyE«€#ª!±R;BÁ)R;tïµÉ©ùêIqVÛ¬eóØßµþ-‹C’âÞeΙ¿ßíÞßþ®äðwEKFU ¡p`©ÎB“¾Ø®žì¡;µà„Zá¤V$J"wr—=?ö,ð7½9gþ~ß§>.çðw·:txOp^‹èÒÑM€OÔž=tŽ¥¥,‡÷´€¸.æ.{þ_¼¹¤D üMoΙ¿??>Óœ©÷Cµ7à3­ Go2®€3é{‡õ: )Áí`¥Nä,ûEþ’_¿ý|H /ß=ô&sÎüý‘üñˆ*µj8¬Þ×&†UÀj³V+ý*˜˜®ñаV}9Ë~‘¿@ –ï:õ³7˜sæïçï›ù’ºÀ­‡ÌÏKª˜þ TèêôÏ C‡r–eÌ›Ñìî=çÏ9uÎüå}¡ÊcçV¨æò¼÷÷þÞm ¤ÈêÞ¡)o1çÌßÊß•pÅaj§â“~oc*ýØßÂ>ö÷yβ_üå&¾ÜV/©â¯‡¯y—9gþþ8þÞJ;6µLŸómæ)ÜÍÚÏTæ™ß~½œ=4óÌïuÅ`oæ™ßÊYöüŒöoi üÂçÌßÉßË:ÀëÚG"ÜX¦hÔÀuß“²àK½ùÜ. ’¹Ë¿ÄéwÛkÌŸsæïäo£þ@«ú¡YÇk%Ñ$ìÒ@*®Áì¡§ÔÐ¥=p;}j%wÙ/ó÷Cßk %’Ê_~ß»Ì9ó÷‡ð·¡~?SÅEà#EoBŸâ£L¬Ñ`$Tz†©nÕwê¿T\½p2þؤö$#5:Jî²_⯽R’*:>¼èç>œ3Õú ¦:z~mBýÀT›JÇTs  Wª¯V0 +œÕÔI½ã5*oÔÆìe¿ÀŸT¹îà%o/çÌßÈßME’ÀÔáb¡ŠŽóL]7ÒmŠÄ^:pL­\h‹E–õ§Ïëª â=“÷/{4]õÖrÎüýÁŸö|êñ¿kc—þÖ‹ñO}$NüÛß&¼Åœ3ïèôã^-‘ÄãobkD’}Ëo|sÎüý1ü­®}Ü'Re¿ùb¼ï#ž—wtv4HÍþÌçÌ_}ÕÑ»Z‘þZ‘«/è]ï2çÌ_ñð·°,ûüpâ™zï2çÌ_ñð,Ÿ>ÙZê]æœù+þb Ó'+¼Ëœ3ÅÃßÊé7ÑM¿fÚ9gþŠƒ¿ãŠv_˜¸{ãÜ‘’3ÞeΙ¿âáne {“9gþЉ?έ¯–Bµ¯ûÝoΙ¿"ã˜Løã^œ3EÉ_¦‹ÞeΙ¿bá/5ôùÀõÌéÑ®ï2çÌ_‘ð7—Ú”&þ'â»wÎü #e -˜W¢—¹{p®´ê;ï2çÌ_qð÷†VÜ€‘çµ»Njö«þœ3EÃ_½¾.‘ŸðsÎüÑXúgúýÂçÌ_1ñ—ýŽ¥f?çáœù+2þ2ð·Üü9gþŠŒ¿ØºuëÖ­[7GéŸë¼Ëœ3EÂßì¼Ëœ3ÅÁ߇³ó.sÎüç{~sæÏü9çÌßÿ={³¯?É6±¿¹"4÷,Àdw<¨ÞšùN󾯲òöK3<·¦<ºü‹ôéÑÎÊÒ…ûRÜ·Ìü9gþò’¿É.Íâ /X>ï$Z¥ð‚2ÕOì‘jç(:ãS©ª˜'«R4R'³—™?çÌ_^ò÷S«ZrùK.Ö†ÑÌé#ª!±R;BÁ)R;Ô4}dj¾zR•Ý:Õ6Á•*œµÌü9gþò’¿ÉE꺚ËßµO¿­YŸÊMÂÛÚ¤j5ý¹,§U?lP/L”†®«mÖ2óçœùËÏ{û{¸’Ëß"]Éžœ…“Kušô5ÀvõdÏÞ©Ý'Ô 'µ Q¹“»Ìü9gþòö©Ë9üêÞ÷ŽŸ×"ºôDtàµgÏ^£céåðž¶×ÅÜeæÏ9óW üPו—Ÿ¬øøL«èÑ›Œ+àŒ–d­×9€TH ¶h/+u"g™ùsÎü è•g+WÍWè 8¬Þ×&†UÀj³‡V+ý*˜˜®ñаV}9ËÌŸsæ¯Pø{GÚ: ïè¹´€ZÏ%ULÿ*tuúg‡СC9ËÌŸsæ¯PøÛ¡úªÑÙ'wïïO3òNrÎüå'ÿ£7ø³qtúA¼mŒ©Èyìoáûûù¥^Èün—ÉÜeæÏ9óW ü%cú¸3GÃЬãÀµ’hvé ×`öÐSé—viÜÂc@ŸZÉ]fþœ3ùÏ߆úýÀn-¹Îõjúeb¶#¡Ò3Lu«¸ÛPÿ ¤âê…“¡ðÀ&µ'©ÑÑYËÌŸsæ/ÿù«ÖW@²E‘ÅQ͹Lµ©tqL5·z¥újƒÀ°Â `0PMÔ 0^£ò†@mÌ^fþœ3ùÎßME’wÞ]Ì}e€É=ñ ²ëFúÀ£M‘ØK玩€ m±È²þô¹c]•A¼gòþeæÏ9ó—çŸö|JyÜËb—þÖ‹Ñü9gþòŽ¿wtúq/‹–HÂü9gþžþV×N=æE‘*ëüÍ£ùsÎüù«ŽœsæÏü9çÌŸùsΙ?óçœ3æÏ9gþÌŸsÎü™?çœù3Î9ógþœsæÏü9çÌŸùsΙ?óçœ3æÏ9gþÌŸsÎü™?çœù3Î9ógþœ3æÏü9gþÌŸùsÎü™?óçœù3æÏ9ógþÌŸsæÏü™?çÌ_~ñ·Wu÷ýÝvU0Ùª·f¾Ó¼¯±¬¼ýÒÌÃέ).ÿ"}z´³²tá¾ÔýËÌŸsæ//ù›ìÒýü …Òü¥V)¼ Lõ{¤Ú9Š^¼wØ@Xó¤#cUŠÆCê¼o™ùsÎüå%?µªå>þRËâiþލv„ÄJí~§HíPÓ½Ãæ«'ÅñPÙM Sm\©ÒÉYËÌŸsæ//ù›\¤®«÷ñ·_‡Òü5ë3`X±Ix[[€T­¾ËvZõSÀõÂDiè:ð±Úf-3Ι¿ü¼÷·¿‡+³ù6«˜…“Kušô5ÀvõdÛ©Ý'Ô 'µ Q¹“»Ìü9gþòö©Ë³ùk ÝP5p^‹èÒÑM€OÔž=nŽŒªÞÓV⺘»Ìü9gþ †¿ÚAš¿Ï´€½É¸ÎhIöÀzH…”`‹ö°R'r–™?çÌ_Áð7ñܼŸ3üVïkê`HµÙ#«•~LL×xEX«¾œeæÏ9óW0ümÓ—dø; õùyIUÓ? ]þÙ¡CtèPÎ2óçœù+þ.„þOúÞߟfääœùËKþR±Óü~oc*rû[øÀÇþ>ÏYfþœ3Âß׊ÖÕÕÕŪ«ÿ6óîfíg*óÌo¿^Λyæ÷ºb°7óÌï 1s™ùuÎü'u¯‰Pp`™ Q;Ô=ö­ôÉ/õBæ?p»$H’³Ìü9gþ çuÓ¿üÒ¬ãÀµ’hvé ×`ö SjèÒ¸„Ç€>µÎZfþœ3ùÏ߆úý³øëS|”‰5ÚŒ„JÏ0Õ­zànCý7Š«N†Â?›Ôžd¤FGg-3Ι¿üç¯Z_ÍâoªM¥‹cª¹Ð+ÕW+†Nƒjê¤^€ñ•7j»o™ùsÎüå;7IÎâÉ=ñ ²ëFú/6Eb/8¦V.´Å"ËúÓçŽuUñžÉû—™?çÌ_žÚó)ýåq/‹]:ø[/FóçœùË;þÞÑéǽ,Z" óçœù{jø[];õ˜Eª¬ó7_ŒæÏ9óç¯:rΙ?óçœ3æÏ9gþÌŸsÎü™?çœù3Î9ógþœsæÏü9çÌŸùsΙ?óçœ3æÏ9gþÌŸsÎü™?çœù3Î9ógþœsæÏü9çÌŸùsÎü™?óçœù3æÏ9ógþÌŸsæÏü™?çÌŸù3Ι?ógþœ3æÏ9ãw8#{U7ó·÷6FKöN0Ùª·&Òçô5–•·_šyì¹5åÑå_¤OvV–.Ü—º™ùsæÏüå%“]ÊáïÛ*õµRë] µJáeªŸØ#ÕÎQôâ½cª˜'«R4R'³—™?gþÌ_^ò÷S«Zrø®èNÀ¹˜>ލv„ÄJí~§HíPÓô¡©ùêIqż÷gþœù3…Á_·–L~oc*ýØßÂ>ö÷yÎ2ÿòëÌŸù+ þŽhÞ ¾Í<…»Yû™Ê<óÛ¯—³Çežù½®ìÍ<ó»@C9ËÌŸ3æ¯pø;.¿’>•w–i5°CÝÙßJŸüR/dþ·K‚dî2óçÌŸù+þ.Æ"ç²§›u¸VMÂ.½¤âÌž{J ]Ú·ƒðЧÖYËÌŸ3æ/ÿùÛP¿®?:1}VŸâ£L¬Ñ`$Tz†©nÕwê¿T\½p2þؤö$#5::k™ùsæÏüå?Õú Úš›î$Lµ©tqL5·z¥újƒÀ°Â `0PMÔ 0^£ò†@m0k™ùsæÏüå;7IB«²&÷ăʮé6Eb/8¦V.´Å"ËúÓçŽuUñžÌÇÎ\fþœù3yÊß½‡òþò¸—Å.ü­Åü9ógþòŽ¿wtúq/‹–HÂü9gþžþV×N=æE‘*ëÄü9gþžþ~ŸÌŸ3æÏü9gþÌŸùsÎü™?óçœù3æÏ9ógþÌŸsæÏü™?çÌŸù3Ι?ógþœ3æÏü9gþÌŸùsÎü™?óçœù3æÏ9ógþÌŸsæÏü™?çÌŸù3Ι?ógþœ3æÏü9gþÌŸùsÎü™?óçœù3æÏ™?ógþÌŸ3æÏü™?gþÌ_Þò·Wu9í¬,]¸/Àdw<¨ÞšùN󾯲òöK3=·¦<ºü‹_Xfþœù3yÉßd—rù«R4R'@j• ÊT?°Gª£èÅ{‡„U1O:òÈeæÏ™?ó——üýÔª–\þ:Õ6Á•*ލv„ÄJí~§HíPÓô‘©ùêIqù¥^xÄ2óçÌŸù+þná1 O­@³Ž×J¢IØ¥7€T\ƒÙCO© K{±Ìü9ógþòŸ¿ õûMjO2R££@Ÿâ£L¬Ñ`$Tz†©nÕwê¿T\½p2þñËÌŸ3æ/ÿù«ÖWÀxʵLµ©tqL5·z¥újƒÀ°Â `0PMÔË£–™?gþÌ_¾ówS‘$ÀXWeïIZÁäžxPÙu#}àѦHì¥óÇÔ À…¶XdYú܇.3Îü™¿<åïÞCyyÜËb—þÖbþœù3yÇß;:ý¸—EK$aþœ3O «k§ó¢H•ubþœ3O ¿OæÏ™?ógþœ3æÏü9gþÌŸùsÎü™?óçœù3æÏ9ógþÌŸsæÏü™?çÌŸù3Ι?ógþœ3æÏü9gþÌŸùsÎü™?óçœù3æÏ9ógþÌŸsæÏü™?çÌŸù3Ι?ógþœ3æÏü9gþÌŸùsÎü™?óçÌŸù3æÏ™?ógþÌŸ3æÏü™?gþÌ_~ó÷¯¶òPõÆa&»ãAõÖDúŒ¾Æ²òöK3=·¦<ºü‹ôéÑÎÊÒ…ûR÷/3Îü™¿Âàï°T¿ªRÏ ©U /(SýÀ©vŽ¢ï:VÅ<éÀX•¢ñ:™½Ìü9ógþ ƒ¿ä3úÜyE«€#ª!±R;BÁ)R;Ô4}hj¾zR•Ý:Õ6Á•*œµÌü9ógþ „¿ ªÑ3@³>†›„·µHÕê»ì¡§U?lP/L”†®«mÖ2óçÌŸù+þ®h À¨ªa"N,ÕYhÒ×ÛÕ“=t§vœP+œÔ €DIäNî2óçÌŸù+þîV‡.ï©Îk]ú"º ð‰Ú³‡®Ñ±´”åðž¶×ÅÜeæÏ™?óW(O}|¦9'Rï‡joÀgZ @Þd\gÒ÷êu R‚-Ú ÀJÈYfþœù3…ó—DT©U£Àauð¾61¬ †T›=°ZéWÁÄtWt€µêËYfþœù3…Ãß7ó%u%€Z™Ÿ—T0ý¨ÐÕéŸ:@‡å,˘7#ßVœù3yÊ__¨òعª¹üïý™?gþÌ_<ó®ø/LíT|’£ÓâmcL¥³û[øÀÇþ>ÏYæ_~ù3…Âß[iǦ–és¾Í<…»Yû™Ê<óÛ¯—³‡fžù½®ìÍ<ó»@C9ËÌŸ3æ¯Pø{Y'x]ûH„‚;Ë4Ø¡î{Rv|©2ÿÛ%A2w™ùsæÏüõ7ZÕÍ:\+‰&a—ÞRq f=¥€.íÛAx èS+¹ËÌŸ3æ¯@ø;¦Š‹ÀGŠÞ„>ÅG™X£-ÀH¨ô Sݪî6Ô©¸zád(ü#°IíIFjt”ÜeæÏ™?óW üMu(ôüÚ:…ú©6•.Ž©æ@¯T_­`V8 ª©“zÆkTÞ¨ÙËÌŸ3æ¯@^ø2uø…X¨¢ã<“{âAe×ô9G›"±—Χï"¶p¡-YÖŸ>w¬«2ˆ÷LÞ¿Ìü9ógþ äeÏÑ.ü­KÍŸ3æ¯ùk‰$ÌŸsæ¯ùK•ubþœ3Åxïï‘ùsæÏü™?çÌŸù3Ι?ógþœ3æÏü9gþÌŸùsÎü™?óçœù3æÏ9ógþÌŸsæÏü™?çÌŸù3Ι?ógþœ3æÏü9gþÌŸùsÎü™?óçœù3æÏ9ógþÌŸsæÏü™?çÌŸù3Ι?ógþœ3æÏü9ógþÌŸùsæÏü™?óçÌŸù+þ&ö7W„枘ìŽÕ[3ßiÞ×XVÞ~iæ‘çÖ”G—‘>=ÚYYºp_Šû–™?gþÌ_ð÷ÃB…,ŸwH­RxA™ê'öHµs½xïȰ*æIGƪ‡ÔÉìeæÏ™?óW ü%kÃhæôÕŽX©À¡à©jš>25_=)އÊnj›àJ•NÎZfþœù3…ÂßµOeO7ë3`X±Ix[[€T­¾Ëž{ZõSÀõÂDiè:ð±Úf-3Îü™¿Báo‘®L? '–ê,4ék€íêÉž½S»N¨Nj@¢$r'w™ùsæÏü£j˜>}^‹èÒÑM€OÔž={Ž¥W”Ã{Ú @\s—™?gþÌ_ðwB]W^~6²âkà3­ Go2®€3Z’=´^çR!%Ø¢½¬Ô‰œeæÏ™?óW(ü} Wž­\5_¡/à°:x_›VCªÍZ­ô«`bºÆ+:ÀZõå,3Îü™¿Báïië$¼£çRÐzh=—T0ý¨ÐÕéŸ:@‡å,˘7#ßVœù3ùÉßÕ§€TÎ>¹{æÏ™?ó—ÿüýÞàÏ:ÄÑéñ¶1¦ÒÙý-|àcŸç,ó/¿Îü™¿Báo¿^`³öómæ)ÜÍÚÏTæ™ß~½œ=4óÌïuÅ`oæ™ßÊYfþœù3…Âß@æmíê' î,Ó4j ýËqwöзÒ'¿Ô ™ÿÀí’ ™»Ìü9ógþ „¿dLßwæhšu¸VMÂ.½¤âÌz*ýÁ.íÛAx èS+¹ËÌŸ3æ¯PÞõ±[K®sg½Z€>ÅG™X£-ÀH¨ô Sݪî6Ô©¸zád(ü#°IíIFjttÖ2óçÌŸù+þ’-Š,ŽjÎ`ªM¥‹cª¹Ð+ÕW+†Nƒjê¤^€ñ•7jcö2óçÌŸù+þ¸óî‚`î+#L]7ÒgmŠÄ^:pL­\h‹E–õ§Ïëª â=“÷/3Îü™¿áï1Ú¥ƒ¿u©ùsæÏü2-‘„ùsÎü!©²NÌŸsæ¯ïýý/2Îü™?óçœù3æÏ9ógþÌŸsæÏü™?çÌŸù3Ι?ógþœ3æÏü9gþÌŸùsÎü™?óçœù3æÏ9ógþÌŸsæÏü™?çÌŸù3Ι?ógþœ3æÏü9gþÌŸùsÎü™?óçœù3æÏ9ógþÌŸsæÏü™?gþÌŸù3Îü™?ógþœù3ÅßvU0Ùª·f¾Ó¼¯±¬¼ýÒÌÃέ).ÿ"}z´³²tá¾ÔýËÌŸ3æ¯pø ¥ùK­RxA™ê'öHµs½xï°°*æIGƪ‡Ôyß2óçÌŸù+þRËâiþލv„ÄJí~§HíPÓ½Ãæ«'ÅñPÙM Sm\©ÒÉYËÌŸ3毀øÛ¯Ciþšõ0¬Ø$¼­-@ªVße;­ú)`ƒza¢4tøXm³–™?gþÌ_áð7mW50 '–ê,4éëô£‚=Ùãvj7À µÂI­H”Dîä.3Î8xÂÂá¯=4tCÕÀy- K@D7>Q{ö¸5:0ªrxO[ˆëbî2ó猃',þNhiþ>Ójzô&ã 8£%Ùëu R‚-Ú ÀJÈYfþœqð„ÃßÄsó~ÎðwX¼¯M «€!Õf¬VúU01]ã`­úr–™?gw¬«2ˆ÷LÞ¿Ìü™?ãà ˆ¿_h—þÖ¥æÏüOXÈüµDæÏ8xBOX„ü¥Ê:1æÏzÂb¼÷÷¿Èüù¦ã =¡ùs¾éxBOhþÌŸo:žÐš?ó盎'ô„æÏüù¦ã =¡ù3¾éxBOhþÌŸo:žÐš?ó盎'ô„æÏüù¦ã =¡ù3¾éxBOhþÌŸo:žÐš?ó盎'4æÏüù¦ã ÍŸù3¾éxBógþÌŸo:žÐü™?ó盎'4æÏüù¦ã ÍŸù3ÆÁš?ógþ<¡'4æÏüyBOhþþoøóÆò„žÐš?o,Oè =¡ùóÆò„žÐš?o,Oè =áâïöÞÆhiÃÞI&»ãAõÖDúœ¾Æ²òöK3=·¦<ºü‹ôéÑÎÊÒ…ûR÷/3žÐz‚àïÛ*õµRë] µJáeªŸØ#ÕÎQôâ½cª˜'«R4R'³—™?Oè =aað7\Ñ€s1} Qí‰•Ú ü N‘Ú¡¦éCSóÕ“âx¨ì&Щ¶ ®Téä¬eæÏzBOX(¿ü¦ï²u«hÖgÀ°b“ð¶¶©Z}—=ò´ê§€ ê…‰ÒÐuàcµÍZfþ<¡'ô„…Â_º£j…‰P8 °Tg¡I_lWOö˜Ú pB­pR+%‘;¹ËÌŸ'ô„ž°°øûP…óZ@—>€ˆn|¢öì1kt `Tåðž¶×ÅÜeæÏzBOXXüµé|¦ÕôèMÆpFK²ÇÔë@*¤[´€•:‘³ÌüyBOè ‹¿+–€Ãêà}mbX ©6{PµÒ¯‚‰é¯èkÕ—³ÌüyBOè Š¿dƒ´2?/© `ú'P¡«Ó?;t€ÊY–1oFæÏzBO˜Çü­WûOðÞŸùó„žÐÝZ2‘~ú7û Þ6ÆT:û±¿…|ìïóœeþå×zBOX@üѼéw€džÂݬýLežùí×˳žù½®ìÍ<ó»@C9ËÌŸ'ô„ž°pø;.¿’>•w–i5°CÝÙßJŸüR/dþ·K‚dî2óç =¡',þ.Æ"ç²§›u¸VMÂ.½¤âÌž{J é—÷íÛAx èSë¬eæÏzBOX ü].tbú}Š2±F[€‘P馺UÜm¨ÿRqõÂÉPøG`“Ú“ŒÔèè¬eæÏzBOX üµ+47ÝI˜jSéâ˜jnôJõÕ a…À` š:©`¼Få Ú`Ö2óç =¡', þZ•í80¹'TvÝȼ¸){é<À1µp¡-YÖŸ>w¬«2ˆ÷d>&pæ2óç =¡',ŒÇþ§]:ø[—š?Oè =a!ó×I˜?o,Oè ‹¿TY'æÏËzÂb¼÷÷¿ÈüyBOè ÍŸ7–'ô„žÐüycyBOè ÍŸ7–'ô„žÐüycyBOè ÍŸ7–'ô„žÐüycyBOè ÍŸ7–'ô„žÐüycyBOè ÍŸ7–'ô„žÐüycyBOè ÍŸ7–'ô„æÏüycyBOhþÌŸ7–'ô„æÏüycyBOhþÌŸ7–'ô„æÏüycyBOhþÌŸ7–'ô„æÏüycyBOhþÌŸ7–'ô„æÏüù¦ã =¡ù3žÐzBógþ<¡'ô„ÅÄßdw<¨Þš0žÐzÂ"ã/µJáeªŸ0žÐzÂââïˆjGH¬ÔNóç =¡',.þšõ0¬Ø¤ùó„žÐ¡p`©Îš?Oè =a1ñw^‹èÒæÏzBOXLü}¦ÕôèMóç =¡',&þ«€÷µÉüyBOè ‹‰¿ZŸóþ4#óç =¡',¢{ÿ þþïÞ~’7ÿOè =áïÓïÀßÑéÇþ¶ùb÷„žÐßfžùݬý¾Ø=¡'ô„ÅÄ_"ÜX¦_ìžÐzÂbâf®•D“¾Ø=¡'ô„EÅ_Ÿâ£L¬Ñ_ìžÐzÂââoªM¥‹cª¹å‹ÝzBOX\ü1¹'TvÝðÅî =¡',6þ|±{BOè ÍŸ/vOè =¡ùóÆò„žÐš?o,Oè =¡ùsÎ9óçœsæÏ9çÌŸsΙ?çœ3O Ëš?ëoND{ž¢éêžúë¯ÎÃyLó÷¤øÛ¡Vo,OèáÌ_1ò7¼áôS0WåÞ§üösIçÌŸ¯Có÷„ù{J6ÖÓÎßAóçëÐü™¿õáSÏߟ͟¯Có÷èÖ…&V–EW¦ÿx¢5VZÿnúó§Ç7W–6þ!ÃßñåÑXë©ôÿ$m=‹¢åKwæýÿ~~ueí³‘æ/á+ÕŒèûöIÚÎe5ÜÞVÌÛy'=ò›µÁœµçÓ[®{bGMxÞŽdANxr™$é‹§aB8ñ|¤|ýh¿úî¡`èµxPÖüeúÒYW4 Õ» ¨y;ùª~ôuhþÄŸzõÜòrC=Ң戞Ÿ~ªS´e‘ºÒü½§È Ma}œå/Y¯ÊUQ]Ê{Þ,¯h‰Kÿ`²\W¾PãøÆz-ݸñ(—ÕÜ45„´àZž]Wè(pYnšJô—‚œppc¹^Ú¸qèi˜ÃRÝòhõfõÝ7B0µ@ ×,‘€ƒÚU[>O:°A%ËC«Vä?yuú&ZÔ |«²A¸µBoojñM8h>p1T}ƒèx†¿~µLB2ïŸ9(mš„^Å~¢+ý ïf½ Û³¿üjÑ( Hÿ^Òº$-)»6}ΗÒHaNؘýÅ©à'êïX-õÝ7BÀw×€=jK_ë“°C󀓊~Wk”ÿüåÕuXLü=pZõÀzu +’ U®/ÓWÃ|à5بƒþökGAÌwPeóu„Ój¦ªty&'Vè +šxE»ïÓ¬c…9á½›N¡Oø¡Z~,Qß}#Ü{P캪ƒ*ý ˜k:Òû¹¿øË«ë°˜øëQP­ 4è4—8®ù@~HoÄÍþ;Yü½Àm!U¡Q¸ …Ìà/4™vý|¤ôÇ Wó¬s qÂé›NÁO¸Nû2Û²ï¾2üݽñßaEƒi*©ÑU¨Lïç[À_^]‡ÅÄßÇ74&¥Ûtè §2;kHó2µgŸúØ.µœ,þ:3÷ þ›õ!tk÷LþjHßÇ=ok;—4wÖ9…8áôM§à'|^_°V}÷Ppâ…@’Ê€ƒÚ@.sGš –ÿüåÕuXLü}:Í_Bº @§þÆq-àªæCRÚ°qãÆ7îÏòljziÅ•üço3é_€Za@­°TfòWwoûlÓnþ«è¬s qÂÆÜMð„ `½ú8Â[Žÿg†¿ÍÓüÝ’RTå?yu'S!ÝÈÜûû;'Õ˜ù™ù0ÒO÷]WS_4ªüǼçï•{ÿ»šª ÝÕ<Â_Of°Kª,(þ<áƒn:…9áóéG¡éP߃FHFõO`ò>þîH?P‘ÿüåÕuXœüQ›¾´iЗT>pZó¸ïãRméGózc­ ÍÝVàu}úQúw‡ñ÷­Ê<ª²¢ ø{ð„ºéæ„ú€ê{Ðߪ`ä>þ¨ÐE€;¡üç/¯®Ã"åo‹¶ +:ÁÝXú¢ß¡ùÀ–iòfòÇÇ3þ:_7Vð@­ú³ÚÔ‘†|§þç¾uCáq€WôNAñ÷à ›Ò¿2>îÓ€ŸJÕ÷ .(žþÅñ>þÖê=€“ðÔG^]‡EÊß• 2‰m¶jÙOðmTóËAÉ!àçÃc™ö¯MÁ5™çäòyciÃ$ôjÎ0U¯¨L| çS³7µîEG Š¿OØž~iÒS0áh©>…;ëÓ¯û»o„Û¡ðpsÁýüWù%¸¾¨^÷—O×a‘òÇG%jl©i¸9_±Kvó—¨zE]©†3;ì}ÍiYY¡ÚDÞó÷çg*^¬WIúuQÛ¤× oíšµ}n.QÅ‹ 3ßPPü=xÂO¥¦å‡ž† Ù/-y±¢r­ú8Â6Å÷î¨^U´+¼â…È‹ñüç/¯®Ãbå3/U”ÖïI¿pìÕ¹Aý!êÒïù=×^®^ù÷;™6²u~]ôö-òž¿m—ÖÆ"ËO¥ÿxNʼQåLs¤¼{öö¹ýN]iùÚo),þ2áßë‚çN< ÂÑÆÒòu×6¤ßó{ß“Ûçó»'7ÞÏßäžùÁs;’Ïå?yuú_y]m.¤ìk3ÿxMÏÞ}ꮎ§}ÂlIÿOõ¯¯"óŠ_‡æ¯ØøËùǾŸyUìÓ{u<…f{^§~Óº¤”ôuhþžLïë­‚Åaqæ´O/Oá„™FKã¸cZèëÐü=¡Öf^†U€8|˜ù0µ§—¿§qB¶_n´f^ðöø]ê.ÔèÿóuhþžDê+H†V,VèÜÓÌßS:!*›U\ý•ëÎIó›k¥çïø:4O¢áŠHã™ÂÄá?±ð’¯ž¾käéŸþ—kËJã[õ'‹ßÞ×RD÷&}š?çœ3Î9gþœsÎüI»¢§}!8gþб&õøB¸¯Doó³áªuÿñ%áÌßSÜWþë avCs4,‰*ôeaþ|¸¢*ùâÞ H´g>ãÛ™?犬¤I_ 毘;¨¯®¬}6Òœþ†N<)_?ÚŸþ´¡-õe{e¸üåK0ý_ãoÖsÖž¸¬[«‚…ûÒߌóýÚX´õ›Quåí8s›¦ö×Õ[îš_ZÕòaò«Ì{¥’ý»+Ž“ï/‰D—÷ß¿[[*KŽŸ?ýxT‘©ü¿6:EWú:ëÍ|ÛeA<êðZ<(KßÔRGšË£ _½JÒï«jÑ?XšXY]™yPb`ͳ‘x×ÍÙ[öÉÞF‹¿7Ë+ZâÒ?KuË£Õ› š¿k¡Ò%/ÕhÎø4×jôìŠxöC#Ûš#+¥MCQU®¨ uç3Ïn/Y²"¢† ø>ªºÕõ¡ê»“åº ð…al¡‚†j}wW+hZZ¢­³r»^e+ê´;|¿^½T׿C§//ù7ŒÇBßÊÆœZ …k–H@§"+_¨ÐAþ”þÖÞŸB¡[¬S¯ž[^®``¿TÝ©¼;kË>áÛh±ó§M“ЫØO0Õß!±Zͧ0¹F½Óü½¤uI8ZRv .KKÆál àym¸Kj·ò™?Å.Àh\ݰYocç¡+ýõM›õ.t¨eFnC¯êGáû¹:>k!»Ô0'ÂÊð÷ó¥·B5W ¿‡NqP/À–Ì7áDß]ö¨ F5g¦~¦/ýå&ýZë¤`¢EÀP(ô)L^™µeŸôm´Øù+›˜¯#ðaú‰K ›?Òûi}–¿aE¯h7\–þ°Iáûô9SuyÍ_7@ŸjàåÌ×@Âi5SUºÌµ’ óÙ©êô§'ÖŠY Sé©_MówNRÐ}³®Ç‡O‘jÔ±ïC•· lc^W5 iYæ·KƒðW„uz>}ÝÖ¯¦ïÃ3kË>éÛh±ó÷";´Öe¾Í¨¡ÐùKŽŽô©-ËßGúÇÕ —UšøR áï™sÞÈkþ&¤1ÞÕâ̗ͧ*4 ´>ÑÊ̡Ê¥n)”Ì]x%sÎñ4ÆTöêDAð÷Ð)¾Õ¼V}RPóîÿ+ ?ÇÔ›~$võÃÝgKnÀº4õ#ªâ:3Íߌ-û¤o£ÅÎ_'ùÒåçõk š¿»ï×KÒ=þÞÎü‚tIsá²jø^QØ•9çý¼æïstŸW(´áé_{?„ní†=Ú2}—piúD….ç.Ì~‘ý¦ûû¦E­ÁßçèRæ;s ¤/’T ?4 ð©:à_Z¬ÓÇý2žÆ¦ù›±eŸôm´ØùÛœù]±5ý•çë š¿¿¨rwÿñž{ümÓnþ«(\ÖF‚7ÒßÌ¡¼æï:ùöùÉ}Ò¦ÛÀ€Za©.ÀÎô7$ŸkyúÄ<]È]x<ãÄÕ{ü1Q¡xÝó£¦8¥üÿæ¦P°åÈñª àâ©æ+`"R–d»ö‘û]dIéçiþflÙ'}-vþ^™yï/ýÐRG!ówVÑÿ§îñד!þ’*Ც¸˜¾÷·#³1ó™¿aÊuàç•jJAª2tkTó€wôzæÐ3™ï£BWržÌ<Öti´ë@!ð÷Ð)R*©ž(˜™ŒêŸÀdš?ê¾:t‚¸Ffñ7U¢ñiþflÙ'}-vþÒÿƒº][¡#óÑö+ ™¿½ú3ÀÇ÷øûGæ“Ók\VèÀZÒDz;¯ùûà¶”yªbü9ý x]Ÿ~¤íÀáÌ÷pMÑI€[ ßÉ]xIsøz&­Ú_ü=tŠƒj{}úžoþ÷­ÊF²üÁ^µÇ´y8ý¨EÎ7Ñ>7}ßéÛh±óüP«~Ø—~þ§ÒBæïoiÊ6ßãï†Âã¯è¸,èÔ«ðo•'žÏkþvQ<û7Ԝզ WTš½ŸP¯ã‡Õ2kaª\çvÍàoü™Bø¦¤‡Oq³<¸z«<|©P6æ…ô5Ø¿-’ÑÚõî}ü­›~IOΖ}Ò·Ñ¢Ý߆IèÕœ -Õ§pg}A¿îï¤êSp!¸ÇµîEGá²´x ëõ|˜ß¯û‹~7âÚ ýW€Ñj]¦ªã•)€­IÀ­!8¢…£p¥R'f-ä =Ÿ€sQ͇¾¾ÛÀUZ˜*þ2¯j|PÏßp;þn.P\ëO=éüUËué>þÎ(8œ›ÌݲOú6Zìüýù™ŠëUr `¿´äÅŠÊ‚~æ7µT­Û\ºm7—¨âņì»>GZš3ïŒ8Qͪx¨+¯ùë,YÖZ¦eIX«Ú—GÔÀ6e¾0{¸Jeñð6˜Ú¨HËòpæ]3rk¾b/6ê5͇ÝRå²ú*.Rü=dŠó%sp·þ·~úïß6Å÷î¨^U_CŠ<¿j¾Jϧ”ÉÚXZ¾îÚ†‚~æwôÏÑÈÒ>jîñÇíwêJË×~›þMbIâõª`áé÷»^X¶œ=œ×üÝÚWTmKg;*CåMéLpNÊ|–ë­ó‚Š5ƒÀÔÇMÑhó'÷-„]sƒEý ù0üfce8ºx× ‚¿O1µL‡N©ªP^ø<¹}n0¿{rcL¼»¤,˜¿!ý"Î;ÏèíðDZž‰Ô휜½eŸìm´Øù{íþ¿üKáü/ê¯îröÙÑÜKasßþÂÔ5={÷×.¼ô é󜿧aŠGW›~RÿWmÙ'uõëþîëy*.þviWáñ÷¾6üê…'ÕüðWxS<²!Õüú-û¤n£æï¾ßKuã©øA{ij±Ž‹á‰Û-Ü:ý‘Bæ¯ð¦xdÛ2/¾ÿ5[ö‰ÝFÍß½¶_n´f^'WüýíL &·éÙ‰‚ºý|˜ùÈ¿Ç[øÏO“À'a+dþ vŠGõ]iðã¯Ø²Oø6jþ©!PÅÕ§wàܽ´Zѥˢ +¬»? ­X¬Ð¹_±p¯‚EÍs¥m…v}=S<¼ææ@½¿fË>áÛ¨ù»Wÿ˵e¥ñ­£OñÀ¹{i°ká³áª¿œ/°ßþøO,¼ä«_³pd×Ò¹áòÖ£w}=S<¼šPMï¯Ú²Oø6êïúpÎiæÏ9gþœsÎü9çœù+‚–?7æ Á9óW„ý,õ¥0ÝສpEû_ÎüCû¶NúBÈ”zUª\UpÊ—…3®¸Úºt’U3åË™?WTMN$#úÞ—…3OsuRGšË£ _-¬Ç¼æ6Mí¯ ª·þ0Ü5¿´ªåÃäW™·Ã&#ú/$v/*V&ß_‰.ï¿!·¶T–6!>ã›0êòøñÐÑž%eAÝߦ˜q­5)ýνwÔÉA Œ¬+§î¬ ž[ë3ù{(Ь|¡¢ ¾:æ>»½dÉŠˆ&àû¨êVׇªïN–ë*Àj„±… ªõ!Ü]­ iiæCsg.äv½ÊVÔiwxst%o§~Uϵ¶„ÔÍŒkmŸÖШ/8¨]å±åó2ß9UlI¹ïÌ:ó÷PþF5g¦~.°yìŒÆÕ ›õ60vº´`³Þ…µŒÃÈmèUý(|?WÇg-d—ÆáDxÆ]Peþ>öwí;à¬b©×ÚŠM£ŠÞá ´> ;4HVëÍI¸èmîÌßÃøÊ|‰j¡ýË»úT/g¾N« ˜ªÒe®•™w‡OU§? ï°VÌZ˜ªÐ¿Òwªîñ÷²zò}öžy­5ë$pHëà J&‡~5øIgþÉßÏ1õ¦ ð_>0!ñ®g~_MUh.h!|¢•™C‡KÜR(™»ðJæœã÷øëWm^öÔÍÿŽ4êÂÌkm¿^Útª€]…®ü‡Ü™¿?˜?ŽŠš,¸ù5æè?¯PhCúk_7ëCèÖnØ3ýÉÀ§Óß% ºœ»ð¤šæo(|›ÇSßñŒ$é»™×Úõ’ŠÉHéÌ|~.C«Žz‡;ó÷hþ¸¸FªùªÐþå׈k&÷UH›nj…¥º;µ#sèçZž>1Or× ®fùû±:¯¿ëÖþýŸÇ껜kí rBâÞ§8Öé24M?&àœù{0Ô!}Q`ÿòaÊÓ_–õóJ5¥ Uº5ªyÀ;z=sè™ì§FVèJî“™Ð.eøK4¤Ÿ:É×ZÓO^7뻜k퀶óªŽÌæ¯EǼÃùûEþ`oæQ£Âù— p[º™þ‹ñçô/àu}ú‘¶‡õbæÐkŠNÜRøNîÂKšÀ×iþ&3?+ÕE€š Ùkm,TGuèÖlþ6è]ïpgþƒ¿-(°ùN€#Šgÿfƒú³ÚÔ¡AàŠJÇ3çÔë8ÀaµÌZ˜*×y€]iþ6©=¿ŸŠjø±dš¿ÌµÖª¯ÒØçð÷÷ìcžÎ™¿‡ðw­? ôèOö/~7âÚ ýW€Ñj]¦ªã•)€­IÀ­!8¢…£p¥R'f-ä =Ÿ€sQÍöhE2¿‡nÒQH­“¾Ë½Öiyú…Î9üýô¬v§à‡kÞçÎü=„¿!Ež_5_¥ç ì_ÞY²¬µLË’°Vµ/.¨€mÒk W©¬1ÞSiYμëcÆBnÍWìÅF½¦ùð)6wîܹsç¶æëПë™]=ÏýYßå^kã!¥ŸÐÉá*–Õ¤ïú:gþÀßÄ»KÊ‚ù®Ú¿üÖ¾º j[8ÛQ*oʼvçœt:}È­ó‚Š5ƒÀÔÇMÑhó'÷-„]sƒEý ù0¨l‹óvêÃñðÜÎGôݬkm•š¹Ÿ?þý犠fƒïý9ó÷0þž²ù5={÷×.¼”ó‚X§þæÍìÌ_Ñó÷~æ•¿¿fáȨ́Bín¹F¼™ùûuÅ4Q ÿò‡ò·8ýß_µpëô;D ³ìË·3Ý¿3¯{{Šøû0ó‘·ðŸŸ&OÂ:WÈWãÍ:}æÍìÌ߯©ëù2mªøZ±X¡s¿bá^‹šçJÛ øjÜÒò¬Ú|svæïWµ5¨Ú’,ÔüùûO,¼ä«_³pd×Ò¹áòÖ‚þh€WBå¯NøæìÌŸsΙ?çœ3Î9gþœsÎü9çÌŸsΙ?çœ3Î9÷´öÿ+ãͼLðôÆIEND®B`‚././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/pyproject.toml0000644000175100001770000000703514705014413015563 0ustar00runnerdocker[project] name = "asyncpg" description = "An asyncio PostgreSQL driver" authors = [{name = "MagicStack Inc", email = "hello@magic.io"}] requires-python = '>=3.8.0' readme = "README.rst" license = {text = "Apache License, Version 2.0"} dynamic = ["version"] keywords = [ "database", "postgres", ] classifiers = [ "Development Status :: 5 - Production/Stable", "Framework :: AsyncIO", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: POSIX", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Database :: Front-Ends", ] dependencies = [ 'async_timeout>=4.0.3; python_version < "3.11.0"', ] [project.urls] github = "https://github.com/MagicStack/asyncpg" [project.optional-dependencies] gssauth = [ 'gssapi; platform_system != "Windows"', 'sspilib; platform_system == "Windows"', ] test = [ 'flake8~=6.1', 'flake8-pyi~=24.1.0', 'distro~=1.9.0', 'uvloop>=0.15.3; platform_system != "Windows" and python_version < "3.14.0"', 'gssapi; platform_system == "Linux"', 'k5test; platform_system == "Linux"', 'sspilib; platform_system == "Windows"', 'mypy~=1.8.0', ] docs = [ 'Sphinx~=8.1.3', 'sphinx_rtd_theme>=1.2.2', ] [build-system] requires = [ "setuptools>=60", "wheel", "Cython(>=0.29.24,<4.0.0)" ] build-backend = "setuptools.build_meta" [tool.setuptools] zip-safe = false [tool.setuptools.packages.find] include = ["asyncpg", "asyncpg.*"] [tool.setuptools.exclude-package-data] "*" = ["*.c", "*.h"] [tool.cibuildwheel] build-frontend = "build" test-extras = "test" [tool.cibuildwheel.macos] before-all = ".github/workflows/install-postgres.sh" test-command = "python {project}/tests/__init__.py" [tool.cibuildwheel.windows] test-command = "python {project}\\tests\\__init__.py" [tool.cibuildwheel.linux] before-all = """ .github/workflows/install-postgres.sh \ && .github/workflows/install-krb5.sh \ """ test-command = """\ PY=`which python` \ && chmod -R go+rX "$(dirname $(dirname $(dirname $PY)))" \ && su -l apgtest -c "$PY {project}/tests/__init__.py" \ """ [tool.pytest.ini_options] addopts = "--capture=no --assert=plain --strict-markers --tb=native --import-mode=importlib" testpaths = "tests" filterwarnings = "default" [tool.coverage.run] branch = true plugins = ["Cython.Coverage"] parallel = true source = ["asyncpg/", "tests/"] omit = ["*.pxd"] [tool.coverage.report] exclude_lines = [ "pragma: no cover", "def __repr__", "if debug", "raise NotImplementedError", "if __name__ == .__main__.", ] show_missing = true [tool.mypy] exclude = [ "^.eggs", "^.github", "^.vscode", "^build", "^dist", "^docs", "^tests", ] incremental = true strict = true implicit_reexport = true [[tool.mypy.overrides]] module = [ "asyncpg._testbase", "asyncpg._testbase.*", "asyncpg.cluster", "asyncpg.connect_utils", "asyncpg.connection", "asyncpg.connresource", "asyncpg.cursor", "asyncpg.exceptions", "asyncpg.exceptions.*", "asyncpg.pool", "asyncpg.prepared_stmt", "asyncpg.transaction", "asyncpg.utils", ] ignore_errors = true ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1729370387.5055544 asyncpg-0.30.0/setup.cfg0000644000175100001770000000004614705014424014465 0ustar00runnerdocker[egg_info] tag_build = tag_date = 0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/setup.py0000644000175100001770000001763014705014413014363 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import sys if sys.version_info < (3, 8): raise RuntimeError('asyncpg requires Python 3.8 or greater') import os import os.path import pathlib import platform import re import subprocess # We use vanilla build_ext, to avoid importing Cython via # the setuptools version. import setuptools from setuptools.command import build_py as setuptools_build_py from setuptools.command import sdist as setuptools_sdist from setuptools.command import build_ext as setuptools_build_ext CYTHON_DEPENDENCY = 'Cython(>=0.29.24,<4.0.0)' CFLAGS = ['-O2'] LDFLAGS = [] if platform.uname().system != 'Windows': CFLAGS.extend(['-fsigned-char', '-Wall', '-Wsign-compare', '-Wconversion']) _ROOT = pathlib.Path(__file__).parent with open(str(_ROOT / 'README.rst')) as f: readme = f.read() with open(str(_ROOT / 'asyncpg' / '_version.py')) as f: for line in f: if line.startswith('__version__: typing.Final ='): _, _, version = line.partition('=') VERSION = version.strip(" \n'\"") break else: raise RuntimeError( 'unable to read the version from asyncpg/_version.py') if (_ROOT / '.git').is_dir() and 'dev' in VERSION: # This is a git checkout, use git to # generate a precise version. def git_commitish(): env = {} v = os.environ.get('PATH') if v is not None: env['PATH'] = v git = subprocess.run(['git', 'rev-parse', 'HEAD'], env=env, cwd=str(_ROOT), stdout=subprocess.PIPE) if git.returncode == 0: commitish = git.stdout.strip().decode('ascii') else: commitish = 'unknown' return commitish VERSION += '+' + git_commitish()[:7] class VersionMixin: def _fix_version(self, filename): # Replace asyncpg.__version__ with the actual version # of the distribution (possibly inferred from git). with open(str(filename)) as f: content = f.read() version_re = r"(.*__version__\s*=\s*)'[^']+'(.*)" repl = r"\1'{}'\2".format(self.distribution.metadata.version) content = re.sub(version_re, repl, content) with open(str(filename), 'w') as f: f.write(content) class sdist(setuptools_sdist.sdist, VersionMixin): def make_release_tree(self, base_dir, files): super().make_release_tree(base_dir, files) self._fix_version(pathlib.Path(base_dir) / 'asyncpg' / '_version.py') class build_py(setuptools_build_py.build_py, VersionMixin): def build_module(self, module, module_file, package): outfile, copied = super().build_module(module, module_file, package) if module == '__init__' and package == 'asyncpg': self._fix_version(outfile) return outfile, copied class build_ext(setuptools_build_ext.build_ext): user_options = setuptools_build_ext.build_ext.user_options + [ ('cython-always', None, 'run cythonize() even if .c files are present'), ('cython-annotate', None, 'Produce a colorized HTML version of the Cython source.'), ('cython-directives=', None, 'Cython compiler directives'), ] def initialize_options(self): # initialize_options() may be called multiple times on the # same command object, so make sure not to override previously # set options. if getattr(self, '_initialized', False): return super(build_ext, self).initialize_options() if os.environ.get('ASYNCPG_DEBUG'): self.cython_always = True self.cython_annotate = True self.cython_directives = "linetrace=True" self.define = 'PG_DEBUG,CYTHON_TRACE,CYTHON_TRACE_NOGIL' self.debug = True else: self.cython_always = False self.cython_annotate = None self.cython_directives = None def finalize_options(self): # finalize_options() may be called multiple times on the # same command object, so make sure not to override previously # set options. if getattr(self, '_initialized', False): return if not self.cython_always: self.cython_always = bool(os.environ.get( "ASYNCPG_BUILD_CYTHON_ALWAYS")) if self.cython_annotate is None: self.cython_annotate = os.environ.get( "ASYNCPG_BUILD_CYTHON_ANNOTATE") if self.cython_directives is None: self.cython_directives = os.environ.get( "ASYNCPG_BUILD_CYTHON_DIRECTIVES") need_cythonize = self.cython_always cfiles = {} for extension in self.distribution.ext_modules: for i, sfile in enumerate(extension.sources): if sfile.endswith('.pyx'): prefix, ext = os.path.splitext(sfile) cfile = prefix + '.c' if os.path.exists(cfile) and not self.cython_always: extension.sources[i] = cfile else: if os.path.exists(cfile): cfiles[cfile] = os.path.getmtime(cfile) else: cfiles[cfile] = 0 need_cythonize = True if need_cythonize: import pkg_resources # Double check Cython presence in case setup_requires # didn't go into effect (most likely because someone # imported Cython before setup_requires injected the # correct egg into sys.path. try: import Cython except ImportError: raise RuntimeError( 'please install {} to compile asyncpg from source'.format( CYTHON_DEPENDENCY)) cython_dep = pkg_resources.Requirement.parse(CYTHON_DEPENDENCY) if Cython.__version__ not in cython_dep: raise RuntimeError( 'asyncpg requires {}, got Cython=={}'.format( CYTHON_DEPENDENCY, Cython.__version__ )) from Cython.Build import cythonize directives = { 'language_level': '3', } if self.cython_directives: for directive in self.cython_directives.split(','): k, _, v = directive.partition('=') if v.lower() == 'false': v = False if v.lower() == 'true': v = True directives[k] = v self.distribution.ext_modules[:] = cythonize( self.distribution.ext_modules, compiler_directives=directives, annotate=self.cython_annotate) super(build_ext, self).finalize_options() setup_requires = [] if ( not (_ROOT / 'asyncpg' / 'protocol' / 'protocol.c').exists() or os.environ.get("ASYNCPG_BUILD_CYTHON_ALWAYS") ): # No Cython output, require Cython to build. setup_requires.append(CYTHON_DEPENDENCY) setuptools.setup( version=VERSION, ext_modules=[ setuptools.extension.Extension( "asyncpg.pgproto.pgproto", ["asyncpg/pgproto/pgproto.pyx"], extra_compile_args=CFLAGS, extra_link_args=LDFLAGS), setuptools.extension.Extension( "asyncpg.protocol.protocol", ["asyncpg/protocol/record/recordobj.c", "asyncpg/protocol/protocol.pyx"], include_dirs=['asyncpg/pgproto/'], extra_compile_args=CFLAGS, extra_link_args=LDFLAGS), ], cmdclass={'build_ext': build_ext, 'build_py': build_py, 'sdist': sdist}, setup_requires=setup_requires, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1729370387.5015545 asyncpg-0.30.0/tests/0000755000175100001770000000000014705014424014006 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/__init__.py0000644000175100001770000000116314705014413016116 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import pathlib import sys import unittest def suite(): test_loader = unittest.TestLoader() test_suite = test_loader.discover(str(pathlib.Path(__file__).parent), pattern='test_*.py') return test_suite if __name__ == '__main__': runner = unittest.runner.TextTestRunner(verbosity=2) result = runner.run(suite()) sys.exit(not result.wasSuccessful()) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1729370387.5055544 asyncpg-0.30.0/tests/certs/0000755000175100001770000000000014705014424015126 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/certs/ca.cert.pem0000644000175100001770000000421714705014413017152 0ustar00runnerdocker-----BEGIN CERTIFICATE----- MIIGJjCCBA6gAwIBAgIICJCUmtkcj2MwDQYJKoZIhvcNAQELBQAwgaExCzAJBgNV BAYTAkNBMRAwDgYDVQQIDAdPbnRhcmlvMRAwDgYDVQQHDAdUb3JvbnRvMRgwFgYD VQQKDA9NYWdpY1N0YWNrIEluYy4xFjAUBgNVBAsMDWFzeW5jcGcgdGVzdHMxHTAb BgNVBAMMFGFzeW5jcGcgdGVzdCByb290IGNhMR0wGwYJKoZIhvcNAQkBFg5oZWxs b0BtYWdpYy5pbzAeFw0yNDEwMTYxNzIzNTZaFw00MzEyMTcxNzIzNTZaMIGhMQsw CQYDVQQGEwJDQTEQMA4GA1UECAwHT250YXJpbzEQMA4GA1UEBwwHVG9yb250bzEY MBYGA1UECgwPTWFnaWNTdGFjayBJbmMuMRYwFAYDVQQLDA1hc3luY3BnIHRlc3Rz MR0wGwYDVQQDDBRhc3luY3BnIHRlc3Qgcm9vdCBjYTEdMBsGCSqGSIb3DQEJARYO aGVsbG9AbWFnaWMuaW8wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCP +oCl0qrReSlWj+yvfGz68UQqm6joL9VgeA0Tvc8S23Ia3S73wcTTdGhIQwMOaIuW y+m3J3js2wtpF0fmULYHr1ED7vQ+QOWarTyv/cGxSCyOYo4KVPHBfT6lYQTJk5NW Oc2wr5ff/9nhdO61sGxZa2GVBjmbLOJ9IBKTvRcmNgLmPo60wMHtF4L5/PuwVPuu +zRoETfEh12avtY7Y2G+0i4ZRm4uBmw7hmByWzWCwqrV619BaFHaJUf2bEh5eCbz 1nhF7WHVjBfnSJOgDxmZbKZZPmNzTVm8UxN22g9Ao6cZSxjbFAdpIhlQhAT6sjlW hvI6b58A3AJKi7zo+a7lnbPIeckduSkgbil3LZ4KxWgx6fPCBLqGH1XN6I8MQnX/ e1ewiFXwuZMb+FgoKxaQBseuPVaA3ViYefysjvLjP7U9eRzv6qRimOmH5efaplbD zGhRUKA8GgmN/B+S3ofqDhpp3zz7gFxjkE1f4/XNACqXt79iGaH+EscV4znxlsZj gUQYAcExpAmKrJg5kmxagHcgu0pVKlyUvSba/kKQ/aYDgdddgPutH+UHs5pssc69 YBpEXQTG9CMeRh6ZUgcrR0foJLM5g2k53xpG1oTHiJcCKARFZPRpDoZ6NjCIuFKY 6+HMcpFRVDsDnUXmFah9bUhsSQbc6MHHX/iTbpMGNwIDAQABo2AwXjAPBgNVHRMB Af8EBTADAQH/MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUhGQbAW97KXQs68Z3efEj 55zsc4UwHwYDVR0jBBgwFoAUhGQbAW97KXQs68Z3efEj55zsc4UwDQYJKoZIhvcN AQELBQADggIBADsy7jhBmwGbOZPox0XvB2XzWjOPl3uI3Ys3uGaAXVbGVnP3nDtU waGg7Fhf/ibQVAOkWLfm9FCJEO6bEojF4CjCa//iMqXgnPJaWeYceb8+CzuF5Ukg n/kfbj04dVvOnPa8KYkMOWQ6zsBgKuNaA5jOKWYwoHFgQNjKRiVikyOp6zF3aPu0 wW7M7FOVHn0ZhMRBcJG8dGbQ8vaeu8z4i04tlvpQaFgtY66ECeUwhTIrvVuqtQOl jR//w70TUTIH3JzzYmyCubOCjdqcNRYPRRiA/L+mdzrE7honSTQfo0iupT/5bJcu GRjLHL/aRvYrq8ogqQKIYW0EbVuFzHfb+kPV61Bf5APbA26GU/14XkA4KwzJnDMR d2wr0RivSceXtY2ZakYP6+2cqjuhk6Y0tl0FBuyQXqAbe1L7X2VctLJMi5UgksVB q5rdHSJ3fbHRoCUpj4/rSafqJNHlAf2MEE/q8l0D8JhYoN69RhvyFQJLFEU4c74b XHdFt6bfyxm4+ZzUdj/TXadPAUO1YfQCn9Tf7QOoR68acSvQxEDbChZlJYkdAE+C zxNcoHVc6XIpk7NIr09qTQ5viz736fV6EI6OIoUaqrz9u+NZ3sPPD2Gf+rOinVFQ R2Q5kxHYo8Kt1DK0fFcUe1cOZk3df7seQWw1OdJngp5S7gEWBiWg8zr7 -----END CERTIFICATE----- ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/certs/ca.crl.pem0000644000175100001770000000211114705014413016764 0ustar00runnerdocker-----BEGIN X509 CRL----- MIIDAjCB6wIBATANBgkqhkiG9w0BAQsFADCBoTELMAkGA1UEBhMCQ0ExEDAOBgNV BAgMB09udGFyaW8xEDAOBgNVBAcMB1Rvcm9udG8xGDAWBgNVBAoMD01hZ2ljU3Rh Y2sgSW5jLjEWMBQGA1UECwwNYXN5bmNwZyB0ZXN0czEdMBsGA1UEAwwUYXN5bmNw ZyB0ZXN0IHJvb3QgY2ExHTAbBgkqhkiG9w0BCQEWDmhlbGxvQG1hZ2ljLmlvFw0y MTA5MTQxNjA2MDFaFw0yMTA5MTUxNjA2MDFaMBUwEwICEAAXDTIxMDkxNDE2MDYw MVowDQYJKoZIhvcNAQELBQADggIBAL4yfNmvGS8SkIVbRzdAC9+XJPw/dBJOUJwr EgERICAz7OTqG1PkmMhPL00Dm9fe52+KnSwHgL749W0S/X5rTNMSwLyGiiJ5HYbH GFRKQ/cvXLi4jYpSI1Ac94kk0japf3SfwEw3+122oba8SiAVP0nY3bHpHvNfOaDV fhbFTwb5bFm6ThqlKLZxGCKP0fGeQ4homuwgRiLE/UOiue5ted1ph0PkKVui208k FnhNYXSllakTGT8ZZZZVid/4tSHqJEY9vbdMXNv1GX8mhjoU1Gv9dOuyFGgUc9Vx e7gzf/Wf36vKI29o8QGkkTslRZpMG59z3sG4Y0vJEoqXMB6eQLOr5iUCyj2CyDha 66pwrdc1fRt3EvNXUWkdHfY3EHb7DxueedDEgtmfSNbEaZTXa5RaZRavNGNTaPDf UcrDU4w1N0wkYLQxPqd+VPcf1iKyfkAydpeOq9CChqRD0Tx58eTn6N/lLGFPPRfs x47BA4FmefBeXZzd5HiXCUouk3qHIHs2yCzFs+TEBkx5eV42cP++HxjirPydLf6Y G/o/TKRnc/2Lw+dCzvUV/p3geuw4+vq1BIFanwB9jp4tGaBrffIAyle8vPQLw6bp 1o1O39pdxniz+c9r0Kw/ETxTqRLbasSib5FHq5G/G9a+QxPsLAzKgwLWhR4fXvbu YPbhYhRP -----END X509 CRL----- ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/certs/ca.key.pem0000644000175100001770000000625314705014413017007 0ustar00runnerdocker-----BEGIN RSA PRIVATE KEY----- MIIJKAIBAAKCAgEAj/qApdKq0XkpVo/sr3xs+vFEKpuo6C/VYHgNE73PEttyGt0u 98HE03RoSEMDDmiLlsvptyd47NsLaRdH5lC2B69RA+70PkDlmq08r/3BsUgsjmKO ClTxwX0+pWEEyZOTVjnNsK+X3//Z4XTutbBsWWthlQY5myzifSASk70XJjYC5j6O tMDB7ReC+fz7sFT7rvs0aBE3xIddmr7WO2NhvtIuGUZuLgZsO4Zgcls1gsKq1etf QWhR2iVH9mxIeXgm89Z4Re1h1YwX50iToA8ZmWymWT5jc01ZvFMTdtoPQKOnGUsY 2xQHaSIZUIQE+rI5VobyOm+fANwCSou86Pmu5Z2zyHnJHbkpIG4pdy2eCsVoMenz wgS6hh9VzeiPDEJ1/3tXsIhV8LmTG/hYKCsWkAbHrj1WgN1YmHn8rI7y4z+1PXkc 7+qkYpjph+Xn2qZWw8xoUVCgPBoJjfwfkt6H6g4aad88+4BcY5BNX+P1zQAql7e/ Yhmh/hLHFeM58ZbGY4FEGAHBMaQJiqyYOZJsWoB3ILtKVSpclL0m2v5CkP2mA4HX XYD7rR/lB7OabLHOvWAaRF0ExvQjHkYemVIHK0dH6CSzOYNpOd8aRtaEx4iXAigE RWT0aQ6GejYwiLhSmOvhzHKRUVQ7A51F5hWofW1IbEkG3OjBx1/4k26TBjcCAwEA AQKCAgABseW8zf+TyrTZX4VeRX008Q0n4UA6R4HgClnBDz12T94Gge8RHJdYE+k8 XImXLFTkWA8uyEispSF7wbnndLDH42D1RmVarEHnsb1ipv6WOy7HGFLqvThBWluX 783yH4oe/Dw3JcIIcYcbl9hNjD+iR9jUu8eG057w8SU21wWEPiOHmVntt80woNO6 ZKeD2mRCGZPy260H474O2ctE1LUsXWYMhx857HpusvTEs90r5mXDcetjpjo8cq7n sDukLm1q9m3hCNvbezQ21UxjmHnpK/XDXDAohdMWG/ZBMmz2ilanvhITVieGLdAV ehBi8SEqqxkD5hd9l5lxTjbRmUrdRZilnUKqup9WcOTQYeAZ2WAazyYuFqWAwSf+ dU+SzMTG+7ts9y4RbnWL9H6hN2GWMeNdLRVqE4aECMv7kAIJZ2u6VyNXSEoVueBM CJ7CU075QgxNL1REDWRBaUaflBhdwQFnMXBULw2E01KZFmQvZLe06SI/xjkB7oGU HdqWRDx0YP8lrFG35ukA2t+EswJxcbZHsagEdrz0jjz0a87vjgHnff1XpowhZU6M 4OgtQpoM4t4O7xg/sl80c0WwVvsOHVkGwUARCfZ4F2fXnocpYOCWQQbsA/SH/qJ8 l+ChM4XkBNzKAUtpwkozqisKURJKTAJyeuAKD4fXRX/IwcPUYQKCAQEAyp1iiuTX pXzDso+3WPxLr3kwYJSUxpxSP4EjZZvzJoVflFBttUOoLURPEMrK5tEqWHqRrJto 73s3yQt4xWUtUql5eCB69nIVjseRhsbXjNzMIC41u65aflfIqQztHzF2gdFMZh3I gBp87CzKHSf83ToN3QZtQxIvuPdYdxDIjCMHc5hgRSLNKGhKXs1qWA76ASGNwQKW 7nUflWfDG3yZ7sWtmz7T2djz2zsmmzppCRRVjHAxQWZ+TxW+KsBOpGzgNvteUese ZK2ARc6lLSdgS74J5U6j07dOzQZ4eVC/OPHAIbPZxJAZ7/waP7YM+h+ohU+G8kXL KevnXjsC2oa/FwKCAQEAteoHugnwXvl9VyPceGQeffmQIq095CoD35UVlq60yR/9 zgGN8mrXuEgGyydCYrK0/pUYb1pQhk5Xy1D6t5ou44uYlGuksWDqquRwgl7qMMVE 0GAwm+3wUmz7u5XD3uEJaGWV+gbvg8Hbvl3V/MzjlI4caAZ3lcNaX/Jf3xG6Gyfi So0iQzVMN6NR7m+I32YFB3jxu9PlzUTEj+9SCHuERFAozuzwjdLwiYjNMzv0zPWj v3ERO2mX6PE6yN1XkBsCGGG9qVz/ZzvKOz8Dl4TryY0a5eg4QUEZ3nUlnpq9/8M3 xcN6M2yK8XLbTmVhSHX2J5nVI3s+BTbVHBoO0edl4QKCAQBcmMbTUThYkgdh0Jpr WYpBXHJGgUDo78IK8bq6kiXygdunjYZF4/C1F1XHB9bo28itfP6cUr4HTFm3UL3W AKJQ99DinH11qbe+c+hHHxKddr73Kgc2ib0jpny2/YhUzCcrtvpiZNQf73sN+H46 Cu9eL0zsqSZAE8ypjKjqaUot+UhLhOTiU8BM6jSq1Nf3/Ig3Ah2lishtnCtd/XjG VBCJdeAcZf8tvR/dHlBLestL8fYS46cvC2dIP1iUcyS9smBZ4FE/wOM4Aa7wuDr2 wtsYYnZlTKZEeK7TtlRSpRtvK9Sx0l8AnRatfZqFaW7O1K8QlcLHcCwkMYKgpvlr 407rAoIBAQCi5nqa1xGgCux53wwr5wQDLTssQlS8//7N9ZQKhlIwFOzT0EKLha+9 PwqOW46wEXXQ0DS8anTXgEpQMCkDxxcb/sLYjfhCOxaJh91Ucahnmg+ARdLhn1Xo id124qsu5/fju6xs5E8RfsTHmQHpypQ1UHkRklD+FJzWdJXzjM1KShHzTqUS6CRj YmYZDVnVK2dvhJd76knL4jve5KFiJTGRdvLEMhtL9Uwe7RlMOvGBpKpI4fhbarh1 CafpfYRO8FCVAtmzUysHB9yV51zRD1+R8kDXBndxv9lpgx/4AnwID4nfF6hTamyV wJOwhUpzd+bBGZlql483Xh3Cd3cz8nIhAoIBACs/XIDpXojtWopHXZReNwhqPC1D q3rjpPrZ8uqDu0Z/iTTO9OSvYaMBTVjXQ7w8T3X3ilMr45kpsHx0TQeh3Jbjy459 S9z+6MtSIM0fbpYBEfa7sirDQM/ZlgZjm7vq/4lBVFGFIw7vxu4m/G0oHtihWRKh ClGG1Ypm00srgWihhjtRn8hfnLqCi4t9xxW1q8Te01Gem8H0nfNKfs5V8O4cKIZa izrfne/1Fto1khYFTlP6XdVHPjvl2/qX2WUz4G+2eNWGQVghC70cuV8kiFYlEXVp a6w2oSx8jo+5qRZrMlUQP5bE7dOBvZuoBmEi/FVfRYuFdxSZ3H2VAZKRgC4= -----END RSA PRIVATE KEY----- ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/certs/client.cert.pem0000644000175100001770000000265414705014413020050 0ustar00runnerdocker-----BEGIN CERTIFICATE----- MIIEAzCCAuugAwIBAgIUPfej8IQ/5bCrihqWImrq2vKPOq0wDQYJKoZIhvcNAQEL BQAwgaMxCzAJBgNVBAYTAkNBMRAwDgYDVQQIDAdPbnRhcmlvMRAwDgYDVQQHDAdU b3JvbnRvMRgwFgYDVQQKDA9NYWdpY1N0YWNrIEluYy4xFjAUBgNVBAsMDWFzeW5j cGcgdGVzdHMxHzAdBgNVBAMMFmFzeW5jcGcgdGVzdCBjbGllbnQgQ0ExHTAbBgkq hkiG9w0BCQEWDmhlbGxvQG1hZ2ljLmlvMB4XDTIxMDgwOTIxNTA1MloXDTMyMDEw NDIxNTA1MlowgZUxCzAJBgNVBAYTAkNBMRAwDgYDVQQIDAdPbnRhcmlvMRAwDgYD VQQHDAdUb3JvbnRvMRgwFgYDVQQKDA9NYWdpY1N0YWNrIEluYy4xFjAUBgNVBAsM DWFzeW5jcGcgdGVzdHMxETAPBgNVBAMMCHNzbF91c2VyMR0wGwYJKoZIhvcNAQkB Fg5oZWxsb0BtYWdpYy5pbzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB AJjiP9Ik/KRRLK9GMvoH8m1LO+Gyrr8Gz36LpmKJMR/PpwTL+1pOkYSGhOyT3Cw9 /kWWLJRCvYqKgFtYtbr4S6ReGm3GdSVW+sfVRYDrRQZLPgQSPeq25g2v8UZ63Ota lPAyUPUZKpxyWz8PL77lV8psb9yv14yBH2kv9BbxKPksWOU8p8OCn1Z3WFFl0ItO nzMvCp5os+xFrt4SpoRGTx9x4QleY+zrEsYZtmnV4wC+JuJkNw4fuCdrX5k7dghs uZkcsAZof1nMdYsYiazeDfQKZtJqh5kO7mpwvCudKUWaLJJUwiQA87BwSlnCd/Hh TZDbC+zeFNjTS49/4Q72xVECAwEAAaM7MDkwHwYDVR0jBBgwFoAUi1jMmAisuOib mHIE2n0W2WnnaL0wCQYDVR0TBAIwADALBgNVHQ8EBAMCBPAwDQYJKoZIhvcNAQEL BQADggEBACbnp5oOp639ko4jn8axF+so91k0vIcgwDg+NqgtSRsuAENGumHAa8ec YOks0TCTvNN5E6AfNSxRat5CyguIlJ/Vy3KbkkFNXcCIcI/duAJvNphg7JeqYlQM VIJhrO/5oNQMzzTw8XzTHnciGbrbiZ04hjwrruEkvmIAwgQPhIgq4H6umTZauTvk DEo7uLm7RuG9hnDyWCdJxLLljefNL/EAuDYpPzgTeEN6JAnOu0ULIbpxpJKiYEId 8I0U2n0I2NTDOHmsAJiXf8BiHHmpK5SXFyY9s2ZuGkCzvmeZlR81tTXmHZ3v1X2z 8NajoAZfJ+QD50DrbF5E00yovZbyIB4= -----END CERTIFICATE----- ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/certs/client.csr.pem0000644000175100001770000000205214705014413017672 0ustar00runnerdocker-----BEGIN CERTIFICATE REQUEST----- MIIC2zCCAcMCAQAwgZUxCzAJBgNVBAYTAkNBMRAwDgYDVQQIDAdPbnRhcmlvMRAw DgYDVQQHDAdUb3JvbnRvMRgwFgYDVQQKDA9NYWdpY1N0YWNrIEluYy4xFjAUBgNV BAsMDWFzeW5jcGcgdGVzdHMxETAPBgNVBAMMCHNzbF91c2VyMR0wGwYJKoZIhvcN AQkBFg5oZWxsb0BtYWdpYy5pbzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC ggEBAJjiP9Ik/KRRLK9GMvoH8m1LO+Gyrr8Gz36LpmKJMR/PpwTL+1pOkYSGhOyT 3Cw9/kWWLJRCvYqKgFtYtbr4S6ReGm3GdSVW+sfVRYDrRQZLPgQSPeq25g2v8UZ6 3OtalPAyUPUZKpxyWz8PL77lV8psb9yv14yBH2kv9BbxKPksWOU8p8OCn1Z3WFFl 0ItOnzMvCp5os+xFrt4SpoRGTx9x4QleY+zrEsYZtmnV4wC+JuJkNw4fuCdrX5k7 dghsuZkcsAZof1nMdYsYiazeDfQKZtJqh5kO7mpwvCudKUWaLJJUwiQA87BwSlnC d/HhTZDbC+zeFNjTS49/4Q72xVECAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQCG irI2ph09V/4BMe6QMhjBFUatwmTa/05PYGjvT3LAhRzEb3/o/gca0XFSAFrE6zIY DsgMk1c8aLr9DQsn9cf22oMFImKdnIZ3WLE9MXjN+s1Bjkiqt7uxDpxPo/DdfUTQ RQC5i/Z2tn29y9K09lEjp35ZhPp3tOA0V4CH0FThAjRR+amwaBjxQ7TTSNfoMUd7 i/DrylwnNg1iEQmYUwJYopqgxtwseiBUSDXzEvjFPY4AvZKmEQmE5QkybpWIfivt 1kmKhvKKpn5Cb6c0D3XoYqyPN3TxqjH9L8R+tWUCwhYJeDZj5DumFr3Hw/sx8tOL EctyS6XfO3S2KbmDiyv8 -----END CERTIFICATE REQUEST----- ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/certs/client.key.pem0000644000175100001770000000321314705014413017673 0ustar00runnerdocker-----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEAmOI/0iT8pFEsr0Yy+gfybUs74bKuvwbPfoumYokxH8+nBMv7 Wk6RhIaE7JPcLD3+RZYslEK9ioqAW1i1uvhLpF4abcZ1JVb6x9VFgOtFBks+BBI9 6rbmDa/xRnrc61qU8DJQ9RkqnHJbPw8vvuVXymxv3K/XjIEfaS/0FvEo+SxY5Tyn w4KfVndYUWXQi06fMy8Knmiz7EWu3hKmhEZPH3HhCV5j7OsSxhm2adXjAL4m4mQ3 Dh+4J2tfmTt2CGy5mRywBmh/Wcx1ixiJrN4N9Apm0mqHmQ7uanC8K50pRZosklTC JADzsHBKWcJ38eFNkNsL7N4U2NNLj3/hDvbFUQIDAQABAoIBAAIMVeqM0E2rQLwA ZsJuxNKuBVlauXiZsMHzQQFk8SGJ+KTZzr5A+zYZT0KUIIj/M57fCi3aTwvCG0Ie CCE/HlRPZm8+D2e2qJlwxAOcI0qYS3ZmgCna1W4tgz/8eWU1y3UEV41RDv8VkR9h JrSaAfkWRtFgEbUyLaeNGuoLxQ7Bggo9zi1/xDJz/aZ/y4L4y8l1xs2eNVmbRGnj mPr1daeYhsWgaNiT/Wm3CAxvykptHavyWSsrXzCp0bEw6fAXxBqkeDFGIMVC9q3t ZRFtqMHi9i7SJtH1XauOC6QxLYgSEmNEie1JYbNx2Zf4h2KvSwDxpTqWhOjJ/m5j /NSkASECgYEAyHQAqG90yz5QaYnC9lgUhGIMokg9O3LcEbeK7IKIPtC9xINOrnj6 ecCfhfc1aP3wQI+VKC3kiYerfTJvVsU5CEawBQSRiBY/TZZ7hTR7Rkm3s4xeM+o6 2zADdVUwmTVYwu0gUKCeDKO4iD8Uhh8J54JrKUejuG50VWZQWGVgqo0CgYEAwz+2 VdYcfuQykMA3jQBnXmMMK92/Toq6FPDgsa45guEFD6Zfdi9347/0Ipt+cTNg0sUZ YBLOnNPwLn+yInfFa88Myf0UxCAOoZKfpJg/J27soUJzpd/CGx+vaAHrxMP6t/qo JAGMBIyOoqquId7jvErlC/sGBk/duya7IdiT1tUCgYBuvM8EPhaKlVE9DJL9Hmmv PK94E2poZiq3SutffzkfYpgDcPrNnh3ZlxVJn+kMqITKVcfz226On7mYP32MtQWt 0cc57m0rfgbYqRJx4y1bBiyK7ze3fGWpYxv1/OsNKJBxlygsAp9toiC2fAqtkYYa NE1ZD6+dmr9/0jb+rnq5nQKBgQCtZvwsp4ePOmOeItgzJdSoAxdgLgQlYRd6WaN0 qeLx1Z6FE6FceTPk1SmhQq+9IYAwMFQk+w78QU3iPg6ahfyTjsMw8M9sj3vvCyU1 LPGJt/34CehjvKHLLQy/NlWJ3vPgSYDi2Wzc7WgQF72m3ykqpOlfBoWHPY8TE4bG vG4wMQKBgFSq2GDAJ1ovBl7yWYW7w4SM8X96YPOff+OmI4G/8+U7u3dDM1dYeQxD 7BHLuvr4AXg27LC97u8/eFIBXC1elbco/nAKE1YHj2xcIb/4TsgAqkcysGV08ngi dULh3q0GpTYyuELZV4bfWE8MjSiGAH+nuMdXYDGuY2QnBq8MdSOH -----END RSA PRIVATE KEY----- ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/certs/client.key.protected.pem0000644000175100001770000000334614705014413021672 0ustar00runnerdocker-----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: AES-256-CBC,B222CD7D00828606A07DBC489D400921 LRHsNGUsD5bG9+x/1UlzImN0rqEF10sFPBmxKeQpXQ/hy4iR+X/Gagoyagi23wOn EZf0sCLJx95ixG+4fXJDX0jgBtqeziVNS4FLWHIuf3+blja8nf4tkmmH9pF8jFQ0 i1an3TP6KRyDKa17gioOdtSsS51BZmPkp3MByJQsrMhyB0txEUsGtUMaBTYmVN/5 uYHf9MsmfcfQy30nt2t6St6W82QupHHMOx5xyhPJo8cqQncZC7Dwo4hyDV3h3vWn UjaRZiEMmQ3IgCwfJd1VmMECvrwXd/sTOXNhofWwDQIqmQ3GGWdrRnmgD863BQT3 V8RVyPLkutOnrZ/kiMSAuiXGsSYK0TV8F9TaP/abLob4P8jbKYLcuR7ws3cu1xBl XWt9RALxGPUyHIy+BWLXJTYL8T+TVJpiKsAGCQB54j8VQBSArwFL4LnzdUu1txe2 qa6ZEwt4q6SEwOTJpJWz3oJ1j+OTsRCN+4dlyo7sEZMeyTRp9nUzwulhd+fOdIhY 2UllMG71opKfNxZzEW7lq6E/waf0MmxwjUJmgwVO218yag9oknHnoFwewF42DGY7 072h23EJeKla7sI+MAB18z01z6C/yHWXLybOlXaGqk6zOm3OvTUFnUXtKzlBO2v3 FQwrOE5U/VEyQkNWzHzh4j4LxYEL9/B08PxaveUwvNVGn9I3YknE6uMfcU7VuxDq +6bgM6r+ez+9QLFSjH/gQuPs2DKX0h3b9ppQNx+MANX0DEGbGabJiBp887f8pG6Q tW0i0+rfzYz3JwnwIuMZjYz6qUlP4bJMEmmDfod3fbnvg3MoCSMTUvi1Tq3Iiv4L GM5/YNkL0V3PhOI686aBfU7GLGXQFhdbQ9xrSoQRBmmNBqTCSf+iIEoTxlBac8GQ vSzDO+A+ovBP36K13Yn7gzuN/3PLZXH2TZ8t2b/OkEXOciH5KbycGHQA7gqxX1P4 J55gpqPAWe8e7wKheWj3BMfmbWuH4rpiEkrLpqbTSfTwIKqplk253chmJj5I82XI ioFLS5vCi9JJsTrQ720O+VQPVB5xeA80WL8NxamWQb/KkvVnb4dTmaV30RCgLLZC tuMx8YSW71ALLT15qFB2zlMDKZO1jjunNE71BUFBPIkTKEOCyMAiF60fFeIWezxy kvBBOg7+MTcZNeW110FqRWNGr2A5KYFN15g+YVpfEoF26slHisSjVW5ndzGh0kaQ sIOjQitA9JYoLua7sHvsr6H5KdCGjNxv7O7y8wLGBVApRhU0wxZtbClqqEUvCLLP UiLDp9L34wDL7sGrfNgWA4UuN29XQzTxI5kbv/EPKhyt2oVHLqUiE+eGyvnuYm+X KqFi016nQaxTU5Kr8Pl0pSHbJMLFDWLSpsbbTB6YJpdEGxJoj3JB3VncOpwcuK+G xZ1tV2orPt1s/6m+/ihzRgoEkyLwcLRPN7ojgD/sqS679ZGf1IkDMgFCQe4g0UWm Fw7v816MNCgypUM5hQaU+Jp8vSlEc29RbrdSHbcxrKj/xPCLWrAbvmI5tgonKmuJ J1LW8AXyh/EUp/uUh++jqVGx+8pFfcmJw6V6JrJzQ7HMlakkry7N1eAGrIJGtYCW -----END RSA PRIVATE KEY----- ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/certs/client_ca.cert.pem0000644000175100001770000000274114705014413020510 0ustar00runnerdocker-----BEGIN CERTIFICATE----- MIIEKTCCAxGgAwIBAgIUKmL8tfNS9LIB6GLB9RpZpTyk3uIwDQYJKoZIhvcNAQEL BQAwgaMxCzAJBgNVBAYTAkNBMRAwDgYDVQQIDAdPbnRhcmlvMRAwDgYDVQQHDAdU b3JvbnRvMRgwFgYDVQQKDA9NYWdpY1N0YWNrIEluYy4xFjAUBgNVBAsMDWFzeW5j cGcgdGVzdHMxHzAdBgNVBAMMFmFzeW5jcGcgdGVzdCBjbGllbnQgQ0ExHTAbBgkq hkiG9w0BCQEWDmhlbGxvQG1hZ2ljLmlvMB4XDTIxMDgwOTIxNDQxM1oXDTQxMDgw NDIxNDQxM1owgaMxCzAJBgNVBAYTAkNBMRAwDgYDVQQIDAdPbnRhcmlvMRAwDgYD VQQHDAdUb3JvbnRvMRgwFgYDVQQKDA9NYWdpY1N0YWNrIEluYy4xFjAUBgNVBAsM DWFzeW5jcGcgdGVzdHMxHzAdBgNVBAMMFmFzeW5jcGcgdGVzdCBjbGllbnQgQ0Ex HTAbBgkqhkiG9w0BCQEWDmhlbGxvQG1hZ2ljLmlvMIIBIjANBgkqhkiG9w0BAQEF AAOCAQ8AMIIBCgKCAQEAptRYfxKiWExfZguQDva53bIqYa4lJwZA86Qu0peBUcsd E6zyHNgVv4XSMim1FH12KQ4KPKuQAcVqRMCRAHqB96kUfWQqF//fLajr0umdzcbx +UTgNux8TkScTl9KNAxhiR/oOGbKFcNSs4raaG8puwwEN66uMhoKk2pN2NwDVfHa bTekJ3jouTcTCnqCynx4qwI4WStJkuW4IPCmDRVXxOOauT7YalElYLWYtAOqGEvf noDK2Imhc0h6B5XW8nI54rVCXWwhW1v3RLAJGP+LwSy++bf08xmpHXdKkAj5BmUO QwJRiJ33Xa17rmi385egx8KpqV04YEAPdV1Z4QM6PQIDAQABo1MwUTAdBgNVHQ4E FgQUi1jMmAisuOibmHIE2n0W2WnnaL0wHwYDVR0jBBgwFoAUi1jMmAisuOibmHIE 2n0W2WnnaL0wDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAifNE ZLZXxECp2Sl6jCViZxgFf2+OHDvRORgI6J0heckYyYF/JHvLaDphh6TkSJAdT6Y3 hAb7jueTMI+6RIdRzIjTKCGdJqUetiSfAbnQyIp2qmVqdjeFoXTvQL7BdkIE+kOW 0iomMqDB3czTl//LrgVQCYqKM0D/Ytecpg2mbshLfpPxdHyliCJcb4SqfdrDnKoV HUduBjOVot+6bkB5SEGCrrB4KMFTzbAu+zriKWWz+uycIyeVMLEyhDs59vptOK6e gWkraG43LZY3cHPiVeN3tA/dWdyJf9rgK21zQDSMB8OSH4yQjdQmkkvRQBjp3Fcy w2SZIP4o9l1Y7+hMMw== -----END CERTIFICATE----- ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/certs/client_ca.key.pem0000644000175100001770000000321714705014413020342 0ustar00runnerdocker-----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEAptRYfxKiWExfZguQDva53bIqYa4lJwZA86Qu0peBUcsdE6zy HNgVv4XSMim1FH12KQ4KPKuQAcVqRMCRAHqB96kUfWQqF//fLajr0umdzcbx+UTg Nux8TkScTl9KNAxhiR/oOGbKFcNSs4raaG8puwwEN66uMhoKk2pN2NwDVfHabTek J3jouTcTCnqCynx4qwI4WStJkuW4IPCmDRVXxOOauT7YalElYLWYtAOqGEvfnoDK 2Imhc0h6B5XW8nI54rVCXWwhW1v3RLAJGP+LwSy++bf08xmpHXdKkAj5BmUOQwJR iJ33Xa17rmi385egx8KpqV04YEAPdV1Z4QM6PQIDAQABAoIBABQrKcO7CftoyEO6 9CCK/W9q4arLddxg6itKVwrInC66QnqlduO7z+1GjWHZHvYqMMXH17778r30EuPa 7+zB4sKBI2QBXwFlwqJvgIsQCS7edVRwWjbpoiGIM+lZpcvjD0uXmuhurNGyumXQ TJVBkyb0zfG5YX/XHB40RNMJzjFuiMPDLVQmmDE//FOuWqBG88MgJP9Ghk3J7wA2 JfDPavb49EzOCSh74zJWP7/QyybzF3ABCMu4OFkaOdqso8FS659XI55QReBbUppu FRkOgao1BclJhbBdrdtLNjlETM82tfVgW56vaIrrU2z7HskihEyMdB4c+CYbBnPx QqIhkhUCgYEA0SLVExtNy5Gmi6/ZY9tcd3QIuxcN6Xiup+LgIhWK3+GIoVOPsOjN 27dlVRINPKhrCfVbrLxUtDN5PzphwSA2Qddm4jg3d5FzX+FgKHQpoaU1WjtRPP+w K+t6W/NbZ8Rn4JyhZQ3Yqj264NA2l3QmuTfZSUQ5m4x7EUakfGU7G1sCgYEAzDaU jHsovn0FedOUaaYl6pgzjFV8ByPeT9usN54PZyuzyc+WunjJkxCQqD88J9jyG8XB 3V3tQj/CNbMczrS2ZaJ29aI4b/8NwBNR9e6t01bY3B90GJi8S4B4Hf8tYyIlVdeL tCC4FCZhvl4peaK3AWBj4NhjvdB32ThDXSGxLEcCgYEAiA5tKHz+44ziGMZSW1B+ m4f1liGtf1Jv7fD/d60kJ/qF9M50ENej9Wkel3Wi/u9ik5v4BCyRvpouKyBEMGxQ YA1OdaW1ECikMqBg+nB4FR1x1D364ABIEIqlk+SCdsOkANBlf2S+rCJ0zYUnvuhl uOHIjo3AHJ4MAnU+1V7WUTkCgYBkMedioc7U34x/QJNR3sY9ux2Xnh2zdyLNdc+i njeafDPDMcoXhcoJERiYpCYEuwnXHIlI7pvJZHUKWe4pcTsI1NSfIk+ki7SYaCJP kyLQTY0rO3d/1fiU5tyIgzomqIs++fm+kEsg/8/3UkXxOyelUkDPAfy2FgGnn1ZV 7ID8YwKBgQCeZCapdGJ6Iu5oYB17TyE5pLwb+QzaofR5uO8H4pXGVQyilKVCG9Dp GMnlXD7bwXPVKa8Icow2OIbmgrZ2mzOo9BSY3BlkKbpJDy7UNtAhzsHHN5/AEk8z YycWQtMiXI+cRsYO0eyHhJeSS2hX+JTe++iZX65twV53agzCHWRIbg== -----END RSA PRIVATE KEY----- ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/certs/gen.py0000644000175100001770000001542214705014413016253 0ustar00runnerdockerimport datetime import os from cryptography import x509 from cryptography.hazmat import backends from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives.asymmetric import rsa from cryptography.x509 import oid def _new_cert(issuer=None, is_issuer=False, serial_number=None, **subject): backend = backends.default_backend() private_key = rsa.generate_private_key( public_exponent=65537, key_size=4096, backend=backend ) public_key = private_key.public_key() subject = x509.Name( [ x509.NameAttribute(getattr(oid.NameOID, key.upper()), value) for key, value in subject.items() ] ) builder = ( x509.CertificateBuilder() .subject_name(subject) .public_key(public_key) .serial_number(serial_number or int.from_bytes(os.urandom(8), "big")) ) if issuer: issuer_cert, signing_key = issuer builder = ( builder.issuer_name(issuer_cert.subject) .not_valid_before(issuer_cert.not_valid_before) .not_valid_after(issuer_cert.not_valid_after) ) aki_ext = x509.AuthorityKeyIdentifier( key_identifier=issuer_cert.extensions.get_extension_for_class( x509.SubjectKeyIdentifier ).value.digest, authority_cert_issuer=[x509.DirectoryName(issuer_cert.subject)], authority_cert_serial_number=issuer_cert.serial_number, ) else: signing_key = private_key builder = ( builder.issuer_name(subject) .not_valid_before( datetime.datetime.today() - datetime.timedelta(days=1) ) .not_valid_after( datetime.datetime.today() + datetime.timedelta(weeks=1000) ) ) aki_ext = x509.AuthorityKeyIdentifier.from_issuer_public_key( public_key ) if is_issuer: builder = ( builder.add_extension( x509.BasicConstraints(ca=True, path_length=None), critical=True, ) .add_extension( x509.KeyUsage( digital_signature=False, content_commitment=False, key_encipherment=False, data_encipherment=False, key_agreement=False, key_cert_sign=True, crl_sign=True, encipher_only=False, decipher_only=False, ), critical=False, ) .add_extension( x509.SubjectKeyIdentifier.from_public_key(public_key), critical=False, ) .add_extension( aki_ext, critical=False, ) ) else: builder = ( builder.add_extension( x509.KeyUsage( digital_signature=True, content_commitment=False, key_encipherment=True, data_encipherment=False, key_agreement=False, key_cert_sign=False, crl_sign=False, encipher_only=False, decipher_only=False, ), critical=False, ) .add_extension( x509.BasicConstraints(ca=False, path_length=None), critical=True, ) .add_extension( x509.ExtendedKeyUsage([oid.ExtendedKeyUsageOID.SERVER_AUTH]), critical=False, ) .add_extension( x509.SubjectAlternativeName([x509.DNSName("localhost")]), critical=False, ) .add_extension( x509.SubjectKeyIdentifier.from_public_key(public_key), critical=False, ) .add_extension( aki_ext, critical=False, ) ) certificate = builder.sign( private_key=signing_key, algorithm=hashes.SHA256(), backend=backend, ) return certificate, private_key def _write_cert(path, cert_key_pair, password=None): certificate, private_key = cert_key_pair if password: encryption = serialization.BestAvailableEncryption(password) else: encryption = serialization.NoEncryption() with open(path + ".key.pem", "wb") as f: f.write( private_key.private_bytes( encoding=serialization.Encoding.PEM, format=serialization.PrivateFormat.TraditionalOpenSSL, encryption_algorithm=encryption, ) ) with open(path + ".cert.pem", "wb") as f: f.write( certificate.public_bytes( encoding=serialization.Encoding.PEM, ) ) def new_ca(path, **subject): cert_key_pair = _new_cert(is_issuer=True, **subject) _write_cert(path, cert_key_pair) return cert_key_pair def new_cert( path, ca_cert_key_pair, password=None, is_issuer=False, **subject ): cert_key_pair = _new_cert( issuer=ca_cert_key_pair, is_issuer=is_issuer, **subject ) _write_cert(path, cert_key_pair, password) return cert_key_pair def new_crl(path, issuer, cert): issuer_cert, signing_key = issuer revoked_cert = ( x509.RevokedCertificateBuilder() .serial_number(cert[0].serial_number) .revocation_date(datetime.datetime.today()) .build() ) builder = ( x509.CertificateRevocationListBuilder() .issuer_name(issuer_cert.subject) .last_update(datetime.datetime.today()) .next_update(datetime.datetime.today() + datetime.timedelta(days=1)) .add_revoked_certificate(revoked_cert) ) crl = builder.sign(private_key=signing_key, algorithm=hashes.SHA256()) with open(path + ".crl.pem", "wb") as f: f.write(crl.public_bytes(encoding=serialization.Encoding.PEM)) def main(): ca = new_ca( "ca", country_name="CA", state_or_province_name="Ontario", locality_name="Toronto", organization_name="MagicStack Inc.", organizational_unit_name="asyncpg tests", common_name="asyncpg test root ca", email_address="hello@magic.io", ) server = new_cert( "server", ca, country_name="CA", state_or_province_name="Ontario", organization_name="MagicStack Inc.", organizational_unit_name="asyncpg tests", common_name="localhost", email_address="hello@magic.io", serial_number=4096, ) new_crl('server', ca, server) if __name__ == "__main__": main() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/certs/server.cert.pem0000644000175100001770000000462314705014413020076 0ustar00runnerdocker-----BEGIN CERTIFICATE----- MIIG5jCCBM6gAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgaExCzAJBgNVBAYTAkNB MRAwDgYDVQQIDAdPbnRhcmlvMRAwDgYDVQQHDAdUb3JvbnRvMRgwFgYDVQQKDA9N YWdpY1N0YWNrIEluYy4xFjAUBgNVBAsMDWFzeW5jcGcgdGVzdHMxHTAbBgNVBAMM FGFzeW5jcGcgdGVzdCByb290IGNhMR0wGwYJKoZIhvcNAQkBFg5oZWxsb0BtYWdp Yy5pbzAeFw0yNDEwMTYxNzIzNTZaFw00MzEyMTcxNzIzNTZaMIGEMQswCQYDVQQG EwJDQTEQMA4GA1UECAwHT250YXJpbzEYMBYGA1UECgwPTWFnaWNTdGFjayBJbmMu MRYwFAYDVQQLDA1hc3luY3BnIHRlc3RzMRIwEAYDVQQDDAlsb2NhbGhvc3QxHTAb BgkqhkiG9w0BCQEWDmhlbGxvQG1hZ2ljLmlvMIICIjANBgkqhkiG9w0BAQEFAAOC Ag8AMIICCgKCAgEA3F017q/obCM1SsHY5dFz72pFgVMhBIZ6kdIInbFv7RmEykZz ubbJnrgwgYDO5FKGUNO+a80AbjIvBrtPtXs9Ip/QDg0jqgw/MOADCxCzYnAQ2Ew2 y1PfspGtdPhLNTmrO8+AxU2XmjsYY0+ysgUQQttOs9hJ79pIsKGBEES8g9oJTiIf tKgCxCIuhiZC+AgjeIQZUB9ccifmOGrCJYrD6LBuNGoQNW2/ykqjuHE8219dv1hV do8azcp/WmejjQguZyU3S/AofnyyNE24rWpXbbFs+9FFaUXd8g/fWCwrRmcXpOaE lvkmMZyuT9kuglHsvpzzGGNSUpvVoPfldk/4JY/kJrA2G5pgTX6mGRYGEN0jmlCa yg/ZFn36G0mA5ZBH4Qln+lKUSjJH8bhlFXvXlE3Mc34OCdOAp1TRfOT/qCRKo9A5 KCjVOvG5MAKE8TZnTFLCSx5gK/EdQ2iV7Sm3aVc2P4eEJh+nvv1LDVLQEAak6U+u sZN5+Wnu7wDKSlh80vTTtoqls5Uo3gIxHYnqX5Fj6nwCzGjjXISNE4OKZLuk3can mciEES3plUrut+O6a2JWiDoCrwX4blYXhtL92Xaer/Mk1TSf2JsmL6pODoapsA0S CHtpcgoodxdKriy1qUGsiNlPNVWjASGyKXoEZdv49wyoZuysudl1aS1w42UCAwEA AaOCAUEwggE9MAsGA1UdDwQEAwIFoDAMBgNVHRMBAf8EAjAAMBMGA1UdJQQMMAoG CCsGAQUFBwMBMBQGA1UdEQQNMAuCCWxvY2FsaG9zdDAdBgNVHQ4EFgQUO/cXg1uX 2oHZodbw6F3/HakLdaQwgdUGA1UdIwSBzTCByoAUhGQbAW97KXQs68Z3efEj55zs c4WhgaekgaQwgaExCzAJBgNVBAYTAkNBMRAwDgYDVQQIDAdPbnRhcmlvMRAwDgYD VQQHDAdUb3JvbnRvMRgwFgYDVQQKDA9NYWdpY1N0YWNrIEluYy4xFjAUBgNVBAsM DWFzeW5jcGcgdGVzdHMxHTAbBgNVBAMMFGFzeW5jcGcgdGVzdCByb290IGNhMR0w GwYJKoZIhvcNAQkBFg5oZWxsb0BtYWdpYy5pb4IICJCUmtkcj2MwDQYJKoZIhvcN AQELBQADggIBAD4Ti52nEttUNay+sqqbDLtnSyMRsJI8agPqiHz6bYifSf530rlh qlHYUY5tgfrd8yDZNIe9Ib7Q1WQjgR8c/T9SoFnLl/tff1CVOAYQ/ffCZGTdBOSc KfdKEEvObWxWsqv31ZAMWVzfPsF7rwbTbZ8YdH2CNjxbZxrSEn2IrjplsoP5WMsE 6t7Q+J5wpi2yiEI9PoY2wH5WBB8ONWvZfj9r6OrczlTEZ+L6eiip5kMiw5R9EVt6 ju2aMWqbZTI49Mu/qvXRAkwYvX7mrhuW/4mPHOW/zSnN7hOyjntx1fdnpPD5BTT6 CoJ7nhWgnntw2kk2V9UBCYpVeqidDRrs+nr1xSpduuM1ve3SDkIpd6EGEUqZJ12s 5xpCUFK67atCZOXbJXqanm+3N9kbqYuwkWoqnPjOfMYW7oABmUy8elVGGwTuiTI0 sXS3aQJ+Bm7oqSXrIxUTjOUUaYNhhaqZdXaO/29vI2+i975Pt1ZLLPUkp0hsUgTT kryN02TlNTxxQafTWad6YdzyrwvMpV7vxf7JQkOKRwLinqLCDVxjBt66O9mLIpQF WIfWQG+X4sgobB0NTtBWeGkrIgnhUtsT0ibVm4JAC1cbxdLOq2dfcURC8UFWJXok yFr/uaDZiKKbUFXbalZwnx6H6ucfl5No3hheexadyIbPNcHhFJ9zGXot -----END CERTIFICATE----- ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/certs/server.crl.pem0000644000175100001770000000211114705014413017707 0ustar00runnerdocker-----BEGIN X509 CRL----- MIIDAjCB6wIBATANBgkqhkiG9w0BAQsFADCBoTELMAkGA1UEBhMCQ0ExEDAOBgNV BAgMB09udGFyaW8xEDAOBgNVBAcMB1Rvcm9udG8xGDAWBgNVBAoMD01hZ2ljU3Rh Y2sgSW5jLjEWMBQGA1UECwwNYXN5bmNwZyB0ZXN0czEdMBsGA1UEAwwUYXN5bmNw ZyB0ZXN0IHJvb3QgY2ExHTAbBgkqhkiG9w0BCQEWDmhlbGxvQG1hZ2ljLmlvFw0y NDEwMTcxNzIzNTZaFw0yNDEwMTgxNzIzNTZaMBUwEwICEAAXDTI0MTAxNzE3MjM1 NlowDQYJKoZIhvcNAQELBQADggIBAEVNX72KK6etoZQOXzPgd8ZJNrYcsOwjNZFL ZxC47uX+yrxjv7Wrrk4feyakFi5bL9n8/JMggcpxC6yxMQH/sdOZJ0BzKw3GUAxj m53i1GGO1lGdKH5a7uDPZVW362JwCVE81ROCdb1SL/yYmIwhD4w2bqjOQuI63Xe1 MDfVZBqcIwzzkA5PEjTSFQIsBcHU+rDrWggkz/XJh5alRav8Gnj7KTE8U1z5UeKV LUk8L8+ZLW6XlrTnyjOn3qT7sZw2C/R46GCyHWwT5tbLhJhm2u1EuX3Iids02vIP w9bYf7+Uu2lsse9TuFNXtW0UFLdvVezomHjNBCaMI/MIvG4wSWnAo5bTtlowzxSy 7rpQQYBebcl5somUAhHqs4dsxbEwCXMPDdapiXkhxR9R4nDvkfsgwyqIRsWsIEq6 PFjjRySNFUg5/vqhVQrg0hV7ygzXfd/kIlud3ZkKnli51TuFMWKD5sMN0r8ITLdG usoJQiF6G3ByLQBnsiQoHbipWkWTOKmfB/cfaPXdagPZH6rQmJeeNq0vBy6VqbFi 7D+BqABs+yIT6uJEEqyPGJttkUZP+0ziaK+DZF4MgJtiERtz2GjKMeh3h/YSqA27 8El6na7hPA3k1pANkaOaKuxZYzrPsl3P91ISGL6E0dgd6f9NZMOxbhfNKoDsBJnd Hjb3RTY4 -----END X509 CRL----- ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/certs/server.key.pem0000644000175100001770000000625314705014413017732 0ustar00runnerdocker-----BEGIN RSA PRIVATE KEY----- MIIJKQIBAAKCAgEA3F017q/obCM1SsHY5dFz72pFgVMhBIZ6kdIInbFv7RmEykZz ubbJnrgwgYDO5FKGUNO+a80AbjIvBrtPtXs9Ip/QDg0jqgw/MOADCxCzYnAQ2Ew2 y1PfspGtdPhLNTmrO8+AxU2XmjsYY0+ysgUQQttOs9hJ79pIsKGBEES8g9oJTiIf tKgCxCIuhiZC+AgjeIQZUB9ccifmOGrCJYrD6LBuNGoQNW2/ykqjuHE8219dv1hV do8azcp/WmejjQguZyU3S/AofnyyNE24rWpXbbFs+9FFaUXd8g/fWCwrRmcXpOaE lvkmMZyuT9kuglHsvpzzGGNSUpvVoPfldk/4JY/kJrA2G5pgTX6mGRYGEN0jmlCa yg/ZFn36G0mA5ZBH4Qln+lKUSjJH8bhlFXvXlE3Mc34OCdOAp1TRfOT/qCRKo9A5 KCjVOvG5MAKE8TZnTFLCSx5gK/EdQ2iV7Sm3aVc2P4eEJh+nvv1LDVLQEAak6U+u sZN5+Wnu7wDKSlh80vTTtoqls5Uo3gIxHYnqX5Fj6nwCzGjjXISNE4OKZLuk3can mciEES3plUrut+O6a2JWiDoCrwX4blYXhtL92Xaer/Mk1TSf2JsmL6pODoapsA0S CHtpcgoodxdKriy1qUGsiNlPNVWjASGyKXoEZdv49wyoZuysudl1aS1w42UCAwEA AQKCAgAXD9TfxfPCXWzrsJ3NGhPSr9crpvzYRw/3cs5esn3O3Sd92SGuAz3WfoWV CAX0SdlaBs7xjo1yUDjbsNQGtNRmaz3lj+Ug8WcrlkYQl7mDnnbPgX+6h8HsI5LO SwM+mWpyN/p3Vkd8vJ0wx4Z2sFD4rjruV2m60FK11DEi+A6X6JmmCQGIcTeDjzrk jzHdrfxdqyAlt80qT+1Sui7XVE5sa7Uc3HzAcAaXr81dNXyeThIMPxJdS1y4F258 kkbA27pU0Rrtt5SFUvIoxyQsrJRkcSJsDYVWHxm7MNi5luXF2G7WXcmX2JCcCz8I MZJ3JlvAbGyEgOB8r2e2u5AoHEu7xjpjJ0/6smmig7LDe96uNpg6zDwS3xl6rAup qgwJ5TTwY8BydVOtDqe5Na8yqLtwMr0yA+k2Hz856mzCTJEOI9TaOq/jtq+n4AXW lkBai762oVKSKYCVJSK6eslTf2bAqjT3jakbgqJLKmMo5XvCnYUWWIve0RhQMNT4 0tiLCxKurYa7xPqgW26c/fEHvdBDrU1JAablcAjsW9sJ+KIlilK02M9DqF0RnBBI wK7Ql76ugsYbp8WBXkpFjMMyciMhqH8xJiyi7MuiCwpBGQwxBHHaX7f9OqDWOClR mVGjrZuk9oiI3waUjGG50SzLBlMbeIzMdXgRuM7fByq6DG0VgQKCAQEA8d2YCODh ApCM7GB/tmANfVQ0tnfxUT3ceEAOH7XkI+nz87Zv/1k6NOklCMi+nUwoGQfM5CxU NdWC0I7wI1ATdllPStUAJ4c8xtdEdlrLHBcGNvhYbbqMWRsNGITstnAx3tZ4X32H duhS5wfPE/X25YMN+8Dtm7jifEMqoCUV55iZxfYs+LXxQF03KVAJ5Ie5a1ac5UCz zzu9fbYSs70ByJsHWt4ZOsPkJVmkmuXzUPvr72otUYYSdju0PgbJqRoEyTbCh3HT zo0emKl8jj7oTSzVNjb6AaB6nsKco6wQLQSlaxBzo0j7TBRylVtG81CYjr5LFpp0 UQrHjLZnSTvC5wKCAQEA6T3yH6bFc9FcJGOW1jYozQ5y+NWkXv3MVFIf3IqPT76p rMEI6krmGUKi+otOaV2Axy36kOcbntzENMg++LPCe0SczK14+pwUrI91cp/Ega6K +/4sKvh8WDZhzVYkWs76UiRj7Ef4MvtsaPAcFN/Ek+fItDHFRoSGdm+vx+j3ZDxx tdRudTs0kYyhmdlM0kZTbXsmz37x6+45uO16s+D2lvX2PXM9Lve9z/Ti6nn9QvIF kM9ZmAU6epmMPsGKM9WOK/sTcPUnd3Ife9tmi3BRAAygDk6hFx67kAsc124oLeZ3 0CJGshA+50hBAL7wiybLrBMRzHrElzsicppVbn3p0wKCAQAldmRBI8vWYNtjFYNS lUghnHRZuvRG2CUY/xrw8HR415jwq9ZnH8PzRBV3adiUdqJTVjD3OqKEgCC1+x3Y 6mNJVoYAmkNe3ASe6+LvzhpdrHdK9maEAHwSpSz/Gj+r9m7TDDcy2zerRErq+/uo JNXsMMNutjBXiWiTRLgKfBQLfkh7MClBELVgec+8d2hA3IDszkqY+8+eDqvIF/aH noPzNYgLHBGeV48z9dGYKHvqlEq0F6cTVIfxhkfhv51msuAA5pl07z2WZadSkBX5 1maW5ZXUwukwbVHw20X12AXdYzXYAoFWzkwWOaiR18SClX47xd/NjXjswJWuBuay oi4LAoIBAQDirP0+nYmQAYwXIWJaVNBaWQyLoLXaS7XkzNuCLncQ/S9RYVkUui3d ptFVxUUzSVf6O0kkwjYpskxNL79jXPBJdGke0gidJktBWTq/Z15G2ibguCicqlnO MSvjrzAtwLGuWwdxfpBMm+TEJ3ZjIwWc6Mo5tZUP74PuXqTrGBI2LDgmiom/DQcN 3SrAplrukMJLyD/zsF/U9vTKMKHrZ1q/Y9Mn7XMszkB+dnSBhIUKJsQZ9CoSgCJR PCD8bIOv1IATZjOCt/7fKt5GNPf30/QkpCB5RxlvqsKGPwaMp9YMpcsTT/x82SUJ CUODQg3sbovKc838d+PPRf04e51DgMNZAoIBAQC2uiJjluIKRabFSeSfu4+I6cEY kXI0F65UAudFmyXVfaQbO9DR0Y4bWPDfXAUimRvxixEhSrSIBZ/itVxzhOvqZrl1 XRCZsTOVoz7Z8lcd8opxPBnWDk1m2nyajwPXp8ZLo67FG0bWbayVBBRxyvirrZjG PatRKMTyVLTCD+WlQiP4b4kShKdWA4ZH6pHUIviAotWqXMTsEKfupg9avxEk8GtH GZnXAmpnBqmbU4+3rNOaCZLdekVCoEtW0NGZEYEV5UQnZoWY6AiUUxGGE/qionKH sdKN+8CowudMH02bo1a0akS+eh+D/SGc/MLofH7uPWtX7l8sTvQivzDIkZeu -----END RSA PRIVATE KEY----- ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/test__environment.py0000644000175100001770000000264114705014413020123 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import os import unittest import asyncpg import asyncpg.serverversion from asyncpg import _testbase as tb class TestEnvironment(tb.ConnectedTestCase): @unittest.skipIf(not os.environ.get('PGVERSION'), "environ[PGVERSION] is not set") async def test_environment_server_version(self): pgver = os.environ.get('PGVERSION') env_ver = asyncpg.serverversion.split_server_version_string(pgver) srv_ver = self.con.get_server_version() self.assertEqual( env_ver[:2], srv_ver[:2], 'Expecting PostgreSQL version {pgver}, got {maj}.{min}.'.format( pgver=pgver, maj=srv_ver.major, min=srv_ver.minor) ) @unittest.skipIf(not os.environ.get('ASYNCPG_VERSION'), "environ[ASYNCPG_VERSION] is not set") @unittest.skipIf("dev" in asyncpg.__version__, "development version with git commit data") async def test_environment_asyncpg_version(self): apgver = os.environ.get('ASYNCPG_VERSION') self.assertEqual( asyncpg.__version__, apgver, 'Expecting asyncpg version {}, got {}.'.format( apgver, asyncpg.__version__) ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/test__sourcecode.py0000644000175100001770000000424614705014413017715 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import os import subprocess import sys import unittest def find_root(): return os.path.dirname(os.path.dirname(os.path.abspath(__file__))) class TestCodeQuality(unittest.TestCase): def test_flake8(self): try: import flake8 # NoQA except ImportError: raise unittest.SkipTest('flake8 module is missing') root_path = find_root() config_path = os.path.join(root_path, '.flake8') if not os.path.exists(config_path): raise RuntimeError('could not locate .flake8 file') try: subprocess.run( [sys.executable, '-m', 'flake8', '--config', config_path], check=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=root_path) except subprocess.CalledProcessError as ex: output = ex.output.decode() raise AssertionError( 'flake8 validation failed:\n{}'.format(output)) from None def test_mypy(self): try: import mypy # NoQA except ImportError: raise unittest.SkipTest('mypy module is missing') root_path = find_root() config_path = os.path.join(root_path, 'pyproject.toml') if not os.path.exists(config_path): raise RuntimeError('could not locate mypy.ini file') try: subprocess.run( [ sys.executable, '-m', 'mypy', '--config-file', config_path, 'asyncpg' ], check=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=root_path ) except subprocess.CalledProcessError as ex: output = ex.output.decode() raise AssertionError( 'mypy validation failed:\n{}'.format(output)) from None ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/test_adversity.py0000644000175100001770000000615014705014413017431 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 """Tests how asyncpg behaves in non-ideal conditions.""" import asyncio import os import platform import unittest from asyncpg import _testbase as tb @unittest.skipIf(os.environ.get('PGHOST'), 'using remote cluster for testing') @unittest.skipIf( platform.system() == 'Windows', 'not compatible with ProactorEventLoop which is default in Python 3.8+') class TestConnectionLoss(tb.ProxiedClusterTestCase): @tb.with_timeout(30.0) async def test_connection_close_timeout(self): con = await self.connect() self.proxy.trigger_connectivity_loss() with self.assertRaises(asyncio.TimeoutError): await con.close(timeout=0.5) @tb.with_timeout(30.0) async def test_pool_acquire_timeout(self): pool = await self.create_pool( database='postgres', min_size=2, max_size=2) try: self.proxy.trigger_connectivity_loss() for _ in range(2): with self.assertRaises(asyncio.TimeoutError): async with pool.acquire(timeout=0.5): pass self.proxy.restore_connectivity() async with pool.acquire(timeout=0.5): pass finally: self.proxy.restore_connectivity() pool.terminate() @tb.with_timeout(30.0) async def test_pool_release_timeout(self): pool = await self.create_pool( database='postgres', min_size=2, max_size=2) try: with self.assertRaises(asyncio.TimeoutError): async with pool.acquire(timeout=0.5): self.proxy.trigger_connectivity_loss() finally: self.proxy.restore_connectivity() pool.terminate() @tb.with_timeout(30.0) async def test_pool_handles_abrupt_connection_loss(self): pool_size = 3 query_runtime = 0.5 pool_timeout = cmd_timeout = 1.0 concurrency = 9 pool_concurrency = (concurrency - 1) // pool_size + 1 # Worst expected runtime + 20% to account for other latencies. worst_runtime = (pool_timeout + cmd_timeout) * pool_concurrency * 1.2 async def worker(pool): async with pool.acquire(timeout=pool_timeout) as con: await con.fetch('SELECT pg_sleep($1)', query_runtime) def kill_connectivity(): self.proxy.trigger_connectivity_loss() new_pool = self.create_pool( database='postgres', min_size=pool_size, max_size=pool_size, timeout=cmd_timeout, command_timeout=cmd_timeout) with self.assertRunUnder(worst_runtime): pool = await new_pool try: workers = [worker(pool) for _ in range(concurrency)] self.loop.call_later(1, kill_connectivity) await asyncio.gather( *workers, return_exceptions=True) finally: pool.terminate() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/test_cache_invalidation.py0000644000175100001770000004025714705014413021231 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncpg from asyncpg import _testbase as tb ERRNUM = 'unexpected number of attributes of composite type' ERRTYP = 'unexpected data type of composite type' class TestCacheInvalidation(tb.ConnectedTestCase): def _get_cached_statements(self, connection=None): if connection is None: connection = self.con return list(connection._stmt_cache.iter_statements()) def _check_statements_are_not_closed(self, statements): self.assertGreater(len(statements), 0) self.assertTrue(all(not s.closed for s in statements)) def _check_statements_are_closed(self, statements): self.assertGreater(len(statements), 0) self.assertTrue(all(s.closed for s in statements)) async def test_prepare_cache_invalidation_silent(self): await self.con.execute('CREATE TABLE tab1(a int, b int)') try: await self.con.execute('INSERT INTO tab1 VALUES (1, 2)') result = await self.con.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, 2)) statements = self._get_cached_statements() self._check_statements_are_not_closed(statements) await self.con.execute( 'ALTER TABLE tab1 ALTER COLUMN b SET DATA TYPE text') result = await self.con.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, '2')) self._check_statements_are_closed(statements) finally: await self.con.execute('DROP TABLE tab1') async def test_prepare_cache_invalidation_in_transaction(self): await self.con.execute('CREATE TABLE tab1(a int, b int)') try: await self.con.execute('INSERT INTO tab1 VALUES (1, 2)') result = await self.con.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, 2)) statements = self._get_cached_statements() self._check_statements_are_not_closed(statements) await self.con.execute( 'ALTER TABLE tab1 ALTER COLUMN b SET DATA TYPE text') with self.assertRaisesRegex(asyncpg.InvalidCachedStatementError, 'cached statement plan is invalid'): async with self.con.transaction(): result = await self.con.fetchrow('SELECT * FROM tab1') self._check_statements_are_closed(statements) # This is now OK, result = await self.con.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, '2')) finally: await self.con.execute('DROP TABLE tab1') async def test_prepare_cache_invalidation_in_pool(self): pool = await self.create_pool(database='postgres', min_size=2, max_size=2) await self.con.execute('CREATE TABLE tab1(a int, b int)') try: await self.con.execute('INSERT INTO tab1 VALUES (1, 2)') con1 = await pool.acquire() con2 = await pool.acquire() result = await con1.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, 2)) result = await con2.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, 2)) statements1 = self._get_cached_statements(con1) self._check_statements_are_not_closed(statements1) statements2 = self._get_cached_statements(con2) self._check_statements_are_not_closed(statements2) await self.con.execute( 'ALTER TABLE tab1 ALTER COLUMN b SET DATA TYPE text') # con1 tries the same plan, will invalidate the cache # for the entire pool. result = await con1.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, '2')) self._check_statements_are_closed(statements1) self._check_statements_are_closed(statements2) async with con2.transaction(): # This should work, as con1 should have invalidated # the plan cache. result = await con2.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, '2')) finally: await self.con.execute('DROP TABLE tab1') await pool.release(con2) await pool.release(con1) await pool.close() async def test_type_cache_invalidation_in_transaction(self): await self.con.execute('CREATE TYPE typ1 AS (x int, y int)') await self.con.execute('CREATE TABLE tab1(a int, b typ1)') try: await self.con.execute('INSERT INTO tab1 VALUES (1, (2, 3))') result = await self.con.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, (2, 3))) statements = self._get_cached_statements() self._check_statements_are_not_closed(statements) async with self.con.transaction(): await self.con.execute('ALTER TYPE typ1 ADD ATTRIBUTE c text') with self.assertRaisesRegex( asyncpg.OutdatedSchemaCacheError, ERRNUM): await self.con.fetchrow('SELECT * FROM tab1') self._check_statements_are_closed(statements) # The second request must be correct (cache was dropped): result = await self.con.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, (2, 3, None))) # This is now OK, the cache is actual after the transaction. result = await self.con.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, (2, 3, None))) finally: await self.con.execute('DROP TABLE tab1') await self.con.execute('DROP TYPE typ1') async def test_type_cache_invalidation_in_cancelled_transaction(self): await self.con.execute('CREATE TYPE typ1 AS (x int, y int)') await self.con.execute('CREATE TABLE tab1(a int, b typ1)') try: await self.con.execute('INSERT INTO tab1 VALUES (1, (2, 3))') result = await self.con.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, (2, 3))) statements = self._get_cached_statements() self._check_statements_are_not_closed(statements) try: async with self.con.transaction(): await self.con.execute( 'ALTER TYPE typ1 ADD ATTRIBUTE c text') with self.assertRaisesRegex( asyncpg.OutdatedSchemaCacheError, ERRNUM): await self.con.fetchrow('SELECT * FROM tab1') self._check_statements_are_closed(statements) # The second request must be correct (cache was dropped): result = await self.con.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, (2, 3, None))) raise UserWarning # Just to generate ROLLBACK except UserWarning: pass with self.assertRaisesRegex( asyncpg.OutdatedSchemaCacheError, ERRNUM): await self.con.fetchrow('SELECT * FROM tab1') # This is now OK, the cache is filled after being dropped. result = await self.con.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, (2, 3))) finally: await self.con.execute('DROP TABLE tab1') await self.con.execute('DROP TYPE typ1') async def test_prepared_type_cache_invalidation(self): await self.con.execute('CREATE TYPE typ1 AS (x int, y int)') await self.con.execute('CREATE TABLE tab1(a int, b typ1)') try: await self.con.execute('INSERT INTO tab1 VALUES (1, (2, 3))') prep = await self.con._prepare('SELECT * FROM tab1', use_cache=True) result = await prep.fetchrow() self.assertEqual(result, (1, (2, 3))) statements = self._get_cached_statements() self._check_statements_are_not_closed(statements) try: async with self.con.transaction(): await self.con.execute( 'ALTER TYPE typ1 ADD ATTRIBUTE c text') with self.assertRaisesRegex( asyncpg.OutdatedSchemaCacheError, ERRNUM): await prep.fetchrow() self._check_statements_are_closed(statements) # PS has its local cache for types codecs, even after the # cache cleanup it is not possible to use it. # That's why it is marked as closed. with self.assertRaisesRegex( asyncpg.InterfaceError, 'the prepared statement is closed'): await prep.fetchrow() prep = await self.con._prepare('SELECT * FROM tab1', use_cache=True) # The second PS must be correct (cache was dropped): result = await prep.fetchrow() self.assertEqual(result, (1, (2, 3, None))) raise UserWarning # Just to generate ROLLBACK except UserWarning: pass with self.assertRaisesRegex( asyncpg.OutdatedSchemaCacheError, ERRNUM): await prep.fetchrow() # Reprepare it again after dropping cache. prep = await self.con._prepare('SELECT * FROM tab1', use_cache=True) # This is now OK, the cache is filled after being dropped. result = await prep.fetchrow() self.assertEqual(result, (1, (2, 3))) finally: await self.con.execute('DROP TABLE tab1') await self.con.execute('DROP TYPE typ1') async def test_type_cache_invalidation_on_drop_type_attr(self): await self.con.execute('CREATE TYPE typ1 AS (x int, y int, c text)') await self.con.execute('CREATE TABLE tab1(a int, b typ1)') try: await self.con.execute( 'INSERT INTO tab1 VALUES (1, (2, 3, $1))', 'x') result = await self.con.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, (2, 3, 'x'))) statements = self._get_cached_statements() self._check_statements_are_not_closed(statements) await self.con.execute('ALTER TYPE typ1 DROP ATTRIBUTE x') with self.assertRaisesRegex( asyncpg.OutdatedSchemaCacheError, ERRNUM): await self.con.fetchrow('SELECT * FROM tab1') self._check_statements_are_closed(statements) # This is now OK, the cache is filled after being dropped. result = await self.con.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, (3, 'x'))) finally: await self.con.execute('DROP TABLE tab1') await self.con.execute('DROP TYPE typ1') async def test_type_cache_invalidation_on_change_attr(self): await self.con.execute('CREATE TYPE typ1 AS (x int, y int)') await self.con.execute('CREATE TABLE tab1(a int, b typ1)') try: await self.con.execute('INSERT INTO tab1 VALUES (1, (2, 3))') result = await self.con.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, (2, 3))) statements = self._get_cached_statements() self._check_statements_are_not_closed(statements) # It is slightly artificial, but can take place in transactional # schema changing. Nevertheless, if the code checks and raises it # the most probable reason is a difference with the cache type. await self.con.execute('ALTER TYPE typ1 DROP ATTRIBUTE y') await self.con.execute('ALTER TYPE typ1 ADD ATTRIBUTE y bigint') with self.assertRaisesRegex( asyncpg.OutdatedSchemaCacheError, ERRTYP): await self.con.fetchrow('SELECT * FROM tab1') self._check_statements_are_closed(statements) # This is now OK, the cache is filled after being dropped. result = await self.con.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, (2, None))) finally: await self.con.execute('DROP TABLE tab1') await self.con.execute('DROP TYPE typ1') async def test_type_cache_invalidation_in_pool(self): await self.con.execute('CREATE DATABASE testdb') pool = await self.create_pool(database='postgres', min_size=2, max_size=2) pool_chk = await self.create_pool(database='testdb', min_size=2, max_size=2) await self.con.execute('CREATE TYPE typ1 AS (x int, y int)') await self.con.execute('CREATE TABLE tab1(a int, b typ1)') try: await self.con.execute('INSERT INTO tab1 VALUES (1, (2, 3))') con1 = await pool.acquire() con2 = await pool.acquire() result = await con1.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, (2, 3))) statements1 = self._get_cached_statements(con1) self._check_statements_are_not_closed(statements1) result = await con2.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, (2, 3))) statements2 = self._get_cached_statements(con2) self._check_statements_are_not_closed(statements2) # Create the same schema in the "testdb", fetch data which caches # type info. con_chk = await pool_chk.acquire() await con_chk.execute('CREATE TYPE typ1 AS (x int, y int)') await con_chk.execute('CREATE TABLE tab1(a int, b typ1)') await con_chk.execute('INSERT INTO tab1 VALUES (1, (2, 3))') result = await con_chk.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, (2, 3))) statements_chk = self._get_cached_statements(con_chk) self._check_statements_are_not_closed(statements_chk) # Change schema in the databases. await self.con.execute('ALTER TYPE typ1 ADD ATTRIBUTE c text') await con_chk.execute('ALTER TYPE typ1 ADD ATTRIBUTE c text') # con1 tries to get cached type info, fails, but invalidates the # cache for the entire pool. with self.assertRaisesRegex( asyncpg.OutdatedSchemaCacheError, ERRNUM): await con1.fetchrow('SELECT * FROM tab1') self._check_statements_are_closed(statements1) self._check_statements_are_closed(statements2) async with con2.transaction(): # This should work, as con1 should have invalidated all caches. result = await con2.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, (2, 3, None))) # After all the con1 uses actual info from renewed cache entry. result = await con1.fetchrow('SELECT * FROM tab1') self.assertEqual(result, (1, (2, 3, None))) # Check the invalidation is database-specific, i.e. cache entries # for pool_chk/con_chk was not dropped via pool/con1. self._check_statements_are_not_closed(statements_chk) with self.assertRaisesRegex( asyncpg.OutdatedSchemaCacheError, ERRNUM): await con_chk.fetchrow('SELECT * FROM tab1') self._check_statements_are_closed(statements_chk) finally: await self.con.execute('DROP TABLE tab1') await self.con.execute('DROP TYPE typ1') await pool.release(con2) await pool.release(con1) await pool.close() await pool_chk.release(con_chk) await pool_chk.close() await self.con.execute('DROP DATABASE testdb') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/test_cancellation.py0000644000175100001770000000605714705014413020061 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncio import asyncpg from asyncpg import _testbase as tb class TestCancellation(tb.ConnectedTestCase): async def test_cancellation_01(self): st1000 = await self.con.prepare('SELECT 1000') async def test0(): val = await self.con.execute('SELECT 42') self.assertEqual(val, 'SELECT 1') async def test1(): val = await self.con.fetchval('SELECT 42') self.assertEqual(val, 42) async def test2(): val = await self.con.fetchrow('SELECT 42') self.assertEqual(val, (42,)) async def test3(): val = await self.con.fetch('SELECT 42') self.assertEqual(val, [(42,)]) async def test4(): val = await self.con.prepare('SELECT 42') self.assertEqual(await val.fetchval(), 42) async def test5(): self.assertEqual(await st1000.fetchval(), 1000) async def test6(): self.assertEqual(await st1000.fetchrow(), (1000,)) async def test7(): self.assertEqual(await st1000.fetch(), [(1000,)]) async def test8(): cur = await st1000.cursor() self.assertEqual(await cur.fetchrow(), (1000,)) for test in {test0, test1, test2, test3, test4, test5, test6, test7, test8}: with self.subTest(testfunc=test), self.assertRunUnder(1): st = await self.con.prepare('SELECT pg_sleep(20)') task = self.loop.create_task(st.fetch()) await asyncio.sleep(0.05) task.cancel() with self.assertRaises(asyncio.CancelledError): await task async with self.con.transaction(): await test() async def test_cancellation_02(self): st = await self.con.prepare('SELECT 1') task = self.loop.create_task(st.fetch()) await asyncio.sleep(0.05) task.cancel() self.assertEqual(await task, [(1,)]) async def test_cancellation_03(self): with self.assertRaises(asyncpg.InFailedSQLTransactionError): async with self.con.transaction(): task = self.loop.create_task( self.con.fetch('SELECT pg_sleep(20)')) await asyncio.sleep(0.05) task.cancel() with self.assertRaises(asyncio.CancelledError): await task await self.con.fetch('SELECT generate_series(0, 100)') self.assertEqual( await self.con.fetchval('SELECT 42'), 42) async def test_cancellation_04(self): await self.con.fetchval('SELECT pg_sleep(0)') waiter = asyncio.Future() self.con._cancel_current_command(waiter) await waiter self.assertEqual(await self.con.fetchval('SELECT 42'), 42) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/test_codecs.py0000644000175100001770000020531614705014413016664 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import datetime import decimal import ipaddress import math import os import random import struct import unittest import uuid import asyncpg from asyncpg import _testbase as tb from asyncpg import cluster as pg_cluster def _timezone(offset): minutes = offset // 60 return datetime.timezone(datetime.timedelta(minutes=minutes)) def _system_timezone(): d = datetime.datetime.now(datetime.timezone.utc).astimezone() return datetime.timezone(d.utcoffset()) infinity_datetime = datetime.datetime( datetime.MAXYEAR, 12, 31, 23, 59, 59, 999999) negative_infinity_datetime = datetime.datetime( datetime.MINYEAR, 1, 1, 0, 0, 0, 0) infinity_date = datetime.date(datetime.MAXYEAR, 12, 31) negative_infinity_date = datetime.date(datetime.MINYEAR, 1, 1) current_timezone = _system_timezone() current_date = datetime.date.today() current_datetime = datetime.datetime.now() type_samples = [ ('bool', 'bool', ( True, False, )), ('smallint', 'int2', ( -2 ** 15, 2 ** 15 - 1, -1, 0, 1, )), ('int', 'int4', ( -2 ** 31, 2 ** 31 - 1, -1, 0, 1, )), ('bigint', 'int8', ( -2 ** 63, 2 ** 63 - 1, -1, 0, 1, )), ('numeric', 'numeric', ( -(2 ** 64), 2 ** 64, -(2 ** 128), 2 ** 128, -1, 0, 1, decimal.Decimal("0.00000000000000"), decimal.Decimal("1.00000000000000"), decimal.Decimal("-1.00000000000000"), decimal.Decimal("-2.00000000000000"), decimal.Decimal("1000000000000000.00000000000000"), decimal.Decimal(1234), decimal.Decimal(-1234), decimal.Decimal("1234000000.00088883231"), decimal.Decimal(str(1234.00088883231)), decimal.Decimal("3123.23111"), decimal.Decimal("-3123000000.23111"), decimal.Decimal("3123.2311100000"), decimal.Decimal("-03123.0023111"), decimal.Decimal("3123.23111"), decimal.Decimal("3123.23111"), decimal.Decimal("10000.23111"), decimal.Decimal("100000.23111"), decimal.Decimal("1000000.23111"), decimal.Decimal("10000000.23111"), decimal.Decimal("100000000.23111"), decimal.Decimal("1000000000.23111"), decimal.Decimal("1000000000.3111"), decimal.Decimal("1000000000.111"), decimal.Decimal("1000000000.11"), decimal.Decimal("100000000.0"), decimal.Decimal("10000000.0"), decimal.Decimal("1000000.0"), decimal.Decimal("100000.0"), decimal.Decimal("10000.0"), decimal.Decimal("1000.0"), decimal.Decimal("100.0"), decimal.Decimal("100"), decimal.Decimal("100.1"), decimal.Decimal("100.12"), decimal.Decimal("100.123"), decimal.Decimal("100.1234"), decimal.Decimal("100.12345"), decimal.Decimal("100.123456"), decimal.Decimal("100.1234567"), decimal.Decimal("100.12345679"), decimal.Decimal("100.123456790"), decimal.Decimal("100.123456790000000000000000"), decimal.Decimal("1.0"), decimal.Decimal("0.0"), decimal.Decimal("-1.0"), decimal.Decimal("1.0E-1000"), decimal.Decimal("1E1000"), decimal.Decimal("0.000000000000000000000000001"), decimal.Decimal("0.000000000000010000000000001"), decimal.Decimal("0.00000000000000000000000001"), decimal.Decimal("0.00000000100000000000000001"), decimal.Decimal("0.0000000000000000000000001"), decimal.Decimal("0.000000000000000000000001"), decimal.Decimal("0.00000000000000000000001"), decimal.Decimal("0.0000000000000000000001"), decimal.Decimal("0.000000000000000000001"), decimal.Decimal("0.00000000000000000001"), decimal.Decimal("0.0000000000000000001"), decimal.Decimal("0.000000000000000001"), decimal.Decimal("0.00000000000000001"), decimal.Decimal("0.0000000000000001"), decimal.Decimal("0.000000000000001"), decimal.Decimal("0.00000000000001"), decimal.Decimal("0.0000000000001"), decimal.Decimal("0.000000000001"), decimal.Decimal("0.00000000001"), decimal.Decimal("0.0000000001"), decimal.Decimal("0.000000001"), decimal.Decimal("0.00000001"), decimal.Decimal("0.0000001"), decimal.Decimal("0.000001"), decimal.Decimal("0.00001"), decimal.Decimal("0.0001"), decimal.Decimal("0.001"), decimal.Decimal("0.01"), decimal.Decimal("0.1"), decimal.Decimal("0.10"), decimal.Decimal("0.100"), decimal.Decimal("0.1000"), decimal.Decimal("0.10000"), decimal.Decimal("0.100000"), decimal.Decimal("0.00001000"), decimal.Decimal("0.000010000"), decimal.Decimal("0.0000100000"), decimal.Decimal("0.00001000000"), decimal.Decimal("1" + "0" * 117 + "." + "0" * 161) )), ('bytea', 'bytea', ( bytes(range(256)), bytes(range(255, -1, -1)), b'\x00\x00', b'foo', b'f' * 1024 * 1024, dict(input=bytearray(b'\x02\x01'), output=b'\x02\x01'), )), ('text', 'text', ( '', 'A' * (1024 * 1024 + 11) )), ('"char"', 'char', ( b'a', b'b', b'\x00' )), ('timestamp', 'timestamp', [ datetime.datetime(3000, 5, 20, 5, 30, 10), datetime.datetime(2000, 1, 1, 5, 25, 10), datetime.datetime(500, 1, 1, 5, 25, 10), datetime.datetime(250, 1, 1, 5, 25, 10), infinity_datetime, negative_infinity_datetime, {'textinput': 'infinity', 'output': infinity_datetime}, {'textinput': '-infinity', 'output': negative_infinity_datetime}, {'input': datetime.date(2000, 1, 1), 'output': datetime.datetime(2000, 1, 1)}, {'textinput': '1970-01-01 20:31:23.648', 'output': datetime.datetime(1970, 1, 1, 20, 31, 23, 648000)}, {'input': datetime.datetime(1970, 1, 1, 20, 31, 23, 648000), 'textoutput': '1970-01-01 20:31:23.648'}, ]), ('date', 'date', [ datetime.date(3000, 5, 20), datetime.date(2000, 1, 1), datetime.date(500, 1, 1), infinity_date, negative_infinity_date, {'textinput': 'infinity', 'output': infinity_date}, {'textinput': '-infinity', 'output': negative_infinity_date}, ]), ('time', 'time', [ datetime.time(12, 15, 20), datetime.time(0, 1, 1), datetime.time(23, 59, 59), ]), ('timestamptz', 'timestamptz', [ # It's converted to UTC. When it comes back out, it will be in UTC # again. The datetime comparison will take the tzinfo into account. datetime.datetime(1990, 5, 12, 10, 10, 0, tzinfo=_timezone(4000)), datetime.datetime(1982, 5, 18, 10, 10, 0, tzinfo=_timezone(6000)), datetime.datetime(1950, 1, 1, 10, 10, 0, tzinfo=_timezone(7000)), datetime.datetime(1800, 1, 1, 10, 10, 0, tzinfo=_timezone(2000)), datetime.datetime(2400, 1, 1, 10, 10, 0, tzinfo=_timezone(2000)), infinity_datetime, negative_infinity_datetime, { 'input': current_date, 'output': datetime.datetime( year=current_date.year, month=current_date.month, day=current_date.day, tzinfo=current_timezone), }, { 'input': current_datetime, 'output': current_datetime.replace(tzinfo=current_timezone), } ]), ('timetz', 'timetz', [ # timetz retains the offset datetime.time(10, 10, 0, tzinfo=_timezone(4000)), datetime.time(10, 10, 0, tzinfo=_timezone(6000)), datetime.time(10, 10, 0, tzinfo=_timezone(7000)), datetime.time(10, 10, 0, tzinfo=_timezone(2000)), datetime.time(22, 30, 0, tzinfo=_timezone(0)), ]), ('interval', 'interval', [ datetime.timedelta(40, 10, 1234), datetime.timedelta(0, 0, 4321), datetime.timedelta(0, 0), datetime.timedelta(-100, 0), datetime.timedelta(-100, -400), { 'textinput': '-2 years -11 months -10 days ' '-2 hours -800 milliseconds', 'output': datetime.timedelta( days=(-2 * 365) + (-11 * 30) - 10, seconds=(-2 * 3600), milliseconds=-800 ), }, { 'query': 'SELECT justify_hours($1::interval)::text', 'input': datetime.timedelta( days=(-2 * 365) + (-11 * 30) - 10, seconds=(-2 * 3600), milliseconds=-800 ), 'textoutput': '-1070 days -02:00:00.8', }, ]), ('uuid', 'uuid', [ uuid.UUID('38a4ff5a-3a56-11e6-a6c2-c8f73323c6d4'), uuid.UUID('00000000-0000-0000-0000-000000000000'), {'input': '00000000-0000-0000-0000-000000000000', 'output': uuid.UUID('00000000-0000-0000-0000-000000000000')} ]), ('uuid[]', 'uuid[]', [ [uuid.UUID('38a4ff5a-3a56-11e6-a6c2-c8f73323c6d4'), uuid.UUID('00000000-0000-0000-0000-000000000000')], [] ]), ('json', 'json', [ '[1, 2, 3, 4]', '{"a": [1, 2], "b": 0}' ]), ('jsonb', 'jsonb', [ '[1, 2, 3, 4]', '{"a": [1, 2], "b": 0}' ], (9, 4)), ('jsonpath', 'jsonpath', [ '$."track"."segments"[*]."HR"?(@ > 130)', ], (12, 0)), ('oid[]', 'oid[]', [ [1, 2, 3, 4], [] ]), ('smallint[]', 'int2[]', [ [1, 2, 3, 4], [1, 2, 3, 4, 5, 6, 7, 8, 9, 0], [] ]), ('bigint[]', 'int8[]', [ [2 ** 42, -2 ** 54, 0], [] ]), ('int[]', 'int4[]', [ [2 ** 22, -2 ** 24, 0], [] ]), ('time[]', 'time[]', [ [datetime.time(12, 15, 20), datetime.time(0, 1, 1)], [] ]), ('text[]', 'text[]', [ ['ABCDE', 'EDCBA'], [], ['A' * 1024 * 1024] * 10 ]), ('float8', 'float8', [ 1.1, -1.1, 0, 2, 1e-4, -1e-20, 122.2e-100, 2e5, math.pi, math.e, math.inf, -math.inf, math.nan, {'textinput': 'infinity', 'output': math.inf}, {'textinput': '-infinity', 'output': -math.inf}, {'textinput': 'NaN', 'output': math.nan}, ]), ('float4', 'float4', [ 1.1, -1.1, 0, 2, 1e-4, -1e-20, 2e5, math.pi, math.e, math.inf, -math.inf, math.nan, {'textinput': 'infinity', 'output': math.inf}, {'textinput': '-infinity', 'output': -math.inf}, {'textinput': 'NaN', 'output': math.nan}, ]), ('cidr', 'cidr', [ ipaddress.IPv4Network('255.255.255.255/32'), ipaddress.IPv4Network('127.0.0.0/8'), ipaddress.IPv4Network('127.1.0.0/16'), ipaddress.IPv4Network('127.1.0.0/18'), ipaddress.IPv4Network('10.0.0.0/32'), ipaddress.IPv4Network('0.0.0.0/0'), ipaddress.IPv6Network('ffff' + ':ffff' * 7 + '/128'), ipaddress.IPv6Network('::1/128'), ipaddress.IPv6Network('::/0'), ]), ('inet', 'inet', [ ipaddress.IPv4Address('255.255.255.255'), ipaddress.IPv4Address('127.0.0.1'), ipaddress.IPv4Address('0.0.0.0'), ipaddress.IPv6Address('ffff' + ':ffff' * 7), ipaddress.IPv6Address('::1'), ipaddress.IPv6Address('::'), ipaddress.IPv4Interface('10.0.0.1/30'), ipaddress.IPv4Interface('0.0.0.0/0'), ipaddress.IPv4Interface('255.255.255.255/31'), dict( input='127.0.0.0/8', output=ipaddress.IPv4Interface('127.0.0.0/8')), dict( input='127.0.0.1/32', output=ipaddress.IPv4Address('127.0.0.1')), # Postgres appends /32 when casting to text explicitly, but # *not* in inet_out. dict( input='10.11.12.13', textoutput='10.11.12.13/32' ), dict( input=ipaddress.IPv4Address('10.11.12.13'), textoutput='10.11.12.13/32' ), dict( input=ipaddress.IPv4Interface('10.11.12.13'), textoutput='10.11.12.13/32' ), dict( textinput='10.11.12.13', output=ipaddress.IPv4Address('10.11.12.13'), ), dict( textinput='10.11.12.13/0', output=ipaddress.IPv4Interface('10.11.12.13/0'), ), ]), ('macaddr', 'macaddr', [ '00:00:00:00:00:00', 'ff:ff:ff:ff:ff:ff' ]), ('txid_snapshot', 'txid_snapshot', [ (100, 1000, (100, 200, 300, 400)) ]), ('pg_snapshot', 'pg_snapshot', [ (100, 1000, (100, 200, 300, 400)) ], (13, 0)), ('xid', 'xid', ( 2 ** 32 - 1, 0, 1, )), ('xid8', 'xid8', ( 2 ** 64 - 1, 0, 1, ), (13, 0)), ('varbit', 'varbit', [ asyncpg.BitString('0000 0001'), asyncpg.BitString('00010001'), asyncpg.BitString(''), asyncpg.BitString(), asyncpg.BitString.frombytes(b'\x00', bitlength=3), asyncpg.BitString('0000 0000 1'), dict(input=b'\x01', output=asyncpg.BitString('0000 0001')), dict(input=bytearray(b'\x02'), output=asyncpg.BitString('0000 0010')), ]), ('path', 'path', [ asyncpg.Path(asyncpg.Point(0.0, 0.0), asyncpg.Point(1.0, 1.0)), asyncpg.Path(asyncpg.Point(0.0, 0.0), asyncpg.Point(1.0, 1.0), is_closed=True), dict(input=((0.0, 0.0), (1.0, 1.0)), output=asyncpg.Path(asyncpg.Point(0.0, 0.0), asyncpg.Point(1.0, 1.0), is_closed=True)), dict(input=[(0.0, 0.0), (1.0, 1.0)], output=asyncpg.Path(asyncpg.Point(0.0, 0.0), asyncpg.Point(1.0, 1.0), is_closed=False)), ]), ('point', 'point', [ asyncpg.Point(0.0, 0.0), asyncpg.Point(1.0, 2.0), ]), ('box', 'box', [ asyncpg.Box((1.0, 2.0), (0.0, 0.0)), ]), ('line', 'line', [ asyncpg.Line(1, 2, 3), ], (9, 4)), ('lseg', 'lseg', [ asyncpg.LineSegment((1, 2), (2, 2)), ]), ('polygon', 'polygon', [ asyncpg.Polygon(asyncpg.Point(0.0, 0.0), asyncpg.Point(1.0, 0.0), asyncpg.Point(1.0, 1.0), asyncpg.Point(0.0, 1.0)), ]), ('circle', 'circle', [ asyncpg.Circle((0.0, 0.0), 100), ]), ('tid', 'tid', [ (100, 200), (0, 0), (2147483647, 0), (4294967295, 0), (0, 32767), (0, 65535), (4294967295, 65535), ]), ('oid', 'oid', [ 0, 10, 4294967295 ]) ] class TestCodecs(tb.ConnectedTestCase): async def test_standard_codecs(self): """Test encoding/decoding of standard data types and arrays thereof.""" for (typname, intname, sample_data, *metadata) in type_samples: if metadata and self.server_version < metadata[0]: continue st = await self.con.prepare( "SELECT $1::" + typname ) text_in = await self.con.prepare( "SELECT $1::text::" + typname ) text_out = await self.con.prepare( "SELECT $1::" + typname + "::text" ) for sample in sample_data: with self.subTest(sample=sample, typname=typname): stmt = st if isinstance(sample, dict): if 'textinput' in sample: inputval = sample['textinput'] stmt = text_in else: inputval = sample['input'] if 'textoutput' in sample: outputval = sample['textoutput'] if stmt is text_in: raise ValueError( 'cannot test "textin" and' ' "textout" simultaneously') stmt = text_out else: outputval = sample['output'] if sample.get('query'): stmt = await self.con.prepare(sample['query']) else: inputval = outputval = sample result = await stmt.fetchval(inputval) err_msg = ( "unexpected result for {} when passing {!r}: " "received {!r}, expected {!r}".format( typname, inputval, result, outputval)) if typname.startswith('float'): if math.isnan(outputval): if not math.isnan(result): self.fail(err_msg) else: self.assertTrue( math.isclose(result, outputval, rel_tol=1e-6), err_msg) else: self.assertEqual(result, outputval, err_msg) if (typname == 'numeric' and isinstance(inputval, decimal.Decimal)): self.assertEqual( result.as_tuple(), outputval.as_tuple(), err_msg, ) with self.subTest(sample=None, typname=typname): # Test that None is handled for all types. rsample = await st.fetchval(None) self.assertIsNone(rsample) at = st.get_attributes() self.assertEqual(at[0].type.name, intname) async def test_all_builtin_types_handled(self): from asyncpg.protocol.protocol import BUILTIN_TYPE_OID_MAP for oid, typename in BUILTIN_TYPE_OID_MAP.items(): codec = self.con.get_settings().get_data_codec(oid) self.assertIsNotNone( codec, 'core type {} ({}) is unhandled'.format(typename, oid)) async def test_void(self): res = await self.con.fetchval('select pg_sleep(0)') self.assertIsNone(res) await self.con.fetchval('select now($1::void)', '') def test_bitstring(self): bitlen = random.randint(0, 1000) bs = ''.join(random.choice(('1', '0', ' ')) for _ in range(bitlen)) bits = asyncpg.BitString(bs) sanitized_bs = bs.replace(' ', '') self.assertEqual(sanitized_bs, bits.as_string().replace(' ', '')) expected_bytelen = \ len(sanitized_bs) // 8 + (1 if len(sanitized_bs) % 8 else 0) self.assertEqual(len(bits.bytes), expected_bytelen) little, big = bits.to_int('little'), bits.to_int('big') self.assertEqual(bits.from_int(little, len(bits), 'little'), bits) self.assertEqual(bits.from_int(big, len(bits), 'big'), bits) naive_little = 0 for i, c in enumerate(sanitized_bs): naive_little |= int(c) << i naive_big = 0 for c in sanitized_bs: naive_big = (naive_big << 1) | int(c) self.assertEqual(little, naive_little) self.assertEqual(big, naive_big) async def test_interval(self): res = await self.con.fetchval("SELECT '5 years'::interval") self.assertEqual(res, datetime.timedelta(days=1825)) res = await self.con.fetchval("SELECT '5 years 1 month'::interval") self.assertEqual(res, datetime.timedelta(days=1855)) res = await self.con.fetchval("SELECT '-5 years'::interval") self.assertEqual(res, datetime.timedelta(days=-1825)) res = await self.con.fetchval("SELECT '-5 years -1 month'::interval") self.assertEqual(res, datetime.timedelta(days=-1855)) async def test_numeric(self): # Test that we handle dscale correctly. cases = [ '0.001', '0.001000', '1', '1.00000' ] for case in cases: res = await self.con.fetchval( "SELECT $1::numeric", case) self.assertEqual(str(res), case) try: await self.con.execute( ''' CREATE TABLE tab (v numeric(3, 2)); INSERT INTO tab VALUES (0), (1); ''') res = await self.con.fetchval("SELECT v FROM tab WHERE v = $1", 0) self.assertEqual(str(res), '0.00') res = await self.con.fetchval("SELECT v FROM tab WHERE v = $1", 1) self.assertEqual(str(res), '1.00') finally: await self.con.execute('DROP TABLE tab') res = await self.con.fetchval( "SELECT $1::numeric", decimal.Decimal('NaN')) self.assertTrue(res.is_nan()) res = await self.con.fetchval( "SELECT $1::numeric", decimal.Decimal('sNaN')) self.assertTrue(res.is_nan()) if self.server_version < (14, 0): with self.assertRaisesRegex( asyncpg.DataError, 'invalid sign in external "numeric" value' ): await self.con.fetchval( "SELECT $1::numeric", decimal.Decimal('-Inf')) with self.assertRaisesRegex( asyncpg.DataError, 'invalid sign in external "numeric" value' ): await self.con.fetchval( "SELECT $1::numeric", decimal.Decimal('+Inf')) with self.assertRaisesRegex(asyncpg.DataError, 'invalid'): await self.con.fetchval( "SELECT $1::numeric", 'invalid') else: res = await self.con.fetchval( "SELECT $1::numeric", decimal.Decimal("-Inf")) self.assertTrue(res.is_infinite()) res = await self.con.fetchval( "SELECT $1::numeric", decimal.Decimal("+Inf")) self.assertTrue(res.is_infinite()) with self.assertRaisesRegex(asyncpg.DataError, 'invalid'): await self.con.fetchval( "SELECT $1::numeric", 'invalid') async def test_unhandled_type_fallback(self): await self.con.execute(''' CREATE EXTENSION IF NOT EXISTS isn ''') try: input_val = '1436-4522' res = await self.con.fetchrow(''' SELECT $1::issn AS issn, 42 AS int ''', input_val) self.assertEqual(res['issn'], input_val) self.assertEqual(res['int'], 42) finally: await self.con.execute(''' DROP EXTENSION isn ''') async def test_invalid_input(self): # The latter message appears beginning in Python 3.10. integer_required = ( r"(an integer is required|" r"\('str' object cannot be interpreted as an integer\))") cases = [ ('bytea', 'a bytes-like object is required', [ 1, 'aaa' ]), ('bool', 'a boolean is required', [ 1, ]), ('int2', integer_required, [ '2', 'aa', ]), ('smallint', 'value out of int16 range', [ 2**256, # check for the same exception for any big numbers decimal.Decimal("2000000000000000000000000000000"), 0xffff, 0xffffffff, 32768, -32769 ]), ('float4', 'value out of float32 range', [ 4.1 * 10 ** 40, -4.1 * 10 ** 40, ]), ('int4', integer_required, [ '2', 'aa', ]), ('int', 'value out of int32 range', [ 2**256, # check for the same exception for any big numbers decimal.Decimal("2000000000000000000000000000000"), 0xffffffff, 2**31, -2**31 - 1, ]), ('int8', integer_required, [ '2', 'aa', ]), ('bigint', 'value out of int64 range', [ 2**256, # check for the same exception for any big numbers decimal.Decimal("2000000000000000000000000000000"), 0xffffffffffffffff, 2**63, -2**63 - 1, ]), ('text', 'expected str, got bytes', [ b'foo' ]), ('text', 'expected str, got list', [ [1] ]), ('tid', 'list or tuple expected', [ b'foo' ]), ('tid', 'invalid number of elements in tid tuple', [ [], (), [1, 2, 3], (4,), ]), ('tid', 'tuple id block value out of uint32 range', [ (-1, 0), (2**256, 0), (0xffffffff + 1, 0), (2**32, 0), ]), ('tid', 'tuple id offset value out of uint16 range', [ (0, -1), (0, 2**256), (0, 0xffff + 1), (0, 0xffffffff), (0, 65536), ]), ('oid', 'value out of uint32 range', [ 2 ** 32, -1, ]), ('timestamp', r"expected a datetime\.date.*got 'str'", [ 'foo' ]), ('timestamptz', r"expected a datetime\.date.*got 'str'", [ 'foo' ]), ] for typname, errmsg, data in cases: stmt = await self.con.prepare("SELECT $1::" + typname) for sample in data: with self.subTest(sample=sample, typname=typname): full_errmsg = ( r'invalid input for query argument \$1:.*' + errmsg) with self.assertRaisesRegex( asyncpg.DataError, full_errmsg): await stmt.fetchval(sample) async def test_arrays(self): """Test encoding/decoding of arrays (particularly multidimensional).""" cases = [ ( r"SELECT '[1:3][-1:0]={{1,2},{4,5},{6,7}}'::int[]", [[1, 2], [4, 5], [6, 7]] ), ( r"SELECT '{{{{{{1}}}}}}'::int[]", [[[[[[1]]]]]] ), ( r"SELECT '{1, 2, NULL}'::int[]::anyarray", [1, 2, None] ), ( r"SELECT '{}'::int[]", [] ), ] for sql, expected in cases: with self.subTest(sql=sql): res = await self.con.fetchval(sql) self.assertEqual(res, expected) with self.assertRaises(asyncpg.ProgramLimitExceededError): await self.con.fetchval("SELECT '{{{{{{{1}}}}}}}'::int[]") cases = [ [None], [1, 2, 3, 4, 5, 6], [[1, 2], [4, 5], [6, 7]], [[[1], [2]], [[4], [5]], [[None], [7]]], [[[[[[1]]]]]], [[[[[[None]]]]]] ] st = await self.con.prepare( "SELECT $1::int[]" ) for case in cases: with self.subTest(case=case): result = await st.fetchval(case) err_msg = ( "failed to return array data as-is; " "gave {!r}, received {!r}".format( case, result)) self.assertEqual(result, case, err_msg) # A sized iterable is fine as array input. class Iterable: def __iter__(self): return iter([1, 2, 3]) def __len__(self): return 3 result = await self.con.fetchval("SELECT $1::int[]", Iterable()) self.assertEqual(result, [1, 2, 3]) # A pure container is _not_ OK for array input. class SomeContainer: def __contains__(self, item): return False with self.assertRaisesRegex(asyncpg.DataError, 'sized iterable container expected'): result = await self.con.fetchval("SELECT $1::int[]", SomeContainer()) with self.assertRaisesRegex(asyncpg.DataError, 'dimensions'): await self.con.fetchval( "SELECT $1::int[]", [[[[[[[1]]]]]]]) with self.assertRaisesRegex(asyncpg.DataError, 'non-homogeneous'): await self.con.fetchval( "SELECT $1::int[]", [1, [1]]) with self.assertRaisesRegex(asyncpg.DataError, 'non-homogeneous'): await self.con.fetchval( "SELECT $1::int[]", [[1], 1, [2]]) with self.assertRaisesRegex(asyncpg.DataError, 'invalid array element'): await self.con.fetchval( "SELECT $1::int[]", [1, 't', 2]) with self.assertRaisesRegex(asyncpg.DataError, 'invalid array element'): await self.con.fetchval( "SELECT $1::int[]", [[1], ['t'], [2]]) with self.assertRaisesRegex(asyncpg.DataError, 'sized iterable container expected'): await self.con.fetchval( "SELECT $1::int[]", 1) async def test_composites(self): """Test encoding/decoding of composite types.""" await self.con.execute(''' CREATE TYPE test_composite AS ( a int, b text, c int[] ) ''') st = await self.con.prepare(''' SELECT ROW(NULL, 1234, '5678', ROW(42, '42')) ''') res = await st.fetchval() self.assertEqual(res, (None, 1234, '5678', (42, '42'))) with self.assertRaisesRegex( asyncpg.UnsupportedClientFeatureError, 'query argument \\$1: input of anonymous ' 'composite types is not supported', ): await self.con.fetchval("SELECT (1, 'foo') = $1", (1, 'foo')) try: st = await self.con.prepare(''' SELECT ROW( NULL, '5678', ARRAY[9, NULL, 11]::int[] )::test_composite AS test ''') res = await st.fetch() res = res[0]['test'] self.assertIsNone(res['a']) self.assertEqual(res['b'], '5678') self.assertEqual(res['c'], [9, None, 11]) self.assertIsNone(res[0]) self.assertEqual(res[1], '5678') self.assertEqual(res[2], [9, None, 11]) at = st.get_attributes() self.assertEqual(len(at), 1) self.assertEqual(at[0].name, 'test') self.assertEqual(at[0].type.name, 'test_composite') self.assertEqual(at[0].type.kind, 'composite') res = await self.con.fetchval(''' SELECT $1::test_composite ''', res) # composite input as a mapping res = await self.con.fetchval(''' SELECT $1::test_composite ''', {'b': 'foo', 'a': 1, 'c': [1, 2, 3]}) self.assertEqual(res, (1, 'foo', [1, 2, 3])) # Test None padding res = await self.con.fetchval(''' SELECT $1::test_composite ''', {'a': 1}) self.assertEqual(res, (1, None, None)) with self.assertRaisesRegex( asyncpg.DataError, "'bad' is not a valid element"): await self.con.fetchval( "SELECT $1::test_composite", {'bad': 'foo'}) finally: await self.con.execute('DROP TYPE test_composite') async def test_domains(self): """Test encoding/decoding of composite types.""" await self.con.execute(''' CREATE DOMAIN my_dom AS int ''') await self.con.execute(''' CREATE DOMAIN my_dom2 AS my_dom ''') try: st = await self.con.prepare(''' SELECT 3::my_dom2 ''') res = await st.fetchval() self.assertEqual(res, 3) st = await self.con.prepare(''' SELECT NULL::my_dom2 ''') res = await st.fetchval() self.assertIsNone(res) at = st.get_attributes() self.assertEqual(len(at), 1) self.assertEqual(at[0].name, 'my_dom2') self.assertEqual(at[0].type.name, 'int4') self.assertEqual(at[0].type.kind, 'scalar') finally: await self.con.execute('DROP DOMAIN my_dom2') await self.con.execute('DROP DOMAIN my_dom') async def test_range_types(self): """Test encoding/decoding of range types.""" cases = [ ('int4range', [ [(1, 9), asyncpg.Range(1, 10)], [asyncpg.Range(0, 9, lower_inc=False, upper_inc=True), asyncpg.Range(1, 10)], [(), asyncpg.Range(empty=True)], [asyncpg.Range(empty=True), asyncpg.Range(empty=True)], [(None, 2), asyncpg.Range(None, 3)], [asyncpg.Range(None, 2, upper_inc=True), asyncpg.Range(None, 3)], [(2,), asyncpg.Range(2, None)], [(2, None), asyncpg.Range(2, None)], [asyncpg.Range(2, None), asyncpg.Range(2, None)], [(None, None), asyncpg.Range(None, None)], [asyncpg.Range(None, None), asyncpg.Range(None, None)] ]) ] for (typname, sample_data) in cases: st = await self.con.prepare( "SELECT $1::" + typname ) for sample, expected in sample_data: with self.subTest(sample=sample, typname=typname): result = await st.fetchval(sample) self.assertEqual(result, expected) with self.assertRaisesRegex( asyncpg.DataError, 'list, tuple or Range object expected'): await self.con.fetch("SELECT $1::int4range", 'aa') with self.assertRaisesRegex( asyncpg.DataError, 'expected 0, 1 or 2 elements'): await self.con.fetch("SELECT $1::int4range", (0, 2, 3)) cases = [(asyncpg.Range(0, 1), asyncpg.Range(0, 1), 1), (asyncpg.Range(0, 1), asyncpg.Range(0, 2), 2), (asyncpg.Range(empty=True), asyncpg.Range(0, 2), 2), (asyncpg.Range(empty=True), asyncpg.Range(empty=True), 1), (asyncpg.Range(0, 1, upper_inc=True), asyncpg.Range(0, 1), 2), ] for obj_a, obj_b, count in cases: dic = {obj_a: 1, obj_b: 2} self.assertEqual(len(dic), count) async def test_multirange_types(self): """Test encoding/decoding of multirange types.""" if self.server_version < (14, 0): self.skipTest("this server does not support multirange types") cases = [ ('int4multirange', [ [ [], [] ], [ [()], [] ], [ [asyncpg.Range(empty=True)], [] ], [ [asyncpg.Range(0, 9, lower_inc=False, upper_inc=True)], [asyncpg.Range(1, 10)] ], [ [(1, 9), (9, 11)], [asyncpg.Range(1, 12)] ], [ [(1, 9), (20, 30)], [asyncpg.Range(1, 10), asyncpg.Range(20, 31)] ], [ [(None, 2)], [asyncpg.Range(None, 3)], ] ]) ] for (typname, sample_data) in cases: st = await self.con.prepare( "SELECT $1::" + typname ) for sample, expected in sample_data: with self.subTest(sample=sample, typname=typname): result = await st.fetchval(sample) self.assertEqual(result, expected) with self.assertRaisesRegex( asyncpg.DataError, 'expected a sequence'): await self.con.fetch("SELECT $1::int4multirange", 1) async def test_extra_codec_alias(self): """Test encoding/decoding of a builtin non-pg_catalog codec.""" await self.con.execute(''' CREATE DOMAIN my_dec_t AS decimal; CREATE EXTENSION IF NOT EXISTS hstore; CREATE TYPE rec_t AS ( i my_dec_t, h hstore ); ''') try: await self.con.set_builtin_type_codec( 'hstore', codec_name='pg_contrib.hstore') cases = [ {'ham': 'spam', 'nada': None}, {} ] st = await self.con.prepare(''' SELECT $1::hstore AS result ''') for case in cases: res = await st.fetchval(case) self.assertEqual(res, case) res = await self.con.fetchval(''' SELECT $1::hstore AS result ''', (('foo', '2'), ('bar', '3'))) self.assertEqual(res, {'foo': '2', 'bar': '3'}) with self.assertRaisesRegex(asyncpg.DataError, 'null value not allowed'): await self.con.fetchval(''' SELECT $1::hstore AS result ''', {None: '1'}) await self.con.set_builtin_type_codec( 'my_dec_t', codec_name='decimal') res = await self.con.fetchval(''' SELECT $1::my_dec_t AS result ''', 44) self.assertEqual(res, 44) # Both my_dec_t and hstore are decoded in binary res = await self.con.fetchval(''' SELECT ($1::my_dec_t, 'a=>1'::hstore)::rec_t AS result ''', 44) self.assertEqual(res, (44, {'a': '1'})) # Now, declare only the text format for my_dec_t await self.con.reset_type_codec('my_dec_t') await self.con.set_builtin_type_codec( 'my_dec_t', codec_name='decimal', format='text') # This should fail, as there is no binary codec for # my_dec_t and text decoding of composites is not # implemented. with self.assertRaises(asyncpg.UnsupportedClientFeatureError): res = await self.con.fetchval(''' SELECT ($1::my_dec_t, 'a=>1'::hstore)::rec_t AS result ''', 44) finally: await self.con.execute(''' DROP TYPE rec_t; DROP EXTENSION hstore; DROP DOMAIN my_dec_t; ''') async def test_custom_codec_text(self): """Test encoding/decoding using a custom codec in text mode.""" await self.con.execute(''' CREATE EXTENSION IF NOT EXISTS hstore ''') def hstore_decoder(data): result = {} items = data.split(',') for item in items: k, _, v = item.partition('=>') result[k.strip('"')] = v.strip('"') return result def hstore_encoder(obj): return ','.join('{}=>{}'.format(k, v) for k, v in obj.items()) try: await self.con.set_type_codec('hstore', encoder=hstore_encoder, decoder=hstore_decoder) st = await self.con.prepare(''' SELECT $1::hstore AS result ''') res = await st.fetchrow({'ham': 'spam'}) res = res['result'] self.assertEqual(res, {'ham': 'spam'}) pt = st.get_parameters() self.assertTrue(isinstance(pt, tuple)) self.assertEqual(len(pt), 1) self.assertEqual(pt[0].name, 'hstore') self.assertEqual(pt[0].kind, 'scalar') self.assertEqual(pt[0].schema, 'public') at = st.get_attributes() self.assertTrue(isinstance(at, tuple)) self.assertEqual(len(at), 1) self.assertEqual(at[0].name, 'result') self.assertEqual(at[0].type, pt[0]) err = 'cannot use custom codec on type public._hstore' with self.assertRaisesRegex(asyncpg.InterfaceError, err): await self.con.set_type_codec('_hstore', encoder=hstore_encoder, decoder=hstore_decoder) finally: await self.con.execute(''' DROP EXTENSION hstore ''') async def test_custom_codec_binary(self): """Test encoding/decoding using a custom codec in binary mode.""" await self.con.execute(''' CREATE EXTENSION IF NOT EXISTS hstore ''') longstruct = struct.Struct('!L') ulong_unpack = lambda b: longstruct.unpack_from(b)[0] ulong_pack = longstruct.pack def hstore_decoder(data): result = {} n = ulong_unpack(data) view = memoryview(data) ptr = 4 for i in range(n): klen = ulong_unpack(view[ptr:ptr + 4]) ptr += 4 k = bytes(view[ptr:ptr + klen]).decode() ptr += klen vlen = ulong_unpack(view[ptr:ptr + 4]) ptr += 4 if vlen == -1: v = None else: v = bytes(view[ptr:ptr + vlen]).decode() ptr += vlen result[k] = v return result def hstore_encoder(obj): buffer = bytearray(ulong_pack(len(obj))) for k, v in obj.items(): kenc = k.encode() buffer += ulong_pack(len(kenc)) + kenc if v is None: buffer += b'\xFF\xFF\xFF\xFF' # -1 else: venc = v.encode() buffer += ulong_pack(len(venc)) + venc return buffer try: await self.con.set_type_codec('hstore', encoder=hstore_encoder, decoder=hstore_decoder, format='binary') st = await self.con.prepare(''' SELECT $1::hstore AS result ''') res = await st.fetchrow({'ham': 'spam'}) res = res['result'] self.assertEqual(res, {'ham': 'spam'}) pt = st.get_parameters() self.assertTrue(isinstance(pt, tuple)) self.assertEqual(len(pt), 1) self.assertEqual(pt[0].name, 'hstore') self.assertEqual(pt[0].kind, 'scalar') self.assertEqual(pt[0].schema, 'public') at = st.get_attributes() self.assertTrue(isinstance(at, tuple)) self.assertEqual(len(at), 1) self.assertEqual(at[0].name, 'result') self.assertEqual(at[0].type, pt[0]) finally: await self.con.execute(''' DROP EXTENSION hstore ''') async def test_custom_codec_on_domain(self): """Test encoding/decoding using a custom codec on a domain.""" await self.con.execute(''' CREATE DOMAIN custom_codec_t AS int ''') try: with self.assertRaisesRegex( asyncpg.UnsupportedClientFeatureError, 'custom codecs on domain types are not supported' ): await self.con.set_type_codec( 'custom_codec_t', encoder=lambda v: str(v), decoder=lambda v: int(v)) finally: await self.con.execute('DROP DOMAIN custom_codec_t') async def test_custom_codec_on_stdsql_types(self): types = [ 'smallint', 'int', 'integer', 'bigint', 'decimal', 'real', 'double precision', 'timestamp with timezone', 'time with timezone', 'timestamp without timezone', 'time without timezone', 'char', 'character', 'character varying', 'bit varying', 'CHARACTER VARYING' ] for t in types: with self.subTest(type=t): try: await self.con.set_type_codec( t, schema='pg_catalog', encoder=str, decoder=str, format='text' ) finally: await self.con.reset_type_codec(t, schema='pg_catalog') async def test_custom_codec_on_enum(self): """Test encoding/decoding using a custom codec on an enum.""" await self.con.execute(''' CREATE TYPE custom_codec_t AS ENUM ('foo', 'bar', 'baz') ''') try: await self.con.set_type_codec( 'custom_codec_t', encoder=lambda v: str(v).lstrip('enum :'), decoder=lambda v: 'enum: ' + str(v)) v = await self.con.fetchval('SELECT $1::custom_codec_t', 'foo') self.assertEqual(v, 'enum: foo') finally: await self.con.execute('DROP TYPE custom_codec_t') async def test_custom_codec_on_enum_array(self): """Test encoding/decoding using a custom codec on an enum array. Bug: https://github.com/MagicStack/asyncpg/issues/590 """ await self.con.execute(''' CREATE TYPE custom_codec_t AS ENUM ('foo', 'bar', 'baz') ''') try: await self.con.set_type_codec( 'custom_codec_t', encoder=lambda v: str(v).lstrip('enum :'), decoder=lambda v: 'enum: ' + str(v)) v = await self.con.fetchval( "SELECT ARRAY['foo', 'bar']::custom_codec_t[]") self.assertEqual(v, ['enum: foo', 'enum: bar']) v = await self.con.fetchval( 'SELECT ARRAY[$1]::custom_codec_t[]', 'foo') self.assertEqual(v, ['enum: foo']) v = await self.con.fetchval("SELECT 'foo'::custom_codec_t") self.assertEqual(v, 'enum: foo') finally: await self.con.execute('DROP TYPE custom_codec_t') async def test_custom_codec_override_binary(self): """Test overriding core codecs.""" import json conn = await self.connect() try: def _encoder(value): return json.dumps(value).encode('utf-8') def _decoder(value): return json.loads(value.decode('utf-8')) await conn.set_type_codec( 'json', encoder=_encoder, decoder=_decoder, schema='pg_catalog', format='binary' ) data = {'foo': 'bar', 'spam': 1} res = await conn.fetchval('SELECT $1::json', data) self.assertEqual(data, res) finally: await conn.close() async def test_custom_codec_override_text(self): """Test overriding core codecs.""" import json conn = await self.connect() try: def _encoder(value): return json.dumps(value) def _decoder(value): return json.loads(value) await conn.set_type_codec( 'json', encoder=_encoder, decoder=_decoder, schema='pg_catalog', format='text' ) data = {'foo': 'bar', 'spam': 1} res = await conn.fetchval('SELECT $1::json', data) self.assertEqual(data, res) res = await conn.fetchval('SELECT $1::json[]', [data]) self.assertEqual([data], res) await conn.execute('CREATE DOMAIN my_json AS json') res = await conn.fetchval('SELECT $1::my_json', data) self.assertEqual(data, res) def _encoder(value): return value def _decoder(value): return value await conn.set_type_codec( 'uuid', encoder=_encoder, decoder=_decoder, schema='pg_catalog', format='text' ) data = '14058ad9-0118-4b7e-ac15-01bc13e2ccd1' res = await conn.fetchval('SELECT $1::uuid', data) self.assertEqual(res, data) finally: await conn.execute('DROP DOMAIN IF EXISTS my_json') await conn.close() async def test_custom_codec_override_tuple(self): """Test overriding core codecs.""" cases = [ ('date', (3,), '2000-01-04'), ('date', (2**31 - 1,), 'infinity'), ('date', (-2**31,), '-infinity'), ('time', (60 * 10**6,), '00:01:00'), ('timetz', (60 * 10**6, 12600), '00:01:00-03:30'), ('timestamp', (60 * 10**6,), '2000-01-01 00:01:00'), ('timestamp', (2**63 - 1,), 'infinity'), ('timestamp', (-2**63,), '-infinity'), ('timestamptz', (60 * 10**6,), '1999-12-31 19:01:00', "tab.v AT TIME ZONE 'EST'"), ('timestamptz', (2**63 - 1,), 'infinity'), ('timestamptz', (-2**63,), '-infinity'), ('interval', (2, 3, 1), '2 mons 3 days 00:00:00.000001') ] conn = await self.connect() def _encoder(value): return tuple(value) def _decoder(value): return tuple(value) try: for (typename, data, expected_result, *extra) in cases: with self.subTest(type=typename): await self.con.execute( 'CREATE TABLE tab (v {})'.format(typename)) try: await conn.set_type_codec( typename, encoder=_encoder, decoder=_decoder, schema='pg_catalog', format='tuple' ) await conn.execute( 'INSERT INTO tab VALUES ($1)', data) res = await conn.fetchval('SELECT tab.v FROM tab') self.assertEqual(res, data) await conn.reset_type_codec( typename, schema='pg_catalog') if extra: val = extra[0] else: val = 'tab.v' res = await conn.fetchval( 'SELECT ({val})::text FROM tab'.format(val=val)) self.assertEqual(res, expected_result) finally: await self.con.execute('DROP TABLE tab') finally: await conn.close() async def test_custom_codec_composite_tuple(self): await self.con.execute(''' CREATE TYPE mycomplex AS (r float, i float); ''') try: await self.con.set_type_codec( 'mycomplex', encoder=lambda x: (x.real, x.imag), decoder=lambda t: complex(t[0], t[1]), format='tuple', ) num = complex('1+2j') res = await self.con.fetchval( 'SELECT $1::mycomplex', num, ) self.assertEqual(num, res) finally: await self.con.execute(''' DROP TYPE mycomplex; ''') async def test_custom_codec_composite_non_tuple(self): await self.con.execute(''' CREATE TYPE mycomplex AS (r float, i float); ''') try: with self.assertRaisesRegex( asyncpg.UnsupportedClientFeatureError, "only tuple-format codecs can be used on composite types", ): await self.con.set_type_codec( 'mycomplex', encoder=lambda x: (x.real, x.imag), decoder=lambda t: complex(t[0], t[1]), ) finally: await self.con.execute(''' DROP TYPE mycomplex; ''') async def test_timetz_encoding(self): try: async with self.con.transaction(): await self.con.execute("SET TIME ZONE 'America/Toronto'") # Check decoding: row = await self.con.fetchrow( 'SELECT extract(epoch from now())::float8 AS epoch, ' 'now()::date as date, now()::timetz as time') result = datetime.datetime.combine(row['date'], row['time']) expected = datetime.datetime.fromtimestamp(row['epoch'], tz=result.tzinfo) self.assertEqual(result, expected) # Check encoding: res = await self.con.fetchval( 'SELECT now() = ($1::date + $2::timetz)', row['date'], row['time']) self.assertTrue(res) finally: await self.con.execute('RESET ALL') async def test_composites_in_arrays(self): await self.con.execute(''' CREATE TYPE t AS (a text, b int); CREATE TABLE tab (d t[]); ''') try: await self.con.execute( 'INSERT INTO tab (d) VALUES ($1)', [('a', 1)]) r = await self.con.fetchval(''' SELECT d FROM tab ''') self.assertEqual(r, [('a', 1)]) finally: await self.con.execute(''' DROP TABLE tab; DROP TYPE t; ''') async def test_table_as_composite(self): await self.con.execute(''' CREATE TABLE tab (a text, b int); INSERT INTO tab VALUES ('1', 1); ''') try: r = await self.con.fetchrow(''' SELECT tab FROM tab ''') self.assertEqual(r, (('1', 1),)) finally: await self.con.execute(''' DROP TABLE tab; ''') async def test_relacl_array_type(self): await self.con.execute(r''' CREATE USER """u1'"; CREATE USER "{u2"; CREATE USER ",u3"; CREATE USER "u4}"; CREATE USER "u5"""; CREATE USER "u6\"""; CREATE USER "u7\"; CREATE USER norm1; CREATE USER norm2; CREATE TABLE t0 (); GRANT SELECT ON t0 TO norm1; CREATE TABLE t1 (); GRANT SELECT ON t1 TO """u1'"; CREATE TABLE t2 (); GRANT SELECT ON t2 TO "{u2"; CREATE TABLE t3 (); GRANT SELECT ON t3 TO ",u3"; CREATE TABLE t4 (); GRANT SELECT ON t4 TO "u4}"; CREATE TABLE t5 (); GRANT SELECT ON t5 TO "u5"""; CREATE TABLE t6 (); GRANT SELECT ON t6 TO "u6\"""; CREATE TABLE t7 (); GRANT SELECT ON t7 TO "u7\"; CREATE TABLE a1 (); GRANT SELECT ON a1 TO """u1'"; GRANT SELECT ON a1 TO "{u2"; GRANT SELECT ON a1 TO ",u3"; GRANT SELECT ON a1 TO "norm1"; GRANT SELECT ON a1 TO "u4}"; GRANT SELECT ON a1 TO "u5"""; GRANT SELECT ON a1 TO "u6\"""; GRANT SELECT ON a1 TO "u7\"; GRANT SELECT ON a1 TO "norm2"; CREATE TABLE a2 (); GRANT SELECT ON a2 TO """u1'" WITH GRANT OPTION; GRANT SELECT ON a2 TO "{u2" WITH GRANT OPTION; GRANT SELECT ON a2 TO ",u3" WITH GRANT OPTION; GRANT SELECT ON a2 TO "norm1" WITH GRANT OPTION; GRANT SELECT ON a2 TO "u4}" WITH GRANT OPTION; GRANT SELECT ON a2 TO "u5""" WITH GRANT OPTION; GRANT SELECT ON a2 TO "u6\""" WITH GRANT OPTION; GRANT SELECT ON a2 TO "u7\" WITH GRANT OPTION; SET SESSION AUTHORIZATION """u1'"; GRANT SELECT ON a2 TO "norm2"; SET SESSION AUTHORIZATION "{u2"; GRANT SELECT ON a2 TO "norm2"; SET SESSION AUTHORIZATION ",u3"; GRANT SELECT ON a2 TO "norm2"; SET SESSION AUTHORIZATION "u4}"; GRANT SELECT ON a2 TO "norm2"; SET SESSION AUTHORIZATION "u5"""; GRANT SELECT ON a2 TO "norm2"; SET SESSION AUTHORIZATION "u6\"""; GRANT SELECT ON a2 TO "norm2"; SET SESSION AUTHORIZATION "u7\"; GRANT SELECT ON a2 TO "norm2"; RESET SESSION AUTHORIZATION; ''') try: rows = await self.con.fetch(''' SELECT relacl, relacl::text[] AS chk, relacl::text[]::text AS text_ FROM pg_catalog.pg_class WHERE relacl IS NOT NULL ''') for row in rows: self.assertEqual(row['relacl'], row['chk'],) finally: await self.con.execute(r''' DROP TABLE t0; DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; DROP TABLE t4; DROP TABLE t5; DROP TABLE t6; DROP TABLE t7; DROP TABLE a1; DROP TABLE a2; DROP USER """u1'"; DROP USER "{u2"; DROP USER ",u3"; DROP USER "u4}"; DROP USER "u5"""; DROP USER "u6\"""; DROP USER "u7\"; DROP USER norm1; DROP USER norm2; ''') async def test_enum(self): await self.con.execute(''' CREATE TYPE enum_t AS ENUM ('abc', 'def', 'ghi'); CREATE TABLE tab ( a text, b enum_t ); INSERT INTO tab (a, b) VALUES ('foo', 'abc'); INSERT INTO tab (a, b) VALUES ('bar', 'def'); ''') try: for i in range(10): r = await self.con.fetch(''' SELECT a, b FROM tab ORDER BY b ''') self.assertEqual(r, [('foo', 'abc'), ('bar', 'def')]) finally: await self.con.execute(''' DROP TABLE tab; DROP TYPE enum_t; ''') async def test_unknown_type_text_fallback(self): await self.con.execute(r'CREATE EXTENSION citext') await self.con.execute(r''' CREATE DOMAIN citext_dom AS citext ''') await self.con.execute(r''' CREATE TYPE citext_range AS RANGE (SUBTYPE = citext) ''') await self.con.execute(r''' CREATE TYPE citext_comp AS (t citext) ''') try: # Check that plain fallback works. result = await self.con.fetchval(''' SELECT $1::citext ''', 'citext') self.assertEqual(result, 'citext') # Check that domain fallback works. result = await self.con.fetchval(''' SELECT $1::citext_dom ''', 'citext') self.assertEqual(result, 'citext') # Check that array fallback works. cases = [ ['a', 'b'], [None, 'b'], [], [' a', ' b'], ['"a', r'\""'], [['"a', r'\""'], [',', '",']], ] for case in cases: result = await self.con.fetchval(''' SELECT $1::citext[] ''', case) self.assertEqual(result, case) # Text encoding of ranges and composite types # is not supported yet. with self.assertRaisesRegex( asyncpg.UnsupportedClientFeatureError, 'text encoding of range types is not supported'): await self.con.fetchval(''' SELECT $1::citext_range ''', ['a', 'z']) with self.assertRaisesRegex( asyncpg.UnsupportedClientFeatureError, 'text encoding of composite types is not supported'): await self.con.fetchval(''' SELECT $1::citext_comp ''', ('a',)) # Check that setting a custom codec clears the codec # cache properly and that subsequent queries work # as expected. await self.con.set_type_codec( 'citext', encoder=lambda d: d, decoder=lambda d: 'CI: ' + d) result = await self.con.fetchval(''' SELECT $1::citext[] ''', ['a', 'b']) self.assertEqual(result, ['CI: a', 'CI: b']) finally: await self.con.execute(r'DROP TYPE citext_comp') await self.con.execute(r'DROP TYPE citext_range') await self.con.execute(r'DROP TYPE citext_dom') await self.con.execute(r'DROP EXTENSION citext') async def test_enum_in_array(self): await self.con.execute(''' CREATE TYPE enum_t AS ENUM ('abc', 'def', 'ghi'); ''') try: result = await self.con.fetchrow('''SELECT $1::enum_t[];''', ['abc']) self.assertEqual(result, (['abc'],)) result = await self.con.fetchrow('''SELECT ARRAY[$1::enum_t];''', 'abc') self.assertEqual(result, (['abc'],)) finally: await self.con.execute(''' DROP TYPE enum_t; ''') async def test_enum_and_range(self): await self.con.execute(''' CREATE TYPE enum_t AS ENUM ('abc', 'def', 'ghi'); CREATE TABLE testtab ( a int4range, b enum_t ); INSERT INTO testtab VALUES ( '[10, 20)', 'abc' ); ''') try: result = await self.con.fetchrow(''' SELECT testtab.a FROM testtab WHERE testtab.b = $1 ''', 'abc') self.assertEqual(result, (asyncpg.Range(10, 20),)) finally: await self.con.execute(''' DROP TABLE testtab; DROP TYPE enum_t; ''') async def test_enum_in_composite(self): await self.con.execute(''' CREATE TYPE enum_t AS ENUM ('abc', 'def', 'ghi'); CREATE TYPE composite_w_enum AS (a int, b enum_t); ''') try: result = await self.con.fetchval(''' SELECT ROW(1, 'def'::enum_t)::composite_w_enum ''') self.assertEqual(set(result.items()), {('a', 1), ('b', 'def')}) finally: await self.con.execute(''' DROP TYPE composite_w_enum; DROP TYPE enum_t; ''') async def test_enum_function_return(self): await self.con.execute(''' CREATE TYPE enum_t AS ENUM ('abc', 'def', 'ghi'); CREATE FUNCTION return_enum() RETURNS enum_t LANGUAGE plpgsql AS $$ BEGIN RETURN 'abc'::enum_t; END; $$; ''') try: result = await self.con.fetchval('''SELECT return_enum()''') self.assertEqual(result, 'abc') finally: await self.con.execute(''' DROP FUNCTION return_enum(); DROP TYPE enum_t; ''') async def test_no_result(self): st = await self.con.prepare('rollback') self.assertTupleEqual(st.get_attributes(), ()) async def test_array_with_custom_json_text_codec(self): import json await self.con.execute('CREATE TABLE tab (id serial, val json[]);') insert_sql = 'INSERT INTO tab (val) VALUES (cast($1 AS json[]));' query_sql = 'SELECT val FROM tab ORDER BY id DESC;' try: for custom_codec in [False, True]: if custom_codec: await self.con.set_type_codec( 'json', encoder=lambda v: v, decoder=json.loads, schema="pg_catalog", ) for val in ['"null"', '22', 'null', '[2]', '{"a": null}']: await self.con.execute(insert_sql, [val]) result = await self.con.fetchval(query_sql) if custom_codec: self.assertEqual(result, [json.loads(val)]) else: self.assertEqual(result, [val]) await self.con.execute(insert_sql, [None]) result = await self.con.fetchval(query_sql) self.assertEqual(result, [None]) await self.con.execute(insert_sql, None) result = await self.con.fetchval(query_sql) self.assertEqual(result, None) finally: await self.con.execute(''' DROP TABLE tab; ''') @unittest.skipIf(os.environ.get('PGHOST'), 'using remote cluster for testing') class TestCodecsLargeOIDs(tb.ConnectedTestCase): LARGE_OID = 2147483648 @classmethod def setup_cluster(cls): cls.cluster = cls.new_cluster(pg_cluster.TempCluster) cls.cluster.reset_wal(oid=cls.LARGE_OID) cls.start_cluster(cls.cluster) async def test_custom_codec_large_oid(self): await self.con.execute('CREATE DOMAIN test_domain_t AS int') try: oid = await self.con.fetchval(''' SELECT oid FROM pg_type WHERE typname = 'test_domain_t' ''') expected_oid = self.LARGE_OID if self.server_version >= (11, 0): # PostgreSQL 11 automatically creates a domain array type # _before_ the domain type, so the expected OID is # off by one. expected_oid += 1 self.assertEqual(oid, expected_oid) # Test that introspection handles large OIDs v = await self.con.fetchval('SELECT $1::test_domain_t', 10) self.assertEqual(v, 10) finally: await self.con.execute('DROP DOMAIN test_domain_t') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/test_connect.py0000644000175100001770000023113414705014413017052 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncio import contextlib import gc import ipaddress import os import pathlib import platform import shutil import socket import ssl import stat import tempfile import textwrap import unittest import unittest.mock import urllib.parse import warnings import weakref import distro import asyncpg from asyncpg import _testbase as tb from asyncpg import connection as pg_connection from asyncpg import connect_utils from asyncpg import cluster as pg_cluster from asyncpg import exceptions from asyncpg.connect_utils import SSLMode from asyncpg.serverversion import split_server_version_string _system = platform.uname().system CERTS = os.path.join(os.path.dirname(__file__), 'certs') SSL_CA_CERT_FILE = os.path.join(CERTS, 'ca.cert.pem') SSL_CA_CRL_FILE = os.path.join(CERTS, 'ca.crl.pem') SSL_CERT_FILE = os.path.join(CERTS, 'server.cert.pem') SSL_KEY_FILE = os.path.join(CERTS, 'server.key.pem') CLIENT_CA_CERT_FILE = os.path.join(CERTS, 'client_ca.cert.pem') CLIENT_SSL_CERT_FILE = os.path.join(CERTS, 'client.cert.pem') CLIENT_SSL_KEY_FILE = os.path.join(CERTS, 'client.key.pem') CLIENT_SSL_PROTECTED_KEY_FILE = os.path.join(CERTS, 'client.key.protected.pem') if _system == 'Windows': DEFAULT_GSSLIB = 'sspi' OTHER_GSSLIB = 'gssapi' else: DEFAULT_GSSLIB = 'gssapi' OTHER_GSSLIB = 'sspi' @contextlib.contextmanager def mock_dot_postgresql(*, ca=True, crl=False, client=False, protected=False): with tempfile.TemporaryDirectory() as temp_dir: home = pathlib.Path(temp_dir) pg_home = home / '.postgresql' pg_home.mkdir() if ca: shutil.copyfile(SSL_CA_CERT_FILE, pg_home / 'root.crt') if crl: shutil.copyfile(SSL_CA_CRL_FILE, pg_home / 'root.crl') if client: shutil.copyfile(CLIENT_SSL_CERT_FILE, pg_home / 'postgresql.crt') if protected: shutil.copyfile( CLIENT_SSL_PROTECTED_KEY_FILE, pg_home / 'postgresql.key' ) else: shutil.copyfile( CLIENT_SSL_KEY_FILE, pg_home / 'postgresql.key' ) with unittest.mock.patch( 'pathlib.Path.home', unittest.mock.Mock(return_value=home) ): yield @contextlib.contextmanager def mock_no_home_dir(): with unittest.mock.patch( 'pathlib.Path.home', unittest.mock.Mock(side_effect=RuntimeError) ): yield @contextlib.contextmanager def mock_dev_null_home_dir(): with unittest.mock.patch( 'pathlib.Path.home', unittest.mock.Mock(return_value=pathlib.Path('/dev/null')), ): yield class TestSettings(tb.ConnectedTestCase): async def test_get_settings_01(self): self.assertEqual( self.con.get_settings().client_encoding, 'UTF8') async def test_server_version_01(self): version = self.con.get_server_version() version_num = await self.con.fetchval("SELECT current_setting($1)", 'server_version_num', column=0) ver_maj = int(version_num[:-4]) ver_min = int(version_num[-4:-2]) ver_fix = int(version_num[-2:]) self.assertEqual(version[:3], (ver_maj, ver_min, ver_fix)) def test_server_version_02(self): versions = [ ("9.2", (9, 2, 0, 'final', 0),), ("Postgres-XL 9.2.1", (9, 2, 1, 'final', 0),), ("9.4beta1", (9, 4, 0, 'beta', 1),), ("10devel", (10, 0, 0, 'devel', 0),), ("10beta2", (10, 0, 0, 'beta', 2),), # For PostgreSQL versions >=10 we always # set version.minor to 0. ("10.1", (10, 0, 1, 'final', 0),), ("11.1.2", (11, 0, 1, 'final', 0),), ("PostgreSQL 10.1 (Debian 10.1-3)", (10, 0, 1, 'final', 0),), ("PostgreSQL 11.2-YB-2.7.1.1-b0 on x86_64-pc-linux-gnu, " "compiled by gcc (Homebrew gcc 5.5.0_4) 5.5.0, 64-bit", (11, 0, 2, "final", 0),), ] for version, expected in versions: result = split_server_version_string(version) self.assertEqual(expected, result) CORRECT_PASSWORD = 'correct\u1680password' class BaseTestAuthentication(tb.ConnectedTestCase): USERS = [] def setUp(self): super().setUp() if not self.cluster.is_managed(): self.skipTest('unmanaged cluster') self.cluster.reset_hba() create_script = [] for username, method, password in self.USERS: if method == 'scram-sha-256' and self.server_version.major < 10: continue # if this is a SCRAM password, we need to set the encryption method # to "scram-sha-256" in order to properly hash the password if method == 'scram-sha-256': create_script.append( "SET password_encryption = 'scram-sha-256';" ) create_script.append( 'CREATE ROLE "{}" WITH LOGIN{};'.format( username, f' PASSWORD E{(password or "")!r}' ) ) # to be courteous to the MD5 test, revert back to MD5 after the # scram-sha-256 password is set if method == 'scram-sha-256': create_script.append( "SET password_encryption = 'md5';" ) if _system != 'Windows' and method != 'gss': self.cluster.add_hba_entry( type='local', database='postgres', user=username, auth_method=method) self.cluster.add_hba_entry( type='host', address=ipaddress.ip_network('127.0.0.0/24'), database='postgres', user=username, auth_method=method) self.cluster.add_hba_entry( type='host', address=ipaddress.ip_network('::1/128'), database='postgres', user=username, auth_method=method) # Put hba changes into effect self.cluster.reload() create_script = '\n'.join(create_script) self.loop.run_until_complete(self.con.execute(create_script)) def tearDown(self): # Reset cluster's pg_hba.conf since we've meddled with it self.cluster.trust_local_connections() drop_script = [] for username, method, _ in self.USERS: if method == 'scram-sha-256' and self.server_version.major < 10: continue drop_script.append('DROP ROLE "{}";'.format(username)) drop_script = '\n'.join(drop_script) self.loop.run_until_complete(self.con.execute(drop_script)) super().tearDown() class TestAuthentication(BaseTestAuthentication): USERS = [ ('trust_user', 'trust', None), ('reject_user', 'reject', None), ('scram_sha_256_user', 'scram-sha-256', CORRECT_PASSWORD), ('md5_user', 'md5', CORRECT_PASSWORD), ('password_user', 'password', CORRECT_PASSWORD), ] async def _try_connect(self, **kwargs): # On Windows the server sometimes just closes # the connection sooner than we receive the # actual error. if _system == 'Windows': for tried in range(3): try: return await self.connect(**kwargs) except asyncpg.ConnectionDoesNotExistError: pass return await self.connect(**kwargs) async def test_auth_bad_user(self): with self.assertRaises( asyncpg.InvalidAuthorizationSpecificationError): await self._try_connect(user='__nonexistent__') async def test_auth_trust(self): conn = await self.connect(user='trust_user') await conn.close() async def test_auth_reject(self): with self.assertRaisesRegex( asyncpg.InvalidAuthorizationSpecificationError, 'pg_hba.conf rejects connection'): await self._try_connect(user='reject_user') async def test_auth_password_cleartext(self): conn = await self.connect( user='password_user', password=CORRECT_PASSWORD) await conn.close() with self.assertRaisesRegex( asyncpg.InvalidPasswordError, 'password authentication failed for user "password_user"'): await self._try_connect( user='password_user', password='wrongpassword') async def test_auth_password_cleartext_callable(self): def get_correctpassword(): return CORRECT_PASSWORD def get_wrongpassword(): return 'wrongpassword' conn = await self.connect( user='password_user', password=get_correctpassword) await conn.close() with self.assertRaisesRegex( asyncpg.InvalidPasswordError, 'password authentication failed for user "password_user"'): await self._try_connect( user='password_user', password=get_wrongpassword) async def test_auth_password_cleartext_callable_coroutine(self): async def get_correctpassword(): return CORRECT_PASSWORD async def get_wrongpassword(): return 'wrongpassword' conn = await self.connect( user='password_user', password=get_correctpassword) await conn.close() with self.assertRaisesRegex( asyncpg.InvalidPasswordError, 'password authentication failed for user "password_user"'): await self._try_connect( user='password_user', password=get_wrongpassword) async def test_auth_password_cleartext_callable_awaitable(self): async def get_correctpassword(): return CORRECT_PASSWORD async def get_wrongpassword(): return 'wrongpassword' conn = await self.connect( user='password_user', password=lambda: get_correctpassword()) await conn.close() with self.assertRaisesRegex( asyncpg.InvalidPasswordError, 'password authentication failed for user "password_user"'): await self._try_connect( user='password_user', password=lambda: get_wrongpassword()) async def test_auth_password_md5(self): conn = await self.connect( user='md5_user', password=CORRECT_PASSWORD) await conn.close() with self.assertRaisesRegex( asyncpg.InvalidPasswordError, 'password authentication failed for user "md5_user"'): await self._try_connect( user='md5_user', password='wrongpassword') async def test_auth_password_scram_sha_256(self): # scram is only supported in PostgreSQL 10 and above if self.server_version.major < 10: return conn = await self.connect( user='scram_sha_256_user', password=CORRECT_PASSWORD) await conn.close() with self.assertRaisesRegex( asyncpg.InvalidPasswordError, 'password authentication failed for user "scram_sha_256_user"' ): await self._try_connect( user='scram_sha_256_user', password='wrongpassword') # various SASL prep tests # first ensure that password are being hashed for SCRAM-SHA-256 await self.con.execute("SET password_encryption = 'scram-sha-256';") alter_password = "ALTER ROLE scram_sha_256_user PASSWORD E{!r};" passwords = [ 'nonascii\u1680space', # C.1.2 'common\u1806nothing', # B.1 'ab\ufb01c', # normalization 'ab\u007fc', # C.2.1 'ab\u206ac', # C.2.2, C.6 'ab\ue000c', # C.3, C.5 'ab\ufdd0c', # C.4 'ab\u2ff0c', # C.7 'ab\u2000c', # C.8 'ab\ue0001', # C.9 ] # ensure the passwords that go through SASLprep work for password in passwords: # update the password await self.con.execute(alter_password.format(password)) # test to see that passwords are properly SASL prepped conn = await self.connect( user='scram_sha_256_user', password=password) await conn.close() alter_password = \ f"ALTER ROLE scram_sha_256_user PASSWORD E{CORRECT_PASSWORD!r};" await self.con.execute(alter_password) await self.con.execute("SET password_encryption = 'md5';") @unittest.mock.patch('hashlib.md5', side_effect=ValueError("no md5")) async def test_auth_md5_unsupported(self, _): with self.assertRaisesRegex( exceptions.InternalClientError, ".*no md5.*", ): await self.connect(user='md5_user', password=CORRECT_PASSWORD) @unittest.skipIf( distro.id() == "alpine", "Alpine Linux ships PostgreSQL without GSS auth support", ) class TestGssAuthentication(BaseTestAuthentication): @classmethod def setUpClass(cls): try: from k5test.realm import K5Realm except ModuleNotFoundError: raise unittest.SkipTest('k5test not installed') cls.realm = K5Realm() cls.addClassCleanup(cls.realm.stop) # Setup environment before starting the cluster. patch = unittest.mock.patch.dict(os.environ, cls.realm.env) patch.start() cls.addClassCleanup(patch.stop) # Add credentials. cls.realm.addprinc('postgres/localhost') cls.realm.extract_keytab('postgres/localhost', cls.realm.keytab) cls.USERS = [ (cls.realm.user_princ, 'gss', None), (f'wrong-{cls.realm.user_princ}', 'gss', None), ] super().setUpClass() cls.cluster.override_connection_spec(host='localhost') @classmethod def get_server_settings(cls): settings = super().get_server_settings() settings['krb_server_keyfile'] = f'FILE:{cls.realm.keytab}' return settings @classmethod def setup_cluster(cls): cls.cluster = cls.new_cluster(pg_cluster.TempCluster) cls.start_cluster( cls.cluster, server_settings=cls.get_server_settings()) async def test_auth_gssapi_ok(self): conn = await self.connect(user=self.realm.user_princ) await conn.close() async def test_auth_gssapi_bad_srvname(self): # Service name mismatch. with self.assertRaisesRegex( exceptions.InternalClientError, 'Server .* not found' ): await self.connect(user=self.realm.user_princ, krbsrvname='wrong') async def test_auth_gssapi_bad_user(self): # Credentials mismatch. with self.assertRaisesRegex( exceptions.InvalidAuthorizationSpecificationError, 'GSSAPI authentication failed for user' ): await self.connect(user=f'wrong-{self.realm.user_princ}') @unittest.skipIf(_system != 'Windows', 'SSPI is only available on Windows') class TestSspiAuthentication(BaseTestAuthentication): @classmethod def setUpClass(cls): cls.username = f'{os.getlogin()}@{socket.gethostname()}' cls.USERS = [ (cls.username, 'sspi', None), (f'wrong-{cls.username}', 'sspi', None), ] super().setUpClass() async def test_auth_sspi(self): conn = await self.connect(user=self.username) await conn.close() # Credentials mismatch. with self.assertRaisesRegex( exceptions.InvalidAuthorizationSpecificationError, 'SSPI authentication failed for user' ): await self.connect(user=f'wrong-{self.username}') class TestConnectParams(tb.TestCase): TESTS = [ { 'name': 'all_env_default_ssl', 'env': { 'PGUSER': 'user', 'PGDATABASE': 'testdb', 'PGPASSWORD': 'passw', 'PGHOST': 'host', 'PGPORT': '123' }, 'result': ([('host', 123)], { 'user': 'user', 'password': 'passw', 'database': 'testdb', 'ssl': True, 'sslmode': SSLMode.prefer, 'target_session_attrs': 'any'}) }, { 'name': 'params_override_env', 'env': { 'PGUSER': 'user', 'PGDATABASE': 'testdb', 'PGPASSWORD': 'passw', 'PGHOST': 'host', 'PGPORT': '123' }, 'host': 'host2', 'port': '456', 'user': 'user2', 'password': 'passw2', 'database': 'db2', 'result': ([('host2', 456)], { 'user': 'user2', 'password': 'passw2', 'database': 'db2', 'target_session_attrs': 'any'}) }, { 'name': 'params_override_env_and_dsn', 'env': { 'PGUSER': 'user', 'PGDATABASE': 'testdb', 'PGPASSWORD': 'passw', 'PGHOST': 'host', 'PGPORT': '123', 'PGSSLMODE': 'allow' }, 'dsn': 'postgres://user3:123123@localhost/abcdef', 'host': 'host2', 'port': '456', 'user': 'user2', 'password': 'passw2', 'database': 'db2', 'ssl': False, 'result': ([('host2', 456)], { 'user': 'user2', 'password': 'passw2', 'database': 'db2', 'sslmode': SSLMode.disable, 'ssl': False, 'target_session_attrs': 'any'}) }, { 'name': 'dsn_overrides_env_partially', 'env': { 'PGUSER': 'user', 'PGDATABASE': 'testdb', 'PGPASSWORD': 'passw', 'PGHOST': 'host', 'PGPORT': '123', 'PGSSLMODE': 'allow' }, 'dsn': 'postgres://user3:123123@localhost:5555/abcdef', 'result': ([('localhost', 5555)], { 'user': 'user3', 'password': '123123', 'database': 'abcdef', 'ssl': True, 'sslmode': SSLMode.allow, 'target_session_attrs': 'any'}) }, { 'name': 'params_override_env_and_dsn_ssl_prefer', 'env': { 'PGUSER': 'user', 'PGDATABASE': 'testdb', 'PGPASSWORD': 'passw', 'PGHOST': 'host', 'PGPORT': '123', 'PGSSLMODE': 'prefer' }, 'dsn': 'postgres://user3:123123@localhost/abcdef', 'host': 'host2', 'port': '456', 'user': 'user2', 'password': 'passw2', 'database': 'db2', 'ssl': False, 'result': ([('host2', 456)], { 'user': 'user2', 'password': 'passw2', 'database': 'db2', 'sslmode': SSLMode.disable, 'ssl': False, 'target_session_attrs': 'any'}) }, { 'name': 'params_ssl_negotiation_dsn', 'env': { 'PGSSLNEGOTIATION': 'postgres' }, 'dsn': 'postgres://u:p@localhost/d?sslnegotiation=direct', 'result': ([('localhost', 5432)], { 'user': 'u', 'password': 'p', 'database': 'd', 'ssl_negotiation': 'direct', 'target_session_attrs': 'any', }) }, { 'name': 'params_ssl_negotiation_env', 'env': { 'PGSSLNEGOTIATION': 'direct' }, 'dsn': 'postgres://u:p@localhost/d', 'result': ([('localhost', 5432)], { 'user': 'u', 'password': 'p', 'database': 'd', 'ssl_negotiation': 'direct', 'target_session_attrs': 'any', }) }, { 'name': 'params_ssl_negotiation_params', 'env': { 'PGSSLNEGOTIATION': 'direct' }, 'dsn': 'postgres://u:p@localhost/d', 'direct_tls': False, 'result': ([('localhost', 5432)], { 'user': 'u', 'password': 'p', 'database': 'd', 'ssl_negotiation': 'postgres', 'target_session_attrs': 'any', }) }, { 'name': 'dsn_overrides_env_partially_ssl_prefer', 'env': { 'PGUSER': 'user', 'PGDATABASE': 'testdb', 'PGPASSWORD': 'passw', 'PGHOST': 'host', 'PGPORT': '123', 'PGSSLMODE': 'prefer' }, 'dsn': 'postgres://user3:123123@localhost:5555/abcdef', 'result': ([('localhost', 5555)], { 'user': 'user3', 'password': '123123', 'database': 'abcdef', 'ssl': True, 'sslmode': SSLMode.prefer, 'target_session_attrs': 'any'}) }, { 'name': 'dsn_only', 'dsn': 'postgres://user3:123123@localhost:5555/abcdef', 'result': ([('localhost', 5555)], { 'user': 'user3', 'password': '123123', 'database': 'abcdef', 'target_session_attrs': 'any'}) }, { 'name': 'dsn_only_multi_host', 'dsn': 'postgresql://user@host1,host2/db', 'result': ([('host1', 5432), ('host2', 5432)], { 'database': 'db', 'user': 'user', 'target_session_attrs': 'any', }) }, { 'name': 'dsn_only_multi_host_and_port', 'dsn': 'postgresql://user@host1:1111,host2:2222/db', 'result': ([('host1', 1111), ('host2', 2222)], { 'database': 'db', 'user': 'user', 'target_session_attrs': 'any', }) }, { 'name': 'target_session_attrs', 'dsn': 'postgresql://user@host1:1111,host2:2222/db' '?target_session_attrs=read-only', 'result': ([('host1', 1111), ('host2', 2222)], { 'database': 'db', 'user': 'user', 'target_session_attrs': 'read-only', }) }, { 'name': 'target_session_attrs_2', 'dsn': 'postgresql://user@host1:1111,host2:2222/db' '?target_session_attrs=read-only', 'target_session_attrs': 'read-write', 'result': ([('host1', 1111), ('host2', 2222)], { 'database': 'db', 'user': 'user', 'target_session_attrs': 'read-write', }) }, { 'name': 'target_session_attrs_3', 'dsn': 'postgresql://user@host1:1111,host2:2222/db', 'env': { 'PGTARGETSESSIONATTRS': 'read-only', }, 'result': ([('host1', 1111), ('host2', 2222)], { 'database': 'db', 'user': 'user', 'target_session_attrs': 'read-only', }) }, { 'name': 'krbsrvname', 'dsn': 'postgresql://user@host/db?krbsrvname=srv_qs', 'env': { 'PGKRBSRVNAME': 'srv_env', }, 'result': ([('host', 5432)], { 'database': 'db', 'user': 'user', 'target_session_attrs': 'any', 'krbsrvname': 'srv_qs', }) }, { 'name': 'krbsrvname_2', 'dsn': 'postgresql://user@host/db?krbsrvname=srv_qs', 'krbsrvname': 'srv_kws', 'env': { 'PGKRBSRVNAME': 'srv_env', }, 'result': ([('host', 5432)], { 'database': 'db', 'user': 'user', 'target_session_attrs': 'any', 'krbsrvname': 'srv_kws', }) }, { 'name': 'krbsrvname_3', 'dsn': 'postgresql://user@host/db', 'env': { 'PGKRBSRVNAME': 'srv_env', }, 'result': ([('host', 5432)], { 'database': 'db', 'user': 'user', 'target_session_attrs': 'any', 'krbsrvname': 'srv_env', }) }, { 'name': 'gsslib', 'dsn': f'postgresql://user@host/db?gsslib={OTHER_GSSLIB}', 'env': { 'PGGSSLIB': 'ignored', }, 'result': ([('host', 5432)], { 'database': 'db', 'user': 'user', 'target_session_attrs': 'any', 'gsslib': OTHER_GSSLIB, }) }, { 'name': 'gsslib_2', 'dsn': 'postgresql://user@host/db?gsslib=ignored', 'gsslib': OTHER_GSSLIB, 'env': { 'PGGSSLIB': 'ignored', }, 'result': ([('host', 5432)], { 'database': 'db', 'user': 'user', 'target_session_attrs': 'any', 'gsslib': OTHER_GSSLIB, }) }, { 'name': 'gsslib_3', 'dsn': 'postgresql://user@host/db', 'env': { 'PGGSSLIB': OTHER_GSSLIB, }, 'result': ([('host', 5432)], { 'database': 'db', 'user': 'user', 'target_session_attrs': 'any', 'gsslib': OTHER_GSSLIB, }) }, { 'name': 'gsslib_4', 'dsn': 'postgresql://user@host/db', 'result': ([('host', 5432)], { 'database': 'db', 'user': 'user', 'target_session_attrs': 'any', 'gsslib': DEFAULT_GSSLIB, }) }, { 'name': 'gsslib_5', 'dsn': 'postgresql://user@host/db?gsslib=invalid', 'error': ( exceptions.ClientConfigurationError, "gsslib parameter must be either 'gssapi' or 'sspi'" ), }, { 'name': 'dsn_ipv6_multi_host', 'dsn': 'postgresql://user@[2001:db8::1234%25eth0],[::1]/db', 'result': ([('2001:db8::1234%eth0', 5432), ('::1', 5432)], { 'database': 'db', 'user': 'user', 'target_session_attrs': 'any', }) }, { 'name': 'dsn_ipv6_multi_host_port', 'dsn': 'postgresql://user@[2001:db8::1234]:1111,[::1]:2222/db', 'result': ([('2001:db8::1234', 1111), ('::1', 2222)], { 'database': 'db', 'user': 'user', 'target_session_attrs': 'any', }) }, { 'name': 'dsn_ipv6_multi_host_query_part', 'dsn': 'postgresql:///db?user=user&host=[2001:db8::1234],[::1]', 'result': ([('2001:db8::1234', 5432), ('::1', 5432)], { 'database': 'db', 'user': 'user', 'target_session_attrs': 'any', }) }, { 'name': 'dsn_combines_env_multi_host', 'env': { 'PGHOST': 'host1:1111,host2:2222', 'PGUSER': 'foo', }, 'dsn': 'postgresql:///db', 'result': ([('host1', 1111), ('host2', 2222)], { 'database': 'db', 'user': 'foo', 'target_session_attrs': 'any', }) }, { 'name': 'dsn_multi_host_combines_env', 'env': { 'PGUSER': 'foo', }, 'dsn': 'postgresql:///db?host=host1:1111,host2:2222', 'result': ([('host1', 1111), ('host2', 2222)], { 'database': 'db', 'user': 'foo', 'target_session_attrs': 'any', }) }, { 'name': 'params_multi_host_dsn_env_mix', 'env': { 'PGUSER': 'foo', }, 'dsn': 'postgresql:///db', 'host': ['host1', 'host2'], 'result': ([('host1', 5432), ('host2', 5432)], { 'database': 'db', 'user': 'foo', 'target_session_attrs': 'any', }) }, { 'name': 'params_multi_host_dsn_env_mix_tuple', 'env': { 'PGUSER': 'foo', }, 'dsn': 'postgresql:///db', 'host': ('host1', 'host2'), 'result': ([('host1', 5432), ('host2', 5432)], { 'database': 'db', 'user': 'foo', 'target_session_attrs': 'any', }) }, { 'name': 'params_combine_dsn_settings_override_and_ssl', 'dsn': 'postgresql://user3:123123@localhost:5555/' 'abcdef?param=sss¶m=123&host=testhost&user=testuser' '&port=2222&database=testdb&sslmode=require', 'host': '127.0.0.1', 'port': '888', 'user': 'me', 'password': 'ask', 'database': 'db', 'result': ([('127.0.0.1', 888)], { 'server_settings': {'param': '123'}, 'user': 'me', 'password': 'ask', 'database': 'db', 'ssl': True, 'sslmode': SSLMode.require, 'target_session_attrs': 'any'}) }, { 'name': 'params_settings_and_ssl_override_dsn', 'dsn': 'postgresql://user3:123123@localhost:5555/' 'abcdef?param=sss¶m=123&host=testhost&user=testuser' '&port=2222&database=testdb&sslmode=disable', 'host': '127.0.0.1', 'port': '888', 'user': 'me', 'password': 'ask', 'database': 'db', 'server_settings': {'aa': 'bb'}, 'ssl': True, 'result': ([('127.0.0.1', 888)], { 'server_settings': {'aa': 'bb', 'param': '123'}, 'user': 'me', 'password': 'ask', 'database': 'db', 'sslmode': SSLMode.verify_full, 'ssl': True, 'target_session_attrs': 'any'}) }, { 'name': 'dsn_only_unix', 'dsn': 'postgresql:///dbname?host=/unix_sock/test&user=spam', 'result': ([os.path.join('/unix_sock/test', '.s.PGSQL.5432')], { 'user': 'spam', 'database': 'dbname', 'target_session_attrs': 'any'}) }, { 'name': 'dsn_only_quoted', 'dsn': 'postgresql://us%40r:p%40ss@h%40st1,h%40st2:543%33/d%62', 'result': ( [('h@st1', 5432), ('h@st2', 5433)], { 'user': 'us@r', 'password': 'p@ss', 'database': 'db', 'target_session_attrs': 'any', } ) }, { 'name': 'dsn_only_unquoted_host', 'dsn': 'postgresql://user:p@ss@host/db', 'result': ( [('ss@host', 5432)], { 'user': 'user', 'password': 'p', 'database': 'db', 'target_session_attrs': 'any', } ) }, { 'name': 'dsn_only_quoted_params', 'dsn': 'postgresql:///d%62?user=us%40r&host=h%40st&port=543%33', 'result': ( [('h@st', 5433)], { 'user': 'us@r', 'database': 'db', 'target_session_attrs': 'any', } ) }, { 'name': 'dsn_only_illegal_protocol', 'dsn': 'pq:///dbname?host=/unix_sock/test&user=spam', 'error': (ValueError, 'invalid DSN') }, { 'name': 'dsn_params_ports_mismatch_dsn_multi_hosts', 'dsn': 'postgresql://host1,host2,host3/db', 'port': [111, 222], 'error': ( exceptions.InterfaceError, 'could not match 2 port numbers to 3 hosts' ) }, { 'name': 'dsn_only_quoted_unix_host_port_in_params', 'dsn': 'postgres://user@?port=56226&host=%2Ftmp', 'result': ( [os.path.join('/tmp', '.s.PGSQL.56226')], { 'user': 'user', 'database': 'user', 'sslmode': SSLMode.disable, 'ssl': None, 'target_session_attrs': 'any', } ) }, { 'name': 'dsn_only_cloudsql', 'dsn': 'postgres:///db?host=/cloudsql/' 'project:region:instance-name&user=spam', 'result': ( [os.path.join( '/cloudsql/project:region:instance-name', '.s.PGSQL.5432' )], { 'user': 'spam', 'database': 'db', 'target_session_attrs': 'any', } ) }, { 'name': 'dsn_only_cloudsql_unix_and_tcp', 'dsn': 'postgres:///db?host=127.0.0.1:5432,/cloudsql/' 'project:region:instance-name,localhost:5433&user=spam', 'result': ( [ ('127.0.0.1', 5432), os.path.join( '/cloudsql/project:region:instance-name', '.s.PGSQL.5432' ), ('localhost', 5433) ], { 'user': 'spam', 'database': 'db', 'ssl': True, 'sslmode': SSLMode.prefer, 'target_session_attrs': 'any', } ) }, ] @contextlib.contextmanager def environ(self, **kwargs): old_vals = {} for key in kwargs: if key in os.environ: old_vals[key] = os.environ[key] for key, val in kwargs.items(): if val is None: if key in os.environ: del os.environ[key] else: os.environ[key] = val try: yield finally: for key in kwargs: if key in os.environ: del os.environ[key] for key, val in old_vals.items(): os.environ[key] = val def run_testcase(self, testcase): env = testcase.get('env', {}) test_env = {'PGHOST': None, 'PGPORT': None, 'PGUSER': None, 'PGPASSWORD': None, 'PGDATABASE': None, 'PGSSLMODE': None} test_env.update(env) dsn = testcase.get('dsn') user = testcase.get('user') port = testcase.get('port') host = testcase.get('host') password = testcase.get('password') passfile = testcase.get('passfile') database = testcase.get('database') sslmode = testcase.get('ssl') direct_tls = testcase.get('direct_tls') server_settings = testcase.get('server_settings') target_session_attrs = testcase.get('target_session_attrs') krbsrvname = testcase.get('krbsrvname') gsslib = testcase.get('gsslib') expected = testcase.get('result') expected_error = testcase.get('error') if expected is None and expected_error is None: raise RuntimeError( 'invalid test case: either "result" or "error" key ' 'has to be specified') if expected is not None and expected_error is not None: raise RuntimeError( 'invalid test case: either "result" or "error" key ' 'has to be specified, got both') with contextlib.ExitStack() as es: es.enter_context(self.subTest(dsn=dsn, env=env)) es.enter_context(self.environ(**test_env)) if expected_error: es.enter_context(self.assertRaisesRegex(*expected_error)) addrs, params = connect_utils._parse_connect_dsn_and_args( dsn=dsn, host=host, port=port, user=user, password=password, passfile=passfile, database=database, ssl=sslmode, direct_tls=direct_tls, server_settings=server_settings, target_session_attrs=target_session_attrs, krbsrvname=krbsrvname, gsslib=gsslib) params = { k: v for k, v in params._asdict().items() if v is not None or (expected is not None and k in expected[1]) } if isinstance(params.get('ssl'), ssl.SSLContext): params['ssl'] = True result = (addrs, params) if expected is not None: if 'ssl' not in expected[1]: # Avoid the hassle of specifying the default SSL mode # unless explicitly tested for. params.pop('ssl', None) params.pop('sslmode', None) if 'direct_tls' not in expected[1]: # Avoid the hassle of specifying direct_tls # unless explicitly tested for params.pop('direct_tls', False) if 'ssl_negotiation' not in expected[1]: # Avoid the hassle of specifying sslnegotiation # unless explicitly tested for params.pop('ssl_negotiation', False) if 'gsslib' not in expected[1]: # Avoid the hassle of specifying gsslib # unless explicitly tested for params.pop('gsslib', None) self.assertEqual(expected, result, 'Testcase: {}'.format(testcase)) def test_test_connect_params_environ(self): self.assertNotIn('AAAAAAAAAA123', os.environ) self.assertNotIn('AAAAAAAAAA456', os.environ) self.assertNotIn('AAAAAAAAAA789', os.environ) try: os.environ['AAAAAAAAAA456'] = '123' os.environ['AAAAAAAAAA789'] = '123' with self.environ(AAAAAAAAAA123='1', AAAAAAAAAA456='2', AAAAAAAAAA789=None): self.assertEqual(os.environ['AAAAAAAAAA123'], '1') self.assertEqual(os.environ['AAAAAAAAAA456'], '2') self.assertNotIn('AAAAAAAAAA789', os.environ) self.assertNotIn('AAAAAAAAAA123', os.environ) self.assertEqual(os.environ['AAAAAAAAAA456'], '123') self.assertEqual(os.environ['AAAAAAAAAA789'], '123') finally: for key in {'AAAAAAAAAA123', 'AAAAAAAAAA456', 'AAAAAAAAAA789'}: if key in os.environ: del os.environ[key] def test_test_connect_params_run_testcase(self): with self.environ(PGPORT='777'): self.run_testcase({ 'env': { 'PGUSER': '__test__' }, 'host': 'abc', 'result': ( [('abc', 5432)], {'user': '__test__', 'database': '__test__', 'target_session_attrs': 'any'} ) }) def test_connect_params(self): for testcase in self.TESTS: self.run_testcase(testcase) def test_connect_pgpass_regular(self): passfile = tempfile.NamedTemporaryFile('w+t', delete=False) passfile.write(textwrap.dedent(R''' abc:*:*:user:password from pgpass for user@abc localhost:*:*:*:password from pgpass for localhost cde:5433:*:*:password from pgpass for cde:5433 *:*:*:testuser:password from pgpass for testuser *:*:testdb:*:password from pgpass for testdb # comment *:*:test\:db:test\\:password from pgpass with escapes ''')) passfile.close() os.chmod(passfile.name, stat.S_IWUSR | stat.S_IRUSR) try: # passfile path in env self.run_testcase({ 'env': { 'PGPASSFILE': passfile.name }, 'host': 'abc', 'user': 'user', 'database': 'db', 'result': ( [('abc', 5432)], { 'password': 'password from pgpass for user@abc', 'user': 'user', 'database': 'db', 'target_session_attrs': 'any', } ) }) # passfile path as explicit arg self.run_testcase({ 'host': 'abc', 'user': 'user', 'database': 'db', 'passfile': passfile.name, 'result': ( [('abc', 5432)], { 'password': 'password from pgpass for user@abc', 'user': 'user', 'database': 'db', 'target_session_attrs': 'any', } ) }) # passfile path in dsn self.run_testcase({ 'dsn': 'postgres://user@abc/db?passfile={}'.format( passfile.name), 'result': ( [('abc', 5432)], { 'password': 'password from pgpass for user@abc', 'user': 'user', 'database': 'db', 'target_session_attrs': 'any', } ) }) self.run_testcase({ 'host': 'localhost', 'user': 'user', 'database': 'db', 'passfile': passfile.name, 'result': ( [('localhost', 5432)], { 'password': 'password from pgpass for localhost', 'user': 'user', 'database': 'db', 'target_session_attrs': 'any', } ) }) if _system != 'Windows': # unix socket gets normalized as localhost self.run_testcase({ 'host': '/tmp', 'user': 'user', 'database': 'db', 'passfile': passfile.name, 'result': ( ['/tmp/.s.PGSQL.5432'], { 'password': 'password from pgpass for localhost', 'user': 'user', 'database': 'db', 'target_session_attrs': 'any', } ) }) # port matching (also tests that `:` can be part of password) self.run_testcase({ 'host': 'cde', 'port': 5433, 'user': 'user', 'database': 'db', 'passfile': passfile.name, 'result': ( [('cde', 5433)], { 'password': 'password from pgpass for cde:5433', 'user': 'user', 'database': 'db', 'target_session_attrs': 'any', } ) }) # user matching self.run_testcase({ 'host': 'def', 'user': 'testuser', 'database': 'db', 'passfile': passfile.name, 'result': ( [('def', 5432)], { 'password': 'password from pgpass for testuser', 'user': 'testuser', 'database': 'db', 'target_session_attrs': 'any', } ) }) # database matching self.run_testcase({ 'host': 'efg', 'user': 'user', 'database': 'testdb', 'passfile': passfile.name, 'result': ( [('efg', 5432)], { 'password': 'password from pgpass for testdb', 'user': 'user', 'database': 'testdb', 'target_session_attrs': 'any', } ) }) # test escaping self.run_testcase({ 'host': 'fgh', 'user': R'test\\', 'database': R'test\:db', 'passfile': passfile.name, 'result': ( [('fgh', 5432)], { 'password': 'password from pgpass with escapes', 'user': R'test\\', 'database': R'test\:db', 'target_session_attrs': 'any', } ) }) finally: os.unlink(passfile.name) @unittest.skipIf(_system == 'Windows', 'no mode checking on Windows') def test_connect_pgpass_badness_mode(self): # Verify that .pgpass permissions are checked with tempfile.NamedTemporaryFile('w+t') as passfile: os.chmod(passfile.name, stat.S_IWUSR | stat.S_IRUSR | stat.S_IWGRP | stat.S_IRGRP) with self.assertWarnsRegex( UserWarning, 'password file .* has group or world access'): self.run_testcase({ 'host': 'abc', 'user': 'user', 'database': 'db', 'passfile': passfile.name, 'result': ( [('abc', 5432)], { 'user': 'user', 'database': 'db', 'target_session_attrs': 'any', } ) }) def test_connect_pgpass_badness_non_file(self): # Verify warnings when .pgpass is not a file with tempfile.TemporaryDirectory() as passfile: with self.assertWarnsRegex( UserWarning, 'password file .* is not a plain file'): self.run_testcase({ 'host': 'abc', 'user': 'user', 'database': 'db', 'passfile': passfile, 'result': ( [('abc', 5432)], { 'user': 'user', 'database': 'db', 'target_session_attrs': 'any', } ) }) def test_connect_pgpass_nonexistent(self): # nonexistent passfile is OK self.run_testcase({ 'host': 'abc', 'user': 'user', 'database': 'db', 'passfile': 'totally nonexistent', 'result': ( [('abc', 5432)], { 'user': 'user', 'database': 'db', 'target_session_attrs': 'any', } ) }) @unittest.skipIf(_system == 'Windows', 'no mode checking on Windows') def test_connect_pgpass_inaccessible_file(self): with tempfile.NamedTemporaryFile('w+t') as passfile: os.chmod(passfile.name, stat.S_IWUSR) # nonexistent passfile is OK self.run_testcase({ 'host': 'abc', 'user': 'user', 'database': 'db', 'passfile': passfile.name, 'result': ( [('abc', 5432)], { 'user': 'user', 'database': 'db', 'target_session_attrs': 'any', } ) }) @unittest.skipIf(_system == 'Windows', 'no mode checking on Windows') def test_connect_pgpass_inaccessible_directory(self): with tempfile.TemporaryDirectory() as passdir: with tempfile.NamedTemporaryFile('w+t', dir=passdir) as passfile: os.chmod(passdir, stat.S_IWUSR) try: # nonexistent passfile is OK self.run_testcase({ 'host': 'abc', 'user': 'user', 'database': 'db', 'passfile': passfile.name, 'result': ( [('abc', 5432)], { 'user': 'user', 'database': 'db', 'target_session_attrs': 'any', } ) }) finally: os.chmod(passdir, stat.S_IRWXU) async def test_connect_args_validation(self): for val in {-1, 'a', True, False, 0}: with self.assertRaisesRegex(ValueError, 'greater than 0'): await asyncpg.connect(command_timeout=val) for arg in {'max_cacheable_statement_size', 'max_cached_statement_lifetime', 'statement_cache_size'}: for val in {None, -1, True, False}: with self.assertRaisesRegex(ValueError, 'greater or equal'): await asyncpg.connect(**{arg: val}) class TestConnection(tb.ConnectedTestCase): async def test_connection_isinstance(self): self.assertTrue(isinstance(self.con, pg_connection.Connection)) self.assertTrue(isinstance(self.con, object)) self.assertFalse(isinstance(self.con, list)) async def test_connection_use_after_close(self): def check(): return self.assertRaisesRegex(asyncpg.InterfaceError, 'connection is closed') await self.con.close() with check(): await self.con.add_listener('aaa', lambda: None) with check(): self.con.transaction() with check(): await self.con.executemany('SELECT 1', []) with check(): await self.con.set_type_codec('aaa', encoder=None, decoder=None) with check(): await self.con.set_builtin_type_codec('aaa', codec_name='aaa') for meth in ('execute', 'fetch', 'fetchval', 'fetchrow', 'prepare', 'cursor'): with check(): await getattr(self.con, meth)('SELECT 1') with check(): await self.con.reset() @unittest.skipIf(os.environ.get('PGHOST'), 'unmanaged cluster') async def test_connection_ssl_to_no_ssl_server(self): ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) ssl_context.load_verify_locations(SSL_CA_CERT_FILE) with self.assertRaisesRegex(ConnectionError, 'rejected SSL'): await self.connect( host='localhost', user='ssl_user', ssl=ssl_context) @unittest.skipIf(os.environ.get('PGHOST'), 'unmanaged cluster') async def test_connection_sslmode_no_ssl_server(self): async def verify_works(sslmode): con = None try: con = await self.connect( dsn='postgresql://foo/?sslmode=' + sslmode, user='postgres', database='postgres', host='localhost') self.assertEqual(await con.fetchval('SELECT 42'), 42) self.assertFalse(con._protocol.is_ssl) finally: if con: await con.close() async def verify_fails(sslmode): con = None try: with self.assertRaises(ConnectionError): con = await self.connect( dsn='postgresql://foo/?sslmode=' + sslmode, user='postgres', database='postgres', host='localhost') await con.fetchval('SELECT 42') finally: if con: await con.close() await verify_works('disable') await verify_works('allow') await verify_works('prefer') await verify_fails('require') with mock_dot_postgresql(): await verify_fails('require') await verify_fails('verify-ca') await verify_fails('verify-full') async def test_connection_implicit_host(self): conn_spec = self.get_connection_spec() con = await asyncpg.connect( port=conn_spec.get('port'), database=conn_spec.get('database'), user=conn_spec.get('user')) await con.close() @unittest.skipIf(os.environ.get('PGHOST'), 'unmanaged cluster') async def test_connection_no_home_dir(self): with mock_no_home_dir(): con = await self.connect( dsn='postgresql://foo/', user='postgres', database='postgres', host='localhost') await con.fetchval('SELECT 42') await con.close() with mock_dev_null_home_dir(): con = await self.connect( dsn='postgresql://foo/', user='postgres', database='postgres', host='localhost') await con.fetchval('SELECT 42') await con.close() with self.assertRaisesRegex( exceptions.ClientConfigurationError, r'root certificate file "~/\.postgresql/root\.crt" does not exist' ): with mock_no_home_dir(): await self.connect( host='localhost', user='ssl_user', ssl='verify-full') with self.assertRaisesRegex( exceptions.ClientConfigurationError, r'root certificate file ".*" does not exist' ): with mock_dev_null_home_dir(): await self.connect( host='localhost', user='ssl_user', ssl='verify-full') class BaseTestSSLConnection(tb.ConnectedTestCase): @classmethod def get_server_settings(cls): conf = super().get_server_settings() conf.update({ 'ssl': 'on', 'ssl_cert_file': SSL_CERT_FILE, 'ssl_key_file': SSL_KEY_FILE, 'ssl_ca_file': CLIENT_CA_CERT_FILE, }) if cls.cluster.get_pg_version() >= (12, 0): conf['ssl_min_protocol_version'] = 'TLSv1.2' conf['ssl_max_protocol_version'] = 'TLSv1.2' return conf @classmethod def setup_cluster(cls): cls.cluster = cls.new_cluster(pg_cluster.TempCluster) cls.start_cluster( cls.cluster, server_settings=cls.get_server_settings()) def setUp(self): super().setUp() self.cluster.reset_hba() create_script = [] create_script.append('CREATE ROLE ssl_user WITH LOGIN;') create_script.append('GRANT ALL ON SCHEMA public TO ssl_user;') self._add_hba_entry() # Put hba changes into effect self.cluster.reload() create_script = '\n'.join(create_script) self.loop.run_until_complete(self.con.execute(create_script)) def tearDown(self): # Reset cluster's pg_hba.conf since we've meddled with it self.cluster.trust_local_connections() drop_script = [] drop_script.append('REVOKE ALL ON SCHEMA public FROM ssl_user;') drop_script.append('DROP ROLE ssl_user;') drop_script = '\n'.join(drop_script) self.loop.run_until_complete(self.con.execute(drop_script)) super().tearDown() def _add_hba_entry(self): raise NotImplementedError() @unittest.skipIf(os.environ.get('PGHOST'), 'unmanaged cluster') class TestSSLConnection(BaseTestSSLConnection): def _add_hba_entry(self): self.cluster.add_hba_entry( type='hostssl', address=ipaddress.ip_network('127.0.0.0/24'), database='postgres', user='ssl_user', auth_method='trust') self.cluster.add_hba_entry( type='hostssl', address=ipaddress.ip_network('::1/128'), database='postgres', user='ssl_user', auth_method='trust') async def test_ssl_connection_custom_context(self): ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) ssl_context.load_verify_locations(SSL_CA_CERT_FILE) con = await self.connect( host='localhost', user='ssl_user', ssl=ssl_context) try: self.assertEqual(await con.fetchval('SELECT 42'), 42) with self.assertRaises(asyncio.TimeoutError): await con.execute('SELECT pg_sleep(5)', timeout=0.5) self.assertEqual(await con.fetchval('SELECT 43'), 43) finally: await con.close() async def test_ssl_connection_sslmode(self): async def verify_works(sslmode, *, host='localhost'): con = None try: con = await self.connect( dsn='postgresql://foo/postgres?sslmode=' + sslmode, host=host, user='ssl_user') self.assertEqual(await con.fetchval('SELECT 42'), 42) self.assertTrue(con._protocol.is_ssl) finally: if con: await con.close() async def verify_fails(sslmode, *, host='localhost', exn_type): # XXX: uvloop artifact old_handler = self.loop.get_exception_handler() con = None try: self.loop.set_exception_handler(lambda *args: None) with self.assertRaises(exn_type): con = await self.connect( dsn='postgresql://foo/?sslmode=' + sslmode, host=host, user='ssl_user') await con.fetchval('SELECT 42') finally: if con: await con.close() self.loop.set_exception_handler(old_handler) invalid_auth_err = asyncpg.InvalidAuthorizationSpecificationError await verify_fails('disable', exn_type=invalid_auth_err) await verify_works('allow') await verify_works('prefer') await verify_works('require') await verify_fails('verify-ca', exn_type=ValueError) await verify_fails('verify-full', exn_type=ValueError) with mock_dot_postgresql(): await verify_works('require') await verify_works('verify-ca') await verify_works('verify-ca', host='127.0.0.1') await verify_works('verify-full') await verify_fails('verify-full', host='127.0.0.1', exn_type=ssl.CertificateError) with mock_dot_postgresql(crl=True): await verify_fails('disable', exn_type=invalid_auth_err) await verify_works('allow') await verify_works('prefer') await verify_fails('require', exn_type=ssl.SSLError) await verify_fails('verify-ca', exn_type=ssl.SSLError) await verify_fails('verify-ca', host='127.0.0.1', exn_type=ssl.SSLError) await verify_fails('verify-full', exn_type=ssl.SSLError) async def test_ssl_connection_default_context(self): # XXX: uvloop artifact old_handler = self.loop.get_exception_handler() try: self.loop.set_exception_handler(lambda *args: None) with self.assertRaisesRegex(ssl.SSLError, 'verify failed'): await self.connect( host='localhost', user='ssl_user', ssl=True) finally: self.loop.set_exception_handler(old_handler) async def test_ssl_connection_pool(self): ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) ssl_context.load_verify_locations(SSL_CA_CERT_FILE) pool = await self.create_pool( host='localhost', user='ssl_user', database='postgres', min_size=5, max_size=10, ssl=ssl_context) async def worker(): async with pool.acquire() as con: self.assertEqual(await con.fetchval('SELECT 42'), 42) with self.assertRaises(asyncio.TimeoutError): await con.execute('SELECT pg_sleep(5)', timeout=0.5) self.assertEqual(await con.fetchval('SELECT 43'), 43) tasks = [worker() for _ in range(100)] await asyncio.gather(*tasks) await pool.close() async def test_executemany_uvloop_ssl_issue_700(self): ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) ssl_context.load_verify_locations(SSL_CA_CERT_FILE) con = await self.connect( host='localhost', user='ssl_user', ssl=ssl_context) try: await con.execute('CREATE TABLE test_many (v int)') await con.executemany( 'INSERT INTO test_many VALUES ($1)', [(x + 1,) for x in range(100)] ) self.assertEqual( await con.fetchval('SELECT sum(v) FROM test_many'), 5050 ) finally: try: await con.execute('DROP TABLE IF EXISTS test_many') finally: await con.close() async def test_tls_version(self): if self.cluster.get_pg_version() < (12, 0): self.skipTest("PostgreSQL < 12 cannot set ssl protocol version") # XXX: uvloop artifact old_handler = self.loop.get_exception_handler() with warnings.catch_warnings(): warnings.filterwarnings( "ignore", message="ssl.TLSVersion.TLSv1_1 is deprecated", category=DeprecationWarning ) try: self.loop.set_exception_handler(lambda *args: None) with self.assertRaisesRegex( ssl.SSLError, '(protocol version)|(handshake failure)', ): await self.connect( dsn='postgresql://ssl_user@localhost/postgres' '?sslmode=require&ssl_min_protocol_version=TLSv1.3' ) with self.assertRaises((ssl.SSLError, ConnectionResetError)): await self.connect( dsn='postgresql://ssl_user@localhost/postgres' '?sslmode=require' '&ssl_min_protocol_version=TLSv1.1' '&ssl_max_protocol_version=TLSv1.1' ) if not ssl.OPENSSL_VERSION.startswith('LibreSSL'): with self.assertRaisesRegex(ssl.SSLError, 'no protocols'): await self.connect( dsn='postgresql://ssl_user@localhost/postgres' '?sslmode=require' '&ssl_min_protocol_version=TLSv1.2' '&ssl_max_protocol_version=TLSv1.1' ) con = await self.connect( dsn='postgresql://ssl_user@localhost/postgres' '?sslmode=require' '&ssl_min_protocol_version=TLSv1.2' '&ssl_max_protocol_version=TLSv1.2' ) try: self.assertEqual(await con.fetchval('SELECT 42'), 42) finally: await con.close() finally: self.loop.set_exception_handler(old_handler) @unittest.skipIf(os.environ.get('PGHOST'), 'unmanaged cluster') class TestClientSSLConnection(BaseTestSSLConnection): def _add_hba_entry(self): self.cluster.add_hba_entry( type='hostssl', address=ipaddress.ip_network('127.0.0.0/24'), database='postgres', user='ssl_user', auth_method='cert') self.cluster.add_hba_entry( type='hostssl', address=ipaddress.ip_network('::1/128'), database='postgres', user='ssl_user', auth_method='cert') async def test_ssl_connection_client_auth_fails_with_wrong_setup(self): ssl_context = ssl.create_default_context( ssl.Purpose.SERVER_AUTH, cafile=SSL_CA_CERT_FILE, ) with self.assertRaisesRegex( exceptions.InvalidAuthorizationSpecificationError, "requires a valid client certificate", ): await self.connect( host='localhost', user='ssl_user', ssl=ssl_context, ) async def _test_works(self, **conn_args): con = await self.connect(**conn_args) try: self.assertEqual(await con.fetchval('SELECT 42'), 42) finally: await con.close() async def test_ssl_connection_client_auth_custom_context(self): for key_file in (CLIENT_SSL_KEY_FILE, CLIENT_SSL_PROTECTED_KEY_FILE): ssl_context = ssl.create_default_context( ssl.Purpose.SERVER_AUTH, cafile=SSL_CA_CERT_FILE, ) ssl_context.load_cert_chain( CLIENT_SSL_CERT_FILE, keyfile=key_file, password='secRet', ) await self._test_works( host='localhost', user='ssl_user', ssl=ssl_context, ) async def test_ssl_connection_client_auth_dsn(self): params = { 'sslrootcert': SSL_CA_CERT_FILE, 'sslcert': CLIENT_SSL_CERT_FILE, 'sslkey': CLIENT_SSL_KEY_FILE, 'sslmode': 'verify-full', } params_str = urllib.parse.urlencode(params) dsn = 'postgres://ssl_user@localhost/postgres?' + params_str await self._test_works(dsn=dsn) params['sslkey'] = CLIENT_SSL_PROTECTED_KEY_FILE params['sslpassword'] = 'secRet' params_str = urllib.parse.urlencode(params) dsn = 'postgres://ssl_user@localhost/postgres?' + params_str await self._test_works(dsn=dsn) async def test_ssl_connection_client_auth_env(self): env = { 'PGSSLROOTCERT': SSL_CA_CERT_FILE, 'PGSSLCERT': CLIENT_SSL_CERT_FILE, 'PGSSLKEY': CLIENT_SSL_KEY_FILE, } dsn = 'postgres://ssl_user@localhost/postgres?sslmode=verify-full' with unittest.mock.patch.dict('os.environ', env): await self._test_works(dsn=dsn) env['PGSSLKEY'] = CLIENT_SSL_PROTECTED_KEY_FILE with unittest.mock.patch.dict('os.environ', env): await self._test_works(dsn=dsn + '&sslpassword=secRet') async def test_ssl_connection_client_auth_dot_postgresql(self): dsn = 'postgres://ssl_user@localhost/postgres?sslmode=verify-full' with mock_dot_postgresql(client=True): await self._test_works(dsn=dsn) with mock_dot_postgresql(client=True, protected=True): await self._test_works(dsn=dsn + '&sslpassword=secRet') @unittest.skipIf(os.environ.get('PGHOST'), 'unmanaged cluster') class TestNoSSLConnection(BaseTestSSLConnection): def _add_hba_entry(self): self.cluster.add_hba_entry( type='hostnossl', address=ipaddress.ip_network('127.0.0.0/24'), database='postgres', user='ssl_user', auth_method='trust') self.cluster.add_hba_entry( type='hostnossl', address=ipaddress.ip_network('::1/128'), database='postgres', user='ssl_user', auth_method='trust') async def test_nossl_connection_sslmode(self): async def verify_works(sslmode, *, host='localhost'): con = None try: con = await self.connect( dsn='postgresql://foo/postgres?sslmode=' + sslmode, host=host, user='ssl_user') self.assertEqual(await con.fetchval('SELECT 42'), 42) self.assertFalse(con._protocol.is_ssl) finally: if con: await con.close() async def verify_fails(sslmode, *, host='localhost'): # XXX: uvloop artifact old_handler = self.loop.get_exception_handler() con = None try: self.loop.set_exception_handler(lambda *args: None) with self.assertRaises( asyncpg.InvalidAuthorizationSpecificationError ): con = await self.connect( dsn='postgresql://foo/?sslmode=' + sslmode, host=host, user='ssl_user') await con.fetchval('SELECT 42') finally: if con: await con.close() self.loop.set_exception_handler(old_handler) await verify_works('disable') await verify_works('allow') await verify_works('prefer') await verify_fails('require') with mock_dot_postgresql(): await verify_fails('require') await verify_fails('verify-ca') await verify_fails('verify-full') async def test_nossl_connection_prefer_cancel(self): con = await self.connect( dsn='postgresql://foo/postgres?sslmode=prefer', host='localhost', user='ssl_user') try: self.assertFalse(con._protocol.is_ssl) with self.assertRaises(asyncio.TimeoutError): await con.execute('SELECT pg_sleep(5)', timeout=0.5) val = await con.fetchval('SELECT 123') self.assertEqual(val, 123) finally: await con.close() async def test_nossl_connection_pool(self): pool = await self.create_pool( host='localhost', user='ssl_user', database='postgres', min_size=5, max_size=10, ssl='prefer') async def worker(): async with pool.acquire() as con: self.assertFalse(con._protocol.is_ssl) self.assertEqual(await con.fetchval('SELECT 42'), 42) with self.assertRaises(asyncio.TimeoutError): await con.execute('SELECT pg_sleep(5)', timeout=0.5) self.assertEqual(await con.fetchval('SELECT 43'), 43) tasks = [worker() for _ in range(100)] await asyncio.gather(*tasks) await pool.close() class TestConnectionGC(tb.ClusterTestCase): async def _run_no_explicit_close_test(self): gc_was_enabled = gc.isenabled() gc.disable() try: con = await self.connect() await con.fetchval("select 123") proto = con._protocol conref = weakref.ref(con) del con self.assertIsNone(conref()) self.assertTrue(proto.is_closed()) # tick event loop; asyncio.selector_events._SelectorSocketTransport # needs a chance to close itself and remove its reference to proto await asyncio.sleep(0) protoref = weakref.ref(proto) del proto self.assertIsNone(protoref()) finally: if gc_was_enabled: gc.enable() async def test_no_explicit_close_no_debug(self): olddebug = self.loop.get_debug() self.loop.set_debug(False) try: with self.assertWarnsRegex( ResourceWarning, r'unclosed connection.*run in asyncio debug'): await self._run_no_explicit_close_test() finally: self.loop.set_debug(olddebug) async def test_no_explicit_close_with_debug(self): olddebug = self.loop.get_debug() self.loop.set_debug(True) try: with self.assertWarnsRegex(ResourceWarning, r'unclosed connection') as rw: await self._run_no_explicit_close_test() msg = " ".join(rw.warning.args) self.assertIn(' created at:\n', msg) self.assertIn('in test_no_explicit_close_with_debug', msg) finally: self.loop.set_debug(olddebug) class TestConnectionAttributes(tb.HotStandbyTestCase): async def _run_connection_test( self, connect, target_attribute, expected_port ): conn = await connect(target_session_attrs=target_attribute) self.assertTrue(_get_connected_host(conn).endswith(expected_port)) await conn.close() async def test_target_server_attribute_port(self): master_port = self.master_cluster.get_connection_spec()['port'] standby_port = self.standby_cluster.get_connection_spec()['port'] tests = [ (self.connect_primary, 'primary', master_port), (self.connect_standby, 'standby', standby_port), ] for connect, target_attr, expected_port in tests: await self._run_connection_test( connect, target_attr, expected_port ) if self.master_cluster.get_pg_version()[0] < 14: self.skipTest("PostgreSQL<14 does not support these features") tests = [ (self.connect_primary, 'read-write', master_port), (self.connect_standby, 'read-only', standby_port), ] for connect, target_attr, expected_port in tests: await self._run_connection_test( connect, target_attr, expected_port ) async def test_target_attribute_not_matched(self): tests = [ (self.connect_standby, 'primary'), (self.connect_primary, 'standby'), ] for connect, target_attr in tests: with self.assertRaises(exceptions.TargetServerAttributeNotMatched): await connect(target_session_attrs=target_attr) if self.master_cluster.get_pg_version()[0] < 14: self.skipTest("PostgreSQL<14 does not support these features") tests = [ (self.connect_standby, 'read-write'), (self.connect_primary, 'read-only'), ] for connect, target_attr in tests: with self.assertRaises(exceptions.TargetServerAttributeNotMatched): await connect(target_session_attrs=target_attr) async def test_prefer_standby_when_standby_is_up(self): con = await self.connect(target_session_attrs='prefer-standby') standby_port = self.standby_cluster.get_connection_spec()['port'] connected_host = _get_connected_host(con) self.assertTrue(connected_host.endswith(standby_port)) await con.close() async def test_prefer_standby_picks_master_when_standby_is_down(self): primary_spec = self.get_cluster_connection_spec(self.master_cluster) connection_spec = { 'host': [ primary_spec['host'], 'unlocalhost', ], 'port': [primary_spec['port'], 15345], 'database': primary_spec['database'], 'user': primary_spec['user'], 'target_session_attrs': 'prefer-standby' } con = await self.connect(**connection_spec) master_port = self.master_cluster.get_connection_spec()['port'] connected_host = _get_connected_host(con) self.assertTrue(connected_host.endswith(master_port)) await con.close() def _get_connected_host(con): peername = con._transport.get_extra_info('peername') if isinstance(peername, tuple): peername = "".join((str(s) for s in peername if s)) return peername ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/test_copy.py0000644000175100001770000005270614705014413016401 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncio import datetime import io import os import tempfile import unittest import asyncpg from asyncpg import _testbase as tb class TestCopyFrom(tb.ConnectedTestCase): async def test_copy_from_table_basics(self): await self.con.execute(''' CREATE TABLE copytab(a text, "b~" text, i int); INSERT INTO copytab (a, "b~", i) ( SELECT 'a' || i::text, 'b' || i::text, i FROM generate_series(1, 5) AS i ); INSERT INTO copytab (a, "b~", i) VALUES('*', NULL, NULL); ''') try: f = io.BytesIO() # Basic functionality. res = await self.con.copy_from_table('copytab', output=f) self.assertEqual(res, 'COPY 6') output = f.getvalue().decode().split('\n') self.assertEqual( output, [ 'a1\tb1\t1', 'a2\tb2\t2', 'a3\tb3\t3', 'a4\tb4\t4', 'a5\tb5\t5', '*\t\\N\t\\N', '' ] ) # Test parameters. await self.con.execute('SET search_path=none') f.seek(0) f.truncate() res = await self.con.copy_from_table( 'copytab', output=f, columns=('a', 'b~'), schema_name='public', format='csv', delimiter='|', null='n-u-l-l', header=True, quote='*', escape='!', force_quote=('a',)) output = f.getvalue().decode().split('\n') self.assertEqual( output, [ 'a|b~', '*a1*|b1', '*a2*|b2', '*a3*|b3', '*a4*|b4', '*a5*|b5', '*!**|n-u-l-l', '' ] ) await self.con.execute('SET search_path=public') finally: await self.con.execute('DROP TABLE public.copytab') async def test_copy_from_table_large_rows(self): await self.con.execute(''' CREATE TABLE copytab(a text, b text); INSERT INTO copytab (a, b) ( SELECT repeat('a' || i::text, 500000), repeat('b' || i::text, 500000) FROM generate_series(1, 5) AS i ); ''') try: f = io.BytesIO() # Basic functionality. res = await self.con.copy_from_table('copytab', output=f) self.assertEqual(res, 'COPY 5') output = f.getvalue().decode().split('\n') self.assertEqual( output, [ 'a1' * 500000 + '\t' + 'b1' * 500000, 'a2' * 500000 + '\t' + 'b2' * 500000, 'a3' * 500000 + '\t' + 'b3' * 500000, 'a4' * 500000 + '\t' + 'b4' * 500000, 'a5' * 500000 + '\t' + 'b5' * 500000, '' ] ) finally: await self.con.execute('DROP TABLE public.copytab') async def test_copy_from_query_basics(self): f = io.BytesIO() res = await self.con.copy_from_query(''' SELECT repeat('a' || i::text, 500000), repeat('b' || i::text, 500000) FROM generate_series(1, 5) AS i ''', output=f) self.assertEqual(res, 'COPY 5') output = f.getvalue().decode().split('\n') self.assertEqual( output, [ 'a1' * 500000 + '\t' + 'b1' * 500000, 'a2' * 500000 + '\t' + 'b2' * 500000, 'a3' * 500000 + '\t' + 'b3' * 500000, 'a4' * 500000 + '\t' + 'b4' * 500000, 'a5' * 500000 + '\t' + 'b5' * 500000, '' ] ) async def test_copy_from_query_with_args(self): f = io.BytesIO() res = await self.con.copy_from_query(''' SELECT i, i * 10, $2::text FROM generate_series(1, 5) AS i WHERE i = $1 ''', 3, None, output=f) self.assertEqual(res, 'COPY 1') output = f.getvalue().decode().split('\n') self.assertEqual( output, [ '3\t30\t\\N', '' ] ) async def test_copy_from_query_to_path(self): with tempfile.NamedTemporaryFile() as f: f.close() await self.con.copy_from_query(''' SELECT i, i * 10 FROM generate_series(1, 5) AS i WHERE i = $1 ''', 3, output=f.name) with open(f.name, 'rb') as fr: output = fr.read().decode().split('\n') self.assertEqual( output, [ '3\t30', '' ] ) async def test_copy_from_query_to_path_like(self): with tempfile.NamedTemporaryFile() as f: f.close() class Path: def __init__(self, path): self.path = path def __fspath__(self): return self.path await self.con.copy_from_query(''' SELECT i, i * 10 FROM generate_series(1, 5) AS i WHERE i = $1 ''', 3, output=Path(f.name)) with open(f.name, 'rb') as fr: output = fr.read().decode().split('\n') self.assertEqual( output, [ '3\t30', '' ] ) async def test_copy_from_query_to_bad_output(self): with self.assertRaisesRegex(TypeError, 'output is expected to be'): await self.con.copy_from_query(''' SELECT i, i * 10 FROM generate_series(1, 5) AS i WHERE i = $1 ''', 3, output=1) async def test_copy_from_query_to_sink(self): with tempfile.NamedTemporaryFile() as f: async def writer(data): # Sleeping here to simulate slow output sink to test # backpressure. await asyncio.sleep(0.05) f.write(data) await self.con.copy_from_query(''' SELECT repeat('a', 500) FROM generate_series(1, 5000) AS i ''', output=writer) f.seek(0) output = f.read().decode().split('\n') self.assertEqual( output, [ 'a' * 500 ] * 5000 + [''] ) self.assertEqual(await self.con.fetchval('SELECT 1'), 1) async def test_copy_from_query_cancellation_explicit(self): async def writer(data): # Sleeping here to simulate slow output sink to test # backpressure. await asyncio.sleep(0.5) coro = self.con.copy_from_query(''' SELECT repeat('a', 500) FROM generate_series(1, 5000) AS i ''', output=writer) task = self.loop.create_task(coro) await asyncio.sleep(0.7) task.cancel() with self.assertRaises(asyncio.CancelledError): await task self.assertEqual(await self.con.fetchval('SELECT 1'), 1) async def test_copy_from_query_cancellation_on_sink_error(self): async def writer(data): await asyncio.sleep(0.05) raise RuntimeError('failure') coro = self.con.copy_from_query(''' SELECT repeat('a', 500) FROM generate_series(1, 5000) AS i ''', output=writer) task = self.loop.create_task(coro) with self.assertRaises(RuntimeError): await task self.assertEqual(await self.con.fetchval('SELECT 1'), 1) async def test_copy_from_query_cancellation_while_waiting_for_data(self): async def writer(data): pass coro = self.con.copy_from_query(''' SELECT pg_sleep(60) FROM generate_series(1, 5000) AS i ''', output=writer) task = self.loop.create_task(coro) await asyncio.sleep(0.7) task.cancel() with self.assertRaises(asyncio.CancelledError): await task self.assertEqual(await self.con.fetchval('SELECT 1'), 1) async def test_copy_from_query_timeout_1(self): async def writer(data): await asyncio.sleep(0.05) coro = self.con.copy_from_query(''' SELECT repeat('a', 500) FROM generate_series(1, 5000) AS i ''', output=writer, timeout=0.10) task = self.loop.create_task(coro) with self.assertRaises(asyncio.TimeoutError): await task self.assertEqual(await self.con.fetchval('SELECT 1'), 1) async def test_copy_from_query_timeout_2(self): async def writer(data): try: await asyncio.sleep(10) except asyncio.TimeoutError: raise else: self.fail('TimeoutError not raised') coro = self.con.copy_from_query(''' SELECT repeat('a', 500) FROM generate_series(1, 5000) AS i ''', output=writer, timeout=0.10) task = self.loop.create_task(coro) with self.assertRaises(asyncio.TimeoutError): await task self.assertEqual(await self.con.fetchval('SELECT 1'), 1) class TestCopyTo(tb.ConnectedTestCase): async def test_copy_to_table_basics(self): await self.con.execute(''' CREATE TABLE copytab(a text, "b~" text, i int); ''') try: f = io.BytesIO() f.write( '\n'.join([ 'a1\tb1\t1', 'a2\tb2\t2', 'a3\tb3\t3', 'a4\tb4\t4', 'a5\tb5\t5', '*\t\\N\t\\N', '' ]).encode('utf-8') ) f.seek(0) res = await self.con.copy_to_table('copytab', source=f) self.assertEqual(res, 'COPY 6') output = await self.con.fetch(""" SELECT * FROM copytab ORDER BY a """) self.assertEqual( output, [ ('*', None, None), ('a1', 'b1', 1), ('a2', 'b2', 2), ('a3', 'b3', 3), ('a4', 'b4', 4), ('a5', 'b5', 5), ] ) # Test parameters. await self.con.execute('TRUNCATE copytab') await self.con.execute('SET search_path=none') f.seek(0) f.truncate() f.write( '\n'.join([ 'a|b~', '*a1*|b1', '*a2*|b2', '*a3*|b3', '*a4*|b4', '*a5*|b5', '*!**|*n-u-l-l*', 'n-u-l-l|bb', ]).encode('utf-8') ) f.seek(0) if self.con.get_server_version() < (9, 4): force_null = None forced_null_expected = 'n-u-l-l' else: force_null = ('b~',) forced_null_expected = None res = await self.con.copy_to_table( 'copytab', source=f, columns=('a', 'b~'), schema_name='public', format='csv', delimiter='|', null='n-u-l-l', header=True, quote='*', escape='!', force_not_null=('a',), force_null=force_null) self.assertEqual(res, 'COPY 7') await self.con.execute('SET search_path=public') output = await self.con.fetch(""" SELECT * FROM copytab ORDER BY a """) self.assertEqual( output, [ ('*', forced_null_expected, None), ('a1', 'b1', None), ('a2', 'b2', None), ('a3', 'b3', None), ('a4', 'b4', None), ('a5', 'b5', None), ('n-u-l-l', 'bb', None), ] ) finally: await self.con.execute('DROP TABLE public.copytab') async def test_copy_to_table_large_rows(self): await self.con.execute(''' CREATE TABLE copytab(a text, b text); ''') try: class _Source: def __init__(self): self.rowcount = 0 def __aiter__(self): return self async def __anext__(self): if self.rowcount >= 100: raise StopAsyncIteration else: self.rowcount += 1 return b'a1' * 500000 + b'\t' + b'b1' * 500000 + b'\n' res = await self.con.copy_to_table('copytab', source=_Source()) self.assertEqual(res, 'COPY 100') finally: await self.con.execute('DROP TABLE copytab') async def test_copy_to_table_from_bytes_like(self): await self.con.execute(''' CREATE TABLE copytab(a text, b text); ''') try: data = memoryview((b'a1' * 500 + b'\t' + b'b1' * 500 + b'\n') * 2) res = await self.con.copy_to_table('copytab', source=data) self.assertEqual(res, 'COPY 2') finally: await self.con.execute('DROP TABLE copytab') async def test_copy_to_table_fail_in_source_1(self): await self.con.execute(''' CREATE TABLE copytab(a text, b text); ''') try: class _Source: def __init__(self): self.rowcount = 0 def __aiter__(self): return self async def __anext__(self): raise RuntimeError('failure in source') with self.assertRaisesRegex(RuntimeError, 'failure in source'): await self.con.copy_to_table('copytab', source=_Source()) # Check that the protocol has recovered. self.assertEqual(await self.con.fetchval('SELECT 1'), 1) finally: await self.con.execute('DROP TABLE copytab') async def test_copy_to_table_fail_in_source_2(self): await self.con.execute(''' CREATE TABLE copytab(a text, b text); ''') try: class _Source: def __init__(self): self.rowcount = 0 def __aiter__(self): return self async def __anext__(self): if self.rowcount == 0: self.rowcount += 1 return b'a\tb\n' else: raise RuntimeError('failure in source') with self.assertRaisesRegex(RuntimeError, 'failure in source'): await self.con.copy_to_table('copytab', source=_Source()) # Check that the protocol has recovered. self.assertEqual(await self.con.fetchval('SELECT 1'), 1) finally: await self.con.execute('DROP TABLE copytab') async def test_copy_to_table_timeout(self): await self.con.execute(''' CREATE TABLE copytab(a text, b text); ''') try: class _Source: def __init__(self, loop): self.rowcount = 0 self.loop = loop def __aiter__(self): return self async def __anext__(self): self.rowcount += 1 await asyncio.sleep(60) return b'a1' * 50 + b'\t' + b'b1' * 50 + b'\n' with self.assertRaises(asyncio.TimeoutError): await self.con.copy_to_table( 'copytab', source=_Source(self.loop), timeout=0.10) # Check that the protocol has recovered. self.assertEqual(await self.con.fetchval('SELECT 1'), 1) finally: await self.con.execute('DROP TABLE copytab') async def test_copy_to_table_from_file_path(self): await self.con.execute(''' CREATE TABLE copytab(a text, "b~" text, i int); ''') f = tempfile.NamedTemporaryFile(delete=False) try: f.write( '\n'.join([ 'a1\tb1\t1', 'a2\tb2\t2', 'a3\tb3\t3', 'a4\tb4\t4', 'a5\tb5\t5', '*\t\\N\t\\N', '' ]).encode('utf-8') ) f.close() res = await self.con.copy_to_table('copytab', source=f.name) self.assertEqual(res, 'COPY 6') output = await self.con.fetch(""" SELECT * FROM copytab ORDER BY a """) self.assertEqual( output, [ ('*', None, None), ('a1', 'b1', 1), ('a2', 'b2', 2), ('a3', 'b3', 3), ('a4', 'b4', 4), ('a5', 'b5', 5), ] ) finally: await self.con.execute('DROP TABLE public.copytab') os.unlink(f.name) async def test_copy_records_to_table_1(self): await self.con.execute(''' CREATE TABLE copytab(a text, b int, c timestamptz); ''') try: date = datetime.datetime.now(tz=datetime.timezone.utc) delta = datetime.timedelta(days=1) records = [ ('a-{}'.format(i), i, date + delta) for i in range(100) ] records.append(('a-100', None, None)) res = await self.con.copy_records_to_table( 'copytab', records=records) self.assertEqual(res, 'COPY 101') finally: await self.con.execute('DROP TABLE copytab') async def test_copy_records_to_table_where(self): if not self.con._server_caps.sql_copy_from_where: raise unittest.SkipTest( 'COPY WHERE not supported on server') await self.con.execute(''' CREATE TABLE copytab_where(a text, b int, c timestamptz); ''') try: date = datetime.datetime.now(tz=datetime.timezone.utc) delta = datetime.timedelta(days=1) records = [ ('a-{}'.format(i), i, date + delta) for i in range(100) ] records.append(('a-100', None, None)) records.append(('b-999', None, None)) res = await self.con.copy_records_to_table( 'copytab_where', records=records, where='a <> \'b-999\'') self.assertEqual(res, 'COPY 101') finally: await self.con.execute('DROP TABLE copytab_where') async def test_copy_records_to_table_async(self): await self.con.execute(''' CREATE TABLE copytab_async(a text, b int, c timestamptz); ''') try: date = datetime.datetime.now(tz=datetime.timezone.utc) delta = datetime.timedelta(days=1) async def record_generator(): for i in range(100): yield ('a-{}'.format(i), i, date + delta) yield ('a-100', None, None) res = await self.con.copy_records_to_table( 'copytab_async', records=record_generator(), ) self.assertEqual(res, 'COPY 101') finally: await self.con.execute('DROP TABLE copytab_async') async def test_copy_records_to_table_no_binary_codec(self): await self.con.execute(''' CREATE TABLE copytab(a uuid); ''') try: def _encoder(value): return value def _decoder(value): return value await self.con.set_type_codec( 'uuid', encoder=_encoder, decoder=_decoder, schema='pg_catalog', format='text' ) records = [('2975ab9a-f79c-4ab4-9be5-7bc134d952f0',)] with self.assertRaisesRegex( asyncpg.InternalClientError, 'no binary format encoder'): await self.con.copy_records_to_table( 'copytab', records=records) finally: await self.con.reset_type_codec( 'uuid', schema='pg_catalog' ) await self.con.execute('DROP TABLE copytab') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/test_cursor.py0000644000175100001770000001344314705014413016737 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncpg import inspect from asyncpg import _testbase as tb class TestIterableCursor(tb.ConnectedTestCase): async def test_cursor_iterable_01(self): st = await self.con.prepare('SELECT generate_series(0, 20)') expected = await st.fetch() for prefetch in range(1, 25): with self.subTest(prefetch=prefetch): async with self.con.transaction(): result = [] async for rec in st.cursor(prefetch=prefetch): result.append(rec) self.assertEqual( result, expected, 'result != expected for prefetch={}'.format(prefetch)) async def test_cursor_iterable_02(self): # Test that it's not possible to create a cursor without hold # outside of a transaction s = await self.con.prepare( 'DECLARE t BINARY CURSOR WITHOUT HOLD FOR SELECT 1') with self.assertRaises(asyncpg.NoActiveSQLTransactionError): await s.fetch() # Now test that statement.cursor() does not let you # iterate over it outside of a transaction st = await self.con.prepare('SELECT generate_series(0, 20)') it = st.cursor(prefetch=5).__aiter__() if inspect.isawaitable(it): it = await it with self.assertRaisesRegex(asyncpg.NoActiveSQLTransactionError, 'cursor cannot be created.*transaction'): await it.__anext__() async def test_cursor_iterable_03(self): st = await self.con.prepare('SELECT generate_series(0, 20)') it = st.cursor().__aiter__() if inspect.isawaitable(it): it = await it st._state.mark_closed() with self.assertRaisesRegex(asyncpg.InterfaceError, 'statement is closed'): async for _ in it: # NOQA pass async def test_cursor_iterable_04(self): st = await self.con.prepare('SELECT generate_series(0, 20)') st._state.mark_closed() with self.assertRaisesRegex(asyncpg.InterfaceError, 'statement is closed'): async for _ in st.cursor(): # NOQA pass async def test_cursor_iterable_05(self): st = await self.con.prepare('SELECT generate_series(0, 20)') for prefetch in range(-1, 1): with self.subTest(prefetch=prefetch): with self.assertRaisesRegex(asyncpg.InterfaceError, 'must be greater than zero'): async for _ in st.cursor(prefetch=prefetch): # NOQA pass async def test_cursor_iterable_06(self): recs = [] async with self.con.transaction(): await self.con.execute(''' CREATE TABLE cursor_iterable_06 (id int); INSERT INTO cursor_iterable_06 VALUES (0), (1); ''') try: cur = self.con.cursor('SELECT * FROM cursor_iterable_06') async for rec in cur: recs.append(rec) finally: # Check that after iteration has exhausted the cursor, # its associated portal is closed properly, unlocking # the table. await self.con.execute('DROP TABLE cursor_iterable_06') self.assertEqual(recs, [(i,) for i in range(2)]) class TestCursor(tb.ConnectedTestCase): async def test_cursor_01(self): st = await self.con.prepare('SELECT generate_series(0, 20)') with self.assertRaisesRegex(asyncpg.NoActiveSQLTransactionError, 'cursor cannot be created.*transaction'): await st.cursor() async def test_cursor_02(self): st = await self.con.prepare('SELECT generate_series(0, 20)') async with self.con.transaction(): cur = await st.cursor() for i in range(-1, 1): with self.assertRaisesRegex(asyncpg.InterfaceError, 'greater than zero'): await cur.fetch(i) res = await cur.fetch(2) self.assertEqual(res, [(0,), (1,)]) rec = await cur.fetchrow() self.assertEqual(rec, (2,)) r = repr(cur) self.assertTrue(r.startswith(' # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncpg from asyncpg import _testbase as tb class TestExceptions(tb.ConnectedTestCase): def test_exceptions_exported(self): for err in ('PostgresError', 'SubstringError', 'InterfaceError'): self.assertTrue(hasattr(asyncpg, err)) self.assertIn(err, asyncpg.__all__) for err in ('PostgresMessage',): self.assertFalse(hasattr(asyncpg, err)) self.assertNotIn(err, asyncpg.__all__) self.assertIsNone(asyncpg.PostgresError.schema_name) async def test_exceptions_unpacking(self): try: await self.con.execute('SELECT * FROM _nonexistent_') except asyncpg.UndefinedTableError as e: self.assertEqual(e.sqlstate, '42P01') self.assertEqual(e.position, '15') self.assertEqual(e.query, 'SELECT * FROM _nonexistent_') self.assertIsNotNone(e.severity) else: self.fail('UndefinedTableError not raised') async def test_exceptions_str(self): try: await self.con.execute(''' CREATE FUNCTION foo() RETURNS bool AS $$ $$ LANGUAGE SQL; ''') except asyncpg.InvalidFunctionDefinitionError as e: if self.server_version < (17, 0): detail = ( "Function's final statement must be SELECT or " "INSERT/UPDATE/DELETE RETURNING." ) else: detail = ( "Function's final statement must be SELECT or " "INSERT/UPDATE/DELETE/MERGE RETURNING." ) self.assertEqual(e.detail, detail) self.assertIn('DETAIL: Function', str(e)) else: self.fail('InvalidFunctionDefinitionError not raised') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/test_execute.py0000644000175100001770000002761214705014413017067 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncio import asyncpg from asyncpg import _testbase as tb from asyncpg import exceptions class TestExecuteScript(tb.ConnectedTestCase): async def test_execute_script_1(self): self.assertEqual(self.con._protocol.queries_count, 0) status = await self.con.execute(''' SELECT 1; SELECT true FROM pg_type WHERE false = true; SELECT generate_series(0, 9); ''') self.assertEqual(self.con._protocol.queries_count, 1) self.assertEqual(status, 'SELECT 10') async def test_execute_script_2(self): status = await self.con.execute(''' CREATE TABLE mytab (a int); ''') self.assertEqual(status, 'CREATE TABLE') try: status = await self.con.execute(''' INSERT INTO mytab (a) VALUES ($1), ($2) ''', 10, 20) self.assertEqual(status, 'INSERT 0 2') finally: await self.con.execute('DROP TABLE mytab') async def test_execute_script_3(self): with self.assertRaisesRegex(asyncpg.PostgresSyntaxError, 'cannot insert multiple commands'): await self.con.execute(''' CREATE TABLE mytab (a int); INSERT INTO mytab (a) VALUES ($1), ($2); ''', 10, 20) async def test_execute_script_check_transactionality(self): with self.assertRaises(asyncpg.PostgresError): await self.con.execute(''' CREATE TABLE mytab (a int); SELECT * FROM mytab WHERE 1 / 0 = 1; ''') with self.assertRaisesRegex(asyncpg.PostgresError, '"mytab" does not exist'): await self.con.prepare(''' SELECT * FROM mytab ''') async def test_execute_exceptions_1(self): with self.assertRaisesRegex(asyncpg.PostgresError, 'relation "__dne__" does not exist'): await self.con.execute('select * from __dne__') async def test_execute_script_interrupted_close(self): fut = self.loop.create_task( self.con.execute('''SELECT pg_sleep(10)''')) await asyncio.sleep(0.2) self.assertFalse(self.con.is_closed()) await self.con.close() self.assertTrue(self.con.is_closed()) with self.assertRaises(asyncpg.QueryCanceledError): await fut async def test_execute_script_interrupted_terminate(self): fut = self.loop.create_task( self.con.execute('''SELECT pg_sleep(10)''')) await asyncio.sleep(0.2) self.assertFalse(self.con.is_closed()) self.con.terminate() self.assertTrue(self.con.is_closed()) with self.assertRaisesRegex(asyncpg.ConnectionDoesNotExistError, 'closed in the middle'): await fut self.con.terminate() class TestExecuteMany(tb.ConnectedTestCase): def setUp(self): super().setUp() self.loop.run_until_complete(self.con.execute( 'CREATE TABLE exmany (a text, b int PRIMARY KEY)')) def tearDown(self): self.loop.run_until_complete(self.con.execute('DROP TABLE exmany')) super().tearDown() async def test_executemany_basic(self): result = await self.con.executemany(''' INSERT INTO exmany VALUES($1, $2) ''', [ ('a', 1), ('b', 2), ('c', 3), ('d', 4) ]) self.assertIsNone(result) result = await self.con.fetch(''' SELECT * FROM exmany ''') self.assertEqual(result, [ ('a', 1), ('b', 2), ('c', 3), ('d', 4) ]) # Empty set await self.con.executemany(''' INSERT INTO exmany VALUES($1, $2) ''', ()) result = await self.con.fetch(''' SELECT * FROM exmany ''') self.assertEqual(result, [ ('a', 1), ('b', 2), ('c', 3), ('d', 4) ]) async def test_executemany_returning(self): result = await self.con.fetchmany(''' INSERT INTO exmany VALUES($1, $2) RETURNING a, b ''', [ ('a', 1), ('b', 2), ('c', 3), ('d', 4) ]) self.assertEqual(result, [ ('a', 1), ('b', 2), ('c', 3), ('d', 4) ]) result = await self.con.fetch(''' SELECT * FROM exmany ''') self.assertEqual(result, [ ('a', 1), ('b', 2), ('c', 3), ('d', 4) ]) # Empty set await self.con.fetchmany(''' INSERT INTO exmany VALUES($1, $2) RETURNING a, b ''', ()) result = await self.con.fetch(''' SELECT * FROM exmany ''') self.assertEqual(result, [ ('a', 1), ('b', 2), ('c', 3), ('d', 4) ]) # Without "RETURNING" result = await self.con.fetchmany(''' INSERT INTO exmany VALUES($1, $2) ''', [('e', 5), ('f', 6)]) self.assertEqual(result, []) result = await self.con.fetch(''' SELECT * FROM exmany ''') self.assertEqual(result, [ ('a', 1), ('b', 2), ('c', 3), ('d', 4), ('e', 5), ('f', 6) ]) async def test_executemany_bad_input(self): with self.assertRaisesRegex( exceptions.DataError, r"invalid input in executemany\(\) argument sequence element #1: " r"expected a sequence", ): await self.con.executemany(''' INSERT INTO exmany (b) VALUES($1) ''', [(0,), {1: 0}]) with self.assertRaisesRegex( exceptions.DataError, r"invalid input for query argument \$1 in element #1 of " r"executemany\(\) sequence: 'bad'", ): await self.con.executemany(''' INSERT INTO exmany (b) VALUES($1) ''', [(0,), ("bad",)]) async def test_executemany_error_in_input_gen(self): bad_data = ([1 / 0] for v in range(10)) with self.assertRaises(ZeroDivisionError): async with self.con.transaction(): await self.con.executemany(''' INSERT INTO exmany (b)VALUES($1) ''', bad_data) good_data = ([v] for v in range(10)) async with self.con.transaction(): await self.con.executemany(''' INSERT INTO exmany (b)VALUES($1) ''', good_data) async def test_executemany_server_failure(self): with self.assertRaises(exceptions.UniqueViolationError): await self.con.executemany(''' INSERT INTO exmany VALUES($1, $2) ''', [ ('a', 1), ('b', 2), ('c', 2), ('d', 4) ]) result = await self.con.fetch('SELECT * FROM exmany') self.assertEqual(result, []) async def test_executemany_server_failure_after_writes(self): with self.assertRaises(exceptions.UniqueViolationError): await self.con.executemany(''' INSERT INTO exmany VALUES($1, $2) ''', [('a' * 32768, x) for x in range(10)] + [ ('b', 12), ('c', 12), ('d', 14) ]) result = await self.con.fetch('SELECT b FROM exmany') self.assertEqual(result, []) async def test_executemany_server_failure_during_writes(self): # failure at the beginning, server error detected in the middle pos = 0 def gen(): nonlocal pos while pos < 128: pos += 1 if pos < 3: yield ('a', 0) else: yield 'a' * 32768, pos with self.assertRaises(exceptions.UniqueViolationError): await self.con.executemany(''' INSERT INTO exmany VALUES($1, $2) ''', gen()) result = await self.con.fetch('SELECT b FROM exmany') self.assertEqual(result, []) self.assertLess(pos, 128, 'should stop early') async def test_executemany_client_failure_after_writes(self): with self.assertRaises(ZeroDivisionError): await self.con.executemany(''' INSERT INTO exmany VALUES($1, $2) ''', (('a' * 32768, y + y / y) for y in range(10, -1, -1))) result = await self.con.fetch('SELECT b FROM exmany') self.assertEqual(result, []) async def test_executemany_timeout(self): with self.assertRaises(asyncio.TimeoutError): await self.con.executemany(''' INSERT INTO exmany VALUES(pg_sleep(0.1) || $1, $2) ''', [('a' * 32768, x) for x in range(128)], timeout=0.5) result = await self.con.fetch('SELECT * FROM exmany') self.assertEqual(result, []) async def test_executemany_timeout_flow_control(self): event = asyncio.Event() async def locker(): test_func = getattr(self, self._testMethodName).__func__ opts = getattr(test_func, '__connect_options__', {}) conn = await self.connect(**opts) try: tx = conn.transaction() await tx.start() await conn.execute("UPDATE exmany SET a = '1' WHERE b = 10") event.set() await asyncio.sleep(1) await tx.rollback() finally: event.set() await conn.close() await self.con.executemany(''' INSERT INTO exmany VALUES(NULL, $1) ''', [(x,) for x in range(128)]) fut = asyncio.ensure_future(locker()) await event.wait() with self.assertRaises(asyncio.TimeoutError): await self.con.executemany(''' UPDATE exmany SET a = $1 WHERE b = $2 ''', [('a' * 32768, x) for x in range(128)], timeout=0.5) await fut result = await self.con.fetch( 'SELECT * FROM exmany WHERE a IS NOT NULL') self.assertEqual(result, []) async def test_executemany_client_failure_in_transaction(self): tx = self.con.transaction() await tx.start() with self.assertRaises(ZeroDivisionError): await self.con.executemany(''' INSERT INTO exmany VALUES($1, $2) ''', (('a' * 32768, y + y / y) for y in range(10, -1, -1))) result = await self.con.fetch('SELECT b FROM exmany') # only 2 batches executed (2 x 4) self.assertEqual( [x[0] for x in result], [y + 1 for y in range(10, 2, -1)]) await tx.rollback() result = await self.con.fetch('SELECT b FROM exmany') self.assertEqual(result, []) async def test_executemany_client_server_failure_conflict(self): self.con._transport.set_write_buffer_limits(65536 * 64, 16384 * 64) with self.assertRaises(exceptions.UniqueViolationError): await self.con.executemany(''' INSERT INTO exmany VALUES($1, 0) ''', (('a' * 32768,) for y in range(4, -1, -1) if y / y)) result = await self.con.fetch('SELECT b FROM exmany') self.assertEqual(result, []) async def test_executemany_prepare(self): stmt = await self.con.prepare(''' INSERT INTO exmany VALUES($1, $2) ''') result = await stmt.executemany([ ('a', 1), ('b', 2), ('c', 3), ('d', 4) ]) self.assertIsNone(result) result = await self.con.fetch(''' SELECT * FROM exmany ''') self.assertEqual(result, [ ('a', 1), ('b', 2), ('c', 3), ('d', 4) ]) # Empty set await stmt.executemany(()) result = await self.con.fetch(''' SELECT * FROM exmany ''') self.assertEqual(result, [ ('a', 1), ('b', 2), ('c', 3), ('d', 4) ]) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/test_introspection.py0000644000175100001770000001656014705014413020325 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncio import json from asyncpg import _testbase as tb from asyncpg import connection as apg_con MAX_RUNTIME = 0.25 class SlowIntrospectionConnection(apg_con.Connection): """Connection class to test introspection races.""" introspect_count = 0 async def _introspect_types(self, *args, **kwargs): self.introspect_count += 1 await asyncio.sleep(0.4) return await super()._introspect_types(*args, **kwargs) class TestIntrospection(tb.ConnectedTestCase): @classmethod def setUpClass(cls): super().setUpClass() cls.adminconn = cls.loop.run_until_complete(cls.connect()) cls.loop.run_until_complete( cls.adminconn.execute('CREATE DATABASE asyncpg_intro_test')) @classmethod def tearDownClass(cls): cls.loop.run_until_complete( cls.adminconn.execute('DROP DATABASE asyncpg_intro_test')) cls.loop.run_until_complete(cls.adminconn.close()) cls.adminconn = None super().tearDownClass() @classmethod def get_server_settings(cls): settings = super().get_server_settings() settings.pop('jit', None) return settings def setUp(self): super().setUp() self.loop.run_until_complete(self._add_custom_codec(self.con)) async def _add_custom_codec(self, conn): # mess up with the codec - builtin introspection shouldn't be affected await conn.set_type_codec( "oid", schema="pg_catalog", encoder=lambda value: None, decoder=lambda value: None, format="text", ) @tb.with_connection_options(database='asyncpg_intro_test') async def test_introspection_on_large_db(self): await self.con.execute( 'CREATE TABLE base ({})'.format( ','.join('c{:02} varchar'.format(n) for n in range(50)) ) ) for n in range(1000): await self.con.execute( 'CREATE TABLE child_{:04} () inherits (base)'.format(n) ) with self.assertRunUnder(MAX_RUNTIME): await self.con.fetchval('SELECT $1::int[]', [1, 2]) @tb.with_connection_options(statement_cache_size=0) async def test_introspection_no_stmt_cache_01(self): old_uid = apg_con._uid self.assertEqual(self.con._stmt_cache.get_max_size(), 0) await self.con.fetchval('SELECT $1::int[]', [1, 2]) await self.con.execute(''' CREATE EXTENSION IF NOT EXISTS hstore ''') try: await self.con.set_builtin_type_codec( 'hstore', codec_name='pg_contrib.hstore') finally: await self.con.execute(''' DROP EXTENSION hstore ''') self.assertEqual(apg_con._uid, old_uid) @tb.with_connection_options(max_cacheable_statement_size=1) async def test_introspection_no_stmt_cache_02(self): # max_cacheable_statement_size will disable caching both for # the user query and for the introspection query. old_uid = apg_con._uid await self.con.fetchval('SELECT $1::int[]', [1, 2]) await self.con.execute(''' CREATE EXTENSION IF NOT EXISTS hstore ''') try: await self.con.set_builtin_type_codec( 'hstore', codec_name='pg_contrib.hstore') finally: await self.con.execute(''' DROP EXTENSION hstore ''') self.assertEqual(apg_con._uid, old_uid) @tb.with_connection_options(max_cacheable_statement_size=10000) async def test_introspection_no_stmt_cache_03(self): # max_cacheable_statement_size will disable caching for # the user query but not for the introspection query. old_uid = apg_con._uid await self.con.fetchval( "SELECT $1::int[], '{foo}'".format(foo='a' * 10000), [1, 2]) self.assertGreater(apg_con._uid, old_uid) async def test_introspection_sticks_for_ps(self): # Test that the introspected codec pipeline for a prepared # statement is not affected by a subsequent codec cache bust. ps = await self.con._prepare('SELECT $1::json[]', use_cache=True) try: # Setting a custom codec blows the codec cache for derived types. await self.con.set_type_codec( 'json', encoder=lambda v: v, decoder=json.loads, schema='pg_catalog', format='text' ) # The originally prepared statement should still be OK and # use the previously selected codec. self.assertEqual(await ps.fetchval(['{"foo": 1}']), ['{"foo": 1}']) # The new query uses the custom codec. v = await self.con.fetchval('SELECT $1::json[]', ['{"foo": 1}']) self.assertEqual(v, [{'foo': 1}]) finally: await self.con.reset_type_codec( 'json', schema='pg_catalog') async def test_introspection_retries_after_cache_bust(self): # Test that codec cache bust racing with the introspection # query would cause introspection to retry. slow_intro_conn = await self.connect( connection_class=SlowIntrospectionConnection) await self._add_custom_codec(slow_intro_conn) try: await self.con.execute(''' CREATE DOMAIN intro_1_t AS int; CREATE DOMAIN intro_2_t AS int; ''') await slow_intro_conn.fetchval(''' SELECT $1::intro_1_t ''', 10) # slow_intro_conn cache is now populated with intro_1_t async def wait_and_drop(): await asyncio.sleep(0.1) await slow_intro_conn.reload_schema_state() # Now, in parallel, run another query that # references both intro_1_t and intro_2_t. await asyncio.gather( slow_intro_conn.fetchval(''' SELECT $1::intro_1_t, $2::intro_2_t ''', 10, 20), wait_and_drop() ) # Initial query + two tries for the second query. self.assertEqual(slow_intro_conn.introspect_count, 3) finally: await self.con.execute(''' DROP DOMAIN intro_1_t; DROP DOMAIN intro_2_t; ''') await slow_intro_conn.close() @tb.with_connection_options(database='asyncpg_intro_test') async def test_introspection_loads_basetypes_of_domains(self): # Test that basetypes of domains are loaded to the # client encode/decode cache await self.con.execute(''' DROP TABLE IF EXISTS test; DROP DOMAIN IF EXISTS num_array; CREATE DOMAIN num_array numeric[]; CREATE TABLE test ( num num_array ); ''') try: # if domain basetypes are not loaded, this insert will fail await self.con.execute( 'INSERT INTO test (num) VALUES ($1)', ([1, 2],)) finally: await self.con.execute(''' DROP TABLE IF EXISTS test; DROP DOMAIN IF EXISTS num_array; ''') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/test_listeners.py0000644000175100001770000002661014705014413017432 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncio import os import platform import unittest from asyncpg import _testbase as tb from asyncpg import exceptions class TestListeners(tb.ClusterTestCase): async def test_listen_01(self): async with self.create_pool(database='postgres') as pool: async with pool.acquire() as con: q1 = asyncio.Queue() q2 = asyncio.Queue() q3 = asyncio.Queue() def listener1(*args): q1.put_nowait(args) def listener2(*args): q2.put_nowait(args) async def async_listener3(*args): q3.put_nowait(args) await con.add_listener('test', listener1) await con.add_listener('test', listener2) await con.add_listener('test', async_listener3) await con.execute("NOTIFY test, 'aaaa'") self.assertEqual( await q1.get(), (con, con.get_server_pid(), 'test', 'aaaa')) self.assertEqual( await q2.get(), (con, con.get_server_pid(), 'test', 'aaaa')) self.assertEqual( await q3.get(), (con, con.get_server_pid(), 'test', 'aaaa')) await con.remove_listener('test', listener2) await con.remove_listener('test', async_listener3) await con.execute("NOTIFY test, 'aaaa'") self.assertEqual( await q1.get(), (con, con.get_server_pid(), 'test', 'aaaa')) with self.assertRaises(asyncio.TimeoutError): await asyncio.wait_for(q2.get(), timeout=0.05) await con.reset() await con.remove_listener('test', listener1) await con.execute("NOTIFY test, 'aaaa'") with self.assertRaises(asyncio.TimeoutError): await asyncio.wait_for(q1.get(), timeout=0.05) with self.assertRaises(asyncio.TimeoutError): await asyncio.wait_for(q2.get(), timeout=0.05) async def test_listen_02(self): async with self.create_pool(database='postgres') as pool: async with pool.acquire() as con1, pool.acquire() as con2: q1 = asyncio.Queue() def listener1(*args): q1.put_nowait(args) await con1.add_listener('ipc', listener1) await con2.execute("NOTIFY ipc, 'hello'") self.assertEqual( await q1.get(), (con1, con2.get_server_pid(), 'ipc', 'hello')) await con1.remove_listener('ipc', listener1) async def test_listen_notletters(self): async with self.create_pool(database='postgres') as pool: async with pool.acquire() as con1, pool.acquire() as con2: q1 = asyncio.Queue() def listener1(*args): q1.put_nowait(args) await con1.add_listener('12+"34', listener1) await con2.execute("""NOTIFY "12+""34", 'hello'""") self.assertEqual( await q1.get(), (con1, con2.get_server_pid(), '12+"34', 'hello')) await con1.remove_listener('12+"34', listener1) async def test_dangling_listener_warns(self): async with self.create_pool(database='postgres') as pool: with self.assertWarnsRegex( exceptions.InterfaceWarning, '.*Connection.*is being released to the pool but ' 'has 1 active notification listener'): async with pool.acquire() as con: def listener1(*args): pass await con.add_listener('ipc', listener1) class TestLogListeners(tb.ConnectedTestCase): @tb.with_connection_options(server_settings={ 'client_min_messages': 'notice' }) async def test_log_listener_01(self): q1 = asyncio.Queue() q2 = asyncio.Queue() def notice_callb(con, message): # Message fields depend on PG version, hide some values. dct = message.as_dict() del dct['server_source_line'] q1.put_nowait((con, type(message), dct)) async def async_notice_callb(con, message): # Message fields depend on PG version, hide some values. dct = message.as_dict() del dct['server_source_line'] q2.put_nowait((con, type(message), dct)) async def raise_notice(): await self.con.execute( """DO $$ BEGIN RAISE NOTICE 'catch me!'; END; $$ LANGUAGE plpgsql""" ) async def raise_warning(): await self.con.execute( """DO $$ BEGIN RAISE WARNING 'catch me!'; END; $$ LANGUAGE plpgsql""" ) con = self.con con.add_log_listener(notice_callb) con.add_log_listener(async_notice_callb) expected_msg = { 'context': 'PL/pgSQL function inline_code_block line 2 at RAISE', 'message': 'catch me!', 'server_source_function': 'exec_stmt_raise', } expected_msg_notice = { **expected_msg, 'severity': 'NOTICE', 'severity_en': 'NOTICE', 'sqlstate': '00000', } expected_msg_warn = { **expected_msg, 'severity': 'WARNING', 'severity_en': 'WARNING', 'sqlstate': '01000', } if con.get_server_version() < (9, 6): del expected_msg_notice['context'] del expected_msg_notice['severity_en'] del expected_msg_warn['context'] del expected_msg_warn['severity_en'] await raise_notice() await raise_warning() msg = await q1.get() msg[2].pop('server_source_filename', None) self.assertEqual( msg, (con, exceptions.PostgresLogMessage, expected_msg_notice)) msg = await q1.get() msg[2].pop('server_source_filename', None) self.assertEqual( msg, (con, exceptions.PostgresWarning, expected_msg_warn)) msg = await q2.get() msg[2].pop('server_source_filename', None) self.assertEqual( msg, (con, exceptions.PostgresLogMessage, expected_msg_notice)) msg = await q2.get() msg[2].pop('server_source_filename', None) self.assertEqual( msg, (con, exceptions.PostgresWarning, expected_msg_warn)) con.remove_log_listener(notice_callb) con.remove_log_listener(async_notice_callb) await raise_notice() self.assertTrue(q1.empty()) con.add_log_listener(notice_callb) await raise_notice() await q1.get() self.assertTrue(q1.empty()) await con.reset() await raise_notice() self.assertTrue(q1.empty()) @tb.with_connection_options(server_settings={ 'client_min_messages': 'notice' }) async def test_log_listener_02(self): q1 = asyncio.Queue() cur_id = None def notice_callb(con, message): q1.put_nowait((con, cur_id, message.message)) con = self.con await con.execute( "CREATE FUNCTION _test(i INT) RETURNS int LANGUAGE plpgsql AS $$" " BEGIN" " RAISE NOTICE '1_%', i;" " PERFORM pg_sleep(0.1);" " RAISE NOTICE '2_%', i;" " RETURN i;" " END" "$$" ) try: con.add_log_listener(notice_callb) for cur_id in range(10): await con.execute("SELECT _test($1)", cur_id) for cur_id in range(10): self.assertEqual( q1.get_nowait(), (con, cur_id, '1_%s' % cur_id)) self.assertEqual( q1.get_nowait(), (con, cur_id, '2_%s' % cur_id)) con.remove_log_listener(notice_callb) self.assertTrue(q1.empty()) finally: await con.execute('DROP FUNCTION _test(i INT)') @tb.with_connection_options(server_settings={ 'client_min_messages': 'notice' }) async def test_log_listener_03(self): q1 = asyncio.Queue() async def raise_message(level, code): await self.con.execute(""" DO $$ BEGIN RAISE {} 'catch me!' USING ERRCODE = '{}'; END; $$ LANGUAGE plpgsql; """.format(level, code)) def notice_callb(con, message): # Message fields depend on PG version, hide some values. q1.put_nowait(message) self.con.add_log_listener(notice_callb) await raise_message('WARNING', '99999') msg = await q1.get() self.assertIsInstance(msg, exceptions.PostgresWarning) self.assertEqual(msg.sqlstate, '99999') await raise_message('WARNING', '01004') msg = await q1.get() self.assertIsInstance(msg, exceptions.StringDataRightTruncation) self.assertEqual(msg.sqlstate, '01004') with self.assertRaises(exceptions.InvalidCharacterValueForCastError): await raise_message('', '22018') self.assertTrue(q1.empty()) async def test_dangling_log_listener_warns(self): async with self.create_pool(database='postgres') as pool: with self.assertWarnsRegex( exceptions.InterfaceWarning, '.*Connection.*is being released to the pool but ' 'has 1 active log listener'): async with pool.acquire() as con: def listener1(*args): pass con.add_log_listener(listener1) @unittest.skipIf(os.environ.get('PGHOST'), 'using remote cluster for testing') @unittest.skipIf( platform.system() == 'Windows', 'not compatible with ProactorEventLoop which is default in Python 3.8+') class TestConnectionTerminationListener(tb.ProxiedClusterTestCase): async def test_connection_termination_callback_called_on_remote(self): called = False async_called = False def close_cb(con): nonlocal called called = True async def async_close_cb(con): nonlocal async_called async_called = True con = await self.connect() con.add_termination_listener(close_cb) con.add_termination_listener(async_close_cb) self.proxy.close_all_connections() try: await con.fetchval('SELECT 1') except Exception: pass self.assertTrue(called) self.assertTrue(async_called) async def test_connection_termination_callback_called_on_local(self): called = False def close_cb(con): nonlocal called called = True con = await self.connect() con.add_termination_listener(close_cb) await con.close() await asyncio.sleep(0) self.assertTrue(called) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/test_logging.py0000644000175100001770000000301614705014413017043 0ustar00runnerdockerimport asyncio from asyncpg import _testbase as tb from asyncpg import exceptions class LogCollector: def __init__(self): self.records = [] def __call__(self, record): self.records.append(record) class TestQueryLogging(tb.ConnectedTestCase): async def test_logging_context(self): queries = asyncio.Queue() def query_saver(record): queries.put_nowait(record) log = LogCollector() with self.con.query_logger(query_saver): self.assertEqual(len(self.con._query_loggers), 1) await self.con.execute("SELECT 1") with self.con.query_logger(log): self.assertEqual(len(self.con._query_loggers), 2) await self.con.execute("SELECT 2") r1 = await queries.get() r2 = await queries.get() self.assertEqual(r1.query, "SELECT 1") self.assertEqual(r2.query, "SELECT 2") self.assertEqual(len(log.records), 1) self.assertEqual(log.records[0].query, "SELECT 2") self.assertEqual(len(self.con._query_loggers), 0) async def test_error_logging(self): log = LogCollector() with self.con.query_logger(log): with self.assertRaises(exceptions.UndefinedColumnError): await self.con.execute("SELECT x") await asyncio.sleep(0) # wait for logging self.assertEqual(len(log.records), 1) self.assertEqual( type(log.records[0].exception), exceptions.UndefinedColumnError ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/test_pool.py0000644000175100001770000011341214705014413016370 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncio import inspect import os import pathlib import platform import random import textwrap import time import unittest import asyncpg from asyncpg import _testbase as tb from asyncpg import connection as pg_connection from asyncpg import pool as pg_pool from asyncpg import cluster as pg_cluster _system = platform.uname().system POOL_NOMINAL_TIMEOUT = 0.1 class SlowResetConnection(pg_connection.Connection): """Connection class to simulate races with Connection.reset().""" async def reset(self, *, timeout=None): await asyncio.sleep(0.2) return await super().reset(timeout=timeout) class SlowCancelConnection(pg_connection.Connection): """Connection class to simulate races with Connection._cancel().""" async def _cancel(self, waiter): await asyncio.sleep(0.2) return await super()._cancel(waiter) class TestPool(tb.ConnectedTestCase): async def test_pool_01(self): for n in {1, 5, 10, 20, 100}: with self.subTest(tasksnum=n): pool = await self.create_pool(database='postgres', min_size=5, max_size=10) async def worker(): con = await pool.acquire() self.assertEqual(await con.fetchval('SELECT 1'), 1) await pool.release(con) tasks = [worker() for _ in range(n)] await asyncio.gather(*tasks) await pool.close() async def test_pool_02(self): for n in {1, 3, 5, 10, 20, 100}: with self.subTest(tasksnum=n): async with self.create_pool(database='postgres', min_size=5, max_size=5) as pool: async def worker(): con = await pool.acquire(timeout=5) self.assertEqual(await con.fetchval('SELECT 1'), 1) await pool.release(con) tasks = [worker() for _ in range(n)] await asyncio.gather(*tasks) async def test_pool_03(self): pool = await self.create_pool(database='postgres', min_size=1, max_size=1) con = await pool.acquire(timeout=1) with self.assertRaises(asyncio.TimeoutError): await pool.acquire(timeout=0.03) pool.terminate() del con async def test_pool_04(self): pool = await self.create_pool(database='postgres', min_size=1, max_size=1) con = await pool.acquire(timeout=POOL_NOMINAL_TIMEOUT) # Manual termination of pool connections releases the # pool item immediately. con.terminate() self.assertIsNone(pool._holders[0]._con) self.assertIsNone(pool._holders[0]._in_use) con = await pool.acquire(timeout=POOL_NOMINAL_TIMEOUT) self.assertEqual(await con.fetchval('SELECT 1'), 1) await con.close() self.assertIsNone(pool._holders[0]._con) self.assertIsNone(pool._holders[0]._in_use) # Calling release should not hurt. await pool.release(con) pool.terminate() async def test_pool_05(self): for n in {1, 3, 5, 10, 20, 100}: with self.subTest(tasksnum=n): pool = await self.create_pool(database='postgres', min_size=5, max_size=10) async def worker(): async with pool.acquire() as con: self.assertEqual(await con.fetchval('SELECT 1'), 1) tasks = [worker() for _ in range(n)] await asyncio.gather(*tasks) await pool.close() async def test_pool_06(self): fut = asyncio.Future() async def setup(con): fut.set_result(con) async with self.create_pool(database='postgres', min_size=5, max_size=5, setup=setup) as pool: async with pool.acquire() as con: pass self.assertIs(con, await fut) async def test_pool_07(self): cons = set() connect_called = 0 init_called = 0 setup_called = 0 reset_called = 0 async def connect(*args, **kwargs): nonlocal connect_called connect_called += 1 return await pg_connection.connect(*args, **kwargs) async def setup(con): nonlocal setup_called if con._con not in cons: # `con` is `PoolConnectionProxy`. raise RuntimeError('init was not called before setup') setup_called += 1 async def init(con): nonlocal init_called if con in cons: raise RuntimeError('init was called more than once') cons.add(con) init_called += 1 async def reset(con): nonlocal reset_called reset_called += 1 async def user(pool): async with pool.acquire() as con: if con._con not in cons: # `con` is `PoolConnectionProxy`. raise RuntimeError('init was not called') async with self.create_pool(database='postgres', min_size=2, max_size=5, connect=connect, init=init, setup=setup, reset=reset) as pool: users = asyncio.gather(*[user(pool) for _ in range(10)]) await users self.assertEqual(len(cons), 5) self.assertEqual(connect_called, 5) self.assertEqual(init_called, 5) self.assertEqual(setup_called, 10) self.assertEqual(reset_called, 10) async def bad_connect(*args, **kwargs): return 1 with self.assertRaisesRegex( asyncpg.InterfaceError, "expected pool connect callback to return an instance of " "'asyncpg\\.connection\\.Connection', got 'int'" ): await self.create_pool(database='postgres', connect=bad_connect) async def test_pool_08(self): pool = await self.create_pool(database='postgres', min_size=1, max_size=1) con = await pool.acquire(timeout=POOL_NOMINAL_TIMEOUT) with self.assertRaisesRegex(asyncpg.InterfaceError, 'is not a member'): await pool.release(con._con) async def test_pool_09(self): pool1 = await self.create_pool(database='postgres', min_size=1, max_size=1) pool2 = await self.create_pool(database='postgres', min_size=1, max_size=1) try: con = await pool1.acquire(timeout=POOL_NOMINAL_TIMEOUT) with self.assertRaisesRegex(asyncpg.InterfaceError, 'is not a member'): await pool2.release(con) finally: await pool1.release(con) await pool1.close() await pool2.close() async def test_pool_10(self): pool = await self.create_pool(database='postgres', min_size=1, max_size=1) con = await pool.acquire() await pool.release(con) await pool.release(con) await pool.close() async def test_pool_11(self): pool = await self.create_pool(database='postgres', min_size=1, max_size=1) async with pool.acquire() as con: self.assertIn(repr(con._con), repr(con)) # Test __repr__. ps = await con.prepare('SELECT 1') txn = con.transaction() async with con.transaction(): cur = await con.cursor('SELECT 1') ps_cur = await ps.cursor() self.assertIn('[released]', repr(con)) with self.assertRaisesRegex( asyncpg.InterfaceError, r'cannot call Connection\.execute.*released back to the pool'): con.execute('select 1') for meth in ('fetchval', 'fetchrow', 'fetch', 'explain', 'get_query', 'get_statusmsg', 'get_parameters', 'get_attributes'): with self.assertRaisesRegex( asyncpg.InterfaceError, r'cannot call PreparedStatement\.{meth}.*released ' r'back to the pool'.format(meth=meth)): getattr(ps, meth)() for c in (cur, ps_cur): for meth in ('fetch', 'fetchrow'): with self.assertRaisesRegex( asyncpg.InterfaceError, r'cannot call Cursor\.{meth}.*released ' r'back to the pool'.format(meth=meth)): getattr(c, meth)() with self.assertRaisesRegex( asyncpg.InterfaceError, r'cannot call Cursor\.forward.*released ' r'back to the pool'): c.forward(1) for meth in ('start', 'commit', 'rollback'): with self.assertRaisesRegex( asyncpg.InterfaceError, r'cannot call Transaction\.{meth}.*released ' r'back to the pool'.format(meth=meth)): getattr(txn, meth)() await pool.close() async def test_pool_12(self): pool = await self.create_pool(database='postgres', min_size=1, max_size=1) async with pool.acquire() as con: self.assertTrue(isinstance(con, pg_connection.Connection)) self.assertFalse(isinstance(con, list)) await pool.close() async def test_pool_13(self): pool = await self.create_pool(database='postgres', min_size=1, max_size=1) async with pool.acquire() as con: self.assertIn('Execute an SQL command', con.execute.__doc__) self.assertEqual(con.execute.__name__, 'execute') self.assertIn( str(inspect.signature(con.execute))[1:], str(inspect.signature(pg_connection.Connection.execute))) await pool.close() def test_pool_init_run_until_complete(self): pool_init = self.create_pool(database='postgres') pool = self.loop.run_until_complete(pool_init) self.assertIsInstance(pool, asyncpg.pool.Pool) async def test_pool_exception_in_setup_and_init(self): class Error(Exception): pass async def setup(con): nonlocal setup_calls, last_con last_con = con setup_calls += 1 if setup_calls > 1: cons.append(con) else: cons.append('error') raise Error with self.subTest(method='setup'): setup_calls = 0 last_con = None cons = [] async with self.create_pool(database='postgres', min_size=1, max_size=1, setup=setup) as pool: with self.assertRaises(Error): await pool.acquire() self.assertTrue(last_con.is_closed()) async with pool.acquire() as con: self.assertEqual(cons, ['error', con]) with self.subTest(method='init'): setup_calls = 0 last_con = None cons = [] async with self.create_pool(database='postgres', min_size=0, max_size=1, init=setup) as pool: with self.assertRaises(Error): await pool.acquire() self.assertTrue(last_con.is_closed()) async with pool.acquire() as con: self.assertEqual(await con.fetchval('select 1::int'), 1) self.assertEqual(cons, ['error', con._con]) async def test_pool_auth(self): if not self.cluster.is_managed(): self.skipTest('unmanaged cluster') self.cluster.reset_hba() if _system != 'Windows': self.cluster.add_hba_entry( type='local', database='postgres', user='pooluser', auth_method='md5') self.cluster.add_hba_entry( type='host', address='127.0.0.1/32', database='postgres', user='pooluser', auth_method='md5') self.cluster.add_hba_entry( type='host', address='::1/128', database='postgres', user='pooluser', auth_method='md5') self.cluster.reload() try: await self.con.execute(''' CREATE ROLE pooluser WITH LOGIN PASSWORD 'poolpassword' ''') pool = await self.create_pool(database='postgres', user='pooluser', password='poolpassword', min_size=5, max_size=10) async def worker(): con = await pool.acquire() self.assertEqual(await con.fetchval('SELECT 1'), 1) await pool.release(con) tasks = [worker() for _ in range(5)] await asyncio.gather(*tasks) await pool.close() finally: await self.con.execute('DROP ROLE pooluser') # Reset cluster's pg_hba.conf since we've meddled with it self.cluster.trust_local_connections() self.cluster.reload() async def test_pool_handles_task_cancel_in_acquire_with_timeout(self): # See https://github.com/MagicStack/asyncpg/issues/547 pool = await self.create_pool(database='postgres', min_size=1, max_size=1) async def worker(): async with pool.acquire(timeout=100): pass # Schedule task task = self.loop.create_task(worker()) # Yield to task, but cancel almost immediately await asyncio.sleep(0.00000000001) # Cancel the worker. task.cancel() # Wait to make sure the cleanup has completed. await asyncio.sleep(0.4) # Check that the connection has been returned to the pool. self.assertEqual(pool._queue.qsize(), 1) async def test_pool_handles_task_cancel_in_release(self): # Use SlowResetConnectionPool to simulate # the Task.cancel() and __aexit__ race. pool = await self.create_pool(database='postgres', min_size=1, max_size=1, connection_class=SlowResetConnection) async def worker(): async with pool.acquire(): pass task = self.loop.create_task(worker()) # Let the worker() run. await asyncio.sleep(0.1) # Cancel the worker. task.cancel() # Wait to make sure the cleanup has completed. await asyncio.sleep(0.4) # Check that the connection has been returned to the pool. self.assertEqual(pool._queue.qsize(), 1) async def test_pool_handles_query_cancel_in_release(self): # Use SlowResetConnectionPool to simulate # the Task.cancel() and __aexit__ race. pool = await self.create_pool(database='postgres', min_size=1, max_size=1, connection_class=SlowCancelConnection) async def worker(): async with pool.acquire() as con: await con.execute('SELECT pg_sleep(10)') task = self.loop.create_task(worker()) # Let the worker() run. await asyncio.sleep(0.1) # Cancel the worker. task.cancel() # Wait to make sure the cleanup has completed. await asyncio.sleep(0.5) # Check that the connection has been returned to the pool. self.assertEqual(pool._queue.qsize(), 1) async def test_pool_no_acquire_deadlock(self): async with self.create_pool(database='postgres', min_size=1, max_size=1, max_queries=1) as pool: async def sleep_and_release(): async with pool.acquire() as con: await con.execute('SELECT pg_sleep(1)') asyncio.ensure_future(sleep_and_release()) await asyncio.sleep(0.5) async with pool.acquire() as con: await con.fetchval('SELECT 1') async def test_pool_config_persistence(self): N = 100 cons = set() class MyConnection(asyncpg.Connection): async def foo(self): return 42 async def fetchval(self, query): res = await super().fetchval(query) return res + 1 async def test(pool): async with pool.acquire() as con: self.assertEqual(await con.fetchval('SELECT 1'), 2) self.assertEqual(await con.foo(), 42) self.assertTrue(isinstance(con, MyConnection)) self.assertEqual(con._con._config.statement_cache_size, 3) cons.add(con) async with self.create_pool( database='postgres', min_size=10, max_size=10, max_queries=1, connection_class=MyConnection, statement_cache_size=3) as pool: await asyncio.gather(*[test(pool) for _ in range(N)]) self.assertEqual(len(cons), N) async def test_pool_release_in_xact(self): """Test that Connection.reset() closes any open transaction.""" async with self.create_pool(database='postgres', min_size=1, max_size=1) as pool: async def get_xact_id(con): return await con.fetchval('select txid_current()') with self.assertLoopErrorHandlerCalled('an active transaction'): async with pool.acquire() as con: real_con = con._con # unwrap PoolConnectionProxy id1 = await get_xact_id(con) tr = con.transaction() self.assertIsNone(con._con._top_xact) await tr.start() self.assertIs(real_con._top_xact, tr) id2 = await get_xact_id(con) self.assertNotEqual(id1, id2) self.assertIsNone(real_con._top_xact) async with pool.acquire() as con: self.assertIs(con._con, real_con) self.assertIsNone(con._con._top_xact) id3 = await get_xact_id(con) self.assertNotEqual(id2, id3) async def test_pool_connection_methods(self): async def test_fetch(pool): i = random.randint(0, 20) await asyncio.sleep(random.random() / 100) r = await pool.fetch('SELECT {}::int'.format(i)) self.assertEqual(r, [(i,)]) return 1 async def test_fetchrow(pool): i = random.randint(0, 20) await asyncio.sleep(random.random() / 100) r = await pool.fetchrow('SELECT {}::int'.format(i)) self.assertEqual(r, (i,)) return 1 async def test_fetchval(pool): i = random.randint(0, 20) await asyncio.sleep(random.random() / 100) r = await pool.fetchval('SELECT {}::int'.format(i)) self.assertEqual(r, i) return 1 async def test_execute(pool): await asyncio.sleep(random.random() / 100) r = await pool.execute('SELECT generate_series(0, 10)') self.assertEqual(r, 'SELECT {}'.format(11)) return 1 async def test_execute_with_arg(pool): i = random.randint(0, 20) await asyncio.sleep(random.random() / 100) r = await pool.execute('SELECT generate_series(0, $1)', i) self.assertEqual(r, 'SELECT {}'.format(i + 1)) return 1 async def run(N, meth): async with self.create_pool(database='postgres', min_size=5, max_size=10) as pool: coros = [meth(pool) for _ in range(N)] res = await asyncio.gather(*coros) self.assertEqual(res, [1] * N) methods = [test_fetch, test_fetchrow, test_fetchval, test_execute, test_execute_with_arg] with tb.silence_asyncio_long_exec_warning(): for method in methods: with self.subTest(method=method.__name__): await run(200, method) async def test_pool_connection_execute_many(self): async def worker(pool): await asyncio.sleep(random.random() / 100) await pool.executemany(''' INSERT INTO exmany VALUES($1, $2) ''', [ ('a', 1), ('b', 2), ('c', 3), ('d', 4) ]) return 1 N = 200 async with self.create_pool(database='postgres', min_size=5, max_size=10) as pool: await pool.execute('CREATE TABLE exmany (a text, b int)') try: coros = [worker(pool) for _ in range(N)] res = await asyncio.gather(*coros) self.assertEqual(res, [1] * N) n_rows = await pool.fetchval('SELECT count(*) FROM exmany') self.assertEqual(n_rows, N * 4) finally: await pool.execute('DROP TABLE exmany') async def test_pool_max_inactive_time_01(self): async with self.create_pool( database='postgres', min_size=1, max_size=1, max_inactive_connection_lifetime=0.1) as pool: # Test that it's OK if a query takes longer time to execute # than `max_inactive_connection_lifetime`. con = pool._holders[0]._con for _ in range(3): await pool.execute('SELECT pg_sleep(0.5)') self.assertIs(pool._holders[0]._con, con) self.assertEqual( await pool.execute('SELECT 1::int'), 'SELECT 1') self.assertIs(pool._holders[0]._con, con) async def test_pool_max_inactive_time_02(self): async with self.create_pool( database='postgres', min_size=1, max_size=1, max_inactive_connection_lifetime=0.5) as pool: # Test that we have a new connection after pool not # being used longer than `max_inactive_connection_lifetime`. con = pool._holders[0]._con self.assertEqual( await pool.execute('SELECT 1::int'), 'SELECT 1') self.assertIs(pool._holders[0]._con, con) await asyncio.sleep(1) self.assertIs(pool._holders[0]._con, None) self.assertEqual( await pool.execute('SELECT 1::int'), 'SELECT 1') self.assertIsNot(pool._holders[0]._con, con) async def test_pool_max_inactive_time_03(self): async with self.create_pool( database='postgres', min_size=1, max_size=1, max_inactive_connection_lifetime=1) as pool: # Test that we start counting inactive time *after* # the connection is being released back to the pool. con = pool._holders[0]._con await pool.execute('SELECT pg_sleep(0.5)') await asyncio.sleep(0.6) self.assertIs(pool._holders[0]._con, con) self.assertEqual( await pool.execute('SELECT 1::int'), 'SELECT 1') self.assertIs(pool._holders[0]._con, con) async def test_pool_max_inactive_time_04(self): # Chaos test for max_inactive_connection_lifetime. DURATION = 2.0 START = time.monotonic() N = 0 async def worker(pool): nonlocal N await asyncio.sleep(random.random() / 10 + 0.1) async with pool.acquire() as con: if random.random() > 0.5: await con.execute('SELECT pg_sleep({:.2f})'.format( random.random() / 10)) self.assertEqual( await con.fetchval('SELECT 42::int'), 42) if time.monotonic() - START < DURATION: await worker(pool) N += 1 async with self.create_pool( database='postgres', min_size=10, max_size=30, max_inactive_connection_lifetime=0.1) as pool: workers = [worker(pool) for _ in range(50)] await asyncio.gather(*workers) self.assertGreaterEqual(N, 50) async def test_pool_max_inactive_time_05(self): # Test that idle never-acquired connections abide by # the max inactive lifetime. async with self.create_pool( database='postgres', min_size=2, max_size=2, max_inactive_connection_lifetime=0.2) as pool: self.assertIsNotNone(pool._holders[0]._con) self.assertIsNotNone(pool._holders[1]._con) await pool.execute('SELECT pg_sleep(0.3)') await asyncio.sleep(0.3) self.assertIs(pool._holders[0]._con, None) # The connection in the second holder was never used, # but should be closed nonetheless. self.assertIs(pool._holders[1]._con, None) async def test_pool_handles_inactive_connection_errors(self): pool = await self.create_pool(database='postgres', min_size=1, max_size=1) con = await pool.acquire(timeout=POOL_NOMINAL_TIMEOUT) true_con = con._con await pool.release(con) # we simulate network error by terminating the connection true_con.terminate() # now pool should reopen terminated connection async with pool.acquire(timeout=POOL_NOMINAL_TIMEOUT) as con: self.assertEqual(await con.fetchval('SELECT 1'), 1) await con.close() await pool.close() async def test_pool_size_and_capacity(self): async with self.create_pool( database='postgres', min_size=2, max_size=3, ) as pool: self.assertEqual(pool.get_min_size(), 2) self.assertEqual(pool.get_max_size(), 3) self.assertEqual(pool.get_size(), 2) self.assertEqual(pool.get_idle_size(), 2) async with pool.acquire(): self.assertEqual(pool.get_idle_size(), 1) async with pool.acquire(): self.assertEqual(pool.get_idle_size(), 0) async with pool.acquire(): self.assertEqual(pool.get_size(), 3) self.assertEqual(pool.get_idle_size(), 0) async def test_pool_closing(self): async with self.create_pool() as pool: self.assertFalse(pool.is_closing()) await pool.close() self.assertTrue(pool.is_closing()) async with self.create_pool() as pool: self.assertFalse(pool.is_closing()) pool.terminate() self.assertTrue(pool.is_closing()) async def test_pool_handles_transaction_exit_in_asyncgen_1(self): pool = await self.create_pool(database='postgres', min_size=1, max_size=1) locals_ = {} exec(textwrap.dedent('''\ async def iterate(con): async with con.transaction(): for record in await con.fetch("SELECT 1"): yield record '''), globals(), locals_) iterate = locals_['iterate'] class MyException(Exception): pass with self.assertRaises(MyException): async with pool.acquire() as con: async for _ in iterate(con): # noqa raise MyException() async def test_pool_handles_transaction_exit_in_asyncgen_2(self): pool = await self.create_pool(database='postgres', min_size=1, max_size=1) locals_ = {} exec(textwrap.dedent('''\ async def iterate(con): async with con.transaction(): for record in await con.fetch("SELECT 1"): yield record '''), globals(), locals_) iterate = locals_['iterate'] class MyException(Exception): pass with self.assertRaises(MyException): async with pool.acquire() as con: iterator = iterate(con) async for _ in iterator: # noqa raise MyException() del iterator async def test_pool_handles_asyncgen_finalization(self): pool = await self.create_pool(database='postgres', min_size=1, max_size=1) locals_ = {} exec(textwrap.dedent('''\ async def iterate(con): for record in await con.fetch("SELECT 1"): yield record '''), globals(), locals_) iterate = locals_['iterate'] class MyException(Exception): pass with self.assertRaises(MyException): async with pool.acquire() as con: async with con.transaction(): async for _ in iterate(con): # noqa raise MyException() async def test_pool_close_waits_for_release(self): pool = await self.create_pool(database='postgres', min_size=1, max_size=1) flag = self.loop.create_future() conn_released = False async def worker(): nonlocal conn_released async with pool.acquire() as connection: async with connection.transaction(): flag.set_result(True) await asyncio.sleep(0.1) conn_released = True self.loop.create_task(worker()) await flag await pool.close() self.assertTrue(conn_released) async def test_pool_close_timeout(self): pool = await self.create_pool(database='postgres', min_size=1, max_size=1) flag = self.loop.create_future() async def worker(): async with pool.acquire(): flag.set_result(True) await asyncio.sleep(0.5) task = self.loop.create_task(worker()) with self.assertRaises(asyncio.TimeoutError): await flag await asyncio.wait_for(pool.close(), timeout=0.1) await task async def test_pool_expire_connections(self): pool = await self.create_pool(database='postgres', min_size=1, max_size=1) con = await pool.acquire() try: await pool.expire_connections() finally: await pool.release(con) self.assertIsNone(pool._holders[0]._con) await pool.close() async def test_pool_set_connection_args(self): pool = await self.create_pool(database='postgres', min_size=1, max_size=1) # Test that connection is expired on release. con = await pool.acquire() connspec = self.get_connection_spec() try: connspec['server_settings']['application_name'] = \ 'set_conn_args_test' except KeyError: connspec['server_settings'] = { 'application_name': 'set_conn_args_test' } pool.set_connect_args(**connspec) await pool.expire_connections() await pool.release(con) con = await pool.acquire() self.assertEqual(con.get_settings().application_name, 'set_conn_args_test') await pool.release(con) # Test that connection is expired before acquire. connspec = self.get_connection_spec() try: connspec['server_settings']['application_name'] = \ 'set_conn_args_test' except KeyError: connspec['server_settings'] = { 'application_name': 'set_conn_args_test_2' } pool.set_connect_args(**connspec) await pool.expire_connections() con = await pool.acquire() self.assertEqual(con.get_settings().application_name, 'set_conn_args_test_2') await pool.release(con) await pool.close() async def test_pool_init_race(self): pool = self.create_pool(database='postgres', min_size=1, max_size=1) t1 = asyncio.ensure_future(pool) t2 = asyncio.ensure_future(pool) await t1 with self.assertRaisesRegex( asyncpg.InterfaceError, r'pool is being initialized in another task'): await t2 await pool.close() async def test_pool_init_and_use_race(self): pool = self.create_pool(database='postgres', min_size=1, max_size=1) pool_task = asyncio.ensure_future(pool) await asyncio.sleep(0) with self.assertRaisesRegex( asyncpg.InterfaceError, r'being initialized, but not yet ready'): await pool.fetchval('SELECT 1') await pool_task await pool.close() async def test_pool_remote_close(self): pool = await self.create_pool(min_size=1, max_size=1) backend_pid_fut = self.loop.create_future() async def worker(): async with pool.acquire() as conn: pool_backend_pid = await conn.fetchval( 'SELECT pg_backend_pid()') backend_pid_fut.set_result(pool_backend_pid) await asyncio.sleep(0.2) task = self.loop.create_task(worker()) try: conn = await self.connect() backend_pid = await backend_pid_fut await conn.execute('SELECT pg_terminate_backend($1)', backend_pid) finally: await conn.close() await task # Check that connection_lost has released the pool holder. conn = await pool.acquire(timeout=0.1) await pool.release(conn) @unittest.skipIf(os.environ.get('PGHOST'), 'unmanaged cluster') class TestPoolReconnectWithTargetSessionAttrs(tb.ClusterTestCase): @classmethod def setup_cluster(cls): cls.cluster = cls.new_cluster(pg_cluster.TempCluster) cls.start_cluster(cls.cluster) async def simulate_cluster_recovery_mode(self): port = self.cluster.get_connection_spec()['port'] await self.loop.run_in_executor( None, lambda: self.cluster.stop() ) # Simulate recovery mode (pathlib.Path(self.cluster._data_dir) / 'standby.signal').touch() await self.loop.run_in_executor( None, lambda: self.cluster.start( port=port, server_settings=self.get_server_settings(), ) ) async def test_full_reconnect_on_node_change_role(self): if self.cluster.get_pg_version() < (12, 0): self.skipTest("PostgreSQL < 12 cannot support standby.signal") return pool = await self.create_pool( min_size=1, max_size=1, target_session_attrs='primary' ) # Force a new connection to be created await pool.fetchval('SELECT 1') await self.simulate_cluster_recovery_mode() # current pool connection info cache is expired, # but we don't know it yet with self.assertRaises(asyncpg.TargetServerAttributeNotMatched) as cm: await pool.execute('SELECT 1') self.assertEqual( cm.exception.args[0], "None of the hosts match the target attribute requirement " "" ) # force reconnect with self.assertRaises(asyncpg.TargetServerAttributeNotMatched) as cm: await pool.execute('SELECT 1') self.assertEqual( cm.exception.args[0], "None of the hosts match the target attribute requirement " "" ) @unittest.skipIf(os.environ.get('PGHOST'), 'using remote cluster for testing') class TestHotStandby(tb.HotStandbyTestCase): def create_pool(self, **kwargs): conn_spec = self.standby_cluster.get_connection_spec() conn_spec.update(kwargs) return pg_pool.create_pool(loop=self.loop, **conn_spec) async def test_standby_pool_01(self): for n in {1, 3, 5, 10, 20, 100}: with self.subTest(tasksnum=n): pool = await self.create_pool( database='postgres', user='postgres', min_size=5, max_size=10) async def worker(): con = await pool.acquire() self.assertEqual(await con.fetchval('SELECT 1'), 1) await pool.release(con) tasks = [worker() for _ in range(n)] await asyncio.gather(*tasks) await pool.close() async def test_standby_cursors(self): con = await self.standby_cluster.connect( database='postgres', user='postgres', loop=self.loop) try: async with con.transaction(): cursor = await con.cursor('SELECT 1') self.assertEqual(await cursor.fetchrow(), (1,)) finally: await con.close() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/test_prepare.py0000644000175100001770000005426314705014413017065 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncio import asyncpg import gc import unittest from asyncpg import _testbase as tb from asyncpg import exceptions class TestPrepare(tb.ConnectedTestCase): async def test_prepare_01(self): self.assertEqual(self.con._protocol.queries_count, 0) st = await self.con.prepare('SELECT 1 = $1 AS test') self.assertEqual(self.con._protocol.queries_count, 0) self.assertEqual(st.get_query(), 'SELECT 1 = $1 AS test') rec = await st.fetchrow(1) self.assertEqual(self.con._protocol.queries_count, 1) self.assertTrue(rec['test']) self.assertEqual(len(rec), 1) self.assertEqual(False, await st.fetchval(10)) self.assertEqual(self.con._protocol.queries_count, 2) async def test_prepare_02(self): with self.assertRaisesRegex(Exception, 'column "a" does not exist'): await self.con.prepare('SELECT a') async def test_prepare_03(self): cases = [ ('text', ("'NULL'", 'NULL'), [ 'aaa', None ]), ('decimal', ('0', 0), [ 123, 123.5, None ]) ] for type, (none_name, none_val), vals in cases: st = await self.con.prepare(''' SELECT CASE WHEN $1::{type} IS NULL THEN {default} ELSE $1::{type} END'''.format( type=type, default=none_name)) for val in vals: with self.subTest(type=type, value=val): res = await st.fetchval(val) if val is None: self.assertEqual(res, none_val) else: self.assertEqual(res, val) async def test_prepare_04(self): s = await self.con.prepare('SELECT $1::smallint') self.assertEqual(await s.fetchval(10), 10) s = await self.con.prepare('SELECT $1::smallint * 2') self.assertEqual(await s.fetchval(10), 20) s = await self.con.prepare('SELECT generate_series(5,10)') self.assertEqual(await s.fetchval(), 5) # Since the "execute" message was sent with a limit=1, # we will receive a PortalSuspended message, instead of # CommandComplete. Which means there will be no status # message set. self.assertIsNone(s.get_statusmsg()) # Repeat the same test for 'fetchrow()'. self.assertEqual(await s.fetchrow(), (5,)) self.assertIsNone(s.get_statusmsg()) async def test_prepare_05_unknownoid(self): s = await self.con.prepare("SELECT 'test'") self.assertEqual(await s.fetchval(), 'test') async def test_prepare_06_interrupted_close(self): stmt = await self.con.prepare('''SELECT pg_sleep(10)''') fut = self.loop.create_task(stmt.fetch()) await asyncio.sleep(0.2) self.assertFalse(self.con.is_closed()) await self.con.close() self.assertTrue(self.con.is_closed()) with self.assertRaises(asyncpg.QueryCanceledError): await fut # Test that it's OK to call close again await self.con.close() async def test_prepare_07_interrupted_terminate(self): stmt = await self.con.prepare('''SELECT pg_sleep(10)''') fut = self.loop.create_task(stmt.fetchval()) await asyncio.sleep(0.2) self.assertFalse(self.con.is_closed()) self.con.terminate() self.assertTrue(self.con.is_closed()) with self.assertRaisesRegex(asyncpg.ConnectionDoesNotExistError, 'closed in the middle'): await fut # Test that it's OK to call terminate again self.con.terminate() async def test_prepare_08_big_result(self): stmt = await self.con.prepare('select generate_series(0,10000)') result = await stmt.fetch() self.assertEqual(len(result), 10001) self.assertEqual( [r[0] for r in result], list(range(10001))) async def test_prepare_09_raise_error(self): # Stress test ReadBuffer.read_cstr() msg = '0' * 1024 * 100 query = """ DO language plpgsql $$ BEGIN RAISE EXCEPTION '{}'; END $$;""".format(msg) stmt = await self.con.prepare(query) with self.assertRaisesRegex(asyncpg.RaiseError, msg): with tb.silence_asyncio_long_exec_warning(): await stmt.fetchval() async def test_prepare_10_stmt_lru(self): cache = self.con._stmt_cache query = 'select {}' cache_max = cache.get_max_size() iter_max = cache_max * 2 + 11 # First, we have no cached statements. self.assertEqual(len(cache), 0) stmts = [] for i in range(iter_max): s = await self.con._prepare(query.format(i), use_cache=True) self.assertEqual(await s.fetchval(), i) stmts.append(s) # At this point our cache should be full. self.assertEqual(len(cache), cache_max) self.assertTrue(all(not s.closed for s in cache.iter_statements())) # Since there are references to the statements (`stmts` list), # no statements are scheduled to be closed. self.assertEqual(len(self.con._stmts_to_close), 0) # Removing refs to statements and preparing a new statement # will cause connection to cleanup any stale statements. stmts.clear() gc.collect() # Now we have a bunch of statements that have no refs to them # scheduled to be closed. self.assertEqual(len(self.con._stmts_to_close), iter_max - cache_max) self.assertTrue(all(s.closed for s in self.con._stmts_to_close)) self.assertTrue(all(not s.closed for s in cache.iter_statements())) zero = await self.con.prepare(query.format(0)) # Hence, all stale statements should be closed now. self.assertEqual(len(self.con._stmts_to_close), 0) # The number of cached statements will stay the same though. self.assertEqual(len(cache), cache_max) self.assertTrue(all(not s.closed for s in cache.iter_statements())) # After closing all statements will be closed. await self.con.close() self.assertEqual(len(self.con._stmts_to_close), 0) self.assertEqual(len(cache), 0) # An attempt to perform an operation on a closed statement # will trigger an error. with self.assertRaisesRegex(asyncpg.InterfaceError, 'is closed'): await zero.fetchval() async def test_prepare_11_stmt_gc(self): # Test that prepared statements should stay in the cache after # they are GCed. cache = self.con._stmt_cache # First, we have no cached statements. self.assertEqual(len(cache), 0) self.assertEqual(len(self.con._stmts_to_close), 0) # The prepared statement that we'll create will be GCed # right await. However, its state should be still in # in the statements LRU cache. await self.con._prepare('select 1', use_cache=True) gc.collect() self.assertEqual(len(cache), 1) self.assertEqual(len(self.con._stmts_to_close), 0) async def test_prepare_12_stmt_gc(self): # Test that prepared statements are closed when there is no space # for them in the LRU cache and there are no references to them. cache = self.con._stmt_cache cache_max = cache.get_max_size() # First, we have no cached statements. self.assertEqual(len(cache), 0) self.assertEqual(len(self.con._stmts_to_close), 0) stmt = await self.con._prepare('select 100000000', use_cache=True) self.assertEqual(len(cache), 1) self.assertEqual(len(self.con._stmts_to_close), 0) for i in range(cache_max): await self.con._prepare('select {}'.format(i), use_cache=True) self.assertEqual(len(cache), cache_max) self.assertEqual(len(self.con._stmts_to_close), 0) del stmt gc.collect() self.assertEqual(len(cache), cache_max) self.assertEqual(len(self.con._stmts_to_close), 1) async def test_prepare_13_connect(self): v = await self.con.fetchval( 'SELECT $1::smallint AS foo', 10, column='foo') self.assertEqual(v, 10) r = await self.con.fetchrow('SELECT $1::smallint * 2 AS test', 10) self.assertEqual(r['test'], 20) rows = await self.con.fetch('SELECT generate_series(0,$1::int)', 3) self.assertEqual([r[0] for r in rows], [0, 1, 2, 3]) async def test_prepare_14_explain(self): # Test simple EXPLAIN. stmt = await self.con.prepare('SELECT typname FROM pg_type') plan = await stmt.explain() self.assertEqual(plan[0]['Plan']['Relation Name'], 'pg_type') # Test "EXPLAIN ANALYZE". stmt = await self.con.prepare( 'SELECT typname, typlen FROM pg_type WHERE typlen > $1') plan = await stmt.explain(2, analyze=True) self.assertEqual(plan[0]['Plan']['Relation Name'], 'pg_type') self.assertIn('Actual Total Time', plan[0]['Plan']) # Test that 'EXPLAIN ANALYZE' is executed in a transaction # that gets rollbacked. tr = self.con.transaction() await tr.start() try: await self.con.execute('CREATE TABLE mytab (a int)') stmt = await self.con.prepare( 'INSERT INTO mytab (a) VALUES (1), (2)') plan = await stmt.explain(analyze=True) self.assertEqual(plan[0]['Plan']['Operation'], 'Insert') # Check that no data was inserted res = await self.con.fetch('SELECT * FROM mytab') self.assertEqual(res, []) finally: await tr.rollback() async def test_prepare_15_stmt_gc_cache_disabled(self): # Test that even if the statements cache is off, we're still # cleaning up GCed statements. cache = self.con._stmt_cache self.assertEqual(len(cache), 0) self.assertEqual(len(self.con._stmts_to_close), 0) # Disable cache cache.set_max_size(0) stmt = await self.con._prepare('select 100000000', use_cache=True) self.assertEqual(len(cache), 0) self.assertEqual(len(self.con._stmts_to_close), 0) del stmt gc.collect() # After GC, _stmts_to_close should contain stmt's state self.assertEqual(len(cache), 0) self.assertEqual(len(self.con._stmts_to_close), 1) # Next "prepare" call will trigger a cleanup stmt = await self.con._prepare('select 1', use_cache=True) self.assertEqual(len(cache), 0) self.assertEqual(len(self.con._stmts_to_close), 0) del stmt async def test_prepare_16_command_result(self): async def status(query): stmt = await self.con.prepare(query) await stmt.fetch() return stmt.get_statusmsg() try: self.assertEqual( await status('CREATE TABLE mytab (a int)'), 'CREATE TABLE') self.assertEqual( await status('INSERT INTO mytab (a) VALUES (1), (2)'), 'INSERT 0 2') self.assertEqual( await status('SELECT a FROM mytab'), 'SELECT 2') self.assertEqual( await status('UPDATE mytab SET a = 3 WHERE a = 1'), 'UPDATE 1') finally: self.assertEqual( await status('DROP TABLE mytab'), 'DROP TABLE') async def test_prepare_17_stmt_closed_lru(self): st = await self.con.prepare('SELECT 1') st._state.mark_closed() with self.assertRaisesRegex(asyncpg.InterfaceError, 'is closed'): await st.fetch() st = await self.con.prepare('SELECT 1') self.assertEqual(await st.fetchval(), 1) async def test_prepare_18_empty_result(self): # test EmptyQueryResponse protocol message st = await self.con.prepare('') self.assertEqual(await st.fetch(), []) self.assertIsNone(await st.fetchval()) self.assertIsNone(await st.fetchrow()) self.assertEqual(await self.con.fetch(''), []) self.assertIsNone(await self.con.fetchval('')) self.assertIsNone(await self.con.fetchrow('')) async def test_prepare_19_concurrent_calls(self): st = self.loop.create_task(self.con.fetchval( 'SELECT ROW(pg_sleep(0.1), 1)')) # Wait for some time to make sure the first query is fully # prepared (!) and is now awaiting the results (!!). await asyncio.sleep(0.01) with self.assertRaisesRegex(asyncpg.InterfaceError, 'another operation'): await self.con.execute('SELECT 2') self.assertEqual(await st, (None, 1)) async def test_prepare_20_concurrent_calls(self): expected = ((None, 1),) for methname, val in [('fetch', [expected]), ('fetchval', expected[0]), ('fetchrow', expected)]: with self.subTest(meth=methname): meth = getattr(self.con, methname) vf = self.loop.create_task( meth('SELECT ROW(pg_sleep(0.1), 1)')) await asyncio.sleep(0.01) with self.assertRaisesRegex(asyncpg.InterfaceError, 'another operation'): await meth('SELECT 2') self.assertEqual(await vf, val) async def test_prepare_21_errors(self): stmt = await self.con.prepare('SELECT 10 / $1::int') with self.assertRaises(asyncpg.DivisionByZeroError): await stmt.fetchval(0) self.assertEqual(await stmt.fetchval(5), 2) async def test_prepare_22_empty(self): # Support for empty target list was added in PostgreSQL 9.4 if self.server_version < (9, 4): raise unittest.SkipTest( 'PostgreSQL servers < 9.4 do not support empty target list.') result = await self.con.fetchrow('SELECT') self.assertEqual(result, ()) self.assertEqual(repr(result), '') async def test_prepare_statement_invalid(self): await self.con.execute('CREATE TABLE tab1(a int, b int)') try: await self.con.execute('INSERT INTO tab1 VALUES (1, 2)') stmt = await self.con.prepare('SELECT * FROM tab1') await self.con.execute( 'ALTER TABLE tab1 ALTER COLUMN b SET DATA TYPE text') with self.assertRaisesRegex(asyncpg.InvalidCachedStatementError, 'cached statement plan is invalid'): await stmt.fetchrow() finally: await self.con.execute('DROP TABLE tab1') @tb.with_connection_options(statement_cache_size=0) async def test_prepare_23_no_stmt_cache_seq(self): self.assertEqual(self.con._stmt_cache.get_max_size(), 0) async def check_simple(): # Run a simple query a few times. self.assertEqual(await self.con.fetchval('SELECT 1'), 1) self.assertEqual(await self.con.fetchval('SELECT 2'), 2) self.assertEqual(await self.con.fetchval('SELECT 1'), 1) await check_simple() # Run a query that timeouts. with self.assertRaises(asyncio.TimeoutError): await self.con.fetchrow('select pg_sleep(10)', timeout=0.02) # Check that we can run new queries after a timeout. await check_simple() # Try a cursor/timeout combination. Cursors should always use # named prepared statements. async with self.con.transaction(): with self.assertRaises(asyncio.TimeoutError): async for _ in self.con.cursor( # NOQA 'select pg_sleep(10)', timeout=0.1): pass # Check that we can run queries after a failed cursor # operation. await check_simple() @tb.with_connection_options(max_cached_statement_lifetime=142) async def test_prepare_24_max_lifetime(self): cache = self.con._stmt_cache self.assertEqual(cache.get_max_lifetime(), 142) cache.set_max_lifetime(1) s = await self.con._prepare('SELECT 1', use_cache=True) state = s._state s = await self.con._prepare('SELECT 1', use_cache=True) self.assertIs(s._state, state) s = await self.con._prepare('SELECT 1', use_cache=True) self.assertIs(s._state, state) await asyncio.sleep(1) s = await self.con._prepare('SELECT 1', use_cache=True) self.assertIsNot(s._state, state) @tb.with_connection_options(max_cached_statement_lifetime=0.5) async def test_prepare_25_max_lifetime_reset(self): cache = self.con._stmt_cache s = await self.con._prepare('SELECT 1', use_cache=True) state = s._state # Disable max_lifetime cache.set_max_lifetime(0) await asyncio.sleep(1) # The statement should still be cached (as we disabled the timeout). s = await self.con._prepare('SELECT 1', use_cache=True) self.assertIs(s._state, state) @tb.with_connection_options(max_cached_statement_lifetime=0.5) async def test_prepare_26_max_lifetime_max_size(self): cache = self.con._stmt_cache s = await self.con._prepare('SELECT 1', use_cache=True) state = s._state # Disable max_lifetime cache.set_max_size(0) s = await self.con._prepare('SELECT 1', use_cache=True) self.assertIsNot(s._state, state) # Check that nothing crashes after the initial timeout await asyncio.sleep(1) @tb.with_connection_options(max_cacheable_statement_size=50) async def test_prepare_27_max_cacheable_statement_size(self): cache = self.con._stmt_cache await self.con._prepare('SELECT 1', use_cache=True) self.assertEqual(len(cache), 1) # Test that long and explicitly created prepared statements # are not cached. await self.con._prepare("SELECT \'" + "a" * 50 + "\'", use_cache=True) self.assertEqual(len(cache), 1) # Test that implicitly created long prepared statements # are not cached. await self.con.fetchval("SELECT \'" + "a" * 50 + "\'") self.assertEqual(len(cache), 1) # Test that short prepared statements can still be cached. await self.con._prepare('SELECT 2', use_cache=True) self.assertEqual(len(cache), 2) async def test_prepare_28_max_args(self): N = 32768 args = ','.join('${}'.format(i) for i in range(1, N + 1)) query = 'SELECT ARRAY[{}]'.format(args) with self.assertRaisesRegex( exceptions.InterfaceError, 'the number of query arguments cannot exceed 32767'): await self.con.fetchval(query, *range(1, N + 1)) async def test_prepare_29_duplicates(self): # In addition to test_record.py, let's have a full functional # test for records with duplicate keys. r = await self.con.fetchrow('SELECT 1 as a, 2 as b, 3 as a') self.assertEqual(list(r.items()), [('a', 1), ('b', 2), ('a', 3)]) self.assertEqual(list(r.keys()), ['a', 'b', 'a']) self.assertEqual(list(r.values()), [1, 2, 3]) self.assertEqual(r['a'], 3) self.assertEqual(r['b'], 2) self.assertEqual(r[0], 1) self.assertEqual(r[1], 2) self.assertEqual(r[2], 3) async def test_prepare_30_invalid_arg_count(self): with self.assertRaisesRegex( exceptions.InterfaceError, 'the server expects 1 argument for this query, 0 were passed'): await self.con.fetchval('SELECT $1::int') with self.assertRaisesRegex( exceptions.InterfaceError, 'the server expects 0 arguments for this query, 1 was passed'): await self.con.fetchval('SELECT 1', 1) async def test_prepare_31_pgbouncer_note(self): try: await self.con.execute(""" DO $$ BEGIN RAISE EXCEPTION 'duplicate statement' USING ERRCODE = '42P05'; END; $$ LANGUAGE plpgsql; """) except asyncpg.DuplicatePreparedStatementError as e: self.assertTrue('pgbouncer' in e.hint) else: self.fail('DuplicatePreparedStatementError not raised') try: await self.con.execute(""" DO $$ BEGIN RAISE EXCEPTION 'invalid statement' USING ERRCODE = '26000'; END; $$ LANGUAGE plpgsql; """) except asyncpg.InvalidSQLStatementNameError as e: self.assertTrue('pgbouncer' in e.hint) else: self.fail('InvalidSQLStatementNameError not raised') async def test_prepare_does_not_use_cache(self): cache = self.con._stmt_cache # prepare with disabled cache await self.con.prepare('select 1') self.assertEqual(len(cache), 0) async def test_prepare_explicitly_named(self): ps = await self.con.prepare('select 1', name='foobar') self.assertEqual(ps.get_name(), 'foobar') self.assertEqual(await self.con.fetchval('EXECUTE foobar'), 1) with self.assertRaisesRegex( exceptions.DuplicatePreparedStatementError, 'prepared statement "foobar" already exists', ): await self.con.prepare('select 1', name='foobar') async def test_prepare_fetchmany(self): tr = self.con.transaction() await tr.start() try: await self.con.execute('CREATE TABLE fetchmany (a int, b text)') stmt = await self.con.prepare( 'INSERT INTO fetchmany (a, b) VALUES ($1, $2) RETURNING a, b' ) result = await stmt.fetchmany([(1, 'a'), (2, 'b'), (3, 'c')]) self.assertEqual(result, [(1, 'a'), (2, 'b'), (3, 'c')]) finally: await tr.rollback() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/test_record.py0000644000175100001770000004371014705014413016700 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import contextlib import collections import gc import pickle import sys import asyncpg from asyncpg import _testbase as tb from asyncpg.protocol.protocol import _create_record as Record R_A = collections.OrderedDict([('a', 0)]) R_AB = collections.OrderedDict([('a', 0), ('b', 1)]) R_AC = collections.OrderedDict([('a', 0), ('c', 1)]) R_ABC = collections.OrderedDict([('a', 0), ('b', 1), ('c', 2)]) class CustomRecord(asyncpg.Record): pass class AnotherCustomRecord(asyncpg.Record): pass class TestRecord(tb.ConnectedTestCase): @contextlib.contextmanager def checkref(self, *objs): cnt = [sys.getrefcount(objs[i]) for i in range(len(objs))] yield for _ in range(3): gc.collect() for i in range(len(objs)): before = cnt[i] after = sys.getrefcount(objs[i]) if before != after: self.fail('refcounts differ for {!r}: {:+}'.format( objs[i], after - before)) def test_record_gc(self): elem = object() mapping = {} with self.checkref(mapping, elem): r = Record(mapping, (elem,)) del r key = 'spam' val = int('101010') mapping = {key: val} with self.checkref(key, val): r = Record(mapping, (0,)) with self.assertRaises(RuntimeError): r[key] del r key = 'spam' val = 'ham' mapping = {key: val} with self.checkref(key, val): r = Record(mapping, (0,)) with self.assertRaises(RuntimeError): r[key] del r def test_record_freelist_ok(self): for _ in range(10000): Record(R_A, (42,)) Record(R_AB, (42, 42,)) def test_record_len_getindex(self): r = Record(R_A, (42,)) self.assertEqual(len(r), 1) self.assertEqual(r[0], 42) self.assertEqual(r['a'], 42) r = Record(R_AB, (42, 43)) self.assertEqual(len(r), 2) self.assertEqual(r[0], 42) self.assertEqual(r[1], 43) self.assertEqual(r['a'], 42) self.assertEqual(r['b'], 43) with self.assertRaisesRegex(IndexError, 'record index out of range'): r[1000] with self.assertRaisesRegex(KeyError, 'spam'): r['spam'] with self.assertRaisesRegex(KeyError, 'spam'): Record(None, (1,))['spam'] with self.assertRaisesRegex(RuntimeError, 'invalid record descriptor'): Record({'spam': 123}, (1,))['spam'] def test_record_slice(self): r = Record(R_ABC, (1, 2, 3)) self.assertEqual(r[:], (1, 2, 3)) self.assertEqual(r[:1], (1,)) self.assertEqual(r[::-1], (3, 2, 1)) self.assertEqual(r[::-2], (3, 1)) self.assertEqual(r[1:2], (2,)) self.assertEqual(r[2:2], ()) def test_record_immutable(self): r = Record(R_A, (42,)) with self.assertRaisesRegex(TypeError, 'does not support item'): r[0] = 1 def test_record_repr(self): self.assertEqual( repr(Record(R_A, (42,))), '') self.assertEqual( repr(Record(R_AB, (42, -1))), '') # test invalid records just in case with self.assertRaisesRegex(RuntimeError, 'invalid .* mapping'): repr(Record(R_A, (42, 43))) self.assertEqual(repr(Record(R_AB, (42,))), '') class Key: def __str__(self): 1 / 0 def __repr__(self): 1 / 0 with self.assertRaises(ZeroDivisionError): repr(Record({Key(): 0}, (42,))) with self.assertRaises(ZeroDivisionError): repr(Record(R_A, (Key(),))) def test_record_iter(self): r = Record(R_AB, (42, 43)) with self.checkref(r): self.assertEqual(iter(r).__length_hint__(), 2) self.assertEqual(tuple(r), (42, 43)) def test_record_values(self): r = Record(R_AB, (42, 43)) vv = r.values() self.assertEqual(tuple(vv), (42, 43)) self.assertTrue(repr(vv).startswith('') self.assertEqual(str(r), '') with self.assertRaisesRegex(KeyError, 'aaa'): r['aaa'] self.assertEqual(dict(r.items()), {}) self.assertEqual(list(r.keys()), []) self.assertEqual(list(r.values()), []) async def test_record_duplicate_colnames(self): """Test that Record handles duplicate column names.""" records_descs = [ [('a', 1)], [('a', 1), ('a', 2)], [('a', 1), ('b', 2), ('a', 3)], [('a', 1), ('b', 2), ('a', 3), ('c', 4), ('b', 5)], ] for desc in records_descs: items = collections.OrderedDict(desc) query = 'SELECT ' + ', '.join( ['{} as {}'.format(p[1], p[0]) for p in desc]) with self.subTest(query=query): r = await self.con.fetchrow(query) for idx, (field, val) in enumerate(desc): self.assertEqual(r[idx], val) self.assertEqual(r[field], items[field]) expected_repr = ''.format( ' '.join('{}={}'.format(p[0], p[1]) for p in desc)) self.assertEqual(repr(r), expected_repr) self.assertEqual(list(r.items()), desc) self.assertEqual(list(r.values()), [p[1] for p in desc]) self.assertEqual(list(r.keys()), [p[0] for p in desc]) async def test_record_isinstance(self): """Test that Record works with isinstance.""" r = await self.con.fetchrow('SELECT 1 as a, 2 as b') self.assertTrue(isinstance(r, asyncpg.Record)) async def test_record_no_new(self): """Instances of Record cannot be directly created.""" with self.assertRaisesRegex( TypeError, "cannot create 'asyncpg.Record' instances"): asyncpg.Record() @tb.with_connection_options(record_class=CustomRecord) async def test_record_subclass_01(self): r = await self.con.fetchrow("SELECT 1 as a, '2' as b") self.assertIsInstance(r, CustomRecord) r = await self.con.fetch("SELECT 1 as a, '2' as b") self.assertIsInstance(r[0], CustomRecord) async with self.con.transaction(): cur = await self.con.cursor("SELECT 1 as a, '2' as b") r = await cur.fetchrow() self.assertIsInstance(r, CustomRecord) cur = await self.con.cursor("SELECT 1 as a, '2' as b") r = await cur.fetch(1) self.assertIsInstance(r[0], CustomRecord) async with self.con.transaction(): cur = self.con.cursor("SELECT 1 as a, '2' as b") async for r in cur: self.assertIsInstance(r, CustomRecord) ps = await self.con.prepare("SELECT 1 as a, '2' as b") r = await ps.fetchrow() self.assertIsInstance(r, CustomRecord) async def test_record_subclass_02(self): r = await self.con.fetchrow( "SELECT 1 as a, '2' as b", record_class=CustomRecord, ) self.assertIsInstance(r, CustomRecord) r = await self.con.fetch( "SELECT 1 as a, '2' as b", record_class=CustomRecord, ) self.assertIsInstance(r[0], CustomRecord) async with self.con.transaction(): cur = await self.con.cursor( "SELECT 1 as a, '2' as b", record_class=CustomRecord, ) r = await cur.fetchrow() self.assertIsInstance(r, CustomRecord) cur = await self.con.cursor( "SELECT 1 as a, '2' as b", record_class=CustomRecord, ) r = await cur.fetch(1) self.assertIsInstance(r[0], CustomRecord) async with self.con.transaction(): cur = self.con.cursor( "SELECT 1 as a, '2' as b", record_class=CustomRecord, ) async for r in cur: self.assertIsInstance(r, CustomRecord) ps = await self.con.prepare( "SELECT 1 as a, '2' as b", record_class=CustomRecord, ) r = await ps.fetchrow() self.assertIsInstance(r, CustomRecord) r = await ps.fetch() self.assertIsInstance(r[0], CustomRecord) @tb.with_connection_options(record_class=AnotherCustomRecord) async def test_record_subclass_03(self): r = await self.con.fetchrow( "SELECT 1 as a, '2' as b", record_class=CustomRecord, ) self.assertIsInstance(r, CustomRecord) r = await self.con.fetch( "SELECT 1 as a, '2' as b", record_class=CustomRecord, ) self.assertIsInstance(r[0], CustomRecord) async with self.con.transaction(): cur = await self.con.cursor( "SELECT 1 as a, '2' as b", record_class=CustomRecord, ) r = await cur.fetchrow() self.assertIsInstance(r, CustomRecord) cur = await self.con.cursor( "SELECT 1 as a, '2' as b", record_class=CustomRecord, ) r = await cur.fetch(1) self.assertIsInstance(r[0], CustomRecord) async with self.con.transaction(): cur = self.con.cursor( "SELECT 1 as a, '2' as b", record_class=CustomRecord, ) async for r in cur: self.assertIsInstance(r, CustomRecord) ps = await self.con.prepare( "SELECT 1 as a, '2' as b", record_class=CustomRecord, ) r = await ps.fetchrow() self.assertIsInstance(r, CustomRecord) r = await ps.fetch() self.assertIsInstance(r[0], CustomRecord) @tb.with_connection_options(record_class=CustomRecord) async def test_record_subclass_04(self): r = await self.con.fetchrow( "SELECT 1 as a, '2' as b", record_class=asyncpg.Record, ) self.assertIs(type(r), asyncpg.Record) r = await self.con.fetch( "SELECT 1 as a, '2' as b", record_class=asyncpg.Record, ) self.assertIs(type(r[0]), asyncpg.Record) async with self.con.transaction(): cur = await self.con.cursor( "SELECT 1 as a, '2' as b", record_class=asyncpg.Record, ) r = await cur.fetchrow() self.assertIs(type(r), asyncpg.Record) cur = await self.con.cursor( "SELECT 1 as a, '2' as b", record_class=asyncpg.Record, ) r = await cur.fetch(1) self.assertIs(type(r[0]), asyncpg.Record) async with self.con.transaction(): cur = self.con.cursor( "SELECT 1 as a, '2' as b", record_class=asyncpg.Record, ) async for r in cur: self.assertIs(type(r), asyncpg.Record) ps = await self.con.prepare( "SELECT 1 as a, '2' as b", record_class=asyncpg.Record, ) r = await ps.fetchrow() self.assertIs(type(r), asyncpg.Record) r = await ps.fetch() self.assertIs(type(r[0]), asyncpg.Record) async def test_record_subclass_05(self): class MyRecord(asyncpg.Record): pass r = await self.con.fetchrow( "SELECT 1 as a, '2' as b", record_class=MyRecord, ) self.assertIsInstance(r, MyRecord) self.assertEqual(repr(r), "") self.assertEqual(list(r.items()), [('a', 1), ('b', '2')]) self.assertEqual(list(r.keys()), ['a', 'b']) self.assertEqual(list(r.values()), [1, '2']) self.assertIn('b', r) self.assertEqual(next(iter(r)), 1) async def test_record_subclass_06(self): class MyRecord(asyncpg.Record): def __init__(self): raise AssertionError('this is not supposed to be called') class MyRecord2(asyncpg.Record): def __new__(cls): raise AssertionError('this is not supposed to be called') class MyRecordBad: pass with self.assertRaisesRegex( asyncpg.InterfaceError, 'record_class must not redefine __new__ or __init__', ): await self.con.fetchrow( "SELECT 1 as a, '2' as b", record_class=MyRecord, ) with self.assertRaisesRegex( asyncpg.InterfaceError, 'record_class must not redefine __new__ or __init__', ): await self.con.fetchrow( "SELECT 1 as a, '2' as b", record_class=MyRecord2, ) with self.assertRaisesRegex( asyncpg.InterfaceError, 'record_class is expected to be a subclass of asyncpg.Record', ): await self.con.fetchrow( "SELECT 1 as a, '2' as b", record_class=MyRecordBad, ) with self.assertRaisesRegex( asyncpg.InterfaceError, 'record_class is expected to be a subclass of asyncpg.Record', ): await self.connect(record_class=MyRecordBad) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/test_test.py0000644000175100001770000000241114705014413016372 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncio import types import unittest from asyncpg import _testbase as tb class BaseSimpleTestCase: async def test_tests_zero_error(self): await asyncio.sleep(0.01) 1 / 0 class TestTests(unittest.TestCase): def test_tests_fail_1(self): SimpleTestCase = types.new_class('SimpleTestCase', (BaseSimpleTestCase, tb.TestCase)) suite = unittest.TestSuite() suite.addTest(SimpleTestCase('test_tests_zero_error')) result = unittest.TestResult() suite.run(result) self.assertIn('ZeroDivisionError', result.errors[0][1]) class TestHelpers(tb.TestCase): async def test_tests_assertLoopErrorHandlerCalled_01(self): with self.assertRaisesRegex(AssertionError, r'no message.*was logged'): with self.assertLoopErrorHandlerCalled('aa'): self.loop.call_exception_handler({'message': 'bb a bb'}) with self.assertLoopErrorHandlerCalled('aa'): self.loop.call_exception_handler({'message': 'bbaabb'}) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/test_timeout.py0000644000175100001770000001453514705014413017113 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncio import asyncpg from asyncpg import connection as pg_connection from asyncpg import _testbase as tb MAX_RUNTIME = 0.5 class TestTimeout(tb.ConnectedTestCase): async def test_timeout_01(self): for methname in {'fetch', 'fetchrow', 'fetchval', 'execute'}: with self.assertRaises(asyncio.TimeoutError), \ self.assertRunUnder(MAX_RUNTIME): meth = getattr(self.con, methname) await meth('select pg_sleep(10)', timeout=0.02) self.assertEqual(await self.con.fetch('select 1'), [(1,)]) async def test_timeout_02(self): st = await self.con.prepare('select pg_sleep(10)') for methname in {'fetch', 'fetchrow', 'fetchval'}: with self.assertRaises(asyncio.TimeoutError), \ self.assertRunUnder(MAX_RUNTIME): meth = getattr(st, methname) await meth(timeout=0.02) self.assertEqual(await self.con.fetch('select 1'), [(1,)]) async def test_timeout_03(self): task = self.loop.create_task( self.con.fetch('select pg_sleep(10)', timeout=0.2)) await asyncio.sleep(0.05) task.cancel() with self.assertRaises(asyncio.CancelledError), \ self.assertRunUnder(MAX_RUNTIME): await task self.assertEqual(await self.con.fetch('select 1'), [(1,)]) async def test_timeout_04(self): st = await self.con.prepare('select pg_sleep(10)', timeout=0.1) with self.assertRaises(asyncio.TimeoutError), \ self.assertRunUnder(MAX_RUNTIME): async with self.con.transaction(): async for _ in st.cursor(timeout=0.1): # NOQA pass self.assertEqual(await self.con.fetch('select 1'), [(1,)]) st = await self.con.prepare('select pg_sleep(10)', timeout=0.1) async with self.con.transaction(): cur = await st.cursor() with self.assertRaises(asyncio.TimeoutError), \ self.assertRunUnder(MAX_RUNTIME): await cur.fetch(1, timeout=0.1) self.assertEqual(await self.con.fetch('select 1'), [(1,)]) async def test_timeout_05(self): # Stress-test timeouts - try to trigger a race condition # between a cancellation request to Postgres and next # query (SELECT 1) for _ in range(500): with self.assertRaises(asyncio.TimeoutError): await self.con.fetch('SELECT pg_sleep(1)', timeout=1e-10) self.assertEqual(await self.con.fetch('SELECT 1'), [(1,)]) async def test_timeout_06(self): async with self.con.transaction(): with self.assertRaises(asyncio.TimeoutError), \ self.assertRunUnder(MAX_RUNTIME): async for _ in self.con.cursor( # NOQA 'select pg_sleep(10)', timeout=0.1): pass self.assertEqual(await self.con.fetch('select 1'), [(1,)]) async with self.con.transaction(): cur = await self.con.cursor('select pg_sleep(10)') with self.assertRaises(asyncio.TimeoutError), \ self.assertRunUnder(MAX_RUNTIME): await cur.fetch(1, timeout=0.1) async with self.con.transaction(): cur = await self.con.cursor('select pg_sleep(10)') with self.assertRaises(asyncio.TimeoutError), \ self.assertRunUnder(MAX_RUNTIME): await cur.forward(1, timeout=1e-10) async with self.con.transaction(): cur = await self.con.cursor('select pg_sleep(10)') with self.assertRaises(asyncio.TimeoutError), \ self.assertRunUnder(MAX_RUNTIME): await cur.fetchrow(timeout=0.1) async with self.con.transaction(): cur = await self.con.cursor('select pg_sleep(10)') with self.assertRaises(asyncio.TimeoutError), \ self.assertRunUnder(MAX_RUNTIME): await cur.fetchrow(timeout=0.1) with self.assertRaises(asyncpg.InFailedSQLTransactionError): await cur.fetch(1) self.assertEqual(await self.con.fetch('select 1'), [(1,)]) async def test_invalid_timeout(self): for command_timeout in ('a', False, -1): with self.subTest(command_timeout=command_timeout): with self.assertRaisesRegex(ValueError, 'invalid command_timeout'): await self.connect(command_timeout=command_timeout) # Note: negative timeouts are OK for method calls. for methname in {'fetch', 'fetchrow', 'fetchval', 'execute'}: for timeout in ('a', False): with self.subTest(timeout=timeout): with self.assertRaisesRegex(ValueError, 'invalid timeout'): await self.con.execute('SELECT 1', timeout=timeout) class TestConnectionCommandTimeout(tb.ConnectedTestCase): @tb.with_connection_options(command_timeout=0.2) async def test_command_timeout_01(self): for methname in {'fetch', 'fetchrow', 'fetchval', 'execute'}: with self.assertRaises(asyncio.TimeoutError), \ self.assertRunUnder(MAX_RUNTIME): meth = getattr(self.con, methname) await meth('select pg_sleep(10)') self.assertEqual(await self.con.fetch('select 1'), [(1,)]) class SlowPrepareConnection(pg_connection.Connection): """Connection class to test timeouts.""" async def _get_statement(self, query, timeout, **kwargs): await asyncio.sleep(0.3) return await super()._get_statement(query, timeout, **kwargs) class TestTimeoutCoversPrepare(tb.ConnectedTestCase): @tb.with_connection_options(connection_class=SlowPrepareConnection, command_timeout=0.3) async def test_timeout_covers_prepare_01(self): for methname in {'fetch', 'fetchrow', 'fetchval', 'execute'}: with self.assertRaises(asyncio.TimeoutError): meth = getattr(self.con, methname) await meth('select pg_sleep($1)', 0.2) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/test_transaction.py0000644000175100001770000002262714705014413017753 0ustar00runnerdocker# Copyright (C) 2016-present the asyncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncpg from asyncpg import _testbase as tb class TestTransaction(tb.ConnectedTestCase): async def test_transaction_regular(self): self.assertIsNone(self.con._top_xact) self.assertFalse(self.con.is_in_transaction()) tr = self.con.transaction() self.assertIsNone(self.con._top_xact) self.assertFalse(self.con.is_in_transaction()) with self.assertRaises(ZeroDivisionError): async with tr as with_tr: self.assertIs(self.con._top_xact, tr) self.assertTrue(self.con.is_in_transaction()) # We don't return the transaction object from __aenter__, # to make it harder for people to use '.rollback()' and # '.commit()' from within an 'async with' block. self.assertIsNone(with_tr) await self.con.execute(''' CREATE TABLE mytab (a int); ''') 1 / 0 self.assertIsNone(self.con._top_xact) self.assertFalse(self.con.is_in_transaction()) with self.assertRaisesRegex(asyncpg.PostgresError, '"mytab" does not exist'): await self.con.prepare(''' SELECT * FROM mytab ''') async def test_transaction_nested(self): self.assertIsNone(self.con._top_xact) self.assertFalse(self.con.is_in_transaction()) tr = self.con.transaction() self.assertIsNone(self.con._top_xact) self.assertFalse(self.con.is_in_transaction()) with self.assertRaises(ZeroDivisionError): async with tr: self.assertIs(self.con._top_xact, tr) self.assertTrue(self.con.is_in_transaction()) await self.con.execute(''' CREATE TABLE mytab (a int); ''') async with self.con.transaction(): self.assertIs(self.con._top_xact, tr) self.assertTrue(self.con.is_in_transaction()) await self.con.execute(''' INSERT INTO mytab (a) VALUES (1), (2); ''') self.assertIs(self.con._top_xact, tr) self.assertTrue(self.con.is_in_transaction()) with self.assertRaises(ZeroDivisionError): in_tr = self.con.transaction() async with in_tr: self.assertIs(self.con._top_xact, tr) self.assertTrue(self.con.is_in_transaction()) await self.con.execute(''' INSERT INTO mytab (a) VALUES (3), (4); ''') 1 / 0 st = await self.con.prepare('SELECT * FROM mytab;') recs = [] async for rec in st.cursor(): recs.append(rec) self.assertEqual(len(recs), 2) self.assertEqual(recs[0][0], 1) self.assertEqual(recs[1][0], 2) self.assertIs(self.con._top_xact, tr) self.assertTrue(self.con.is_in_transaction()) 1 / 0 self.assertIs(self.con._top_xact, None) self.assertFalse(self.con.is_in_transaction()) with self.assertRaisesRegex(asyncpg.PostgresError, '"mytab" does not exist'): await self.con.prepare(''' SELECT * FROM mytab ''') async def test_transaction_interface_errors(self): self.assertIsNone(self.con._top_xact) self.assertFalse(self.con.is_in_transaction()) tr = self.con.transaction(readonly=True, isolation='serializable') with self.assertRaisesRegex(asyncpg.InterfaceError, 'cannot start; .* already started'): async with tr: await tr.start() self.assertTrue(repr(tr).startswith( ' # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 from itertools import product from asyncpg.types import Range from asyncpg import _testbase as tb class TestTypes(tb.TestCase): def test_range_issubset(self): subs = [ Range(empty=True), Range(lower=1, upper=5, lower_inc=True, upper_inc=False), Range(lower=1, upper=5, lower_inc=True, upper_inc=True), Range(lower=1, upper=5, lower_inc=False, upper_inc=True), Range(lower=1, upper=5, lower_inc=False, upper_inc=False), Range(lower=-5, upper=10), Range(lower=2, upper=3), Range(lower=1, upper=None), Range(lower=None, upper=None) ] sups = [ Range(empty=True), Range(lower=1, upper=5, lower_inc=True, upper_inc=False), Range(lower=1, upper=5, lower_inc=True, upper_inc=True), Range(lower=1, upper=5, lower_inc=False, upper_inc=True), Range(lower=1, upper=5, lower_inc=False, upper_inc=False), Range(lower=None, upper=None) ] # Each row is 1 subs with all sups results = [ True, True, True, True, True, True, False, True, True, False, False, True, False, False, True, False, False, True, False, False, True, True, False, True, False, True, True, True, True, True, False, False, False, False, False, True, False, True, True, True, True, True, False, False, False, False, False, True, False, False, False, False, False, True ] for (sub, sup), res in zip(product(subs, sups), results): self.assertIs( sub.issubset(sup), res, "Sub:{}, Sup:{}".format(sub, sup) ) self.assertIs( sup.issuperset(sub), res, "Sub:{}, Sup:{}".format(sub, sup) ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1729370379.0 asyncpg-0.30.0/tests/test_utils.py0000644000175100001770000000225614705014413016562 0ustar00runnerdocker# Copyright (C) 2016-present the ayncpg authors and contributors # # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import datetime from asyncpg import utils from asyncpg import _testbase as tb class TestUtils(tb.ConnectedTestCase): async def test_mogrify_simple(self): cases = [ ('timestamp', datetime.datetime(2016, 10, 10), "SELECT '2016-10-10 00:00:00'::timestamp"), ('int[]', [[1, 2], [3, 4]], "SELECT '{{1,2},{3,4}}'::int[]"), ] for typename, data, expected in cases: with self.subTest(value=data, type=typename): mogrified = await utils._mogrify( self.con, 'SELECT $1::{}'.format(typename), [data]) self.assertEqual(mogrified, expected) async def test_mogrify_multiple(self): mogrified = await utils._mogrify( self.con, 'SELECT $1::int, $2::int[]', [1, [2, 3, 4, 5]]) expected = "SELECT '1'::int, '{2,3,4,5}'::int[]" self.assertEqual(mogrified, expected)